diff --git a/lua/app/module/battle/component/battle_unit_comp.lua b/lua/app/module/battle/component/battle_unit_comp.lua index 53e56a1b..24d6a473 100644 --- a/lua/app/module/battle/component/battle_unit_comp.lua +++ b/lua/app/module/battle/component/battle_unit_comp.lua @@ -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 diff --git a/lua/app/module/battle/controller/battle_controller.lua b/lua/app/module/battle/controller/battle_controller.lua index 8b7375cf..c4853e70 100644 --- a/lua/app/module/battle/controller/battle_controller.lua +++ b/lua/app/module/battle/controller/battle_controller.lua @@ -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