主动技能伤害增加
This commit is contained in:
parent
1c6ff387fc
commit
b7dda49394
@ -252,6 +252,7 @@ local BUFF_NAME = {
|
|||||||
THORNS = "thorns",
|
THORNS = "thorns",
|
||||||
FIRST_HAND = "first_hand",
|
FIRST_HAND = "first_hand",
|
||||||
COUNTER_ATTACK = "counterattack",
|
COUNTER_ATTACK = "counterattack",
|
||||||
|
SKILL_HURT_ADD = "skill_hurt_add",
|
||||||
}
|
}
|
||||||
BattleConst.BUFF_NAME = BUFF_NAME
|
BattleConst.BUFF_NAME = BUFF_NAME
|
||||||
|
|
||||||
@ -301,6 +302,7 @@ local ATTR_NAME = {
|
|||||||
THORNS = "thorns",
|
THORNS = "thorns",
|
||||||
FIRST_HAND = "first_hand",
|
FIRST_HAND = "first_hand",
|
||||||
COUNTER_ATTACK = "counterattack",
|
COUNTER_ATTACK = "counterattack",
|
||||||
|
SKILL_HURT = "skill_hurt",
|
||||||
}
|
}
|
||||||
BattleConst.ATTR_NAME = ATTR_NAME
|
BattleConst.ATTR_NAME = ATTR_NAME
|
||||||
|
|
||||||
@ -343,6 +345,7 @@ BattleConst.BUFF_NAME_TO_ATTR = {
|
|||||||
[BUFF_NAME.THORNS] = {ATTR_NAME.THORNS, false},
|
[BUFF_NAME.THORNS] = {ATTR_NAME.THORNS, false},
|
||||||
[BUFF_NAME.FIRST_HAND] = {ATTR_NAME.FIRST_HAND, false},
|
[BUFF_NAME.FIRST_HAND] = {ATTR_NAME.FIRST_HAND, false},
|
||||||
[BUFF_NAME.COUNTER_ATTACK] = {ATTR_NAME.COUNTER_ATTACK, false},
|
[BUFF_NAME.COUNTER_ATTACK] = {ATTR_NAME.COUNTER_ATTACK, false},
|
||||||
|
[BUFF_NAME.SKILL_HURT_ADD] = {ATTR_NAME.SKILL_HURT, false},
|
||||||
}
|
}
|
||||||
|
|
||||||
---- 格子类型
|
---- 格子类型
|
||||||
|
|||||||
@ -15,11 +15,16 @@ function BattleFormula:getDamageOrCureResult(unitComp, buff, targetUnitComp)
|
|||||||
end
|
end
|
||||||
|
|
||||||
BattleFormula.calculateFormula = {
|
BattleFormula.calculateFormula = {
|
||||||
-- (攻击)*技能倍率*(1+(攻击者元素伤害增加+所有伤害增加)(攻击者)- (攻击者元素伤害降低+所有伤害降低) +(受到元素伤害增加+受到所有伤害增加(受击)-受到元素伤害降低-受到所有伤害降低(受击)*暴击伤害
|
-- (攻击)*技能倍率*(1+(攻击者元素伤害增加+所有伤害增加)(攻击者)- (攻击者元素伤害降低+所有伤害降低) +(受到元素伤害增加+受到所有伤害增加(受击)-受到元素伤害降低-受到所有伤害降低(受击) + 主动技能增伤)*暴击伤害
|
||||||
[1] = function(unitComp, buff, targetUnit)
|
[1] = function(unitComp, buff, targetUnit)
|
||||||
|
local skillHurtAdd = 0
|
||||||
|
local hostSkill = buff:getHostSkill()
|
||||||
|
if hostSkill and hostSkill:getIsActiveType() and unitComp.unitEntity:getSkillHurt() > 0 then -- 是主动技能携带的buff,且拥有技能伤害加成
|
||||||
|
skillHurtAdd = unitComp.unitEntity:getSkillHurt()
|
||||||
|
end
|
||||||
local matchType = unitComp.unitEntity:getMatchType()
|
local matchType = unitComp.unitEntity:getMatchType()
|
||||||
local result = unitComp.unitEntity:getAtk() * buff:getEffectNum() // DEFAULT_FACTOR *
|
local result = unitComp.unitEntity:getAtk() * buff:getEffectNum() // DEFAULT_FACTOR *
|
||||||
(DEFAULT_FACTOR + unitComp.unitEntity:getDmgAddition() - unitComp.unitEntity:getDmgDec() + targetUnit.unitEntity:getWeakness(matchType) - targetUnit.unitEntity:getDecDmg(matchType)) // DEFAULT_FACTOR
|
(DEFAULT_FACTOR + unitComp.unitEntity:getDmgAddition() - unitComp.unitEntity:getDmgDec() + targetUnit.unitEntity:getWeakness(matchType) - targetUnit.unitEntity:getDecDmg(matchType) + skillHurtAdd) // DEFAULT_FACTOR
|
||||||
local hurtState = 0
|
local hurtState = 0
|
||||||
local crit = unitComp.unitEntity:getCrit()
|
local crit = unitComp.unitEntity:getCrit()
|
||||||
if crit > 0 then
|
if crit > 0 then
|
||||||
|
|||||||
@ -6,12 +6,13 @@ local BUFF_TYPE_DIRECT_HURT = BattleConst.BUFF_TYPE.DIRECT_HURT
|
|||||||
function BattleBuffEntity:ctor()
|
function BattleBuffEntity:ctor()
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleBuffEntity:init(effectParams, owner)
|
function BattleBuffEntity:init(effectParams, owner, hostSkill)
|
||||||
self.name = effectParams.type
|
self.name = effectParams.type
|
||||||
self.effectNum = effectParams.num
|
self.effectNum = effectParams.num
|
||||||
self.round = effectParams.round
|
self.round = effectParams.round
|
||||||
self.ratio = effectParams.ratio
|
self.ratio = effectParams.ratio
|
||||||
self.owner = owner
|
self.owner = owner
|
||||||
|
self.hostSkill = hostSkill
|
||||||
self.targetSide = nil
|
self.targetSide = nil
|
||||||
self.buffInfo = ConfigManager:getConfigWithOtherKey("buff", "name")[self.name]
|
self.buffInfo = ConfigManager:getConfigWithOtherKey("buff", "name")[self.name]
|
||||||
self.buffType = self.buffInfo.buff_type
|
self.buffType = self.buffInfo.buff_type
|
||||||
@ -25,6 +26,10 @@ function BattleBuffEntity:getName()
|
|||||||
return self.name
|
return self.name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleBuffEntity:getHostSkill()
|
||||||
|
return self.hostSkill
|
||||||
|
end
|
||||||
|
|
||||||
function BattleBuffEntity:getDesc()
|
function BattleBuffEntity:getDesc()
|
||||||
if self.desc == nil then
|
if self.desc == nil then
|
||||||
local buff18NInfo = I18N:getConfigWithOtherKey("buff", "name")[self.name]
|
local buff18NInfo = I18N:getConfigWithOtherKey("buff", "name")[self.name]
|
||||||
|
|||||||
@ -37,7 +37,7 @@ function BattleSkillEntity:initSkillEffect()
|
|||||||
if self.skillInfo.effect then
|
if self.skillInfo.effect then
|
||||||
for k, v in ipairs(self.skillInfo.effect) do
|
for k, v in ipairs(self.skillInfo.effect) do
|
||||||
local buffEntity = BattleBuffEntity:create()
|
local buffEntity = BattleBuffEntity:create()
|
||||||
buffEntity:init(v, self.owner)
|
buffEntity:init(v, self.owner, self)
|
||||||
if buffEntity:getIsHurtType() then
|
if buffEntity:getIsHurtType() then
|
||||||
self.isHurtType = true
|
self.isHurtType = true
|
||||||
end
|
end
|
||||||
@ -89,7 +89,7 @@ function BattleSkillEntity:addSkillEffectParams(effect)
|
|||||||
end
|
end
|
||||||
if not buffEntity then
|
if not buffEntity then
|
||||||
buffEntity = BattleBuffEntity:create()
|
buffEntity = BattleBuffEntity:create()
|
||||||
buffEntity:init(effect, self.owner)
|
buffEntity:init(effect, self.owner, self)
|
||||||
table.insert(self.effectList, buffEntity)
|
table.insert(self.effectList, buffEntity)
|
||||||
else
|
else
|
||||||
buffEntity:setEffectNum(buffEntity:getEffectNum() + effect.num)
|
buffEntity:setEffectNum(buffEntity:getEffectNum() + effect.num)
|
||||||
@ -106,7 +106,7 @@ function BattleSkillEntity:addSkillEffectRound(effect)
|
|||||||
end
|
end
|
||||||
if not buffEntity then
|
if not buffEntity then
|
||||||
buffEntity = BattleBuffEntity:create()
|
buffEntity = BattleBuffEntity:create()
|
||||||
buffEntity:init(effect, self.owner)
|
buffEntity:init(effect, self.owner, self)
|
||||||
table.insert(self.effectList, buffEntity)
|
table.insert(self.effectList, buffEntity)
|
||||||
else
|
else
|
||||||
buffEntity:setRound(buffEntity:getRound() + effect.round)
|
buffEntity:setRound(buffEntity:getRound() + effect.round)
|
||||||
|
|||||||
@ -269,6 +269,10 @@ function BattleTeamEntity:getCounterAttack()
|
|||||||
return self.attr.counterattack or 0
|
return self.attr.counterattack or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleTeamEntity:getSkillHurt()
|
||||||
|
return self.attr.skill_hurt or 0
|
||||||
|
end
|
||||||
|
|
||||||
function BattleTeamEntity:takeDamageOrCure(num)
|
function BattleTeamEntity:takeDamageOrCure(num)
|
||||||
if self.isDead then
|
if self.isDead then
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@ -318,6 +318,10 @@ function BattleUnitEntity:getCounterAttack()
|
|||||||
return self.team:getCounterAttack()
|
return self.team:getCounterAttack()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleUnitEntity:getSkillHurt()
|
||||||
|
return self.team:getSkillHurt()
|
||||||
|
end
|
||||||
|
|
||||||
function BattleUnitEntity:addLimit(name, buffEffect)
|
function BattleUnitEntity:addLimit(name, buffEffect)
|
||||||
self.team:addLimit(name, buffEffect)
|
self.team:addLimit(name, buffEffect)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user