diff --git a/lua/app/module/battle/component/battle_unit_comp.lua b/lua/app/module/battle/component/battle_unit_comp.lua index 651733b2..cd0ced4c 100644 --- a/lua/app/module/battle/component/battle_unit_comp.lua +++ b/lua/app/module/battle/component/battle_unit_comp.lua @@ -732,7 +732,12 @@ function BattleUnitComp:playHurt() if self.hurtAniNameCount <= 0 then return end - local name = self.hurtAniNameList[math.random(1, self.hurtAniNameCount)] + local name = self.hurtNameList[1] + if not name then + name = self.hurtAniNameList[math.random(1, self.hurtAniNameCount)] + else + table.remove(self.hurtNameList, 1) + end self.playSubAniTime = 0 self.curHurtName = name if self.playSubAniDuration[name] == nil then @@ -1450,6 +1455,8 @@ function BattleUnitComp:onSkillTakeEffect(skill, isFinalBlock, validEffectIdx) if isConditionPass then self.team:addHurtComboTag(BattleConst.COMBO_DEFAULT_POSITION) end + -- 增加受击动画逻辑 + target:setHurtList(skill:getHitNameList()) if self:takeEffect(effect, target, conditionResult) then if isConditionPass and skill:getComboPosition() then self.team:addHurtComboTag(skill:getComboPosition()) @@ -2264,4 +2271,9 @@ function BattleUnitComp:recycle() BattleHelper:recycleBattleHeroModel(self.modelId, self.baseObject) end +-- region +function BattleUnitComp:setHurtList(hurtNameList) + self.hurtNameList = table.refCopy(hurtNameList) +end +-- endregion return BattleUnitComp \ No newline at end of file diff --git a/lua/app/userdata/battle/skill/battle_skill_entity.lua b/lua/app/userdata/battle/skill/battle_skill_entity.lua index a483a5de..919c0499 100644 --- a/lua/app/userdata/battle/skill/battle_skill_entity.lua +++ b/lua/app/userdata/battle/skill/battle_skill_entity.lua @@ -461,4 +461,8 @@ function BattleSkillEntity:getIsHurtType() return self.isHurtType end +function BattleSkillEntity:getHitNameList() + return self.skillInfo.name_hit or {} +end + return BattleSkillEntity \ No newline at end of file