|
|
@@ -71,6 +71,9 @@ REWARD_STATUS_HADGET = 2 -- 已领
|
|
|
TOWER_TONGGUAN_TYPE = 1 -- 通关奖励
|
|
|
TOWER_KING_TYPE = 2 -- 通关王者奖励
|
|
|
|
|
|
+-- 每日最多可通关层数
|
|
|
+local MAX_DAILY_PASSLEVEL_NUM = 50
|
|
|
+
|
|
|
|
|
|
--秘宝加成
|
|
|
local function HJ_GetTalismanAdd(human)
|
|
|
@@ -78,6 +81,41 @@ local function HJ_GetTalismanAdd(human)
|
|
|
return dailyFreeTimes
|
|
|
end
|
|
|
|
|
|
+-- 获取每日通关层数
|
|
|
+local function getDailyPassLevelNum(human)
|
|
|
+ local num = 0
|
|
|
+ if human.db.tower and human.db.tower.dailyPassLevelNum then
|
|
|
+ num = human.db.tower.dailyPassLevelNum
|
|
|
+ end
|
|
|
+
|
|
|
+ return num
|
|
|
+end
|
|
|
+
|
|
|
+-- 增加每日通关层数
|
|
|
+local function addDailyPassLevelNum(human, addNum)
|
|
|
+ if not addNum or addNum <= 0 then
|
|
|
+ return
|
|
|
+ end
|
|
|
+
|
|
|
+ human.db.tower = human.db.tower or {}
|
|
|
+ human.db.tower.dailyPassLevelNum = (human.db.tower.dailyPassLevelNum or 0) + addNum
|
|
|
+end
|
|
|
+
|
|
|
+-- 重置每日通关层数
|
|
|
+local function resetDailyPassLevelNum(human)
|
|
|
+ if not human.db.tower or not human.db.tower.dailyPassLevelNum then
|
|
|
+ return
|
|
|
+ end
|
|
|
+
|
|
|
+ human.db.tower.dailyPassLevelNum = 0
|
|
|
+end
|
|
|
+
|
|
|
+-- 跨天时, 对每日通关层数的处理
|
|
|
+local function dailyPassLevelHandle(human)
|
|
|
+ resetDailyPassLevelNum(human)
|
|
|
+ HuanjingTower_DailyPassLevelInfo_Query(human)
|
|
|
+end
|
|
|
+
|
|
|
|
|
|
function initSeverTower(nowLv)
|
|
|
local towerDB = HuanjingTowerDB.query(#HuanjingTowerExcel.huanjingTower)
|
|
|
@@ -578,6 +616,11 @@ end
|
|
|
|
|
|
-- 挑战
|
|
|
function fight(human, args)
|
|
|
+ local currentPassLevelNum = getDailyPassLevelNum(human)
|
|
|
+ if currentPassLevelNum >= MAX_DAILY_PASSLEVEL_NUM then
|
|
|
+ return Broadcast.sendErr(human, Lang.COMMON_DAILY_PASSLEVEL_LIMIT)
|
|
|
+ end
|
|
|
+
|
|
|
local changeLv = tonumber(args[1] or 0)
|
|
|
if changeLv > #HuanjingTowerExcel.huanjingTower then
|
|
|
return
|
|
|
@@ -615,6 +658,12 @@ function checkUpdeType(db, combatTime, zhandouli)
|
|
|
return timeUp, zhanliUp
|
|
|
end
|
|
|
|
|
|
+local function challengeWinHandle(human)
|
|
|
+ addDailyPassLevelNum(human, 1)
|
|
|
+ HuanjingTower_DailyPassLevelInfo_Query(human)
|
|
|
+end
|
|
|
+
|
|
|
+
|
|
|
-- 挑战结束
|
|
|
function onFightEnd(human, result, fightTypeID, param, combatInfo, args)
|
|
|
local rewardItem = combatInfo.rewardItem
|
|
|
@@ -671,7 +720,9 @@ function onFightEnd(human, result, fightTypeID, param, combatInfo, args)
|
|
|
MengxinLogic.onCallBack(human, MengxinLogic.MX_TASK_TYPE_2, param)
|
|
|
JibanLogic.onCallback(human, 3, param)
|
|
|
DailyTaskLogic.recordDailyTaskFinishCnt(human, DailyTaskLogic.DAILY_TASK_ID_5, 1)
|
|
|
- YunYingLogic.onCallBack(human, "onHuangjingTower",1)
|
|
|
+ YunYingLogic.onCallBack(human, "onHuangjingTower",1)
|
|
|
+
|
|
|
+ challengeWinHandle(human)
|
|
|
end
|
|
|
LiLianLogic.onCallbackByCombat(human, combatInfo)
|
|
|
RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1203)
|
|
|
@@ -794,6 +845,14 @@ function buyTiliDo(human, buyCnt)
|
|
|
-- query(human)
|
|
|
end
|
|
|
|
|
|
+-- 每日通关信息查询
|
|
|
+function HuanjingTower_DailyPassLevelInfo_Query(human)
|
|
|
+ local msgRet = Msg.gc.GC_HUNAGJINGTOWER_DAILY_PASSLVEL_INFO_QUERY
|
|
|
+ msgRet.currentPassLevelNum = getDailyPassLevelNum(human)
|
|
|
+ msgRet.maxPassLevelNum = MAX_DAILY_PASSLEVEL_NUM
|
|
|
+ Msg.send(msgRet, human.fd)
|
|
|
+end
|
|
|
+
|
|
|
-- 挑战结果
|
|
|
function updateResult(human, result, combatInfo, param)
|
|
|
-- 当前胜利关卡已通关
|
|
|
@@ -845,6 +904,8 @@ function updateDaily(human)
|
|
|
human.db.tower.buyCnt = 0
|
|
|
RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1203)
|
|
|
RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1201)
|
|
|
+
|
|
|
+ dailyPassLevelHandle(human)
|
|
|
end
|
|
|
end
|
|
|
|