This commit is contained in:
puxuan 2025-06-16 20:58:37 +08:00
parent b0f9cedce0
commit 4a6d65b9f9
3 changed files with 13 additions and 3 deletions

View File

@ -165,7 +165,8 @@ function BattleBaseData:initRogueSkills(side, formation)
for matchType, heroEntity in pairs(formation) do for matchType, heroEntity in pairs(formation) do
local skillId = heroEntity:getBaseSkill() local skillId = heroEntity:getBaseSkill()
local cfg = SKILL_CFG[skillId] local cfg = SKILL_CFG[skillId]
self.skillMap[side][cfg.position] = BATTLE_BOARD_SKILL_ENTITY:create(skillId, side) local skillLv = heroEntity:getRogueSkillLv()
self.skillMap[side][cfg.position] = BATTLE_BOARD_SKILL_ENTITY:create(skillId, side, skillLv)
-- 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

View File

@ -1,7 +1,7 @@
local BattleBoardSkillEntity = class("BattleBoardSkillEntity", BaseData) local BattleBoardSkillEntity = class("BattleBoardSkillEntity", BaseData)
local BattleBuffEntity = require "app/userdata/battle/skill/battle_buff_entity" local BattleBuffEntity = require "app/userdata/battle/skill/battle_buff_entity"
function BattleBoardSkillEntity:ctor(skillId, side) function BattleBoardSkillEntity:ctor(skillId, side, skillLv)
self:refreshSkillId(skillId) self:refreshSkillId(skillId)
self.side = side self.side = side
self.curEnergy = 0 self.curEnergy = 0
@ -18,7 +18,7 @@ function BattleBoardSkillEntity:ctor(skillId, side)
self.originSkillId = skillId self.originSkillId = skillId
self.upSkillIdMap = {} self.upSkillIdMap = {}
self.getUpSkillKind = 0 self.getUpSkillKind = skillLv
end end
function BattleBoardSkillEntity:refreshSkillId(skillId) function BattleBoardSkillEntity:refreshSkillId(skillId)

View File

@ -408,12 +408,14 @@ end
function HeroEntity:getRogueSkillList() function HeroEntity:getRogueSkillList()
if not self.rogueSkillList then if not self.rogueSkillList then
self.rogueSkillList = {} self.rogueSkillList = {}
self.skillLv = 0
local count = 1 local count = 1
while true do while true do
local ids = self.config["rouge_skill_" .. count] local ids = self.config["rouge_skill_" .. count]
if ids then if ids then
for i = #ids, 1, -1 do for i = #ids, 1, -1 do
if self.data.lv >= ids[i][1] or i == 1 then if self.data.lv >= ids[i][1] or i == 1 then
self.skillLv = self.skillLv + i
table.insert(self.rogueSkillList, ids[i]) table.insert(self.rogueSkillList, ids[i])
break break
end end
@ -428,6 +430,13 @@ function HeroEntity:getRogueSkillList()
return self.rogueSkillList return self.rogueSkillList
end end
function HeroEntity:getRogueSkillLv()
if not self.skillLv then
self:getRogueSkillList()
end
return self.skillLv
end
function HeroEntity:getNextRougeLvUp(idx) function HeroEntity:getNextRougeLvUp(idx)
local ids = self.config["rouge_skill_" .. idx] local ids = self.config["rouge_skill_" .. idx]
if ids then if ids then