限制技能

This commit is contained in:
chenxi 2023-04-19 17:20:28 +08:00
parent 4e629d3da4
commit 8833471b90
2 changed files with 22 additions and 0 deletions

View File

@ -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

View File

@ -53,6 +53,9 @@ function BattleTeam:useNormalSkill(matchType, count, callback)
end
if unit == nil then
return callback()
end
if unit:getIsLimit() then
return callback()
end
self.mainUnit = unit
self.battleController:setIsPauseHpProgress(true)
@ -70,6 +73,9 @@ function BattleTeam:useSkill(matchType, count, callback)
end
if unit == nil then
return callback()
end
if unit:getIsLimit() then
return callback()
end
self.mainUnit = unit
self.battleController:setIsPauseHpProgress(true)
@ -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()