diff --git a/lua/app/module/battle/controller/battle_base_controller.lua b/lua/app/module/battle/controller/battle_base_controller.lua index 294f157d..d7b59561 100644 --- a/lua/app/module/battle/controller/battle_base_controller.lua +++ b/lua/app/module/battle/controller/battle_base_controller.lua @@ -249,7 +249,7 @@ function BattleBaseController:onLinkChange() local dmgSkillId for index, info in ipairs(sequence) do local entity = self.battleData:getGridEntity(info.posId) - if not mainElementType then + if not mainElementType or not dmgSkillId then local skillId = entity:getSkillId() if not skillId and not mainElementType then mainElementType = entity:getElementType() @@ -3075,9 +3075,13 @@ function BattleBaseController:calExpectedInjury(mainElementType, count, skillId) return 0 end local atkUnitComp = atkCompMap[mainElementType] - if not atkUnitComp then + if mainElementType and not atkUnitComp then return 0 end + if not mainElementType or not atkUnitComp then + count = 0 + atkUnitComp = self:getCurActionTeam():getMainUnit() + end local dmg = BattleFormula:getExpectedDamageResult(atkUnitComp, count, self:getCurOtherActionUnitComp(), skillId, atkCompMap) return dmg end diff --git a/lua/app/module/battle/helper/battle_formula.lua b/lua/app/module/battle/helper/battle_formula.lua index de66c004..6db1e3fb 100644 --- a/lua/app/module/battle/helper/battle_formula.lua +++ b/lua/app/module/battle/helper/battle_formula.lua @@ -30,7 +30,7 @@ function BattleFormula:getExpectedDamageResult(unitComp, count, targetUnitComp, local atk = atkCompMap[matchType].unitEntity:getAtk() local dmg = 0 for _, effect in ipairs(skillConfig.effect) do - local buffConfig = ConfigManager:getConfigWithOtherKey("buff", effect.type) + local buffConfig = ConfigManager:getConfigWithOtherKey("buff", "name")[effect.type] if buffConfig and buffConfig.formula == 1 then -- 伤害公式 dmg = dmg + effect.num * atk end