diff --git a/lua/app/module/battle/component/battle_unit_comp.lua b/lua/app/module/battle/component/battle_unit_comp.lua index 0655cf94..dc5dd155 100644 --- a/lua/app/module/battle/component/battle_unit_comp.lua +++ b/lua/app/module/battle/component/battle_unit_comp.lua @@ -1582,7 +1582,7 @@ function BattleUnitComp:takeDamageOrCure(atker, num, effectType, effectStatus, d end local hpPercent = self.unitEntity:getHpPercent() self.battleController:refreshHp(self.side, hp, hpPercent) - if not atker:getIsFinalBlock() then + if not atker:getIsFinalBlock() or not self.battleController:getIsLastInstruction() then if damage < 0 then self:playHurt() end diff --git a/lua/app/module/battle/controller/battle_controller.lua b/lua/app/module/battle/controller/battle_controller.lua index 746eebf8..09004fe5 100644 --- a/lua/app/module/battle/controller/battle_controller.lua +++ b/lua/app/module/battle/controller/battle_controller.lua @@ -1234,6 +1234,14 @@ function BattleController:exeInstructions(callback) end end +function BattleController:getIsLastInstruction() + if not self.instructions or not self.instructions[1] then + return true + end + + return false +end + function BattleController:generateBoard(isFirst) local boardList, _, mysteryBoxIndexMap = self:getInitBoard() if self.curBoardIndex and self.curBoardIndex >= #boardList then diff --git a/lua/app/module/battle/skill/battle_rogue_skill_handle.lua b/lua/app/module/battle/skill/battle_rogue_skill_handle.lua index 99bd4bed..da9ae4ec 100644 --- a/lua/app/module/battle/skill/battle_rogue_skill_handle.lua +++ b/lua/app/module/battle/skill/battle_rogue_skill_handle.lua @@ -21,8 +21,19 @@ local _changeBaseSkill = function(skillId, skillInfo, battleData, battleControll if not battleData.atkTeam then return end - if battleData.atkTeam:getAllMembers()[elementType] then - battleData.atkTeam:getAllMembers()[elementType]:changeSkillId(skillId, newSkillId) + local unitEntity = battleData.atkTeam:getAllMembers()[elementType] + if unitEntity then + unitEntity:changeSkillId(skillId, newSkillId) + Logger.logHighlight("------------") + Logger.printTable(skillEntity:getSkillRoundAdd()) + Logger.printTable(skillEntity:getSkillEffecuNumAdd()) + for effectType, effect in pairs(skillEntity:getSkillRoundAdd()) do -- 技能回合数 + unitEntity:addSkillRound(newSkillId, effect) + end + + for effectType, effect in pairs(skillEntity:getSkillEffecuNumAdd()) do -- 技能效果 + unitEntity:addSkillParams(newSkillId, effect) + end end end end @@ -135,6 +146,7 @@ local _addSkillEffectParams = function(skillId, skillInfo, battleData, battleCon local skillEntity = battleData:getSkillEntityByElement(elementType) if skillEntity then local skillId = skillEntity:getSkillId() + skillEntity:addSkillEffecuNumAdd(effect) if not battleData.atkTeam then return end @@ -173,6 +185,7 @@ local _addSkillRound = function(skillId, skillInfo, battleData, battleController local skillEntity = battleData:getSkillEntityByElement(elementType) if skillEntity then local skillId = skillEntity:getSkillId() + skillEntity:addSkillRoundAdd(effect) if not battleData.atkTeam then return end diff --git a/lua/app/userdata/battle/skill/battle_board_skill_entity.lua b/lua/app/userdata/battle/skill/battle_board_skill_entity.lua index 8437fb21..465bda99 100644 --- a/lua/app/userdata/battle/skill/battle_board_skill_entity.lua +++ b/lua/app/userdata/battle/skill/battle_board_skill_entity.lua @@ -11,6 +11,8 @@ function BattleBoardSkillEntity:ctor(skillId) self.elementCountEffectEntities = {} -- 根据消除数量获得次数的技能效果 type = 13 self.linkCountMoreEffects = {} -- 链接超过x元素获得一次技能效果 type = 14 self.linkCountPowerEffects = {} -- 链接超过x元素获得倍数技能效果 type = 15 + self.skillEffectNumAdd = {} -- 技能效果参数增加 type = 7 用于技能替换时生效 + self.skillRoundAdd = {} -- 技能效果回合增加 type = 8 用于技能替换时生效 self.upSkillIdMap = {} self.getUpSkillKind = 0 @@ -446,4 +448,31 @@ function BattleBoardSkillEntity:getLinkCountPowerEffects() return self.linkCountPowerEffects end +function BattleBoardSkillEntity:addSkillEffecuNumAdd(effect) + local effectInfo = self.skillEffectNumAdd[effect.type] + if effectInfo then + effectInfo.num = effectInfo.num + effect.num + else + self.skillEffectNumAdd[effect.type] = effect + end +end + +function BattleBoardSkillEntity:getSkillEffecuNumAdd() + return self.skillEffectNumAdd +end + +function BattleBoardSkillEntity:addSkillRoundAdd(effect) + local effectInfo = self.skillRoundAdd[effect.type] + if effectInfo then + effectInfo.round = effectInfo.round + effect.round + else + self.skillRoundAdd[effect.type] = effect + end +end + +function BattleBoardSkillEntity:getSkillRoundAdd() + return self.skillRoundAdd +end + + return BattleBoardSkillEntity \ No newline at end of file