From 9481bb830ce07c61a9f802606451ff68b686d2e7 Mon Sep 17 00:00:00 2001 From: puxuan <413323644@qq.com> Date: Thu, 4 Sep 2025 16:21:46 +0800 Subject: [PATCH] fix bug --- lua/app/config/chapter.lua | 28 +++++++++---------- .../localization_global_const.lua | 1 + lua/app/config/strings/cn/global.lua | 1 + .../controller/battle_base_controller.lua | 23 +++++++++++++-- lua/app/ui/battle/battle_base_ui.lua | 7 +++++ lua/app/ui/battle/cell/boss_skill_cell.lua | 10 +++---- lua/app/ui/hero/hero_skill_info_ui.lua | 3 +- .../battle/skill/battle_skill_entity.lua | 4 +++ .../battle/team/battle_unit_entity.lua | 4 +++ 9 files changed, 57 insertions(+), 24 deletions(-) diff --git a/lua/app/config/chapter.lua b/lua/app/config/chapter.lua index dd3ca817..1b375164 100644 --- a/lua/app/config/chapter.lua +++ b/lua/app/config/chapter.lua @@ -2681,20 +2681,20 @@ local chapter = { 28 }, ["monster"]={ - 4030101, - 4030201, - 4030301, - 4030401, - 4030501, - 4030601, - 4030701, - 4030801, - 4030901, - 4031001, - 4031101, - 4031201, - 4031301, - 4031401, + -- 4030101, + -- 4030201, + -- 4030301, + -- 4030401, + -- 4030501, + -- 4030601, + -- 4030701, + -- 4030801, + -- 4030901, + -- 4031001, + -- 4031101, + -- 4031201, + -- 4031301, + -- 4031401, 4031501 }, ["mystery_box"]={ diff --git a/lua/app/config/localization/localization_global_const.lua b/lua/app/config/localization/localization_global_const.lua index c67a1865..e626dda4 100644 --- a/lua/app/config/localization/localization_global_const.lua +++ b/lua/app/config/localization/localization_global_const.lua @@ -679,6 +679,7 @@ local LocalizationGlobalConst = SUMMON_DESC_7 = "SUMMON_DESC_7", HERO_DESC_21 = "HERO_DESC_21", HERO_DESC_22 = "HERO_DESC_22", + HERO_DESC_23 = "HERO_DESC_23", } return LocalizationGlobalConst \ No newline at end of file diff --git a/lua/app/config/strings/cn/global.lua b/lua/app/config/strings/cn/global.lua index ac6f41ea..15139935 100644 --- a/lua/app/config/strings/cn/global.lua +++ b/lua/app/config/strings/cn/global.lua @@ -679,6 +679,7 @@ local localization_global = ["SUMMON_DESC_7"] = "高级召唤", ["HERO_DESC_21"] = "等级达到{0}可升星", ["HERO_DESC_22"] = "去升星", + ["HERO_DESC_23"] = "技能等级:{0}", } return localization_global \ No newline at end of file diff --git a/lua/app/module/battle/controller/battle_base_controller.lua b/lua/app/module/battle/controller/battle_base_controller.lua index e907f187..376a373f 100644 --- a/lua/app/module/battle/controller/battle_base_controller.lua +++ b/lua/app/module/battle/controller/battle_base_controller.lua @@ -198,7 +198,10 @@ function BattleBaseController:generateNextMonster() self.atkTeam:stopRunAction() self:onRoundEnd(true) if isBoss then - self:refreshBossSkill(unitEntity) + self:setBossSkillActive(true) + self:refreshBossSkill(unitEntity) + else + self:setBossSkillActive(false) end end end @@ -223,7 +226,10 @@ function BattleBaseController:generateNextMonster() if count == 2 then self:onRoundEnd(true) if isBoss then - self:refreshBossSkill(unitEntity) + self:setBossSkillActive(true) + self:refreshBossSkill(unitEntity) + else + self:setBossSkillActive(false) end end end @@ -635,12 +641,16 @@ function BattleBaseController:moveBattlefield(time) self.battleUI:moveBattlefield(time) end +function BattleBaseController:setBossSkillActive(active) + self.battleUI:setBossSkillActive(active) +end + function BattleBaseController:refreshBuff(side, buffList) self.battleUI:refreshBuff(side, buffList) end function BattleBaseController:refreshBossSkill(unitEntity) - local skillList = unitEntity:getSkillList() + local skillList = unitEntity:getActiveSkill() self.battleUI:refreshBossSkill(skillList) end @@ -756,6 +766,7 @@ function BattleBaseController:initDefUnits(callback) monsterComp:initWithEntity(modelId, unitEntity, self) self.defTeam:addUnit(monsterComp, true) self.battleUI:refreshDefHp(unitEntity:getHp(), unitEntity:getHpPercent()) + self:setBossSkillActive(true) self:refreshBossSkill(unitEntity) callback() end) @@ -1156,6 +1167,8 @@ function BattleBaseController:enterBattleStep() local defAction = function() self.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_DEF_STEP self.defTeam:mainUnitUseAllSkills(BattleConst.ATTACK_ACTION_STATE.NORMAL, function() + local unitEntity = self.defTeam:getMainUnit().unitEntity + self:refreshBossSkill(unitEntity) self:enterNextTeamAction() end) end @@ -1277,6 +1290,10 @@ function BattleBaseController:enterRoundEnd() self.atkTeam:onRoundEnd() self.defTeam:onRoundEnd() + local unitEntity = self.defTeam:getMainUnit().unitEntity + if unitEntity:getIsBoss() then + self:refreshBossSkill(unitEntity) + end self:checkTeamIsDead(function() self:enterNextWave() end, function() self:onRoundEnd() diff --git a/lua/app/ui/battle/battle_base_ui.lua b/lua/app/ui/battle/battle_base_ui.lua index e21e6870..9cc69683 100644 --- a/lua/app/ui/battle/battle_base_ui.lua +++ b/lua/app/ui/battle/battle_base_ui.lua @@ -505,6 +505,13 @@ function BattleBaseUI:clearBuff(side) end end +function BattleBaseUI:setBossSkillActive(active) + local skillCellCount = #self.bossSkillCells + for i = 1, skillCellCount do + self.bossSkillCells[i]:setActive(active) + end +end + function BattleBaseUI:refreshBossSkill(skillList) if not self.bossSkillCells then return diff --git a/lua/app/ui/battle/cell/boss_skill_cell.lua b/lua/app/ui/battle/cell/boss_skill_cell.lua index a474087d..0ec27bda 100644 --- a/lua/app/ui/battle/cell/boss_skill_cell.lua +++ b/lua/app/ui/battle/cell/boss_skill_cell.lua @@ -8,16 +8,16 @@ function BossSkillCell:init() end) local uiMap = self:getUIMap() self.icon = uiMap["boss_skill_cell.icon"] - local value = uiMap["boss_skill_cell.value"] - local count = uiMap["boss_skill_cell.count"] + self.roundTx = uiMap["boss_skill_cell.round_text"] end -function BossSkillCell:refresh(skillId) - print("=============================== skillId = %s", skillId) +function BossSkillCell:refresh(skillEntity) + local skillId = skillEntity:getSkillId() + local cd = skillEntity:getShowCd() self.skillId = skillId - -- self.icon:setSprite(GConst.ATLAS_PATH.ICON_SKILL, self.lastSkillIcon) local icon = ModuleManager.HeroManager:getSkillIcon(skillId) self.icon:setSprite(GConst.ATLAS_PATH.ICON_SKILL, icon) + self.roundTx:setText(cd + 1) end function BossSkillCell:setActive(active) diff --git a/lua/app/ui/hero/hero_skill_info_ui.lua b/lua/app/ui/hero/hero_skill_info_ui.lua index ce87e1f4..32b8028d 100644 --- a/lua/app/ui/hero/hero_skill_info_ui.lua +++ b/lua/app/ui/hero/hero_skill_info_ui.lua @@ -76,12 +76,11 @@ end function HeroSkillInfoUI:refreshSkillIcon() local skillInfo, currIdx = self.heroEntity:getRogueSkillListByIdx(self.idx) - self.titleTx:setText(currIdx .. "/" .. #skillInfo) local lv = self.heroEntity:getLv() local skillUnlcokLv = skillInfo[1][1] local skillId = skillInfo[1][2] - -- self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4)) + self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_23, currIdx .. "/" .. #skillInfo)) self.icon:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueIcon(skillId)) if skillUnlcokLv > lv then diff --git a/lua/app/userdata/battle/skill/battle_skill_entity.lua b/lua/app/userdata/battle/skill/battle_skill_entity.lua index 919c0499..435f07a0 100644 --- a/lua/app/userdata/battle/skill/battle_skill_entity.lua +++ b/lua/app/userdata/battle/skill/battle_skill_entity.lua @@ -128,6 +128,10 @@ function BattleSkillEntity:getIsAvailable() return self.cd == 0 end +function BattleSkillEntity:getShowCd() + return self.cd +end + -- 技能释放完毕 function BattleSkillEntity:endUse() self.cd = self.coolingRounds diff --git a/lua/app/userdata/battle/team/battle_unit_entity.lua b/lua/app/userdata/battle/team/battle_unit_entity.lua index 89d9fecc..ed3a12f0 100644 --- a/lua/app/userdata/battle/team/battle_unit_entity.lua +++ b/lua/app/userdata/battle/team/battle_unit_entity.lua @@ -170,6 +170,10 @@ function BattleUnitEntity:getNormalSkill(reRandom) return self.normalSkill end +function BattleUnitEntity:getActiveSkill() + return self.activeSkills +end + function BattleUnitEntity:getActiveSkillCount() return #self.activeSkills end