|
|
@@ -713,9 +713,9 @@ local function BattleLogic_SetAddFreeMopupNum(human, nValue)
|
|
|
print("[BattleLogic_SetAddFreeMopupNum] 消耗的额外次数 nValue = "..nValue)
|
|
|
human.db.mopupAddFreeCnt = human.db.mopupAddFreeCnt + nValue
|
|
|
|
|
|
- if 0 > human.db.mopupAddFreeCnt then
|
|
|
- human.db.mopupAddFreeCnt = 0
|
|
|
- end
|
|
|
+ -- if 0 > human.db.mopupAddFreeCnt then
|
|
|
+ -- human.db.mopupAddFreeCnt = 0
|
|
|
+ -- end
|
|
|
end
|
|
|
|
|
|
function getBattleRoleList(nBattleType, worldMapId)
|
|
|
@@ -1259,9 +1259,9 @@ function query(human)
|
|
|
print("[query] 获取到的战斗ID或奖励配置不正确 id = "..human.db._id)
|
|
|
return
|
|
|
end
|
|
|
-
|
|
|
+
|
|
|
print("[BattleLogic query] nNowGuaJiID ="..nNowGuaJiID.." nNowBattleID ="..nNowBattleID)
|
|
|
-
|
|
|
+
|
|
|
msgRet.nowBattleID = nNowBattleID
|
|
|
local configNode = #tBattleConfig.node
|
|
|
if nNowBattleID > configNode then
|
|
|
@@ -1269,7 +1269,7 @@ function query(human)
|
|
|
nNowBattleID = configNode
|
|
|
BattleLogic_SetBattleBattleID(human, nNowBattleID)
|
|
|
end
|
|
|
-
|
|
|
+
|
|
|
if nNowGuaJiID > configNode then
|
|
|
print("[query] 玩家的挂机ID不正确,进行纠正 nNowGuaJiID = "..nNowGuaJiID.." 最大挂机ID = "..configNode)
|
|
|
nNowGuaJiID = configNode
|
|
|
@@ -1399,7 +1399,9 @@ function query(human)
|
|
|
end
|
|
|
|
|
|
-- 判断额外增加的扫荡次数
|
|
|
- if 0 < BattleLogic_GetAddFreeMopupNum(human) and 0 == msgRet.canMopup then
|
|
|
+ --秘宝增加免费扫荡次数
|
|
|
+ local talismanAdd_dailyFeeCnt = TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.GJ_SD_FREE_CNT) or 0
|
|
|
+ if 0 < (BattleLogic_GetAddFreeMopupNum(human) + talismanAdd_dailyFeeCnt) and 0 == msgRet.canMopup then
|
|
|
msgRet.canMopup = 1
|
|
|
end
|
|
|
|
|
|
@@ -1743,7 +1745,7 @@ function calcBattleOut(human,isDiamond)
|
|
|
calcBattleExpOut(human, now)
|
|
|
|
|
|
calcBattleItemOut(human, now)
|
|
|
-
|
|
|
+
|
|
|
if isDiamond then -- 钻石消耗 所有产出翻1.5倍
|
|
|
local tBattleOut = BattleLogic_GetBattleOut(human)
|
|
|
if not tBattleOut then
|
|
|
@@ -1876,7 +1878,11 @@ function calcBattleExpOut(human, now)
|
|
|
local vipJinAdd =(VipLogic.getPowerArgs(human, VipLogic.VIP_POWER8) or 0) / 100
|
|
|
local vipGreenExpAdd =(VipLogic.getPowerArgs(human, VipLogic.VIP_POWER9) or 0) / 100
|
|
|
local vipQingbaoAdd =(VipLogic.getPowerArgs(human, VipLogic.VIP_POWER19) or 0) / 100
|
|
|
- local talismanAdd = (TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.GJ_QB) or 0) / 100
|
|
|
+
|
|
|
+ --秘宝方面的加成
|
|
|
+ local talismanAdd_qb = (TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.GJ_QB) or 0) / 100
|
|
|
+ local talismanAdd_hero_exp = (TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.GJ_HERO_EXP) or 0) / 100
|
|
|
+
|
|
|
local exp = nowNodeConfig.hangExp
|
|
|
local jinbi = nowNodeConfig.hangJinbi
|
|
|
local greenExp = nowNodeConfig.hangGreenExp
|
|
|
@@ -1885,7 +1891,9 @@ function calcBattleExpOut(human, now)
|
|
|
tBattleOut.jinbi = tBattleOut.jinbi + math.floor(outCnt * jinbi *(1 + vipJinAdd))
|
|
|
tBattleOut.greenExp = tBattleOut.greenExp + math.floor(outCnt * greenExp *(1 + vipGreenExpAdd))
|
|
|
tBattleOut.qingbao = tBattleOut.qingbao + math.floor(outCnt * qingbao *(1 + vipQingbaoAdd))
|
|
|
- tBattleOut.qingbao = tBattleOut.qingbao + math.ceil(tBattleOut.qingbao * talismanAdd)
|
|
|
+
|
|
|
+ tBattleOut.qingbao = tBattleOut.qingbao + math.ceil(tBattleOut.qingbao * talismanAdd_qb)
|
|
|
+ tBattleOut.greenExp = tBattleOut.greenExp + math.ceil(tBattleOut.greenExp * talismanAdd_hero_exp)
|
|
|
end
|
|
|
|
|
|
-- 根据时间计算道具产出
|
|
|
@@ -2028,7 +2036,8 @@ function calcBattleItemOut(human, now,isDiamond)
|
|
|
tBattleOut.itemTs2 = now
|
|
|
end
|
|
|
|
|
|
- local talismanAdd = (TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.GJ_ZS) or 0) / 100
|
|
|
+ local talismanAdd_zs = (TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.GJ_ZS) or 0) / 100
|
|
|
+
|
|
|
local nodeConfig = tBattleNodeConfig.node[guajiID]
|
|
|
local items = getItemOutsByTime(nodeConfig, sec)
|
|
|
for itemID, itemCnt in pairs(items) do
|
|
|
@@ -2043,8 +2052,8 @@ function calcBattleItemOut(human, now,isDiamond)
|
|
|
else
|
|
|
tBattleOut.items = tBattleOut.items or { }
|
|
|
tBattleOut.items[itemID] = tBattleOut.items[itemID] or 0
|
|
|
- if itemID == ItemDefine.ITEM_ZUANSHI_ID and talismanAdd > 0 then
|
|
|
- itemCnt = itemCnt + math.ceil(itemCnt * talismanAdd)
|
|
|
+ if itemID == ItemDefine.ITEM_ZUANSHI_ID and talismanAdd_zs > 0 then
|
|
|
+ itemCnt = itemCnt + math.ceil(itemCnt * talismanAdd_zs)
|
|
|
end
|
|
|
tBattleOut.items[itemID] = tBattleOut.items[itemID] + itemCnt
|
|
|
end
|
|
|
@@ -2440,6 +2449,7 @@ function onFightEnd(human, result, fightTypeID, param1, combatInfo)
|
|
|
if nextBattleID == 10 and EliteDefine.COPY_ELITE_NORMAL == nBattleType then
|
|
|
human.db.combatSpeed = 2
|
|
|
end
|
|
|
+
|
|
|
combatInfo.attacker.oldLv = human.db.lv
|
|
|
-- 给奖励
|
|
|
combatInfo.rewardItem = { }
|
|
|
@@ -2460,7 +2470,7 @@ function onFightEnd(human, result, fightTypeID, param1, combatInfo)
|
|
|
Log.write(Log.LOGID_OSS_BATTLE_MAINGATE, human.db._id, human.db.account, human.db.name, human.db.battleID)
|
|
|
|
|
|
if nBattleType == EliteDefine.COPY_ELITE_NORMAL then
|
|
|
-
|
|
|
+
|
|
|
RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1101)
|
|
|
GuideLogic.onCallback(human)
|
|
|
JibanLogic.onCallback(human, 1, battleID)
|
|
|
@@ -2606,6 +2616,8 @@ end
|
|
|
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)
|
|
|
return
|
|
|
end
|
|
|
|
|
|
@@ -2615,6 +2627,8 @@ function gmSetHangTime(human, hourVal)
|
|
|
|
|
|
local setHandTime = hourVal * 3600
|
|
|
local maxHangTime = getHangMaxTime(human)
|
|
|
+
|
|
|
+
|
|
|
if setHandTime > maxHangTime then
|
|
|
setHandTime = maxHangTime
|
|
|
end
|
|
|
@@ -2646,6 +2660,7 @@ function mopupQuery(human)
|
|
|
if guajiID == 0 then
|
|
|
return Broadcast.sendErr(human, Lang.BATTLE_MOPUP_ERR)
|
|
|
end
|
|
|
+
|
|
|
human.db.mopupDoCnt = human.db.mopupDoCnt or 0
|
|
|
local nextDoCnt = human.db.mopupDoCnt + 1
|
|
|
nextDoCnt = nextDoCnt >= EliteDefine.BATTLE_MOPUP_MAX_LEN and EliteDefine.BATTLE_MOPUP_MAX_LEN or nextDoCnt
|
|
|
@@ -2655,6 +2670,12 @@ function mopupQuery(human)
|
|
|
local dropConfig = DropExcel.dropBattle[dropID]
|
|
|
local dropCnt = 0
|
|
|
|
|
|
+ --秘宝加成
|
|
|
+ local talismanAdd_qb = (TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.GJ_QB) or 0) / 100
|
|
|
+ local talismanAdd_hero_exp = (TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.GJ_HERO_EXP) or 0) / 100
|
|
|
+ local talismanAdd_zs = (TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.GJ_ZS) or 0) / 100
|
|
|
+ local talismanAdd_dailyFeeCnt = TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.GJ_SD_FREE_CNT) or 0
|
|
|
+
|
|
|
-- ABS掉落活动显示到第一个
|
|
|
dropCnt = DropExchangeLogic.getDropItemSaoQuery(human, msgRet, dropCnt)
|
|
|
for i = 1, #dropConfig.dropRule do
|
|
|
@@ -2664,7 +2685,11 @@ function mopupQuery(human)
|
|
|
dropCnt = dropCnt + 1
|
|
|
local tempConfig = dropConfig.dropRule[i]
|
|
|
local itemID = tempConfig[1]
|
|
|
- Grid.makeItem(msgRet.item[dropCnt], itemID, 1)
|
|
|
+ local itemCnt = 1
|
|
|
+ if itemID == ItemDefine.ITEM_ZUANSHI_ID and talismanAdd_zs > 0 then
|
|
|
+ itemCnt = itemCnt + math.ceil(itemCnt * talismanAdd_zs)
|
|
|
+ end
|
|
|
+ Grid.makeItem(msgRet.item[dropCnt], itemID, itemCnt)
|
|
|
end
|
|
|
for i = 1, #dropConfig.dropRule3 do
|
|
|
if dropCnt >= #msgRet.item then
|
|
|
@@ -2673,7 +2698,11 @@ function mopupQuery(human)
|
|
|
dropCnt = dropCnt + 1
|
|
|
local tempConfig = dropConfig.dropRule3[i]
|
|
|
local itemID = tempConfig[1]
|
|
|
- Grid.makeItem(msgRet.item[dropCnt], itemID, 1)
|
|
|
+ local itemCnt = 1
|
|
|
+ if itemID == ItemDefine.ITEM_ZUANSHI_ID and talismanAdd_zs > 0 then
|
|
|
+ itemCnt = itemCnt + math.ceil(itemCnt * talismanAdd_zs)
|
|
|
+ end
|
|
|
+ Grid.makeItem(msgRet.item[dropCnt], itemID, itemCnt)
|
|
|
end
|
|
|
|
|
|
-- local mapConfig = BattleExcel.map[nodeConfig.mapID]
|
|
|
@@ -2681,6 +2710,9 @@ function mopupQuery(human)
|
|
|
msgRet.name = mapConfig.name
|
|
|
msgRet.item[0] = dropCnt
|
|
|
local nNowAddFreeCnt = BattleLogic_GetAddFreeMopupNum(human)
|
|
|
+ nNowAddFreeCnt = nNowAddFreeCnt + talismanAdd_dailyFeeCnt
|
|
|
+
|
|
|
+
|
|
|
if TequanShopLogic.isActiveMopup(human) then
|
|
|
msgRet.leftCnt = BATTLE_MOPUP_CNT_VIP - human.db.mopupDoCnt
|
|
|
else
|
|
|
@@ -2692,6 +2724,7 @@ function mopupQuery(human)
|
|
|
|
|
|
-- 增加额外次数
|
|
|
msgRet.leftCnt = msgRet.leftCnt + nNowAddFreeCnt
|
|
|
+ msgRet.leftCnt = math.max(msgRet.leftCnt, 0)
|
|
|
|
|
|
-- local mupopExcel = BattleExcel.mupop[nextDoCnt]
|
|
|
local mupopExcel = tBattleConfig.mupop[nextDoCnt]
|
|
|
@@ -2720,8 +2753,12 @@ function mopupQuery(human)
|
|
|
msgRet.nowCnt = human.db.mopupDoCnt
|
|
|
msgRet.exp = nodeConfig.hangExp
|
|
|
msgRet.jinbi = nodeConfig.hangJinbi
|
|
|
- msgRet.greenExp = nodeConfig.hangGreenExp
|
|
|
- msgRet.qingbao = nodeConfig.hangQingbao
|
|
|
+ --msgRet.greenExp = nodeConfig.hangGreenExp
|
|
|
+
|
|
|
+ msgRet.greenExp = nodeConfig.hangGreenExp + math.ceil(nodeConfig.hangGreenExp * talismanAdd_hero_exp)
|
|
|
+ msgRet.qingbao = nodeConfig.hangQingbao + math.ceil(nodeConfig.hangQingbao * talismanAdd_qb)
|
|
|
+
|
|
|
+ print("[mopupQuery] nowCnt = "..msgRet.nowCnt.." leftCnt = "..msgRet.leftCnt.." nNowAddFreeCnt = "..nNowAddFreeCnt)
|
|
|
Msg.send(msgRet, human.fd)
|
|
|
end
|
|
|
|
|
|
@@ -2744,7 +2781,10 @@ function mopupFight(human)
|
|
|
nextDoCnt = nextDoCnt >= EliteDefine.BATTLE_MOPUP_MAX_LEN and EliteDefine.BATTLE_MOPUP_MAX_LEN or nextDoCnt
|
|
|
-- local mupopExcel = BattleExcel.mupop[nextDoCnt]
|
|
|
local mupopExcel = tBattleConfig.mupop[nextDoCnt]
|
|
|
+
|
|
|
+ local talismanAdd_dailyFeeCnt = TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.GJ_SD_FREE_CNT) or 0
|
|
|
local nNowAddFreeCnt = BattleLogic_GetAddFreeMopupNum(human)
|
|
|
+ nNowAddFreeCnt = nNowAddFreeCnt + talismanAdd_dailyFeeCnt
|
|
|
|
|
|
if not mupopExcel then
|
|
|
return Broadcast.sendErr(human, Lang.BATTLE_MOPUP_CNT_OVER)
|
|
|
@@ -2806,6 +2846,12 @@ function mopupFight(human)
|
|
|
local vipJinAdd =(VipLogic.getPowerArgs(human, VipLogic.VIP_POWER8) or 0) / 100
|
|
|
local vipGreenExpAdd =(VipLogic.getPowerArgs(human, VipLogic.VIP_POWER9) or 0) / 100
|
|
|
local vipQingbaoAdd =(VipLogic.getPowerArgs(human, VipLogic.VIP_POWER19) or 0) / 100
|
|
|
+
|
|
|
+ --秘宝加成
|
|
|
+ local talismanAdd_qb = (TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.GJ_QB) or 0) / 100
|
|
|
+ local talismanAdd_hero_exp = (TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.GJ_HERO_EXP) or 0) / 100
|
|
|
+ local talismanAdd_zs = (TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.GJ_ZS) or 0) / 100
|
|
|
+
|
|
|
local exp = config.hangExp * 120
|
|
|
local jinbi = config.hangJinbi * 120
|
|
|
local greenExp = config.hangGreenExp * 120
|
|
|
@@ -2814,6 +2860,10 @@ function mopupFight(human)
|
|
|
local addJinbi = math.floor(jinbi *(1 + vipJinAdd))
|
|
|
local addGreenExp = math.floor(greenExp *(1 + vipGreenExpAdd))
|
|
|
local addQingbao = math.floor(qingbao *(1 + vipQingbaoAdd))
|
|
|
+
|
|
|
+ addQingbao = addQingbao + math.ceil(addQingbao * talismanAdd_qb)
|
|
|
+ addGreenExp = addGreenExp + math.ceil(addGreenExp * talismanAdd_hero_exp)
|
|
|
+
|
|
|
local time = 7200
|
|
|
local itemTable = getItemOutsByTime(config, time)
|
|
|
-- 掉落活动
|
|
|
@@ -2841,6 +2891,11 @@ function mopupFight(human)
|
|
|
local rewardCnt = double and 2 or 1
|
|
|
for itemID, itemCnt in pairs(itemTable) do
|
|
|
itemCnt = itemCnt * rewardCnt
|
|
|
+
|
|
|
+ if itemID == ItemDefine.ITEM_ZUANSHI_ID and talismanAdd_zs > 0 then
|
|
|
+ itemCnt = itemCnt + math.ceil(itemCnt * talismanAdd_zs)
|
|
|
+ end
|
|
|
+
|
|
|
if not ItemDefine.isEquip(itemID) then
|
|
|
msgRet.item[0] = msgRet.item[0] + 1
|
|
|
Grid.makeItem(msgRet.item[msgRet.item[0]], itemID, itemCnt)
|
|
|
@@ -3420,7 +3475,6 @@ local function BattleLogic_GetNorewardReceived(human, nBattleType, cIndex)
|
|
|
end
|
|
|
|
|
|
if not (state == true) then
|
|
|
-
|
|
|
local r = STATUS_CANGET
|
|
|
--(k > nGuaJiID) and STATUS_CANGET or STATUS_NONE
|
|
|
--未领取
|
|
|
@@ -3542,6 +3596,7 @@ function CG_BATTLE_TONGGUAN_REWARD_GET_COPY(human, nBattleType)
|
|
|
if not tBattleConfig or -1 >= nGuaJiID or -1 >= nBattleID then
|
|
|
return
|
|
|
end
|
|
|
+
|
|
|
local tMsgRet = Msg.gc.GC_BATTLE_TONGGUAN_REWARD_GET_COPY
|
|
|
local nAdopt = BattleLogic_GetBattleAdopt(human, nBattleType)
|
|
|
local nChoseLen = nBattleID - 1
|