skill
This commit is contained in:
parent
5cfdb4c8d8
commit
c026ff582c
@ -680,6 +680,7 @@ function BattleBaseController:prepareFight()
|
|||||||
self:initDefUnits(onPreloadFinished)
|
self:initDefUnits(onPreloadFinished)
|
||||||
self.battleUI:refreshChessBoard(self:getChessBoardBgName())
|
self.battleUI:refreshChessBoard(self:getChessBoardBgName())
|
||||||
self.battleUI:loadBg(self:getScene())
|
self.battleUI:loadBg(self:getScene())
|
||||||
|
self.battleData:initAllRogueSkills()
|
||||||
end)
|
end)
|
||||||
BattleHelper:setBaseOrder(self.battleUI:getUIOrder())
|
BattleHelper:setBaseOrder(self.battleUI:getUIOrder())
|
||||||
BattleHelper:setBattleData(self.battleData)
|
BattleHelper:setBattleData(self.battleData)
|
||||||
@ -2368,10 +2369,10 @@ function BattleBaseController:dealSelectSkill(skillId, value, side, isSnapshot)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BattleBaseController:onSelectSkill(skillId, value, pos, side)
|
function BattleBaseController:onSelectSkill(skillId, value, pos, side)
|
||||||
if not self.canChoseSkillCount or self.canChoseSkillCount <= 0 then
|
-- if not self.canChoseSkillCount or self.canChoseSkillCount <= 0 then
|
||||||
return
|
-- return
|
||||||
end
|
-- end
|
||||||
self.canChoseSkillCount = self.canChoseSkillCount - 1
|
-- self.canChoseSkillCount = self.canChoseSkillCount - 1
|
||||||
side = side or self:getCurActionSide()
|
side = side or self:getCurActionSide()
|
||||||
self:dealSelectSkill(skillId, value, side)
|
self:dealSelectSkill(skillId, value, side)
|
||||||
|
|
||||||
@ -2389,6 +2390,10 @@ function BattleBaseController:onSelectSkill(skillId, value, pos, side)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not self.battleUI then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
self:selectSKillNextToStep()
|
self:selectSKillNextToStep()
|
||||||
|
|
||||||
self.battleUI:showCommonSkillTips(skillId)
|
self.battleUI:showCommonSkillTips(skillId)
|
||||||
@ -2402,7 +2407,6 @@ function BattleBaseController:selectSKillNextToStep()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function BattleBaseController:changeElementType(count, elementType, side)
|
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)
|
||||||
|
|||||||
@ -54,8 +54,8 @@ function BattleBaseData:init(params, snapInfo)
|
|||||||
BattleSkillEntity.sid = 0
|
BattleSkillEntity.sid = 0
|
||||||
self.atkTeam = self:initTeam(SIDE_ATK, params.atkFormation)
|
self.atkTeam = self:initTeam(SIDE_ATK, params.atkFormation)
|
||||||
self.defTeam = self:initTeam(SIDE_DEF, params.defFormation)
|
self.defTeam = self:initTeam(SIDE_DEF, params.defFormation)
|
||||||
-- self:initRogueSkills(SIDE_ATK, params.atkFormation)
|
self:initRogueSkills(SIDE_ATK, params.atkFormation)
|
||||||
-- self:initRogueSkills(SIDE_DEF, params.defFormation)
|
self:initRogueSkills(SIDE_DEF, params.defFormation)
|
||||||
self.atkFormation = params.atkFormation or {}
|
self.atkFormation = params.atkFormation or {}
|
||||||
self.defFormation = params.defFormation or {}
|
self.defFormation = params.defFormation or {}
|
||||||
self:setMaxBattleLv(nil)
|
self:setMaxBattleLv(nil)
|
||||||
@ -148,19 +148,24 @@ function BattleBaseData:setTimeSpeed(timeSpeed, timeScale)
|
|||||||
self.data.timeSpeed = timeSpeed
|
self.data.timeSpeed = timeSpeed
|
||||||
end
|
end
|
||||||
|
|
||||||
-- function BattleBaseData:initRogueSkills(side, formation)
|
function BattleBaseData:initAllRogueSkills()
|
||||||
-- self.skillPool = self.skillPool or {}
|
self.atkTeam:initRougeSkills()
|
||||||
-- self.skillMap = self.skillMap or {}
|
self.defTeam:initRougeSkills()
|
||||||
-- self.skillPool[side] = self.skillPool[side] or {}
|
end
|
||||||
-- self.skillMap[side] = self.skillMap[side] or {}
|
|
||||||
-- if not formation then
|
function BattleBaseData:initRogueSkills(side, formation)
|
||||||
-- return
|
self.skillPool = self.skillPool or {}
|
||||||
-- end
|
self.skillMap = self.skillMap or {}
|
||||||
-- local skillmap = {}
|
self.skillPool[side] = self.skillPool[side] or {}
|
||||||
-- for matchType, heroEntity in pairs(formation) do
|
self.skillMap[side] = self.skillMap[side] or {}
|
||||||
-- local skillId = heroEntity:getBaseSkill()
|
if not formation then
|
||||||
-- local cfg = SKILL_CFG[skillId]
|
return
|
||||||
-- self.skillMap[side][cfg.position] = BATTLE_BOARD_SKILL_ENTITY:create(skillId, side)
|
end
|
||||||
|
local skillmap = {}
|
||||||
|
for matchType, heroEntity in pairs(formation) do
|
||||||
|
local skillId = heroEntity:getBaseSkill()
|
||||||
|
local cfg = SKILL_CFG[skillId]
|
||||||
|
self.skillMap[side][cfg.position] = BATTLE_BOARD_SKILL_ENTITY:create(skillId, side)
|
||||||
-- self.skillMap[side][cfg.position]:addUpSkills(heroEntity:getRogueSkillList())
|
-- self.skillMap[side][cfg.position]:addUpSkills(heroEntity:getRogueSkillList())
|
||||||
-- self.skillMap[side][cfg.position]:setUnlockId(heroEntity:getUnlockRogueId())
|
-- self.skillMap[side][cfg.position]:setUnlockId(heroEntity:getUnlockRogueId())
|
||||||
-- for _, id in ipairs(heroEntity:getActiveRogueSkills()) do
|
-- for _, id in ipairs(heroEntity:getActiveRogueSkills()) do
|
||||||
@ -172,8 +177,9 @@ end
|
|||||||
-- skillmap[id] = true
|
-- skillmap[id] = true
|
||||||
-- end
|
-- end
|
||||||
-- end
|
-- end
|
||||||
-- end
|
end
|
||||||
-- end
|
Logger.logHighlight("===========")
|
||||||
|
end
|
||||||
|
|
||||||
function BattleBaseData:refreshBoard(board, boardEdge, blockIcon, snapshot)
|
function BattleBaseData:refreshBoard(board, boardEdge, blockIcon, snapshot)
|
||||||
local r = 1
|
local r = 1
|
||||||
|
|||||||
@ -34,7 +34,8 @@ function BattleBoardSkillEntity:getSkillId()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BattleBoardSkillEntity:getUnlocked()
|
function BattleBoardSkillEntity:getUnlocked()
|
||||||
return self.unlocked
|
-- return self.unlocked
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleBoardSkillEntity:setUnlock()
|
function BattleBoardSkillEntity:setUnlock()
|
||||||
|
|||||||
@ -495,4 +495,12 @@ function BattleTeamEntity:getIsDead()
|
|||||||
return self.isDead
|
return self.isDead
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--@region 自带rouge
|
||||||
|
function BattleTeamEntity:initRougeSkills()
|
||||||
|
for k,v in pairs(self.members) do
|
||||||
|
v:initRougeSkills()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
--@endregion
|
||||||
|
|
||||||
return BattleTeamEntity
|
return BattleTeamEntity
|
||||||
@ -52,12 +52,6 @@ function BattleUnitEntity:initSkill()
|
|||||||
table.insert(self.passiveSkills, skill)
|
table.insert(self.passiveSkills, skill)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.unitData.rougeSkills then
|
|
||||||
for i,v in ipairs(self.unitData.rougeSkills) do
|
|
||||||
ModuleManager.BattleManager:onSelectSkill(v)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleUnitEntity:getIsBoss()
|
function BattleUnitEntity:getIsBoss()
|
||||||
@ -68,6 +62,19 @@ function BattleUnitEntity:getId()
|
|||||||
return self.unitData.id
|
return self.unitData.id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleUnitEntity:initRougeSkills()
|
||||||
|
if self.unitData.rougeSkills then
|
||||||
|
local SKILL_ICON_POS = {
|
||||||
|
{x =-240, y= 165},
|
||||||
|
{x =-240, y= 0},
|
||||||
|
{x =-240, y= -165}
|
||||||
|
}
|
||||||
|
for i,v in ipairs(self.unitData.rougeSkills) do
|
||||||
|
ModuleManager.BattleManager:onSelectSkill(v, nil, SKILL_ICON_POS[i])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function BattleUnitEntity:addSkill(skillId)
|
function BattleUnitEntity:addSkill(skillId)
|
||||||
local skillInfo = ConfigManager:getConfig("skill")[skillId]
|
local skillInfo = ConfigManager:getConfig("skill")[skillId]
|
||||||
if skillInfo == nil then
|
if skillInfo == nil then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user