From c4f0fa9afab2b97a599f3583a333254ee5b3096b Mon Sep 17 00:00:00 2001 From: chenxi Date: Mon, 24 Apr 2023 17:24:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=9E=E6=80=A7=E4=BC=A4=E5=AE=B3bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/battle/helper/battle_formula.lua | 3 ++- lua/app/userdata/battle/team/battle_unit_entity.lua | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lua/app/module/battle/helper/battle_formula.lua b/lua/app/module/battle/helper/battle_formula.lua index aa03b2c6..d26bdd4a 100644 --- a/lua/app/module/battle/helper/battle_formula.lua +++ b/lua/app/module/battle/helper/battle_formula.lua @@ -17,8 +17,9 @@ end BattleFormula.calculateFormula = { -- (攻击)*技能倍率*(1+(攻击者元素伤害增加+所有伤害增加)(攻击者)+(受到元素伤害增加+受到所有伤害增加(受击)-受到元素伤害降低-受到所有伤害降低(受击)*暴击伤害 [1] = function(unitComp, buff, targetUnit) + local matchType = unitComp.unitEntity:getMatchType() 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 crit = unitComp.unitEntity:getCrit() if crit > 0 then diff --git a/lua/app/userdata/battle/team/battle_unit_entity.lua b/lua/app/userdata/battle/team/battle_unit_entity.lua index bfa9cba9..e4a872f7 100644 --- a/lua/app/userdata/battle/team/battle_unit_entity.lua +++ b/lua/app/userdata/battle/team/battle_unit_entity.lua @@ -258,12 +258,12 @@ function BattleUnitEntity:getDmgAddition() return self.team:getDmgAddition(self.unitData.matchType) end -function BattleUnitEntity:getDmgDec() - return self.team:getDmgDec(self.unitData.matchType) +function BattleUnitEntity:getDmgDec(matchType) + return self.team:getDmgDec(matchType) end -function BattleUnitEntity:getWeakness() - return self.team:getWeakness(self.unitData.matchType) +function BattleUnitEntity:getWeakness(matchType) + return self.team:getWeakness(matchType) end function BattleUnitEntity:getCrit()