战斗rogue技能接入上阵
This commit is contained in:
parent
d1b80d3527
commit
0d2e914210
@ -10,26 +10,32 @@ local BATTLE_BOARD_SKILL_ENTITY = require "app/userdata/battle/skill/battle_bora
|
|||||||
local ATTR_TYPE = GConst.ATTR_TYPE
|
local ATTR_TYPE = GConst.ATTR_TYPE
|
||||||
local DEFAULT_FACTOR = BattleConst.DEFAULT_FACTOR
|
local DEFAULT_FACTOR = BattleConst.DEFAULT_FACTOR
|
||||||
|
|
||||||
function BattleData:init(skillIds, skillPool)
|
function BattleData:init()
|
||||||
self:clear()
|
self:clear()
|
||||||
self.atkTeam = self:initTeam(BattleConst.SIDE_ATK)
|
self.atkTeam = self:initTeam(BattleConst.SIDE_ATK)
|
||||||
self.defTeam = self:initTeam(BattleConst.SIDE_DEF)
|
self.defTeam = self:initTeam(BattleConst.SIDE_DEF)
|
||||||
|
self:initRogueSkills()
|
||||||
|
end
|
||||||
|
|
||||||
--- todo
|
function BattleData:initRogueSkills()
|
||||||
skillIds = {
|
self.skillPool = {}
|
||||||
10, 21, 30, 40, 50
|
self.skillMap = {}
|
||||||
}
|
local skillmap = {}
|
||||||
for _, skillId in ipairs(skillIds) do
|
local formation = DataManager.FormationData:getStageFormation()
|
||||||
local cfg = SKILL_HERO_CFG[skillId]
|
for matchType, heroId in pairs(formation) do
|
||||||
self.skillMap[cfg.position] = BATTLE_BOARD_SKILL_ENTITY:create(skillId)
|
if heroId > 0 then
|
||||||
end
|
local heroEntity = DataManager.HeroData:getHeroById(heroId)
|
||||||
|
if heroEntity then
|
||||||
---- skillPool
|
local skillId = heroEntity:getActiveSkill()
|
||||||
self.skillPool = skillPool or {}
|
local cfg = SKILL_HERO_CFG[skillId]
|
||||||
|
self.skillMap[cfg.position] = BATTLE_BOARD_SKILL_ENTITY:create(skillId)
|
||||||
for id, info in pairs(ConfigManager:getConfig("skill_rogue")) do
|
for _, id in ipairs(heroEntity:getActiveTogueSkills()) do
|
||||||
if not info.universal then
|
if not skillmap[id] then
|
||||||
table.insert(self.skillPool, id)
|
table.insert(self.skillPool, id)
|
||||||
|
skillmap[id] = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -209,4 +209,18 @@ function HeroEntity:getRogueSkillList()
|
|||||||
return self.rogueSkillList
|
return self.rogueSkillList
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function HeroEntity:getActiveTogueSkills()
|
||||||
|
local list = {}
|
||||||
|
for i = 1, self:getActiveRogueCount() do
|
||||||
|
local id = self:getRogueSkillList()[i]
|
||||||
|
if id then
|
||||||
|
table.insert(list, id)
|
||||||
|
else
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return list
|
||||||
|
end
|
||||||
|
|
||||||
return HeroEntity
|
return HeroEntity
|
||||||
Loading…
x
Reference in New Issue
Block a user