|
|
@@ -11,6 +11,7 @@ local JibanLogic = require("combat.JibanLogic")
|
|
|
local BeSkill = require("combat.BeSkill")
|
|
|
local CombatObj = require("combat.CombatObj")
|
|
|
local RoleDefine = require("role.RoleDefine")
|
|
|
+local CombatLogic = require("combat.CombatLogic")
|
|
|
|
|
|
-- 初始combatInfo
|
|
|
local function initCombatInfo(human, combatType, mapID)
|
|
|
@@ -32,6 +33,7 @@ local function initCombatInfo(human, combatType, mapID)
|
|
|
combatInfo.bufferUseList = nil -- 战斗buff
|
|
|
combatInfo.objList = nil -- 战斗英雄列表
|
|
|
combatInfo.helpList = nil -- 战斗魔兽列表
|
|
|
+ combatInfo.elfList = nil -- 战斗精灵列表
|
|
|
combatInfo.rewardItem = {} -- 奖励
|
|
|
combatInfo.endParam = nil -- 额外参数
|
|
|
combatInfo.isVideo = nil -- 是否录像
|
|
|
@@ -94,6 +96,22 @@ local function setHelp(helpList, side)
|
|
|
end
|
|
|
end
|
|
|
|
|
|
+-- 设置精灵出战
|
|
|
+local function setElf(elfList, side)
|
|
|
+ if not elfList or not next(elfList) then
|
|
|
+ return
|
|
|
+ end
|
|
|
+
|
|
|
+ for index = 1, CombatDefine.COMBAT_ELF_CNT do
|
|
|
+ local elfObj = elfList[index]
|
|
|
+ if elfObj then
|
|
|
+ local pos = CombatDefine.SIDE2ELFPOS[side][index]
|
|
|
+ CombatImpl.setElf(pos, elfObj)
|
|
|
+ end
|
|
|
+ end
|
|
|
+end
|
|
|
+
|
|
|
+
|
|
|
-- 为了战斗回放,某些数据需要保存
|
|
|
local function copyToCombatInfo(combatInfo)
|
|
|
combatInfo.isWin = CombatImpl.result.isWin
|
|
|
@@ -104,6 +122,7 @@ local function copyToCombatInfo(combatInfo)
|
|
|
combatInfo.bufferUseList = Util.copyTable(CombatImpl.bufferUseList)
|
|
|
combatInfo.objList = Util.copyTable(CombatImpl.objList)
|
|
|
combatInfo.helpList = Util.copyTable(CombatImpl.helpList)
|
|
|
+ combatInfo.elfList = Util.copyTable(CombatImpl.elfList)
|
|
|
combatInfo.totalAtkCnt = CombatImpl.totalAtkCnt
|
|
|
end
|
|
|
|
|
|
@@ -173,6 +192,7 @@ local function onFightBegin(human, combatType, cbParam, param)
|
|
|
-- SkinLogic.onFightBegin(human) -- 处理皮肤属性, 这里原来逻辑也有问题,先不处理
|
|
|
CombatPosLogic.onFightBegin(human)
|
|
|
recalcHpFightBegin(human, combatType, cbParam)
|
|
|
+ CombatLogic.ElfInheritHeroAttr()
|
|
|
end
|
|
|
|
|
|
|
|
|
@@ -191,10 +211,10 @@ function combatBegin(attackerInfo, defenderInfo, combatType, onFightEndFunc, ext
|
|
|
|
|
|
|
|
|
local defender, defHelp = defenderInfo.objList, defenderInfo.helpList
|
|
|
- local defRBase, defFormation, defJiban = defenderInfo.roleBase, defenderInfo.formation, defenderInfo.jiBan
|
|
|
+ local defRBase, defFormation, defJiban, defElfList = defenderInfo.roleBase, defenderInfo.formation, defenderInfo.jiBan, defenderInfo.elfList
|
|
|
|
|
|
local attacker, atkHelp = attackerInfo.objList, attackerInfo.helpList
|
|
|
- local atkRBase, atkFormation, atkJiban = attackerInfo.roleBase, attackerInfo.formation, attackerInfo.jiBan
|
|
|
+ local atkRBase, atkFormation, atkJiban, atkElfList = attackerInfo.roleBase, attackerInfo.formation, attackerInfo.jiBan,attackerInfo.elfList
|
|
|
|
|
|
if not (attacker and next(attacker)) then
|
|
|
return
|
|
|
@@ -240,6 +260,8 @@ function combatBegin(attackerInfo, defenderInfo, combatType, onFightEndFunc, ext
|
|
|
setCombatInfo(defFormation, defender, CombatDefine.DEFEND_SIDE)
|
|
|
setHelp(atkHelp, CombatDefine.ATTACK_SIDE)
|
|
|
setHelp(defHelp, CombatDefine.DEFEND_SIDE)
|
|
|
+ setElf(atkElfList, CombatDefine.ATTACK_SIDE)
|
|
|
+ setElf(defElfList, CombatDefine.DEFEND_SIDE)
|
|
|
CombatImpl.setMaxRound(combatInfo.maxRound)
|
|
|
CombatImpl.setFightMode(combatInfo.fightMode)
|
|
|
|