不过修复

This commit is contained in:
xiekaidong 2023-08-03 16:09:58 +08:00
parent a47f18db07
commit bcb336d344
2 changed files with 7 additions and 3 deletions

View File

@ -249,7 +249,7 @@ function BattleBaseController:onLinkChange()
local dmgSkillId local dmgSkillId
for index, info in ipairs(sequence) do for index, info in ipairs(sequence) do
local entity = self.battleData:getGridEntity(info.posId) local entity = self.battleData:getGridEntity(info.posId)
if not mainElementType then if not mainElementType or not dmgSkillId then
local skillId = entity:getSkillId() local skillId = entity:getSkillId()
if not skillId and not mainElementType then if not skillId and not mainElementType then
mainElementType = entity:getElementType() mainElementType = entity:getElementType()
@ -3075,9 +3075,13 @@ function BattleBaseController:calExpectedInjury(mainElementType, count, skillId)
return 0 return 0
end end
local atkUnitComp = atkCompMap[mainElementType] local atkUnitComp = atkCompMap[mainElementType]
if not atkUnitComp then if mainElementType and not atkUnitComp then
return 0 return 0
end 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) local dmg = BattleFormula:getExpectedDamageResult(atkUnitComp, count, self:getCurOtherActionUnitComp(), skillId, atkCompMap)
return dmg return dmg
end end

View File

@ -30,7 +30,7 @@ function BattleFormula:getExpectedDamageResult(unitComp, count, targetUnitComp,
local atk = atkCompMap[matchType].unitEntity:getAtk() local atk = atkCompMap[matchType].unitEntity:getAtk()
local dmg = 0 local dmg = 0
for _, effect in ipairs(skillConfig.effect) do 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 -- 伤害公式 if buffConfig and buffConfig.formula == 1 then -- 伤害公式
dmg = dmg + effect.num * atk dmg = dmg + effect.num * atk
end end