From 55983ad95a960e3ca528f235ff966c11d4ed1d25 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Wed, 24 May 2023 19:12:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9E=84=E5=BB=BA=E4=B8=80=E4=BA=9B=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E9=9C=80=E8=A6=81=E7=9A=84=E6=88=98=E6=96=97=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/battle/component/battle_unit_comp.lua | 2 ++ .../module/battle/controller/battle_controller.lua | 2 ++ lua/app/userdata/battle/team/battle_unit_entity.lua | 12 +++++++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lua/app/module/battle/component/battle_unit_comp.lua b/lua/app/module/battle/component/battle_unit_comp.lua index 3a1e626a..b35409f7 100644 --- a/lua/app/module/battle/component/battle_unit_comp.lua +++ b/lua/app/module/battle/component/battle_unit_comp.lua @@ -436,6 +436,8 @@ function BattleUnitComp:useAllSkills(callback) end function BattleUnitComp:useNormalSkill(count, effectType, callback) + self.unitEntity:addActiveSkillReleaseCount(1) + self.actionOverCallback = callback self.normalSkillCount = count if effectType == BattleConst.EFFECT_TYPE.DIRECT then diff --git a/lua/app/module/battle/controller/battle_controller.lua b/lua/app/module/battle/controller/battle_controller.lua index afed8d59..b9c97d44 100644 --- a/lua/app/module/battle/controller/battle_controller.lua +++ b/lua/app/module/battle/controller/battle_controller.lua @@ -239,6 +239,7 @@ function BattleController:init(params) self.eliminateTotalCount = 0 self.realTime = 0 self.taskProgress = {} + self.waveRoundCount = {} self.chapterId = self:getChapterId() self.waveIndex = 0 @@ -508,6 +509,7 @@ function BattleController:enterNextWave() end function BattleController:enterRoundBegin() + self.waveRoundCount[self.waveIndex] = (self.waveRoundCount[self.waveIndex] or 0) + 1 self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_BEGIN self:takeGridEffect() self:enterEliminationBegin() diff --git a/lua/app/userdata/battle/team/battle_unit_entity.lua b/lua/app/userdata/battle/team/battle_unit_entity.lua index 67a844a4..f64de3f7 100644 --- a/lua/app/userdata/battle/team/battle_unit_entity.lua +++ b/lua/app/userdata/battle/team/battle_unit_entity.lua @@ -11,6 +11,7 @@ function BattleUnitEntity:init(unitData, side, team) self.team = team self.damageCount = 0 -- 记录伤害 self.healCount = 0 -- 记录治疗 + self.activeSkillReleaseCount = 0 -- 记录主动技能释放次数 self:initSkill() end @@ -151,7 +152,7 @@ function BattleUnitEntity:getAssistingSkill() return self.assistingSkill end -function BattleUnitEntity:getActiveSkillCount() +function BattleUnitEntity:getActiveSkillRealeseCount() return #self.activeSkills end @@ -238,6 +239,15 @@ function BattleUnitEntity:addDamageCount(num) end end +function BattleUnitEntity:getActiveSkillReleaseCount() + return self.activeSkillReleaseCount +end + +-- 主动技能释放次数统计 +function BattleUnitEntity:addActiveSkillReleaseCount(num) + self.activeSkillReleaseCount = self.activeSkillReleaseCount + num +end + function BattleUnitEntity:takeDamageOrCure(num) return self.team:takeDamageOrCure(num) end