88 lines
2.8 KiB
Lua
88 lines
2.8 KiB
Lua
local DungeonManager = class("DungeonManager", BaseModule)
|
|
|
|
function DungeonManager:checkDayChange()
|
|
end
|
|
|
|
-- 请求挑战金币副本
|
|
function DungeonManager:reqChallengeGold(id)
|
|
local moduleKey = ModuleManager.MODULE_KEY.DUNGEON_GOLD
|
|
-- 判断次数
|
|
if not DataManager.DungeonData:getRemainTimes(moduleKey) > 0 then
|
|
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_1))
|
|
return
|
|
end
|
|
|
|
-- 判断体力
|
|
if not DataManager.DailyChallengeData:isEnoughHp(moduleKey) then
|
|
GFunc.showItemNotEnough(GConst.ItemConst.ITEM_ID_VIT)
|
|
ModuleManager.CommerceManager:showBuyVitUI()
|
|
return
|
|
end
|
|
|
|
if not DataManager.DailyChallengeData:isCanChallenge(moduleKey) then
|
|
return
|
|
end
|
|
|
|
local parmas = {}
|
|
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterGoldChallengeStartReq, parmas, {}, self.respChallengeGold, BIReport.ITEM_GET_TYPE.DUNGEON_GOLD_CHALLENGE)
|
|
end
|
|
|
|
-- 响应挑战副本
|
|
function DungeonManager:respChallengeGold(result)
|
|
if result.err_code == GConst.ERROR_STR.SUCCESS then
|
|
end
|
|
end
|
|
|
|
-- 请求结算金币副本
|
|
function DungeonManager:reqEndChallengeGold()
|
|
local parmas = {
|
|
win = true,
|
|
total_damage = nil,
|
|
remaining_hp = nil,
|
|
chapter_gold_id = nil,
|
|
task_stat = nil,
|
|
combatReport = nil,
|
|
}
|
|
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterGoldChallengeSettlementReq, parmas, {}, self.respEndChallengeGold, BIReport.ITEM_GET_TYPE.DUNGEON_GOLD_END)
|
|
end
|
|
|
|
-- 响应结算金币副本
|
|
function DungeonManager:respEndChallengeGold(result)
|
|
if result.err_code == GConst.ERROR_STR.SUCCESS then
|
|
ModuleManager.BattleManager:showBattleResultUI(GConst.BattleConst.BATTLE_TYPE.DUNGEON_GOLD, result.rewards, result.reqData.combatReport)
|
|
end
|
|
end
|
|
|
|
-- 请求扫荡金币副本
|
|
function DungeonManager:reqSweepGold(id)
|
|
local moduleKey = ModuleManager.MODULE_KEY.DUNGEON_GOLD
|
|
-- 判断次数
|
|
if not DataManager.DungeonData:getRemainTimes(moduleKey) > 0 then
|
|
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_1))
|
|
return
|
|
end
|
|
|
|
-- 判断体力
|
|
if not DataManager.DailyChallengeData:isEnoughHp(moduleKey) then
|
|
GFunc.showItemNotEnough(GConst.ItemConst.ITEM_ID_VIT)
|
|
ModuleManager.CommerceManager:showBuyVitUI()
|
|
return
|
|
end
|
|
|
|
if not DataManager.DailyChallengeData:isCanChallenge(moduleKey) then
|
|
return
|
|
end
|
|
|
|
local parmas = {
|
|
chapter_gold_id = id,
|
|
}
|
|
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterGoldChallengeFarmReq, parmas, {}, self.respSweepGold, BIReport.ITEM_GET_TYPE.DUNGEON_GOLD_SWEEP)
|
|
end
|
|
|
|
-- 响应扫荡金币副本
|
|
function DungeonManager:respSweepGold(result)
|
|
if result.err_code == GConst.ERROR_STR.SUCCESS then
|
|
end
|
|
end
|
|
|
|
return DungeonManager |