From 8833471b908dd833209fd384bd1201c9cbb9c87f Mon Sep 17 00:00:00 2001 From: chenxi Date: Wed, 19 Apr 2023 17:20:28 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=90=E5=88=B6=E6=8A=80=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../battle/component/battle_unit_comp.lua | 4 ++++ lua/app/module/battle/team/battle_team.lua | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/lua/app/module/battle/component/battle_unit_comp.lua b/lua/app/module/battle/component/battle_unit_comp.lua index ad385622..b820c740 100644 --- a/lua/app/module/battle/component/battle_unit_comp.lua +++ b/lua/app/module/battle/component/battle_unit_comp.lua @@ -52,6 +52,10 @@ function BattleUnitComp:getIsBoss() return self.unitEntity:getIsBoss() end +function BattleUnitComp:getIsLimit() + return self.unitEntity:getIsLimit() +end + function BattleUnitComp:setTeam(team) self.team = team end diff --git a/lua/app/module/battle/team/battle_team.lua b/lua/app/module/battle/team/battle_team.lua index a0dacaa4..3d7025fd 100644 --- a/lua/app/module/battle/team/battle_team.lua +++ b/lua/app/module/battle/team/battle_team.lua @@ -54,6 +54,9 @@ function BattleTeam:useNormalSkill(matchType, count, callback) if unit == nil then return callback() end + if unit:getIsLimit() then + return callback() + end self.mainUnit = unit self.battleController:setIsPauseHpProgress(true) unit:beforeAttack() @@ -71,6 +74,9 @@ function BattleTeam:useSkill(matchType, count, callback) if unit == nil then return callback() end + if unit:getIsLimit() then + return callback() + end self.mainUnit = unit self.battleController:setIsPauseHpProgress(true) unit:beforeAttack() @@ -79,6 +85,12 @@ function BattleTeam:useSkill(matchType, count, callback) end function BattleTeam:useAssistingSkill(assistingList, callback) + if self.mainUnit == nil then + return callback() + end + if self.mainUnit:getIsLimit() then + return callback() + end local count = #assistingList if count <= 0 then return callback() @@ -103,6 +115,12 @@ function BattleTeam:useAssistingSkill(assistingList, callback) end function BattleTeam:mainUnitUseAllSkills(callback) + if self.mainUnit == nil then + return callback() + end + if self.mainUnit:getIsLimit() then + return callback() + end self.battleController:setIsPauseHpProgress(true) self.mainUnit:beforeAttack() self.mainUnit:resetBeforeAttack()