Sfoglia il codice sorgente

异界之战防守阵容精灵

gitxsm 5 mesi fa
parent
commit
894c1450a3

+ 25 - 1
script/module/anotherWorldBattle/AnotherWorldBattleNS.lua

@@ -1082,7 +1082,6 @@ function AB_Morale_Do(human)
     InnerMsg.sendMsg(0, msgData)
 end
 
-
 -- 查询据点羁绊数据
 function AB_PointLine_JiBan_Query(human, msg)
     if not isBattleStage() then
@@ -1113,6 +1112,31 @@ function AB_PointLine_JiBan_Update(human, msg)
     JibanLogic.update(human, msg.combatType, msg.jibanList, extraArgs)
 end
 
+-- 查询据点精灵数据
+function AB_PointLine_Elf_Query(human, msg)
+    if not isBattleStage() then
+        return
+    end
+    local extraArgs = {
+        cityId = msg.cityId,
+        pointIdx = msg.pointIdx,
+    }
+    CombatPosLogic.Elf_Pos_Query(human, msg.combatType, extraArgs)
+end
+
+-- 更新据点精灵
+function AB_PointLine_Elf_Update(human, msg)
+    if not isBattleStage() then
+        return
+    end
+
+    local extraArgs = {
+        cityId = msg.cityId,
+        pointIdx = msg.pointIdx,
+    }
+    CombatPosLogic.Elf_Pos_Update(human, msg.combatType, msg.elfPosArr, extraArgs)
+end
+
 ------------------------------------C2N---------------------------------------------------
 
 -- 跨服通知活动开启

+ 9 - 0
script/module/anotherWorldBattle/Handler.lua

@@ -79,6 +79,15 @@ function CG_AB_JIBAN_UPDATE(human, msg)
     AnotherWorldBattleNS.AB_PointLine_JiBan_Update(human, msg)
 end
 
+
+function CG_AB_ELF_QUERY(human, msg)
+    AnotherWorldBattleNS.AB_PointLine_Elf_Query(human, msg)
+end
+
+function CG_AB_ELF_UPDATE(human, msg)
+    AnotherWorldBattleNS.AB_PointLine_Elf_Update(human, msg)
+end
+
 -------------------------------------------------异界寻宝------------------------------------------
 
 function CG_AB_TREASURE_QUERY(human, msg)

+ 13 - 0
script/module/anotherWorldBattle/Proto.lua

@@ -252,6 +252,19 @@ CG_AB_JIBAN_UPDATE = {
     {"pointIdx",        1,      "byte"},    -- 据点索引
 }
 
+-- 据点防守精灵查询
+CG_AB_ELF_QUERY = {
+    {"cityId",          1,      "int"},     -- 城池Id
+    {"pointIdx",        1,      "byte"},    -- 据点索引
+    {"combatType",      1,      "byte"},    -- 阵容类型
+}
+-- 据点精灵更新
+CG_AB_ELF_UPDATE = {
+	{"combatType",	    1,		"byte"},	-- 战斗类型
+	{"elfPosArr",		4,		"int"},		-- 数组, key对应位置, value为精灵Id,如果当前位置没有精灵上阵,value为0
+    {"cityId",          1,      "int"},     -- 城池Id
+    {"pointIdx",        1,      "byte"},    -- 据点索引
+}
 
 
 -- 异界寻宝查询

+ 26 - 5
script/module/combat/CombatPosLogic.lua

@@ -897,8 +897,19 @@ end
 ----------------------精灵-------------------------
 
 -- 查询某个战斗类型的精灵上阵数据
-function Elf_Pos_Query(human, combatType)
-	local combatPosData = getCombatHeroDB(human,combatType)
+function Elf_Pos_Query(human, combatType, extraArgs)
+	local combatPosData
+	if combatType == CombatDefine.COMBAT_TYPE36 and extraArgs then
+		AnotherWorldBattleNS = AnotherWorldBattleNS or require("anotherWorldBattle.AnotherWorldBattleNS")
+		local v1,v2, v3
+		v1, v2, v3, combatPosData = AnotherWorldBattleNS.getCombatHeros(human, combatType, extraArgs)
+		if not combatPosData then
+			return
+		end
+	else
+		combatPosData = getCombatHeroDB(human,combatType)
+	end
+
 	local elfList = combatPosData.elfList
 
 	local msgRet = Msg.gc.GC_COMBAT_ELFPOS_QUERY
@@ -927,8 +938,18 @@ function Elf_Pos_Query(human, combatType)
 end
 
 -- 更新某个战斗类型的精灵上阵数据
-function Elf_Pos_Update(human, combatType, elfIdArr)
-	local combatPosData = getCombatHeroDB(human,combatType)
+function Elf_Pos_Update(human, combatType, elfIdArr, extraArgs)
+	local combatPosData
+	if combatType == CombatDefine.COMBAT_TYPE36 and extraArgs then
+		AnotherWorldBattleNS = AnotherWorldBattleNS or require("anotherWorldBattle.AnotherWorldBattleNS")
+		local v1,v2, v3
+		v1, v2, v3, combatPosData = AnotherWorldBattleNS.getCombatHeros(human, combatType, extraArgs)
+		if not combatPosData then
+			return
+		end
+	else
+		combatPosData = getCombatHeroDB(human,combatType)
+	end
 
 	local ElfEecordTb = {}
 	for _ ,elfId in ipairs(elfIdArr) do
@@ -955,5 +976,5 @@ function Elf_Pos_Update(human, combatType, elfIdArr)
 	end
 	-- combatPosData.elfList = elfIdArr
 
-	Elf_Pos_Query(human, combatType)
+	Elf_Pos_Query(human, combatType, extraArgs)
 end