|
|
@@ -183,7 +183,7 @@ local function BattleLogic_GetBattleBattleID(human)
|
|
|
|
|
|
if EliteDefine.COPY_ELITE_ERROR >= nBattleType or EliteDefine.COPY_ELITE_DIFFICULTY < nBattleType then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleBattleID 获取到的战斗类型不正确 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
return -1
|
|
|
end
|
|
|
|
|
|
@@ -195,7 +195,7 @@ local function BattleLogic_GetBattleBattleID(human)
|
|
|
return human.db.battleID_hard
|
|
|
else
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleBattleID 未处理的战斗类型 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
return -1
|
|
|
end
|
|
|
end
|
|
|
@@ -204,7 +204,7 @@ end
|
|
|
local function BattleLogic_GetBattleIDByType(human, nBattleType)
|
|
|
if not human or EliteDefine.COPY_ELITE_ERROR >= nBattleType or EliteDefine.COPY_ELITE_DIFFICULTY < nBattleType then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleIDByType 传入的参数不正确 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
return -1
|
|
|
end
|
|
|
|
|
|
@@ -229,7 +229,7 @@ local function BattleLogic_SetBattleBattleID(human, nValue)
|
|
|
local nBattleType = BattleLogic_GetBattleType(human)
|
|
|
if EliteDefine.COPY_ELITE_ERROR >= nBattleType or EliteDefine.COPY_ELITE_DIFFICULTY < nBattleType then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_SetBattleBattleID 获取到的战斗类型不正确 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
return false
|
|
|
end
|
|
|
|
|
|
@@ -241,7 +241,7 @@ local function BattleLogic_SetBattleBattleID(human, nValue)
|
|
|
human.db.battleID_hard = nValue
|
|
|
else
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleGuaJiID 未处理的战斗类型 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
return false
|
|
|
end
|
|
|
|
|
|
@@ -260,7 +260,7 @@ local function BattleLogic_GetBattleGuaJiID(human)
|
|
|
|
|
|
if EliteDefine.COPY_ELITE_ERROR >= nBattleType or EliteDefine.COPY_ELITE_DIFFICULTY < nBattleType then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleGuaJiID 获取到的战斗类型不正确 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
return -1
|
|
|
end
|
|
|
|
|
|
@@ -272,7 +272,7 @@ local function BattleLogic_GetBattleGuaJiID(human)
|
|
|
return human.db.guajiID_hard
|
|
|
else
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleGuaJiID 未处理的战斗类型 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
return -1
|
|
|
end
|
|
|
end
|
|
|
@@ -281,7 +281,7 @@ end
|
|
|
local function BattleLogic_GetBattleGuaJiIDByType(human, nBattleType)
|
|
|
if not human or EliteDefine.COPY_ELITE_ERROR >= nBattleType or EliteDefine.COPY_ELITE_DIFFICULTY < nBattleType then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleGuaJiIDByType 传入的参数不正确 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
return -1
|
|
|
end
|
|
|
|
|
|
@@ -293,7 +293,7 @@ local function BattleLogic_GetBattleGuaJiIDByType(human, nBattleType)
|
|
|
return human.db.guajiID_hard
|
|
|
else
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleGuaJiIDByType 未处理的战斗类型 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
return -1
|
|
|
end
|
|
|
end
|
|
|
@@ -308,7 +308,7 @@ local function BattleLogic_SetBattleGuaJiID(human, nValue)
|
|
|
local nBattleType = BattleLogic_GetBattleType(human)
|
|
|
if EliteDefine.COPY_ELITE_ERROR >= nBattleType or EliteDefine.COPY_ELITE_DIFFICULTY < nBattleType then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_SetBattleGuaJiID 获取到的战斗类型不正确 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
return false
|
|
|
end
|
|
|
|
|
|
@@ -320,7 +320,7 @@ local function BattleLogic_SetBattleGuaJiID(human, nValue)
|
|
|
human.db.guajiID_hard = nValue
|
|
|
else
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleGuaJiID 未处理的战斗类型 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
return false
|
|
|
end
|
|
|
|
|
|
@@ -337,7 +337,7 @@ local function BattleLogic_GetBattleRewards(human)
|
|
|
local nBattleType = BattleLogic_GetBattleType(human)
|
|
|
if EliteDefine.COPY_ELITE_ERROR >= nBattleType or EliteDefine.COPY_ELITE_DIFFICULTY < nBattleType then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleRewards 获取到的战斗类型不正确 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
return nil
|
|
|
end
|
|
|
|
|
|
@@ -345,7 +345,7 @@ local function BattleLogic_GetBattleRewards(human)
|
|
|
if EliteDefine.COPY_ELITE_NORMAL == nBattleType then
|
|
|
if not human.db.battleRewards then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleRewards 玩家普通奖励未初始化进行初始化 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
human.db.battleRewards = {}
|
|
|
end
|
|
|
|
|
|
@@ -353,7 +353,7 @@ local function BattleLogic_GetBattleRewards(human)
|
|
|
elseif EliteDefine.COPY_LEVEL_ELITE == nBattleType then
|
|
|
if not human.db.battleRewards_elite then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleRewards 玩家精英奖励未初始化进行初始化 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
human.db.battleRewards_elite = {}
|
|
|
end
|
|
|
|
|
|
@@ -361,14 +361,14 @@ local function BattleLogic_GetBattleRewards(human)
|
|
|
elseif EliteDefine.COPY_ELITE_DIFFICULTY == nBattleType then
|
|
|
if not human.db.battleRewards_hard then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleRewards 玩家困难奖励未初始化进行初始化 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
human.db.battleRewards_hard = {}
|
|
|
end
|
|
|
|
|
|
tRewards = human.db.battleRewards_hard
|
|
|
else
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleRewards 未处理的战斗类型 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
end
|
|
|
|
|
|
return tRewards
|
|
|
@@ -385,7 +385,7 @@ local function BattleLogic_GetBattleRewardsByType(human, nBattleType)
|
|
|
if EliteDefine.COPY_ELITE_NORMAL == nBattleType then
|
|
|
if not human.db.battleRewards then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "[BattleLogic_GetBattleRewardsByType] 玩家普通奖励未初始化进行初始化 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
human.db.battleRewards = {}
|
|
|
end
|
|
|
|
|
|
@@ -394,7 +394,7 @@ local function BattleLogic_GetBattleRewardsByType(human, nBattleType)
|
|
|
elseif EliteDefine.COPY_LEVEL_ELITE == nBattleType then
|
|
|
if not human.db.battleRewards_elite then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "[BattleLogic_GetBattleRewardsByType] 玩家精英奖励未初始化进行初始化 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
human.db.battleRewards_elite = {}
|
|
|
end
|
|
|
|
|
|
@@ -403,7 +403,7 @@ local function BattleLogic_GetBattleRewardsByType(human, nBattleType)
|
|
|
elseif EliteDefine.COPY_ELITE_DIFFICULTY == nBattleType then
|
|
|
if not human.db.battleRewards_hard then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "[BattleLogic_GetBattleRewardsByType] 玩家困难奖励未初始化进行初始化 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
human.db.battleRewards_hard = {}
|
|
|
end
|
|
|
|
|
|
@@ -411,7 +411,7 @@ local function BattleLogic_GetBattleRewardsByType(human, nBattleType)
|
|
|
tRewards = human.db.battleRewards_hard
|
|
|
else
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "[BattleLogic_GetBattleRewardsByType] 未处理的战斗类型 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
end
|
|
|
|
|
|
return tRewards
|
|
|
@@ -429,7 +429,7 @@ local function BattleLogic_SetBattleRewards(human, id)
|
|
|
local tRewards = BattleLogic_GetBattleRewards(human)
|
|
|
if not tRewards then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_SetBattleRewards 获取到的奖励为空 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name)
|
|
|
return false
|
|
|
end
|
|
|
|
|
|
@@ -451,7 +451,7 @@ local function BattleLogic_GetBattleOut(human)
|
|
|
local nBattleType = BattleLogic_GetBattleType(human)
|
|
|
if EliteDefine.COPY_ELITE_ERROR >= nBattleType or EliteDefine.COPY_ELITE_DIFFICULTY < nBattleType then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleOut 获取到的战斗类型不正确 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
return nil
|
|
|
end
|
|
|
|
|
|
@@ -460,7 +460,7 @@ local function BattleLogic_GetBattleOut(human)
|
|
|
-- if EliteDefine.COPY_ELITE_NORMAL == nBattleType then
|
|
|
-- -- if not human.db.battleRewards then
|
|
|
-- -- Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleRewards 玩家普通奖励未初始化进行初始化 id = "
|
|
|
- -- -- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ -- -- ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
-- -- human.db.battleOut = {}
|
|
|
-- -- end
|
|
|
|
|
|
@@ -468,7 +468,7 @@ local function BattleLogic_GetBattleOut(human)
|
|
|
-- elseif EliteDefine.COPY_LEVEL_ELITE == nBattleType then
|
|
|
-- -- if not human.db.battleRewards_elite then
|
|
|
-- -- Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleRewards 玩家精英奖励未初始化进行初始化 id = "
|
|
|
- -- -- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ -- -- ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
-- -- human.db.battleRewards_elite = {}
|
|
|
-- -- end
|
|
|
|
|
|
@@ -476,14 +476,14 @@ local function BattleLogic_GetBattleOut(human)
|
|
|
-- elseif EliteDefine.COPY_ELITE_DIFFICULTY == nBattleType then
|
|
|
-- -- if not human.db.battleRewards_hard then
|
|
|
-- -- Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleRewards 玩家困难奖励未初始化进行初始化 id = "
|
|
|
- -- -- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ -- -- ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
-- -- human.db.battleRewards_hard = {}
|
|
|
-- -- end
|
|
|
|
|
|
-- tRewards = human.db.battleOut_hard
|
|
|
-- else
|
|
|
-- Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleOut 未处理的战斗类型 id = "
|
|
|
- -- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ -- ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
-- end
|
|
|
end
|
|
|
|
|
|
@@ -544,7 +544,7 @@ local function BattleLogic_GetBattleConfig(human)
|
|
|
local nBattleType = BattleLogic_GetBattleType(human)
|
|
|
if EliteDefine.COPY_ELITE_ERROR >= nBattleType or EliteDefine.COPY_ELITE_DIFFICULTY < nBattleType then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleConfig 获取到的战斗类型不正确 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
return nil
|
|
|
end
|
|
|
|
|
|
@@ -556,7 +556,7 @@ local function BattleLogic_GetBattleConfig(human)
|
|
|
return BattleExcel_Hard
|
|
|
else
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetBattleGuaJiID 未处理的战斗类型 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
return nil
|
|
|
end
|
|
|
end
|
|
|
@@ -591,7 +591,7 @@ local function BattleLogic_GetChapterReward(human)
|
|
|
|
|
|
if EliteDefine.COPY_ELITE_ERROR >= nBattleType or EliteDefine.COPY_ELITE_DIFFICULTY < nBattleType then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetChapterReward 获取到的战斗类型不正确 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
return nil
|
|
|
end
|
|
|
|
|
|
@@ -615,7 +615,7 @@ local function BattleLogic_GetChapterReward(human)
|
|
|
return human.db.chapterReward_Hard
|
|
|
else
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "BattleLogic_GetChapterReward 未处理的战斗类型 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name.." nBattleType = "..nBattleType)
|
|
|
return nil
|
|
|
end
|
|
|
end
|
|
|
@@ -779,21 +779,49 @@ function initAfterStart()
|
|
|
end
|
|
|
end
|
|
|
|
|
|
+--计算当前关卡能获得多少次小游戏次数
|
|
|
+local function calcGameTimes(config, levelId)
|
|
|
+ local gameTimes = 0
|
|
|
+
|
|
|
+ local allCfg = config
|
|
|
+ for i=1, levelId-1 do
|
|
|
+ local cfg = allCfg[i]
|
|
|
+ if cfg and cfg and type(cfg.gameType) == "number" and cfg.gameType == 1 then
|
|
|
+ gameTimes = gameTimes + 1
|
|
|
+ end
|
|
|
+ end
|
|
|
+ return gameTimes
|
|
|
+end
|
|
|
+
|
|
|
+
|
|
|
function onLogin(human)
|
|
|
--处理老号已经在小游戏玩法上线前已经推过图没有获得小游戏次数
|
|
|
if not human.db.battleGameTimes then
|
|
|
- local gameTimes = 0
|
|
|
- local battleID = human.db.battleID
|
|
|
- local allCfg = BattleExcel.node
|
|
|
- for i=1, battleID-1 do
|
|
|
- local cfg = allCfg[i]
|
|
|
- if cfg and cfg and type(cfg.gameType) == "number" and cfg.gameType == 1 then
|
|
|
- gameTimes = gameTimes + 1
|
|
|
- end
|
|
|
- end
|
|
|
- human.db.battleGameTimes = gameTimes
|
|
|
+ -- local gameTimes = 0
|
|
|
+ -- local battleID = human.db.battleID
|
|
|
+ -- local allCfg = BattleExcel.node
|
|
|
+ -- for i=1, battleID-1 do
|
|
|
+ -- local cfg = allCfg[i]
|
|
|
+ -- if cfg and cfg and type(cfg.gameType) == "number" and cfg.gameType == 1 then
|
|
|
+ -- gameTimes = gameTimes + 1
|
|
|
+ -- end
|
|
|
+ -- end
|
|
|
+ human.db.battleGameTimes = calcGameTimes(BattleExcel.node, human.db.battleID)
|
|
|
+ end
|
|
|
+
|
|
|
+
|
|
|
+ --新增精英次数补偿
|
|
|
+ if not human.db.eliteBattleGameTimes then
|
|
|
+ human.db.eliteBattleGameTimes = calcGameTimes(BattleExcel_Elite.node, human.db.battleID_elite)
|
|
|
+ end
|
|
|
+
|
|
|
+ --新增困难次数补偿
|
|
|
+ if not human.db.hardBattleGameTimes then
|
|
|
+ human.db.hardBattleGameTimes = calcGameTimes(BattleExcel_Hard.node, human.db.battleID_hard)
|
|
|
end
|
|
|
|
|
|
+
|
|
|
+
|
|
|
if human.db.lv >= BATTLE_LOGIN_LEV_TIPS then
|
|
|
return
|
|
|
end
|
|
|
@@ -811,7 +839,7 @@ function onLogin(human)
|
|
|
end
|
|
|
else
|
|
|
print("[BattleLogic_onLogin] 获取不到奖励数据 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name)
|
|
|
end
|
|
|
end
|
|
|
|
|
|
@@ -1442,7 +1470,7 @@ function query(human)
|
|
|
fontVideoInfo(human, msgRet.videoInfo, monsterConfig)
|
|
|
fontExtraDataSSZH(msgRet.extraDataSSZH, nowNodeConfig.mapID, nNowBattleID, human)
|
|
|
|
|
|
- msgRet.battleGameTimes = human.db.battleGameTimes or 0
|
|
|
+ msgRet.battleGameTimes = (human.db.battleGameTimes or 0) + (human.db.eliteBattleGameTimes or 0) + (human.db.hardBattleGameTimes or 0)
|
|
|
-- Msg.trace(msgRet)
|
|
|
Msg.send(msgRet, human.fd)
|
|
|
|
|
|
@@ -1737,7 +1765,7 @@ function initBattleOut(human, now)
|
|
|
|
|
|
if false == BattleLogic_InitAllBattleOut(human, now) then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "initBattleOut 初始化挂机奖励表失败 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name)
|
|
|
return
|
|
|
end
|
|
|
|
|
|
@@ -1774,7 +1802,7 @@ function calcBattleOut(human,isDiamond)
|
|
|
local tBattleOut = BattleLogic_GetBattleOut(human)
|
|
|
if not tBattleOut then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "calcBattleOut 获取挂机奖励列表失败 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name)
|
|
|
return
|
|
|
end
|
|
|
|
|
|
@@ -1861,7 +1889,7 @@ function calcBattleExpOut(human, now)
|
|
|
local tBattleOut = BattleLogic_GetBattleOut(human)
|
|
|
if not tBattleOut then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "calcBattleExpOut 获取挂机奖励列表失败 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name)
|
|
|
return
|
|
|
end
|
|
|
|
|
|
@@ -1882,7 +1910,7 @@ function calcBattleExpOut(human, now)
|
|
|
|
|
|
if not tBattleNodeConfig or 0 > nGuaJiID then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "calcBattleExpOut 获取到的配置表不正确或挂机ID不正确 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name)
|
|
|
return
|
|
|
end
|
|
|
|
|
|
@@ -2024,7 +2052,7 @@ function calcBattleItemOut(human, now,isDiamond)
|
|
|
local tBattleOut = BattleLogic_GetBattleOut(human)
|
|
|
if not tBattleOut then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "calcBattleItemOut 获取挂机奖励列表失败 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name)
|
|
|
return
|
|
|
end
|
|
|
|
|
|
@@ -2045,7 +2073,7 @@ function calcBattleItemOut(human, now,isDiamond)
|
|
|
|
|
|
if not tBattleNodeConfig or 0 > nGuaJiID then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "calcBattleItemOut 获取到的配置表不正确或挂机ID不正确 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name)
|
|
|
return
|
|
|
end
|
|
|
|
|
|
@@ -2090,7 +2118,7 @@ local function hangExpGet(human,isDiamond)
|
|
|
local tBattleOut = BattleLogic_GetBattleOut(human)
|
|
|
if not tBattleOut then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "hangExpGet 获取挂机奖励列表失败 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name)
|
|
|
return
|
|
|
end
|
|
|
|
|
|
@@ -2232,7 +2260,7 @@ function nodeSet(human, battleID)
|
|
|
local nNowBattleID = BattleLogic_GetBattleBattleID(human)
|
|
|
if not tBattleConfig or -1 >= nNowBattleID then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "hangExpGet 获取挂机奖励列表失败 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name)
|
|
|
print("[nodeSet] 获取不到战斗配置")
|
|
|
return
|
|
|
end
|
|
|
@@ -2270,7 +2298,7 @@ function nodeDetailQuery(human, battleID)
|
|
|
local nNowBattleID = BattleLogic_GetBattleBattleID(human)
|
|
|
if not tBattleConfig or -1 >= nNowBattleID then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "nodeDetailQuery 获取挂机奖励列表失败 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name)
|
|
|
print("[nodeDetailQuery] 获取不到战斗配置")
|
|
|
return
|
|
|
end
|
|
|
@@ -2330,7 +2358,7 @@ function fight(human)
|
|
|
local tBattleConfig = BattleLogic_GetBattleConfig(human)
|
|
|
if not tBattleConfig or -1 >= battleID then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "nodeDetailQuery 获取挂机奖励列表失败 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name)
|
|
|
print("[nodeDetailQuery] 获取不到战斗配置")
|
|
|
return
|
|
|
end
|
|
|
@@ -2377,7 +2405,7 @@ function onFightEnd(human, result, fightTypeID, param1, combatInfo)
|
|
|
local battleID = BattleLogic_GetBattleBattleID(human)
|
|
|
if EliteDefine.COPY_ELITE_ERROR == nBattleType or -1 >= guajiID or -1 >= battleID then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "onFightEnd 获取战斗类型、挂机ID、战斗关卡ID失败 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name)
|
|
|
print("[onFightEnd] 获取战斗类型、挂机ID、战斗关卡ID失败")
|
|
|
return
|
|
|
end
|
|
|
@@ -2385,7 +2413,7 @@ function onFightEnd(human, result, fightTypeID, param1, combatInfo)
|
|
|
local tBattleConfig = BattleLogic_GetBattleConfig(human)
|
|
|
if not tBattleConfig then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "onFightEnd 获取战斗配置失败 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name)
|
|
|
print("[onFightEnd] 获取战斗配置失败")
|
|
|
return
|
|
|
end
|
|
|
@@ -2474,12 +2502,23 @@ function onFightEnd(human, result, fightTypeID, param1, combatInfo)
|
|
|
BattleLogic_SetBattleBattleID(human, nextBattleID)
|
|
|
|
|
|
--增加小游戏次数
|
|
|
- if EliteDefine.COPY_ELITE_NORMAL == nBattleType then
|
|
|
- if config and type(config.gameType) == "number" and config.gameType == 1 then
|
|
|
+ -- if EliteDefine.COPY_ELITE_NORMAL == nBattleType then
|
|
|
+ -- if config and type(config.gameType) == "number" and config.gameType == 1 then
|
|
|
+ -- human.db.battleGameTimes = (human.db.battleGameTimes or 0) + 1
|
|
|
+ -- end
|
|
|
+ -- end
|
|
|
+
|
|
|
+ if config and type(config.gameType) == "number" and config.gameType == 1 then
|
|
|
+ if EliteDefine.COPY_ELITE_NORMAL == nBattleType then
|
|
|
human.db.battleGameTimes = (human.db.battleGameTimes or 0) + 1
|
|
|
+ elseif EliteDefine.COPY_LEVEL_ELITE == nBattleType then
|
|
|
+ human.db.eliteBattleGameTimes = (human.db.eliteBattleGameTimes or 0) + 1
|
|
|
+ elseif EliteDefine.COPY_ELITE_DIFFICULTY == nBattleType then
|
|
|
+ human.db.hardBattleGameTimes = (human.db.hardBattleGameTimes or 0) + 1
|
|
|
end
|
|
|
end
|
|
|
|
|
|
+
|
|
|
-- human.db.battleID = battleID + 1
|
|
|
-- 通过第10关,默认开启二倍速
|
|
|
if nextBattleID == 10 and EliteDefine.COPY_ELITE_NORMAL == nBattleType then
|
|
|
@@ -2503,7 +2542,7 @@ function onFightEnd(human, result, fightTypeID, param1, combatInfo)
|
|
|
human.getEquip = nil
|
|
|
|
|
|
-- TODO:记录主线关卡
|
|
|
- Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, human.db._id, human.db.account, human.db.name, human.db.battleID)
|
|
|
+ Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, human.db._id, human.db.newUniqueTag, human.db.name, human.db.battleID)
|
|
|
|
|
|
if nBattleType == EliteDefine.COPY_ELITE_NORMAL then
|
|
|
|
|
|
@@ -2644,7 +2683,7 @@ function setBattleByGm(human, val, maxBattleID)
|
|
|
end
|
|
|
|
|
|
local nBattleType = BattleLogic_GetBattleType(human)
|
|
|
- if EliteDefine.COPY_ELITE_NORMAL == nBattleType then
|
|
|
+ if EliteDefine.COPY_ELITE_NORMAL == nBattleType or EliteDefine.COPY_LEVEL_ELITE == nBattleType or EliteDefine.COPY_ELITE_DIFFICULTY == nBattleType then
|
|
|
local gameTimes = 0
|
|
|
local battleID = BattleLogic_GetBattleGuaJiID(human)
|
|
|
local allCfg = BattleExcel.node
|
|
|
@@ -2654,7 +2693,14 @@ function setBattleByGm(human, val, maxBattleID)
|
|
|
gameTimes = gameTimes + 1
|
|
|
end
|
|
|
end
|
|
|
- human.db.battleGameTimes = (human.db.battleGameTimes or 0) + gameTimes
|
|
|
+ if EliteDefine.COPY_ELITE_NORMAL == nBattleType then
|
|
|
+ human.db.battleGameTimes = (human.db.battleGameTimes or 0) + gameTimes
|
|
|
+ elseif EliteDefine.COPY_LEVEL_ELITE == nBattleType then
|
|
|
+ human.db.eliteBattleGameTimes = (human.db.eliteBattleGameTimes or 0) + gameTimes
|
|
|
+ elseif EliteDefine.COPY_ELITE_DIFFICULTY == nBattleType then
|
|
|
+ human.db.hardBattleGameTimes = (human.db.hardBattleGameTimes or 0) + gameTimes
|
|
|
+ end
|
|
|
+
|
|
|
end
|
|
|
|
|
|
|
|
|
@@ -2674,7 +2720,7 @@ function gmSetHangTime(human, hourVal)
|
|
|
local tBattleOut = BattleLogic_GetBattleOut(human)
|
|
|
if not tBattleOut then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "gmSetHangTime func calcBattleExpOut 获取挂机奖励列表失败 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name)
|
|
|
return
|
|
|
end
|
|
|
|
|
|
@@ -2706,7 +2752,7 @@ function mopupQuery(human)
|
|
|
local tBattleConfig = BattleExcel
|
|
|
if -1 >= nNowGuaJiID or not tBattleConfig then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "mopupQuery 获取战斗配置、挂机ID 失败 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name)
|
|
|
print("[mopupQuery] 获取战斗配置、挂机ID 失败")
|
|
|
return
|
|
|
end
|
|
|
@@ -2826,7 +2872,7 @@ function mopupFight(human)
|
|
|
local tBattleConfig = BattleExcel
|
|
|
if -1 >= nNowGuaJiID or not tBattleConfig then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "mopupFight 获取战斗配置、挂机ID 失败 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name)
|
|
|
print("[mopupFight] 获取战斗配置、挂机ID 失败")
|
|
|
return
|
|
|
end
|
|
|
@@ -2995,7 +3041,7 @@ function getTongGuanReward(human, id)
|
|
|
local nBattleID = BattleLogic_GetBattleBattleID(human)
|
|
|
if not tBattleConfig or -1 >= nNowGuaJiID or -1 >= nBattleID then
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, "[getTongGuanReward] 获取战斗配置、挂机ID、战斗节点ID 失败 id = "
|
|
|
- ..human.db._id.. "account = "..human.db.account.." name = "..human.db.name)
|
|
|
+ ..human.db._id.. "newUniqueTag = "..human.db.newUniqueTag.." name = "..human.db.name)
|
|
|
print("[getTongGuanReward] 获取战斗配置、挂机ID 失败")
|
|
|
return
|
|
|
end
|
|
|
@@ -3802,9 +3848,12 @@ end
|
|
|
|
|
|
--获取小游戏奖励
|
|
|
function GetGameReward(human, indexStr)
|
|
|
- local battleGameTimes = human.db.battleGameTimes
|
|
|
-
|
|
|
- if not battleGameTimes or battleGameTimes <= 0 then
|
|
|
+ local battleGameTimes = human.db.battleGameTimes or 0
|
|
|
+ local eliteBattleGameTimes = human.db.eliteBattleGameTimes or 0
|
|
|
+ local hardBattleGameTimes = human.db.hardBattleGameTimes or 0
|
|
|
+
|
|
|
+
|
|
|
+ if battleGameTimes <= 0 and eliteBattleGameTimes <= 0 and hardBattleGameTimes <= 0 then
|
|
|
return Broadcast.sendErr(human, Lang.JINBI_EXCHANGE_ERR_CNT)
|
|
|
end
|
|
|
|
|
|
@@ -3852,11 +3901,20 @@ function GetGameReward(human, indexStr)
|
|
|
return Broadcast.sendErr(human, Lang.COMMON_COMFIG_ERROR)
|
|
|
end
|
|
|
|
|
|
- battleGameTimes = battleGameTimes - 1
|
|
|
- human.db.battleGameTimes = battleGameTimes
|
|
|
+ if battleGameTimes > 0 then
|
|
|
+ battleGameTimes = battleGameTimes - 1
|
|
|
+ human.db.battleGameTimes = battleGameTimes
|
|
|
+ elseif eliteBattleGameTimes > 0 then
|
|
|
+ eliteBattleGameTimes = eliteBattleGameTimes - 1
|
|
|
+ human.db.eliteBattleGameTimes = eliteBattleGameTimes
|
|
|
+ elseif hardBattleGameTimes > 0 then
|
|
|
+ hardBattleGameTimes = hardBattleGameTimes - 1
|
|
|
+ human.db.hardBattleGameTimes = hardBattleGameTimes
|
|
|
+ end
|
|
|
+
|
|
|
BagLogic.addItemList(human, { {itemId, itemCnt} }, "battle")
|
|
|
|
|
|
local msgRet = Msg.gc.GC_BATTLE_GETGAMEREWARD
|
|
|
- msgRet.battleGameTimes = battleGameTimes
|
|
|
+ msgRet.battleGameTimes = battleGameTimes + eliteBattleGameTimes + hardBattleGameTimes
|
|
|
Msg.send(msgRet, human.fd)
|
|
|
end
|