技能机制优化

This commit is contained in:
xiekaidong 2023-08-01 17:35:58 +08:00
parent d79e24d01f
commit e954484a13
4 changed files with 36 additions and 13 deletions

View File

@ -124,6 +124,10 @@ function BattleUnitComp:initWithEntity(modelId, entity, battleController, target
self:initHitAniInfo() self:initHitAniInfo()
end end
function BattleUnitComp:getSide()
return self.side
end
function BattleUnitComp:initHitAniInfo() function BattleUnitComp:initHitAniInfo()
self.hurtAniNameList = {} self.hurtAniNameList = {}
self.hurtAniNameCount = 0 self.hurtAniNameCount = 0

View File

@ -724,8 +724,9 @@ function BattleBaseController:getCurActionUnitComp()
return self:getCurActionTeam():getMainUnit() return self:getCurActionTeam():getMainUnit()
end end
function BattleBaseController:getCurActionBoardRowRange() function BattleBaseController:getCurActionBoardRowRange(side)
local isAtkAction = self.curActionSide == SIDE_ATK side = side or self.curActionSide
local isAtkAction = side == SIDE_ATK
if isAtkAction then if isAtkAction then
return self:getAtkMinRow() + 1, self:getRowCount() return self:getAtkMinRow() + 1, self:getRowCount()
else else
@ -743,6 +744,16 @@ function BattleBaseController:getPosIdInCurActionBoardRowRange(posId)
return true return true
end 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() function BattleBaseController:onLoadComplete()
UIManager:closeLoading() UIManager:closeLoading()
self:handleBuffs() self:handleBuffs()
@ -2151,14 +2162,21 @@ function BattleBaseController:selectSKillNextToStep()
end end
function BattleBaseController:changeElementType(count, elementType) function BattleBaseController:changeElementType(count, elementType, side)
self.changeElementTypeMap = table.clearOrCreate(self.changeElementTypeMap) self.changeElementTypeMap = table.clearOrCreate(self.changeElementTypeMap)
self.changeElementTypeList = table.clearOrCreate(self.changeElementTypeList) self.changeElementTypeList = table.clearOrCreate(self.changeElementTypeList)
local listCount = 0 local listCount = 0
for _, entity in pairs(self.battleData:getGridEnties()) do for _, entity in pairs(self.battleData:getGridEnties()) do
if entity:canChangeInfo() and entity:getElementType() ~= elementType then if entity:canChangeInfo() and entity:getElementType() ~= elementType then
table.insert(self.changeElementTypeList, entity) if side then
listCount = listCount + 1 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
end end

View File

@ -449,7 +449,7 @@ local function _takeChangeElementType(atkUnitComp, skillEntity, battleController
local elementType = params[1] local elementType = params[1]
local changeCount = params[2] local changeCount = params[2]
battleController:changeElementType(changeCount, elementType) battleController:changeElementType(changeCount, elementType, atkUnitComp and atkUnitComp:getSide())
end end

View File

@ -957,13 +957,6 @@ end
-- 弹窗优先级: 升级>功能弹窗>英雄解锁弹窗>礼包弹窗>引导 -- 弹窗优先级: 升级>功能弹窗>英雄解锁弹窗>礼包弹窗>引导
function MainCityUI:checkMainPop() 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 if self.isFirstEnter then
local battleSnapshot = LocalData:getBattleSnapshot() local battleSnapshot = LocalData:getBattleSnapshot()
@ -986,6 +979,14 @@ function MainCityUI:checkMainPop()
end end
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 if DataManager.PlayerData:getIfCanLevelUp() then
ModuleManager.PlayerManager:levelUp() ModuleManager.PlayerManager:levelUp()