普工经验

This commit is contained in:
xiekaidong 2023-04-17 16:41:17 +08:00
parent 65f695030e
commit 503b50c03e
2 changed files with 8 additions and 4 deletions

View File

@ -504,6 +504,9 @@ function BattleUnitComp:updateBuffState(buff, num)
end
function BattleUnitComp:onSkillTakeEffect(skill)
if skill == self.unitEntity:getNormalSkill() then
self.battleController:addBattleExp(self.side)
end
local effectList = skill:getEffectList()
if effectList == nil then
return

View File

@ -1165,10 +1165,12 @@ function BattleController:snapshotBoard()
return snapshot
end
function BattleController:addBattleExp(exp)
if not self.battleData or not exp then
function BattleController:addBattleExp(side, exp)
if side ~= BattleConst.SIDE_ATK or not self.battleData then
return
end
exp = exp or 1
self.battleData:addExp(exp)
end
@ -1222,12 +1224,11 @@ local function _addCurRoundAttr(self, instruction, callback)
end
local function _assisting(self, instruction, callback)
self:addBattleExp(instruction.count)
self:addBattleExp(BattleConst.SIDE_ATK, instruction.count) -- 先直接加
callback()
end
local function _generalAttack(self, instruction, callback)
self:addBattleExp(instruction.count) -- 先直接加
self.atkTeam:useNormalSkill(instruction.skillMatch, instruction.count, callback)
end