属性伤害bug

This commit is contained in:
chenxi 2023-04-24 17:24:13 +08:00
parent 962b6499c6
commit c4f0fa9afa
2 changed files with 6 additions and 5 deletions

View File

@ -17,8 +17,9 @@ end
BattleFormula.calculateFormula = { BattleFormula.calculateFormula = {
-- (攻击)*技能倍率*(1+(攻击者元素伤害增加+所有伤害增加)(攻击者)+(受到元素伤害增加+受到所有伤害增加(受击)-受到元素伤害降低-受到所有伤害降低(受击)*暴击伤害 -- (攻击)*技能倍率*(1+(攻击者元素伤害增加+所有伤害增加)(攻击者)+(受到元素伤害增加+受到所有伤害增加(受击)-受到元素伤害降低-受到所有伤害降低(受击)*暴击伤害
[1] = function(unitComp, buff, targetUnit) [1] = function(unitComp, buff, targetUnit)
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() + targetUnit.unitEntity:getWeakness() - targetUnit.unitEntity:getDmgDec()) // DEFAULT_FACTOR (DEFAULT_FACTOR + unitComp.unitEntity:getDmgAddition() + targetUnit.unitEntity:getWeakness(matchType) - targetUnit.unitEntity:getDmgDec(matchType)) // 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

View File

@ -258,12 +258,12 @@ function BattleUnitEntity:getDmgAddition()
return self.team:getDmgAddition(self.unitData.matchType) return self.team:getDmgAddition(self.unitData.matchType)
end end
function BattleUnitEntity:getDmgDec() function BattleUnitEntity:getDmgDec(matchType)
return self.team:getDmgDec(self.unitData.matchType) return self.team:getDmgDec(matchType)
end end
function BattleUnitEntity:getWeakness() function BattleUnitEntity:getWeakness(matchType)
return self.team:getWeakness(self.unitData.matchType) return self.team:getWeakness(matchType)
end end
function BattleUnitEntity:getCrit() function BattleUnitEntity:getCrit()