Merge branch 'dev' of git.juzugame.com:b6-client/b6-lua into dev

This commit is contained in:
chenxi 2023-04-25 18:17:42 +08:00
commit 96cd67123b
2 changed files with 16 additions and 0 deletions

View File

@ -12,6 +12,7 @@ BattleConst.ELEMENT_WIGHT = 100
BattleConst.MAX_ELEMENT_WIGHT = 500
BattleConst.SIDE_ATK = 1
BattleConst.SIDE_DEF = 2
BattleConst.SIDE_ATK_ALL = 8
BattleConst.SKILL_TYPE_ACTIVE = 1
BattleConst.SKILL_TYPE_NORMAL = 2
BattleConst.SKILL_TYPE_ASSISTING = 3

View File

@ -199,6 +199,21 @@ local _addSkillEffect = function(skillInfo, battleData, battleController)
local target = atkComp
if skillInfo.obj == BattleConst.SIDE_DEF then
target = defComp
elseif skillInfo.obj == BattleConst.SIDE_ATK then
target = atkComp
elseif skillInfo.obj == BattleConst.SIDE_ATK_ALL then
for matchtype, comp in pairs(battleController.atkTeam:getUnitComp()) do
local buffEntity = BattleBuffEntity:create()
buffEntity:init(effect, comp.unitEntity)
buffEntity:setTargetSide(skillInfo.obj)
comp:takeEffect(buffEntity, comp)
end
return
else
local matchType = BattleConst.SIDE_OBJ_TO_MATCH_TYPE[effect:getTartgetSide()]
if matchType then
target = battleController.atkTeam:getUnitComp()[matchType]
end
end
local buffEntity = BattleBuffEntity:create()
buffEntity:init(effect, atkComp.unitEntity)