|
|
@@ -780,6 +780,20 @@ function initAfterStart()
|
|
|
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
|
|
|
+ end
|
|
|
+
|
|
|
if human.db.lv >= BATTLE_LOGIN_LEV_TIPS then
|
|
|
return
|
|
|
end
|
|
|
@@ -799,22 +813,6 @@ function onLogin(human)
|
|
|
print("[BattleLogic_onLogin] 获取不到奖励数据 id = "
|
|
|
..human.db._id.. "account = "..human.db.account.." name = "..human.db.name)
|
|
|
end
|
|
|
-
|
|
|
- --处理老号已经在小游戏玩法上线前已经推过图没有获得小游戏次数
|
|
|
- -- 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
|
|
|
- -- end
|
|
|
-
|
|
|
-
|
|
|
end
|
|
|
|
|
|
-- 是否领取
|
|
|
@@ -2476,11 +2474,11 @@ 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
|
|
|
- -- human.db.battleGameTimes = (human.db.battleGameTimes or 0) + 1
|
|
|
- -- end
|
|
|
- -- end
|
|
|
+ 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
|
|
|
|
|
|
-- human.db.battleID = battleID + 1
|
|
|
-- 通过第10关,默认开启二倍速
|
|
|
@@ -3484,7 +3482,7 @@ end
|
|
|
|
|
|
-- 获取未领取奖励
|
|
|
local function BattleLogic_GetNorewardReceived(human, nBattleType, cIndex)
|
|
|
- print("1:[BattleLogic_GetNorewardReceived] id = "..human.db._id.." nBattleType = "..nBattleType)
|
|
|
+ --print("1:[BattleLogic_GetNorewardReceived] id = "..human.db._id.." nBattleType = "..nBattleType)
|
|
|
|
|
|
local nBattleID = BattleLogic_GetBattleIDByType(human, nBattleType)
|
|
|
local tBattleConfig = BattleLogic_GetBattleConfigByType(nBattleType)
|
|
|
@@ -3512,7 +3510,7 @@ local function BattleLogic_GetNorewardReceived(human, nBattleType, cIndex)
|
|
|
local battleNumber = #tBattleConfig.node
|
|
|
|
|
|
-- local nGuajiID = human.db.guajiID or 0
|
|
|
- print("[BattleLogic_GetNorewardReceived] nGuajiID = "..nGuaJiID.. " nBattleID = "..nBattleID)
|
|
|
+ --print("[BattleLogic_GetNorewardReceived] nGuajiID = "..nGuaJiID.. " nBattleID = "..nBattleID)
|
|
|
|
|
|
-- 判断ID得用战斗ID-1, 因为挂机ID可以设置
|
|
|
local nJudeNum = nGuaJiID
|
|
|
@@ -3524,7 +3522,7 @@ local function BattleLogic_GetNorewardReceived(human, nBattleType, cIndex)
|
|
|
nJudeNum = nBattleID - 1
|
|
|
end
|
|
|
|
|
|
- print("[BattleLogic_GetNorewardReceived] nJudeNum = "..nJudeNum)
|
|
|
+ --print("[BattleLogic_GetNorewardReceived] nJudeNum = "..nJudeNum)
|
|
|
|
|
|
for k,v in ipairs(tBattleConfig.node) do
|
|
|
if #v.tongguan ~= 0 then
|
|
|
@@ -3557,7 +3555,7 @@ local function BattleLogic_GetNorewardReceived(human, nBattleType, cIndex)
|
|
|
HeroGrid.makeHeroSimpleByID(net.heroReward[1], cf[1][1], nil, other, human)
|
|
|
HeroGrid.makeHeroSimpleByGeneral(net.heroReward[1], cf[1][1])
|
|
|
|
|
|
- local tHeroInfo = Util.printTable(net.heroReward)
|
|
|
+ -- local tHeroInfo = Util.printTable(net.heroReward)
|
|
|
-- print("[BattleLogic_GetNorewardReceived] 英雄数据 k = "..k.." 获取的数据 = "..tHeroInfo)
|
|
|
else
|
|
|
net.reward[0] = 1
|