|
@@ -659,6 +659,37 @@ local function BattleLogic_QueryDifficulty(human)
|
|
|
print(info)
|
|
print(info)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
+-- 设置战役通关标记
|
|
|
|
|
+local function BattleLogic_SetBattleAdopt(human, nBattleType, nValue)
|
|
|
|
|
+ if not human or EliteDefine.COPY_ELITE_ERROR >= nBattleType or EliteDefine.COPY_ELITE_DIFFICULTY < nBattleType then
|
|
|
|
|
+ return
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+ print("[BattleLogic_SetBattleAdopt] 玩家通过战役 nBattleType = "..nBattleType.." nValue = "..nValue)
|
|
|
|
|
+ if EliteDefine.COPY_ELITE_NORMAL == nBattleType then
|
|
|
|
|
+ human.db.battleadopt = nValue
|
|
|
|
|
+ elseif EliteDefine.COPY_LEVEL_ELITE == nBattleType then
|
|
|
|
|
+ human.db.battleadopt_elite = nValue
|
|
|
|
|
+ elseif EliteDefine.COPY_ELITE_DIFFICULTY == nBattleType then
|
|
|
|
|
+ human.db.battleadopt_haed = nValue
|
|
|
|
|
+ end
|
|
|
|
|
+end
|
|
|
|
|
+
|
|
|
|
|
+-- 获取战役通关标记
|
|
|
|
|
+local function BattleLogic_GetBattleAdopt(human, nBattleType)
|
|
|
|
|
+ if not human or EliteDefine.COPY_ELITE_ERROR >= nBattleType or EliteDefine.COPY_ELITE_DIFFICULTY < nBattleType then
|
|
|
|
|
+ return 0
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+ if EliteDefine.COPY_ELITE_NORMAL == nBattleType then
|
|
|
|
|
+ return human.db.battleadopt
|
|
|
|
|
+ elseif EliteDefine.COPY_LEVEL_ELITE == nBattleType then
|
|
|
|
|
+ return human.db.battleadopt_elite
|
|
|
|
|
+ elseif EliteDefine.COPY_ELITE_DIFFICULTY == nBattleType then
|
|
|
|
|
+ return human.db.battleadopt_haed
|
|
|
|
|
+ end
|
|
|
|
|
+end
|
|
|
|
|
+
|
|
|
function getBattleRoleList(nBattleType, worldMapId)
|
|
function getBattleRoleList(nBattleType, worldMapId)
|
|
|
if not BATTLE_LEVEL_PLAYER_LIST then
|
|
if not BATTLE_LEVEL_PLAYER_LIST then
|
|
|
BATTLE_LEVEL_PLAYER_LIST = {}
|
|
BATTLE_LEVEL_PLAYER_LIST = {}
|
|
@@ -1179,7 +1210,8 @@ function query(human)
|
|
|
local nNowBattleID = BattleLogic_GetBattleBattleID(human)
|
|
local nNowBattleID = BattleLogic_GetBattleBattleID(human)
|
|
|
local tBattleConfig = BattleLogic_GetBattleConfig(human)
|
|
local tBattleConfig = BattleLogic_GetBattleConfig(human)
|
|
|
local nNowGuaJiID = BattleLogic_GetBattleGuaJiID(human)
|
|
local nNowGuaJiID = BattleLogic_GetBattleGuaJiID(human)
|
|
|
- if -1 >= nNowBattleID or not tBattleConfig or -1 >= nNowGuaJiID then
|
|
|
|
|
|
|
+ local nBattleType = BattleLogic_GetBattleType(human)
|
|
|
|
|
+ if -1 >= nNowBattleID or not tBattleConfig or -1 >= nNowGuaJiID or -1 >= nBattleType then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "[query] 获取到的战斗ID或奖励配置不正确")
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "[query] 获取到的战斗ID或奖励配置不正确")
|
|
|
print("[query] 获取到的战斗ID或奖励配置不正确 id = "..human.db._id)
|
|
print("[query] 获取到的战斗ID或奖励配置不正确 id = "..human.db._id)
|
|
|
return
|
|
return
|
|
@@ -1200,8 +1232,9 @@ function query(human)
|
|
|
nNowGuaJiID = configNode
|
|
nNowGuaJiID = configNode
|
|
|
BattleLogic_SetBattleGuaJiID(human, nNowGuaJiID)
|
|
BattleLogic_SetBattleGuaJiID(human, nNowGuaJiID)
|
|
|
end
|
|
end
|
|
|
-
|
|
|
|
|
- if nNowBattleID == nNowGuaJiID and nNowBattleID == configNode then
|
|
|
|
|
|
|
+
|
|
|
|
|
+ local nBattleAdopt = BattleLogic_GetBattleAdopt(human, nBattleType)
|
|
|
|
|
+ if nBattleAdopt == 1 then
|
|
|
print("[query] nNowBattleID 为最大值 nNowBattleID = "..nNowBattleID.." nNowGuaJiID = "..nNowGuaJiID)
|
|
print("[query] nNowBattleID 为最大值 nNowBattleID = "..nNowBattleID.." nNowGuaJiID = "..nNowGuaJiID)
|
|
|
msgRet.nowBattleID = configNode + 1
|
|
msgRet.nowBattleID = configNode + 1
|
|
|
end
|
|
end
|
|
@@ -2274,6 +2307,10 @@ function onFightEnd(human, result, fightTypeID, param1, combatInfo)
|
|
|
-- local nextBattleConfig = BattleExcel.node[nextBattleID]
|
|
-- local nextBattleConfig = BattleExcel.node[nextBattleID]
|
|
|
-- local config = BattleExcel.node[battleID]
|
|
-- local config = BattleExcel.node[battleID]
|
|
|
|
|
|
|
|
|
|
+ if (battleID + 1) > nAllFightLen then
|
|
|
|
|
+ BattleLogic_SetBattleAdopt(human, nBattleType, 1)
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
local nextBattleConfig = tBattleConfig.node[nextBattleID]
|
|
local nextBattleConfig = tBattleConfig.node[nextBattleID]
|
|
|
local config = tBattleConfig.node[battleID]
|
|
local config = tBattleConfig.node[battleID]
|
|
|
|
|
|
|
@@ -3430,11 +3467,11 @@ end
|
|
|
-- 判断是否是最后一关
|
|
-- 判断是否是最后一关
|
|
|
function BattleLogic_IsLastLevels(human, nBattleType)
|
|
function BattleLogic_IsLastLevels(human, nBattleType)
|
|
|
local tBattleConfig = BattleLogic_GetBattleConfigByType(nBattleType)
|
|
local tBattleConfig = BattleLogic_GetBattleConfigByType(nBattleType)
|
|
|
- local nBattleID = BattleLogic_GetBattleBattleID(human)
|
|
|
|
|
- if not tBattleConfig or -1 >= nBattleID then
|
|
|
|
|
|
|
+ local nBattleType = BattleLogic_GetBattleType(human)
|
|
|
|
|
+ if not tBattleConfig or -1 >= nBattleType then
|
|
|
return false
|
|
return false
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- local nNodeLen = #tBattleConfig.node
|
|
|
|
|
- return nBattleID == nNodeLen
|
|
|
|
|
|
|
+ local nValue = BattleLogic_GetBattleAdopt(human, nBattleType)
|
|
|
|
|
+ return nValue == 1
|
|
|
end
|
|
end
|