bug修复

This commit is contained in:
xiekaidong 2023-05-29 20:56:46 +08:00
parent c50f92bbc0
commit fe6994625c
2 changed files with 18 additions and 7 deletions

View File

@ -1372,12 +1372,17 @@ function BattleUnitComp:onSkillTakeEffect(skill, isFinalBlock, validEffectIdx)
end end
function BattleUnitComp:judgeSkillEffectCondition(skill, index) function BattleUnitComp:judgeSkillEffectCondition(skill, index)
if not skill then if not skill or skill:haveBuffCondition() then
return true return true
end end
local buffConditions = skill:getBuffCondition(index)
local conditionRel = skill:getBuffConditionRel(index)
local buffConditionIndex, conditionRel = skill:getBuffConditionRel(index)
if not buffConditionIndex then
return true
end
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)
end end

View File

@ -30,6 +30,7 @@ function BattleSkillEntity:init()
self.available = false self.available = false
end end
self:clearRecordData() self:clearRecordData()
self.buffConditionRel = nil
end end
function BattleSkillEntity:initSkillEffect() function BattleSkillEntity:initSkillEffect()
@ -210,12 +211,17 @@ function BattleSkillEntity:getBuffConditionRel(index)
if not self.skillInfo.condition_rel then if not self.skillInfo.condition_rel then
return return
end end
for _, info in ipairs(self.skillInfo.condition_rel) do if not self.buffConditionRel then
if info[1] == index then self.buffConditionRel = {}
return info[2] for i, info in ipairs(self.skillInfo.condition_rel) do
self.buffConditionRel[info[1]] = {i, info[2]}
end end
end end
return 1 return self.buffConditionRel[index]
end
function BattleSkillEntity:haveBuffCondition()
return self.skillInfo.condition_rel ~= nil
end end
function BattleSkillEntity:getTargetType() function BattleSkillEntity:getTargetType()