bug修复

This commit is contained in:
xiekaidong 2023-06-20 16:28:51 +08:00
parent 55f72da67f
commit d9a6ccc527
2 changed files with 14 additions and 5 deletions

View File

@ -1478,7 +1478,7 @@ function BattleUnitComp:judgeSkillEffectCondition(skill, index)
local buffConditionIndex, conditionRel = rel[1], rel[2]
local buffConditions = skill:getBuffCondition(buffConditionIndex)
return BATTLE_SKILL_CONDITION_HANDLE.judgeSkillEffectCondition(buffConditions, conditionRel, self.battleController)
return BATTLE_SKILL_CONDITION_HANDLE.judgeSkillEffectCondition(buffConditions, conditionRel, self.battleController, self.side)
end
function BattleUnitComp:takeEffect(buff, target, conditionResult)

View File

@ -47,7 +47,7 @@ BattleSkillConditionHandle._strOperatorOverloading = function(opStr, value1, val
return false
end
function BattleSkillConditionHandle.judgeSkillEffectCondition(buffConditions, conditionRel, battleController)
function BattleSkillConditionHandle.judgeSkillEffectCondition(buffConditions, conditionRel, battleController, side)
if not buffConditions or not conditionRel then
return BattleConst.SKILL_CONDITION_RESULT.NO_CONDITION
end
@ -57,11 +57,20 @@ function BattleSkillConditionHandle.judgeSkillEffectCondition(buffConditions, co
local func = BattleSkillConditionHandle._judgeSkillEffectCondition[condition.type]
if func then
local target
if condition.side == BattleConst.SIDE_ATK then
target = battleController.atkTeam:getMainUnit()
if side == BattleConst.SIDE_ATK then
if condition.side == 1 then
target = battleController.atkTeam:getMainUnit()
else
target = battleController.defTeam:getMainUnit()
end
else
target = battleController.defTeam:getMainUnit()
if condition.side == 1 then
target = battleController.defTeam:getMainUnit()
else
target = battleController.atkTeam:getMainUnit()
end
end
if func(condition, conditionRel, target, battleController) then
passConditionCount = passConditionCount + 1
end