diff --git a/lua/app/module/battle/component/battle_unit_comp.lua b/lua/app/module/battle/component/battle_unit_comp.lua index 25981664..da811716 100644 --- a/lua/app/module/battle/component/battle_unit_comp.lua +++ b/lua/app/module/battle/component/battle_unit_comp.lua @@ -124,6 +124,10 @@ function BattleUnitComp:initWithEntity(modelId, entity, battleController, target self:initHitAniInfo() end +function BattleUnitComp:getSide() + return self.side +end + function BattleUnitComp:initHitAniInfo() self.hurtAniNameList = {} self.hurtAniNameCount = 0 diff --git a/lua/app/module/battle/controller/battle_base_controller.lua b/lua/app/module/battle/controller/battle_base_controller.lua index aa69430b..e11bd70d 100644 --- a/lua/app/module/battle/controller/battle_base_controller.lua +++ b/lua/app/module/battle/controller/battle_base_controller.lua @@ -724,8 +724,9 @@ function BattleBaseController:getCurActionUnitComp() return self:getCurActionTeam():getMainUnit() end -function BattleBaseController:getCurActionBoardRowRange() - local isAtkAction = self.curActionSide == SIDE_ATK +function BattleBaseController:getCurActionBoardRowRange(side) + side = side or self.curActionSide + local isAtkAction = side == SIDE_ATK if isAtkAction then return self:getAtkMinRow() + 1, self:getRowCount() else @@ -743,6 +744,16 @@ function BattleBaseController:getPosIdInCurActionBoardRowRange(posId) return true end +function BattleBaseController:getPosIdInActionBoardRowRange(side, posId) + local min, max = self:getCurActionBoardRowRange(side) + local r = ModuleManager.BattleManager:getPosRC(posId).r + if r < min or r > max then + return false + end + + return true +end + function BattleBaseController:onLoadComplete() UIManager:closeLoading() self:handleBuffs() @@ -2151,14 +2162,21 @@ function BattleBaseController:selectSKillNextToStep() end -function BattleBaseController:changeElementType(count, elementType) +function BattleBaseController:changeElementType(count, elementType, side) self.changeElementTypeMap = table.clearOrCreate(self.changeElementTypeMap) self.changeElementTypeList = table.clearOrCreate(self.changeElementTypeList) local listCount = 0 for _, entity in pairs(self.battleData:getGridEnties()) do if entity:canChangeInfo() and entity:getElementType() ~= elementType then - table.insert(self.changeElementTypeList, entity) - listCount = listCount + 1 + if side then + if self:getPosIdInActionBoardRowRange(side, entity:getPosId()) then + table.insert(self.changeElementTypeList, entity) + listCount = listCount + 1 + end + else + table.insert(self.changeElementTypeList, entity) + listCount = listCount + 1 + end end end diff --git a/lua/app/module/battle/skill/battle_board_skill_handle.lua b/lua/app/module/battle/skill/battle_board_skill_handle.lua index e35908db..40c6171c 100644 --- a/lua/app/module/battle/skill/battle_board_skill_handle.lua +++ b/lua/app/module/battle/skill/battle_board_skill_handle.lua @@ -449,7 +449,7 @@ local function _takeChangeElementType(atkUnitComp, skillEntity, battleController local elementType = params[1] local changeCount = params[2] - battleController:changeElementType(changeCount, elementType) + battleController:changeElementType(changeCount, elementType, atkUnitComp and atkUnitComp:getSide()) end diff --git a/lua/app/ui/main_city/main_city_ui.lua b/lua/app/ui/main_city/main_city_ui.lua index 1c9e8000..a15d2c29 100644 --- a/lua/app/ui/main_city/main_city_ui.lua +++ b/lua/app/ui/main_city/main_city_ui.lua @@ -957,13 +957,6 @@ end -- 弹窗优先级: 升级>功能弹窗>英雄解锁弹窗>礼包弹窗>引导 function MainCityUI:checkMainPop() - if self.selectedIndex ~= GConst.MainCityConst.BOTTOM_PAGE.MAIN then - return - end - if ModuleManager.MaincityManager:getCurModule() ~= GConst.MainCityConst.MAIN_MODULE.CHAPTER then -- 当前不是关卡界面不触发 - return - end - -- 续关 if self.isFirstEnter then local battleSnapshot = LocalData:getBattleSnapshot() @@ -986,6 +979,14 @@ function MainCityUI:checkMainPop() end end + if self.selectedIndex ~= GConst.MainCityConst.BOTTOM_PAGE.MAIN then + return + end + + if ModuleManager.MaincityManager:getCurModule() ~= GConst.MainCityConst.MAIN_MODULE.CHAPTER then -- 当前不是关卡界面不触发 + return + end + -- 检查是否升级 if DataManager.PlayerData:getIfCanLevelUp() then ModuleManager.PlayerManager:levelUp()