每日挑战
This commit is contained in:
parent
e5e23cc06c
commit
e1d389b02d
@ -1,11 +1,6 @@
|
|||||||
local daily_challenge_level = {
|
local daily_challenge_level = {
|
||||||
[1]={
|
[1]={
|
||||||
["max_chapter"]=11,
|
["max_chapter"]=11,
|
||||||
["round_map"]={
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3
|
|
||||||
},
|
|
||||||
["wave_reward"]={
|
["wave_reward"]={
|
||||||
{
|
{
|
||||||
["type"]=1,
|
["type"]=1,
|
||||||
@ -95,13 +90,6 @@ local daily_challenge_level = {
|
|||||||
},
|
},
|
||||||
[2]={
|
[2]={
|
||||||
["max_chapter"]=19,
|
["max_chapter"]=19,
|
||||||
["round_map"]={
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5
|
|
||||||
},
|
|
||||||
["wave_reward"]={
|
["wave_reward"]={
|
||||||
{
|
{
|
||||||
["type"]=1,
|
["type"]=1,
|
||||||
@ -191,15 +179,6 @@ local daily_challenge_level = {
|
|||||||
},
|
},
|
||||||
[3]={
|
[3]={
|
||||||
["max_chapter"]=27,
|
["max_chapter"]=27,
|
||||||
["round_map"]={
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7
|
|
||||||
},
|
|
||||||
["wave_reward"]={
|
["wave_reward"]={
|
||||||
{
|
{
|
||||||
["type"]=1,
|
["type"]=1,
|
||||||
@ -289,17 +268,6 @@ local daily_challenge_level = {
|
|||||||
},
|
},
|
||||||
[4]={
|
[4]={
|
||||||
["max_chapter"]=37,
|
["max_chapter"]=37,
|
||||||
["round_map"]={
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
9
|
|
||||||
},
|
|
||||||
["wave_reward"]={
|
["wave_reward"]={
|
||||||
{
|
{
|
||||||
["type"]=1,
|
["type"]=1,
|
||||||
@ -389,19 +357,6 @@ local daily_challenge_level = {
|
|||||||
},
|
},
|
||||||
[5]={
|
[5]={
|
||||||
["max_chapter"]=47,
|
["max_chapter"]=47,
|
||||||
["round_map"]={
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
9,
|
|
||||||
10,
|
|
||||||
11
|
|
||||||
},
|
|
||||||
["wave_reward"]={
|
["wave_reward"]={
|
||||||
{
|
{
|
||||||
["type"]=1,
|
["type"]=1,
|
||||||
@ -491,21 +446,6 @@ local daily_challenge_level = {
|
|||||||
},
|
},
|
||||||
[6]={
|
[6]={
|
||||||
["max_chapter"]=62,
|
["max_chapter"]=62,
|
||||||
["round_map"]={
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
9,
|
|
||||||
10,
|
|
||||||
11,
|
|
||||||
12,
|
|
||||||
13
|
|
||||||
},
|
|
||||||
["wave_reward"]={
|
["wave_reward"]={
|
||||||
{
|
{
|
||||||
["type"]=1,
|
["type"]=1,
|
||||||
@ -595,23 +535,6 @@ local daily_challenge_level = {
|
|||||||
},
|
},
|
||||||
[7]={
|
[7]={
|
||||||
["max_chapter"]=77,
|
["max_chapter"]=77,
|
||||||
["round_map"]={
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
9,
|
|
||||||
10,
|
|
||||||
11,
|
|
||||||
12,
|
|
||||||
13,
|
|
||||||
14,
|
|
||||||
15
|
|
||||||
},
|
|
||||||
["wave_reward"]={
|
["wave_reward"]={
|
||||||
{
|
{
|
||||||
["type"]=1,
|
["type"]=1,
|
||||||
|
|||||||
@ -4354,7 +4354,7 @@ local hero = {
|
|||||||
1100,
|
1100,
|
||||||
1200
|
1200
|
||||||
},
|
},
|
||||||
["model_id"]="p23001",
|
["model_id"]="p25001",
|
||||||
["icon"]="25001",
|
["icon"]="25001",
|
||||||
["item_id"]=25001,
|
["item_id"]=25001,
|
||||||
["level_id"]=10,
|
["level_id"]=10,
|
||||||
|
|||||||
@ -681,6 +681,13 @@ local LocalizationGlobalConst =
|
|||||||
HERO_DESC_22 = "HERO_DESC_22",
|
HERO_DESC_22 = "HERO_DESC_22",
|
||||||
HERO_DESC_23 = "HERO_DESC_23",
|
HERO_DESC_23 = "HERO_DESC_23",
|
||||||
BAG_DESC_1 = "BAG_DESC_1",
|
BAG_DESC_1 = "BAG_DESC_1",
|
||||||
|
DAILY_CHALLENGE_DESC_2 = "DAILY_CHALLENGE_DESC_2",
|
||||||
|
DAILY_CHALLENGE_DESC_3 = "DAILY_CHALLENGE_DESC_3",
|
||||||
|
DAILY_CHALLENGE_DESC_4 = "DAILY_CHALLENGE_DESC_4",
|
||||||
|
DAILY_CHALLENGE_DESC_5 = "DAILY_CHALLENGE_DESC_5",
|
||||||
|
DAILY_CHALLENGE_DESC_6 = "DAILY_CHALLENGE_DESC_6",
|
||||||
|
DAILY_CHALLENGE_DESC_7 = "DAILY_CHALLENGE_DESC_7",
|
||||||
|
DAILY_CHALLENGE_DESC_8 = "DAILY_CHALLENGE_DESC_8",
|
||||||
}
|
}
|
||||||
|
|
||||||
return LocalizationGlobalConst
|
return LocalizationGlobalConst
|
||||||
@ -2361,15 +2361,11 @@ local skill = {
|
|||||||
},
|
},
|
||||||
["shake_time"]=100,
|
["shake_time"]=100,
|
||||||
["shake_type"]=1,
|
["shake_type"]=1,
|
||||||
["sound_hit"]={
|
|
||||||
1000001
|
|
||||||
},
|
|
||||||
["name_act"]="attack01",
|
["name_act"]="attack01",
|
||||||
["name_hit"]={
|
["name_hit"]={
|
||||||
"suffer01"
|
"suffer01"
|
||||||
},
|
},
|
||||||
["fx_self"]=300018,
|
["fx_self_mirror"]=100000
|
||||||
["fx_self_mirror"]=400018
|
|
||||||
},
|
},
|
||||||
[2500111]={
|
[2500111]={
|
||||||
["position"]=2,
|
["position"]=2,
|
||||||
@ -2390,15 +2386,11 @@ local skill = {
|
|||||||
},
|
},
|
||||||
["shake_time"]=100,
|
["shake_time"]=100,
|
||||||
["shake_type"]=1,
|
["shake_type"]=1,
|
||||||
["sound_hit"]={
|
|
||||||
1000002
|
|
||||||
},
|
|
||||||
["name_act"]="attack02",
|
["name_act"]="attack02",
|
||||||
["name_hit"]={
|
["name_hit"]={
|
||||||
"suffer02"
|
"suffer02"
|
||||||
},
|
},
|
||||||
["fx_self"]=300019,
|
["fx_self_mirror"]=100000
|
||||||
["fx_self_mirror"]=400019
|
|
||||||
},
|
},
|
||||||
[2500112]={
|
[2500112]={
|
||||||
["position"]=2,
|
["position"]=2,
|
||||||
@ -2419,15 +2411,11 @@ local skill = {
|
|||||||
},
|
},
|
||||||
["shake_time"]=100,
|
["shake_time"]=100,
|
||||||
["shake_type"]=1,
|
["shake_type"]=1,
|
||||||
["sound_hit"]={
|
|
||||||
1000003
|
|
||||||
},
|
|
||||||
["name_act"]="attack03",
|
["name_act"]="attack03",
|
||||||
["name_hit"]={
|
["name_hit"]={
|
||||||
"suffer01"
|
"suffer01"
|
||||||
},
|
},
|
||||||
["fx_self"]=300020,
|
["fx_self_mirror"]=100000
|
||||||
["fx_self_mirror"]=400020
|
|
||||||
},
|
},
|
||||||
[2500113]={
|
[2500113]={
|
||||||
["position"]=2,
|
["position"]=2,
|
||||||
@ -2448,15 +2436,11 @@ local skill = {
|
|||||||
},
|
},
|
||||||
["shake_time"]=100,
|
["shake_time"]=100,
|
||||||
["shake_type"]=1,
|
["shake_type"]=1,
|
||||||
["sound_hit"]={
|
|
||||||
1000004
|
|
||||||
},
|
|
||||||
["name_act"]="attack04",
|
["name_act"]="attack04",
|
||||||
["name_hit"]={
|
["name_hit"]={
|
||||||
"suffer02"
|
"suffer02"
|
||||||
},
|
},
|
||||||
["fx_self"]=300021,
|
["fx_self_mirror"]=100000
|
||||||
["fx_self_mirror"]=400021
|
|
||||||
},
|
},
|
||||||
[2500120]={
|
[2500120]={
|
||||||
["energy"]=10,
|
["energy"]=10,
|
||||||
@ -2489,6 +2473,12 @@ local skill = {
|
|||||||
["ratio"]=10000,
|
["ratio"]=10000,
|
||||||
["round"]=0
|
["round"]=0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
["type"]="hurt_yellow",
|
||||||
|
["num"]=20000,
|
||||||
|
["ratio"]=10000,
|
||||||
|
["round"]=0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
["type"]="hurt_yellow",
|
["type"]="hurt_yellow",
|
||||||
["num"]=20000,
|
["num"]=20000,
|
||||||
@ -2501,7 +2491,8 @@ local skill = {
|
|||||||
1,
|
1,
|
||||||
2,
|
2,
|
||||||
3,
|
3,
|
||||||
4
|
4,
|
||||||
|
5
|
||||||
},
|
},
|
||||||
["skill_position"]={
|
["skill_position"]={
|
||||||
1,
|
1,
|
||||||
@ -2509,22 +2500,21 @@ local skill = {
|
|||||||
},
|
},
|
||||||
["shake_time"]=200,
|
["shake_time"]=200,
|
||||||
["shake_type"]=5,
|
["shake_type"]=5,
|
||||||
["sound"]=12001200,
|
|
||||||
["sound_delay"]=0.0,
|
["sound_delay"]=0.0,
|
||||||
["name_act"]="skill01",
|
["name_act"]="skill01",
|
||||||
["name_hit"]={
|
["name_hit"]={
|
||||||
"suffer01",
|
"suffer01",
|
||||||
"suffer01",
|
"suffer01",
|
||||||
"suffer02",
|
"suffer03",
|
||||||
|
"suffer03",
|
||||||
"suffer03"
|
"suffer03"
|
||||||
},
|
},
|
||||||
["fx_self"]=300022,
|
|
||||||
["bullet_time"]={
|
["bullet_time"]={
|
||||||
1167,
|
1167,
|
||||||
3000,
|
3000,
|
||||||
300
|
300
|
||||||
},
|
},
|
||||||
["fx_self_mirror"]=400022
|
["fx_self_mirror"]=100000
|
||||||
},
|
},
|
||||||
[2500121]={
|
[2500121]={
|
||||||
["position"]=2,
|
["position"]=2,
|
||||||
|
|||||||
@ -681,6 +681,13 @@ local localization_global =
|
|||||||
["HERO_DESC_22"] = "去升星",
|
["HERO_DESC_22"] = "去升星",
|
||||||
["HERO_DESC_23"] = "技能等级:{0}",
|
["HERO_DESC_23"] = "技能等级:{0}",
|
||||||
["BAG_DESC_1"] = "背包",
|
["BAG_DESC_1"] = "背包",
|
||||||
|
["DAILY_CHALLENGE_DESC_2"] = "提升难度",
|
||||||
|
["DAILY_CHALLENGE_DESC_3"] = "通关主线{0}-{1}({2})",
|
||||||
|
["DAILY_CHALLENGE_DESC_4"] = "难度提升将提升未领取的任务奖励和通关奖励,是否确定?",
|
||||||
|
["DAILY_CHALLENGE_DESC_5"] = "降低难度后,未领取的任务奖励和通关奖励将降低,是否确定?",
|
||||||
|
["DAILY_CHALLENGE_DESC_6"] = "请先领取已达成的任务奖励",
|
||||||
|
["DAILY_CHALLENGE_DESC_7"] = "降低难度",
|
||||||
|
["DAILY_CHALLENGE_DESC_8"] = "已达成",
|
||||||
}
|
}
|
||||||
|
|
||||||
return localization_global
|
return localization_global
|
||||||
@ -330,11 +330,11 @@ GConst.MESSAGE_BOX_SHOW_TODAY = {
|
|||||||
GConst.QUALITY_TYPE =
|
GConst.QUALITY_TYPE =
|
||||||
{
|
{
|
||||||
[1] = "#D1D1D1",
|
[1] = "#D1D1D1",
|
||||||
[2] = "#A3FF94",
|
[2] = "#5BFF5F",
|
||||||
[3] = "#4DFFF5",
|
[3] = "#4ADBFF",
|
||||||
[4] = "#FA79FF",
|
[4] = "#DF70FF",
|
||||||
[5] = "#F3A345",
|
[5] = "#FF9B59",
|
||||||
[6] = "#F34545",
|
[6] = "#FF5D5D",
|
||||||
}
|
}
|
||||||
|
|
||||||
GConst.QUALITY_COLOR = {
|
GConst.QUALITY_COLOR = {
|
||||||
|
|||||||
@ -12,7 +12,8 @@ function BattleControllerDailyChallenge:getChapterConfig()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function BattleControllerDailyChallenge:getChapterId()
|
function BattleControllerDailyChallenge:getChapterId()
|
||||||
return DataManager.DailyChallengeData:getChapterDailyId()
|
-- return DataManager.DailyChallengeData:getChapterDailyId()
|
||||||
|
return DataManager.DailyChallengeData:getDiffLv()
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleControllerDailyChallenge:getBuffs()
|
function BattleControllerDailyChallenge:getBuffs()
|
||||||
|
|||||||
@ -234,4 +234,18 @@ function DailyChallengeManager:getCurTaskProgress(battleController)
|
|||||||
return taskCurProgress
|
return taskCurProgress
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 修改难度
|
||||||
|
function DailyChallengeManager:onChapterDailyChallengeLevelReq(level)
|
||||||
|
local parmas = {
|
||||||
|
level = level,
|
||||||
|
}
|
||||||
|
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterDailyChallengeLevelReq, parmas, {}, self.onChapterDailyChallengeLevelRsp)
|
||||||
|
end
|
||||||
|
|
||||||
|
function DailyChallengeManager:onChapterDailyChallengeLevelRsp(result)
|
||||||
|
if result.err_code == GConst.ERROR_STR.SUCCESS then
|
||||||
|
DataManager.DailyChallengeData:setDiffLv(result.reqData.level)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return DailyChallengeManager
|
return DailyChallengeManager
|
||||||
@ -113,6 +113,8 @@ local ProtoMsgType = {
|
|||||||
[2017338205] = "BossRushSettlementRsp",
|
[2017338205] = "BossRushSettlementRsp",
|
||||||
[2018011867] = "TournWaveRankReq",
|
[2018011867] = "TournWaveRankReq",
|
||||||
[2018013700] = "TournWaveRankRsp",
|
[2018013700] = "TournWaveRankRsp",
|
||||||
|
[2055679641] = "ChapterDailyChallengeLevelReq",
|
||||||
|
[2055681474] = "ChapterDailyChallengeLevelRsp",
|
||||||
[2060508030] = "ChangeAvatarFrameReq",
|
[2060508030] = "ChangeAvatarFrameReq",
|
||||||
[2060509863] = "ChangeAvatarFrameRsp",
|
[2060509863] = "ChangeAvatarFrameRsp",
|
||||||
[2095612947] = "ChangeNameReq",
|
[2095612947] = "ChangeNameReq",
|
||||||
@ -412,6 +414,8 @@ local ProtoMsgType = {
|
|||||||
BossRushSettlementRsp = 2017338205,
|
BossRushSettlementRsp = 2017338205,
|
||||||
TournWaveRankReq = 2018011867,
|
TournWaveRankReq = 2018011867,
|
||||||
TournWaveRankRsp = 2018013700,
|
TournWaveRankRsp = 2018013700,
|
||||||
|
ChapterDailyChallengeLevelReq = 2055679641,
|
||||||
|
ChapterDailyChallengeLevelRsp = 2055681474,
|
||||||
ChangeAvatarFrameReq = 2060508030,
|
ChangeAvatarFrameReq = 2060508030,
|
||||||
ChangeAvatarFrameRsp = 2060509863,
|
ChangeAvatarFrameRsp = 2060509863,
|
||||||
ChangeNameReq = 2095612947,
|
ChangeNameReq = 2095612947,
|
||||||
@ -711,6 +715,8 @@ local ProtoMsgType = {
|
|||||||
BossRushSettlementRsp = "BossRushSettlementRsp",
|
BossRushSettlementRsp = "BossRushSettlementRsp",
|
||||||
TournWaveRankReq = "TournWaveRankReq",
|
TournWaveRankReq = "TournWaveRankReq",
|
||||||
TournWaveRankRsp = "TournWaveRankRsp",
|
TournWaveRankRsp = "TournWaveRankRsp",
|
||||||
|
ChapterDailyChallengeLevelReq = "ChapterDailyChallengeLevelReq",
|
||||||
|
ChapterDailyChallengeLevelRsp = "ChapterDailyChallengeLevelRsp",
|
||||||
ChangeAvatarFrameReq = "ChangeAvatarFrameReq",
|
ChangeAvatarFrameReq = "ChangeAvatarFrameReq",
|
||||||
ChangeAvatarFrameRsp = "ChangeAvatarFrameRsp",
|
ChangeAvatarFrameRsp = "ChangeAvatarFrameRsp",
|
||||||
ChangeNameReq = "ChangeNameReq",
|
ChangeNameReq = "ChangeNameReq",
|
||||||
|
|||||||
@ -32,6 +32,8 @@ function DailyChallengeUI:onLoadRootComplete()
|
|||||||
end)
|
end)
|
||||||
uiMap["daily_challenge_ui.title.title_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE))
|
uiMap["daily_challenge_ui.title.title_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE))
|
||||||
uiMap["daily_challenge_ui.record_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.CHAPTER_DESC_1, DataManager.DailyChallengeData:getMaxWave()))
|
uiMap["daily_challenge_ui.record_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.CHAPTER_DESC_1, DataManager.DailyChallengeData:getMaxWave()))
|
||||||
|
uiMap["daily_challenge_ui.up_diff_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_2))
|
||||||
|
uiMap["daily_challenge_ui.down_diff_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_7))
|
||||||
|
|
||||||
self.tasks = GFunc.getTable()
|
self.tasks = GFunc.getTable()
|
||||||
table.insert(self.tasks, uiMap["daily_challenge_ui.task.icon_task1"])
|
table.insert(self.tasks, uiMap["daily_challenge_ui.task.icon_task1"])
|
||||||
@ -57,9 +59,60 @@ function DailyChallengeUI:onLoadRootComplete()
|
|||||||
self.countTxNum = uiMap["daily_challenge_ui.fight_btn.tx_count"]
|
self.countTxNum = uiMap["daily_challenge_ui.fight_btn.tx_count"]
|
||||||
-- 按钮文本
|
-- 按钮文本
|
||||||
self.txFight = uiMap["daily_challenge_ui.fight_btn.tx_desc"]
|
self.txFight = uiMap["daily_challenge_ui.fight_btn.tx_desc"]
|
||||||
|
|
||||||
|
self.upDiffBtn = uiMap["daily_challenge_ui.up_diff_btn"]
|
||||||
|
self.upDiffBtnDescTx = uiMap["daily_challenge_ui.up_diff_btn.desc_tx"]
|
||||||
|
self.downDiffBtn = uiMap["daily_challenge_ui.down_diff_btn"]
|
||||||
self.fightBtn:addClickListener(function ()
|
self.fightBtn:addClickListener(function ()
|
||||||
ModuleManager.DailyChallengeManager:startChallenge()
|
ModuleManager.DailyChallengeManager:startChallenge()
|
||||||
end)
|
end)
|
||||||
|
self.upDiffBtn:addClickListener(function ()
|
||||||
|
if DataManager.DailyChallengeData:canGetReward() then
|
||||||
|
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_6))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local diffChapter = DataManager.DailyChallengeData:getDiffLv()
|
||||||
|
local maxChapter = DataManager.DailyChallengeData:getMaxDiffLv()
|
||||||
|
if diffChapter == maxChapter then
|
||||||
|
return
|
||||||
|
else
|
||||||
|
local cfg = DataManager.DailyChallengeData:getDifficultyCfg(diffChapter + 1)
|
||||||
|
local chapterId = DataManager.ChapterData:getMaxChapterId()
|
||||||
|
if cfg.max_chapter <= chapterId then
|
||||||
|
local params = {
|
||||||
|
content = I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_4),
|
||||||
|
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL,
|
||||||
|
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
|
||||||
|
cancelText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_CANCEL),
|
||||||
|
okFunc = function()
|
||||||
|
ModuleManager.DailyChallengeManager:onChapterDailyChallengeLevelReq(diffChapter + 1)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
GFunc.showMessageBox(params)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
self.downDiffBtn:addClickListener(function ()
|
||||||
|
if DataManager.DailyChallengeData:canGetReward() then
|
||||||
|
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_6))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local diffChapter = DataManager.DailyChallengeData:getDiffLv()
|
||||||
|
if diffChapter == 1 then
|
||||||
|
return
|
||||||
|
else
|
||||||
|
local params = {
|
||||||
|
content = I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_5),
|
||||||
|
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL,
|
||||||
|
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
|
||||||
|
cancelText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_CANCEL),
|
||||||
|
okFunc = function()
|
||||||
|
ModuleManager.DailyChallengeManager:onChapterDailyChallengeLevelReq(diffChapter - 1)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
GFunc.showMessageBox(params)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
self:bind(DataManager.DailyChallengeData, "isDirty", function()
|
self:bind(DataManager.DailyChallengeData, "isDirty", function()
|
||||||
self:onRefresh()
|
self:onRefresh()
|
||||||
@ -78,6 +131,7 @@ function DailyChallengeUI:onRefresh()
|
|||||||
self:refreshBoss()
|
self:refreshBoss()
|
||||||
self:updateTime()
|
self:updateTime()
|
||||||
self:refreshFightBtn()
|
self:refreshFightBtn()
|
||||||
|
self:refreshDiffBtn()
|
||||||
|
|
||||||
if DataManager.DailyChallengeData:getIsPopTask() then
|
if DataManager.DailyChallengeData:getIsPopTask() then
|
||||||
ModuleManager.DailyChallengeManager:showBattleTaskUI()
|
ModuleManager.DailyChallengeManager:showBattleTaskUI()
|
||||||
@ -180,4 +234,26 @@ function DailyChallengeUI:refreshFightBtn()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function DailyChallengeUI:refreshDiffBtn()
|
||||||
|
local diffChapter = DataManager.DailyChallengeData:getDiffLv()
|
||||||
|
local maxChapter = DataManager.DailyChallengeData:getMaxDiffLv()
|
||||||
|
if diffChapter == maxChapter then
|
||||||
|
self.upDiffBtn:setActive(false)
|
||||||
|
else
|
||||||
|
self.upDiffBtn:setActive(true)
|
||||||
|
local cfg = DataManager.DailyChallengeData:getDifficultyCfg(diffChapter + 1)
|
||||||
|
local chapterId = DataManager.ChapterData:getMaxChapterId()
|
||||||
|
local chapterPage = DataManager.ChapterData:getChapterPage(diffChapter + 1)
|
||||||
|
local chapterStage = DataManager.ChapterData:getChapterStage(diffChapter + 1)
|
||||||
|
local str
|
||||||
|
if cfg.max_chapter <= chapterId then
|
||||||
|
str = I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_3, chapterPage, chapterStage, "<color=#5BFF5F>" .. I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_8) .. "</color>")
|
||||||
|
else
|
||||||
|
str = I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_3, chapterPage, chapterStage, "<color=#FF5D5D>" .. I18N:getGlobalText(I18N.GlobalConst.CHAPTER_WAVE_REAWRD_1) .. "</color>")
|
||||||
|
end
|
||||||
|
self.upDiffBtnDescTx:setText(str)
|
||||||
|
end
|
||||||
|
self.downDiffBtn:setActive(diffChapter > 1)
|
||||||
|
end
|
||||||
|
|
||||||
return DailyChallengeUI
|
return DailyChallengeUI
|
||||||
@ -10,6 +10,7 @@ function ArenaData:clear()
|
|||||||
self.lastArenaGiftId = nil
|
self.lastArenaGiftId = nil
|
||||||
self.curArenaGiftId = nil
|
self.curArenaGiftId = nil
|
||||||
self.giftExpireAt = nil
|
self.giftExpireAt = nil
|
||||||
|
self.inited = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function ArenaData:init(data)
|
function ArenaData:init(data)
|
||||||
@ -39,6 +40,8 @@ function ArenaData:init(data)
|
|||||||
DataManager.FormationData:initArena(data.attack_array_heroes, data.defend_array_heroes)
|
DataManager.FormationData:initArena(data.attack_array_heroes, data.defend_array_heroes)
|
||||||
DataManager.PlayerData:initArena(data.today_ticket_buy_count, data.today_ticket_ad_count)
|
DataManager.PlayerData:initArena(data.today_ticket_buy_count, data.today_ticket_ad_count)
|
||||||
|
|
||||||
|
self.inited = true
|
||||||
|
|
||||||
-- 未找到相应赛季数据
|
-- 未找到相应赛季数据
|
||||||
if not self:hasServerData() then
|
if not self:hasServerData() then
|
||||||
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_30))
|
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_30))
|
||||||
@ -461,6 +464,9 @@ end
|
|||||||
|
|
||||||
-- 是否有入口红点
|
-- 是否有入口红点
|
||||||
function ArenaData:hasEntranceRedDot()
|
function ArenaData:hasEntranceRedDot()
|
||||||
|
if not self.inited then
|
||||||
|
return false
|
||||||
|
end
|
||||||
if not self:isOpen() then
|
if not self:isOpen() then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
local DailyChallengeData = class("DailyChallengeData", BaseData)
|
local DailyChallengeData = class("DailyChallengeData", BaseData)
|
||||||
local TASK_CFG = ConfigManager:getConfig("task_daily_challenge")
|
local TASK_CFG = ConfigManager:getConfig("task_daily_challenge")
|
||||||
|
local CHAPTER_DAILY_CHALLENGE_CFG = ConfigManager:getConfig("chapter_daily_challenge")
|
||||||
local PER_TASK = {[6] = true}
|
local PER_TASK = {[6] = true}
|
||||||
local FIXED_HERO_TASK = {}
|
local FIXED_HERO_TASK = {}
|
||||||
local MATCH_TYPE_TASK = {[4] = true, [6] = true}
|
local MATCH_TYPE_TASK = {[4] = true, [6] = true}
|
||||||
@ -10,80 +11,81 @@ function DailyChallengeData:ctor()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function DailyChallengeData:init(data)
|
function DailyChallengeData:init(data)
|
||||||
if EDITOR_MODE then
|
if EDITOR_MODE then
|
||||||
Logger.logHighlight("每日挑战 更新数据...")
|
Logger.logHighlight("每日挑战 更新数据...")
|
||||||
Logger.printTable(data)
|
Logger.printTable(data)
|
||||||
end
|
end
|
||||||
data = data or GConst.EMPTY_TABLE
|
data = data or GConst.EMPTY_TABLE
|
||||||
self.maxWave = data.max_wave or 0
|
self.maxWave = data.max_wave or 0
|
||||||
self.fixedChapterId = data.today_fixed_chapter_id or 1
|
self.fixedChapterId = data.today_fixed_chapter_id or 1
|
||||||
self.chapterDailyId = data.rand_chapter_daily_id or 1
|
self.chapterDailyId = data.rand_chapter_daily_id or 1
|
||||||
self.tasks = data.tasks or GConst.EMPTY_TABLE
|
self.tasks = data.tasks or GConst.EMPTY_TABLE
|
||||||
self.buffIds = data.buff_id or GConst.EMPTY_TABLE
|
self.buffIds = data.buff_id or GConst.EMPTY_TABLE
|
||||||
self.totalFightCount = data.total_challenge_count or 0
|
self.totalFightCount = data.total_challenge_count or 0
|
||||||
self.todayFightCount = data.today_challenge_count or 0
|
self.todayFightCount = data.today_challenge_count or 0
|
||||||
self.initDay = Time:getBeginningOfServerToday()
|
self.initDay = Time:getBeginningOfServerToday()
|
||||||
self.popTaskTime = LocalData:getChallengeTaskPopTime()
|
self.popTaskTime = LocalData:getChallengeTaskPopTime()
|
||||||
self:setDirty()
|
self.diffLv = data.level or 1
|
||||||
|
self:setDirty()
|
||||||
end
|
end
|
||||||
|
|
||||||
function DailyChallengeData:onGetedTaskReward(idx)
|
function DailyChallengeData:onGetedTaskReward(idx)
|
||||||
if self.tasks[idx] then
|
if self.tasks[idx] then
|
||||||
self.tasks[idx].claimed = true
|
self.tasks[idx].claimed = true
|
||||||
self:setDirty()
|
self:setDirty()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function DailyChallengeData:clear()
|
function DailyChallengeData:clear()
|
||||||
end
|
end
|
||||||
|
|
||||||
function DailyChallengeData:isOpen()
|
function DailyChallengeData:isOpen()
|
||||||
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.DAILY_CHALLENGE, true) then
|
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.DAILY_CHALLENGE, true) then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
function DailyChallengeData:setDirty()
|
function DailyChallengeData:setDirty()
|
||||||
self.data.isDirty = not self.data.isDirty
|
self.data.isDirty = not self.data.isDirty
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 是否满足挑战条件
|
-- 是否满足挑战条件
|
||||||
function DailyChallengeData:isMeetChallenge()
|
function DailyChallengeData:isMeetChallenge()
|
||||||
return self:isOpen() and self:isEnoughChallengeTime() and self:isEnoughHp()
|
return self:isOpen() and self:isEnoughChallengeTime() and self:isEnoughHp()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 次数是否足够
|
-- 次数是否足够
|
||||||
function DailyChallengeData:isEnoughChallengeTime()
|
function DailyChallengeData:isEnoughChallengeTime()
|
||||||
return self:getTodayRemainLimitCount() > 0
|
return self:getTodayRemainLimitCount() > 0
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取挑战次数消耗
|
-- 获取挑战次数消耗
|
||||||
function DailyChallengeData:getChallengeTimeCost()
|
function DailyChallengeData:getChallengeTimeCost()
|
||||||
return GFunc.getConstIntValue("daily_challenge_limit")
|
return GFunc.getConstIntValue("daily_challenge_limit")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 体力是否足够
|
-- 体力是否足够
|
||||||
function DailyChallengeData:isEnoughHp()
|
function DailyChallengeData:isEnoughHp()
|
||||||
local const = self:getChallengeHpCost()
|
local const = self:getChallengeHpCost()
|
||||||
local constNum = nil
|
local constNum = nil
|
||||||
if const then
|
if const then
|
||||||
constNum = GFunc.getRewardNum(const)
|
constNum = GFunc.getRewardNum(const)
|
||||||
else
|
else
|
||||||
constNum = 0
|
constNum = 0
|
||||||
end
|
end
|
||||||
return constNum <= DataManager.BagData.ItemData:getVit()
|
return constNum <= DataManager.BagData.ItemData:getVit()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取挑战体力消耗
|
-- 获取挑战体力消耗
|
||||||
function DailyChallengeData:getChallengeHpCost()
|
function DailyChallengeData:getChallengeHpCost()
|
||||||
return GFunc.getConstReward("daily_challenge_cost")
|
return GFunc.getConstReward("daily_challenge_cost")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取今日挑战场景配置
|
-- 获取今日挑战场景配置
|
||||||
function DailyChallengeData:getMapConfig()
|
function DailyChallengeData:getMapConfig()
|
||||||
return ConfigManager:getConfig("chapter_daily_challenge")[self:getChapterDailyId()]
|
return ConfigManager:getConfig("chapter_daily_challenge")[self:getChapterDailyId()]
|
||||||
end
|
end
|
||||||
|
|
||||||
function DailyChallengeData:getTaskCfg()
|
function DailyChallengeData:getTaskCfg()
|
||||||
@ -95,173 +97,173 @@ end
|
|||||||
|
|
||||||
-- 获取今日通关次数
|
-- 获取今日通关次数
|
||||||
function DailyChallengeData:getTodayPassNum()
|
function DailyChallengeData:getTodayPassNum()
|
||||||
return self.todayFightCount
|
return self.todayFightCount
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取今日最高记录(最大通过波次)
|
-- 获取今日最高记录(最大通过波次)
|
||||||
function DailyChallengeData:getMaxWave()
|
function DailyChallengeData:getMaxWave()
|
||||||
return self.maxWave
|
return self.maxWave
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取今日增益、负面buff
|
-- 获取今日增益、负面buff
|
||||||
function DailyChallengeData:getTodayBuffIds()
|
function DailyChallengeData:getTodayBuffIds()
|
||||||
return self.buffIds
|
return self.buffIds
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取buff描述
|
-- 获取buff描述
|
||||||
function DailyChallengeData:getBuffDesc(buffId)
|
function DailyChallengeData:getBuffDesc(buffId)
|
||||||
return I18N:getText("buff_daily_challenge", buffId, "desc")
|
return I18N:getText("buff_daily_challenge", buffId, "desc")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取最终boss配置信息
|
-- 获取最终boss配置信息
|
||||||
function DailyChallengeData:getFinalBossInfo()
|
function DailyChallengeData:getFinalBossInfo()
|
||||||
if not self:isOpen() then
|
if not self:isOpen() then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local mapCfg = self:getMapConfig()
|
local mapCfg = self:getMapConfig()
|
||||||
if not mapCfg then
|
if not mapCfg then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
return ConfigManager:getConfig("monster")[mapCfg.monster[#mapCfg.monster]]
|
return ConfigManager:getConfig("monster")[mapCfg.monster[#mapCfg.monster]]
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 任务是否完成
|
-- 任务是否完成
|
||||||
function DailyChallengeData:isTaskFinish(index)
|
function DailyChallengeData:isTaskFinish(index)
|
||||||
if not self:isOpen() then
|
if not self:isOpen() then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
local cfg = self:getTaskCfgInfo(self.tasks[index].task_id)
|
local cfg = self:getTaskCfgInfo(self.tasks[index].task_id)
|
||||||
if not cfg then
|
if not cfg then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
return cfg.param <= self.tasks[index].progress
|
return cfg.param <= self.tasks[index].progress
|
||||||
end
|
end
|
||||||
|
|
||||||
function DailyChallengeData:getTasks()
|
function DailyChallengeData:getTasks()
|
||||||
return self.tasks
|
return self.tasks
|
||||||
end
|
end
|
||||||
|
|
||||||
function DailyChallengeData:getTaskById(taskId)
|
function DailyChallengeData:getTaskById(taskId)
|
||||||
for index, taskInfo in ipairs(self.tasks) do
|
for index, taskInfo in ipairs(self.tasks) do
|
||||||
if taskInfo.task_id == taskId then
|
if taskInfo.task_id == taskId then
|
||||||
return taskInfo
|
return taskInfo
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 任务奖励是否可领取
|
-- 任务奖励是否可领取
|
||||||
function DailyChallengeData:canClaimTask(index)
|
function DailyChallengeData:canClaimTask(index)
|
||||||
if not self:isOpen() then
|
if not self:isOpen() then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if not self.tasks[index] then
|
if not self.tasks[index] then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if self.tasks[index].claimed then
|
if self.tasks[index].claimed then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
return self:isTaskFinish(index)
|
return self:isTaskFinish(index)
|
||||||
end
|
end
|
||||||
|
|
||||||
function DailyChallengeData:getTaskProgresss(index)
|
function DailyChallengeData:getTaskProgresss(index)
|
||||||
if not self:isOpen() then
|
if not self:isOpen() then
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
if not self.tasks[index] then
|
if not self.tasks[index] then
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
return self.tasks[index].progress
|
return self.tasks[index].progress
|
||||||
end
|
end
|
||||||
|
|
||||||
function DailyChallengeData:getTaskCfgInfo(taskId)
|
function DailyChallengeData:getTaskCfgInfo(taskId)
|
||||||
return TASK_CFG[taskId]
|
return TASK_CFG[taskId]
|
||||||
end
|
end
|
||||||
|
|
||||||
function DailyChallengeData:getTaskTotalNumber(taskId)
|
function DailyChallengeData:getTaskTotalNumber(taskId)
|
||||||
if self:getTaskCfgInfo(taskId) then
|
if self:getTaskCfgInfo(taskId) then
|
||||||
return self:getTaskCfgInfo(taskId).param
|
return self:getTaskCfgInfo(taskId).param
|
||||||
else
|
else
|
||||||
return 1 -- 容错,防止报错
|
return 1 -- 容错,防止报错
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function DailyChallengeData:getTaskRewards(taskId)
|
function DailyChallengeData:getTaskRewards(taskId)
|
||||||
if self:getTaskCfgInfo(taskId) then
|
if self:getTaskCfgInfo(taskId) then
|
||||||
return self:getTaskCfgInfo(taskId).reward
|
return self:getTaskCfgInfo(taskId).reward
|
||||||
end
|
end
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function DailyChallengeData:getTaskDesc(taskId, needProgress, customProgress)
|
function DailyChallengeData:getTaskDesc(taskId, needProgress, customProgress)
|
||||||
local desc = GConst.EMPTY_STRING
|
local desc = GConst.EMPTY_STRING
|
||||||
if not I18N:getConfig("task_daily_challenge")[taskId] then
|
if not I18N:getConfig("task_daily_challenge")[taskId] then
|
||||||
return desc
|
return desc
|
||||||
end
|
end
|
||||||
local taskNum = self:getTaskTotalNumber(taskId)
|
local taskNum = self:getTaskTotalNumber(taskId)
|
||||||
if PER_TASK[taskId] then
|
if PER_TASK[taskId] then
|
||||||
taskNum = taskNum * 100 // GConst.BattleConst.DEFAULT_FACTOR
|
taskNum = taskNum * 100 // GConst.BattleConst.DEFAULT_FACTOR
|
||||||
end
|
end
|
||||||
local taskInfo = self:getTaskById(taskId)
|
local taskInfo = self:getTaskById(taskId)
|
||||||
if not taskInfo then
|
if not taskInfo then
|
||||||
return desc
|
return desc
|
||||||
end
|
end
|
||||||
|
|
||||||
local conditionStr
|
local conditionStr
|
||||||
if FIXED_HERO_TASK[taskId] then -- 具体英雄
|
if FIXED_HERO_TASK[taskId] then -- 具体英雄
|
||||||
conditionStr = ModuleManager.HeroManager:getHeroName(taskInfo.param, true)
|
conditionStr = ModuleManager.HeroManager:getHeroName(taskInfo.param, true)
|
||||||
elseif MATCH_TYPE_TASK[taskId] then -- 颜色英雄
|
elseif MATCH_TYPE_TASK[taskId] then -- 颜色英雄
|
||||||
conditionStr = ModuleManager.HeroManager:getMatchTypeName(taskInfo.param, true)
|
conditionStr = ModuleManager.HeroManager:getMatchTypeName(taskInfo.param, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
if conditionStr then
|
if conditionStr then
|
||||||
desc = I18N:getText("task_daily_challenge", taskId, "desc", conditionStr, taskNum)
|
desc = I18N:getText("task_daily_challenge", taskId, "desc", conditionStr, taskNum)
|
||||||
else
|
else
|
||||||
desc = I18N:getText("task_daily_challenge", taskId, "desc", taskNum)
|
desc = I18N:getText("task_daily_challenge", taskId, "desc", taskNum)
|
||||||
end
|
end
|
||||||
|
|
||||||
if needProgress and NEED_PROGRESS_TASK[taskId] then
|
if needProgress and NEED_PROGRESS_TASK[taskId] then
|
||||||
local progress = customProgress or taskInfo.progress
|
local progress = customProgress or taskInfo.progress
|
||||||
if PER_TASK[taskId] then
|
if PER_TASK[taskId] then
|
||||||
progress = progress * 100 // GConst.BattleConst.DEFAULT_FACTOR .. "%"
|
progress = progress * 100 // GConst.BattleConst.DEFAULT_FACTOR .. "%"
|
||||||
taskNum = taskNum .. "%"
|
taskNum = taskNum .. "%"
|
||||||
end
|
end
|
||||||
local progressStr = string.format("<color=#5FFF53>(%s/%s)</color>", progress, taskNum)
|
local progressStr = string.format("<color=#5FFF53>(%s/%s)</color>", progress, taskNum)
|
||||||
desc = desc .. progressStr
|
desc = desc .. progressStr
|
||||||
end
|
end
|
||||||
return desc
|
return desc
|
||||||
end
|
end
|
||||||
|
|
||||||
function DailyChallengeData:getTodayRemainLimitCount()
|
function DailyChallengeData:getTodayRemainLimitCount()
|
||||||
local count = self:getChallengeTimeCost() - self.todayFightCount
|
local count = self:getChallengeTimeCost() - self.todayFightCount
|
||||||
if count < 0 then
|
if count < 0 then
|
||||||
count = 0
|
count = 0
|
||||||
end
|
end
|
||||||
return count
|
return count
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 处理主动退出的情况
|
-- 处理主动退出的情况
|
||||||
function DailyChallengeData:onFightCountReduce()
|
function DailyChallengeData:onFightCountReduce()
|
||||||
self.todayFightCount = self.todayFightCount + 1
|
self.todayFightCount = self.todayFightCount + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
function DailyChallengeData:getFixedChapterId()
|
function DailyChallengeData:getFixedChapterId()
|
||||||
return self.fixedChapterId
|
return self.fixedChapterId
|
||||||
end
|
end
|
||||||
|
|
||||||
function DailyChallengeData:getChapterDailyId()
|
function DailyChallengeData:getChapterDailyId()
|
||||||
return self.chapterDailyId
|
return self.chapterDailyId
|
||||||
end
|
end
|
||||||
|
|
||||||
function DailyChallengeData:setFixedChapterId(id)
|
function DailyChallengeData:setFixedChapterId(id)
|
||||||
self.fixedChapterId = id
|
self.fixedChapterId = id
|
||||||
end
|
end
|
||||||
|
|
||||||
function DailyChallengeData:getTotalFightCount()
|
function DailyChallengeData:getTotalFightCount()
|
||||||
return self.totalFightCount
|
return self.totalFightCount
|
||||||
end
|
end
|
||||||
|
|
||||||
function DailyChallengeData:getIfCanReset()
|
function DailyChallengeData:getIfCanReset()
|
||||||
@ -285,14 +287,14 @@ function DailyChallengeData:getIsInReset()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function DailyChallengeData:getIsPopTask()
|
function DailyChallengeData:getIsPopTask()
|
||||||
if not self:isOpen() then
|
if not self:isOpen() then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
return self.popTaskTime < Time:getBeginningOfServerToday()
|
return self.popTaskTime < Time:getBeginningOfServerToday()
|
||||||
end
|
end
|
||||||
|
|
||||||
function DailyChallengeData:markPopTask()
|
function DailyChallengeData:markPopTask()
|
||||||
if self.popTaskTime >= Time:getBeginningOfServerToday() then
|
if self.popTaskTime >= Time:getBeginningOfServerToday() then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
self.popTaskTime = Time:getBeginningOfServerToday()
|
self.popTaskTime = Time:getBeginningOfServerToday()
|
||||||
@ -301,12 +303,36 @@ end
|
|||||||
|
|
||||||
--@region 红点
|
--@region 红点
|
||||||
function DailyChallengeData:showRedPoint()
|
function DailyChallengeData:showRedPoint()
|
||||||
for i = 1, 3 do
|
return self:canGetReward()
|
||||||
if DataManager.DailyChallengeData:canClaimTask(i) then
|
end
|
||||||
return true
|
|
||||||
end
|
function DailyChallengeData:canGetReward()
|
||||||
end
|
for i = 1, 3 do
|
||||||
return false
|
if DataManager.DailyChallengeData:canClaimTask(i) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
--@endregion
|
||||||
|
|
||||||
|
--@region 难度
|
||||||
|
function DailyChallengeData:setDiffLv(diffLv)
|
||||||
|
self.diffLv = diffLv
|
||||||
|
self:setDirty()
|
||||||
|
end
|
||||||
|
|
||||||
|
function DailyChallengeData:getDiffLv()
|
||||||
|
return self.diffLv
|
||||||
|
end
|
||||||
|
|
||||||
|
function DailyChallengeData:getMaxDiffLv()
|
||||||
|
return #CHAPTER_DAILY_CHALLENGE_CFG
|
||||||
|
end
|
||||||
|
|
||||||
|
function DailyChallengeData:getDifficultyCfg(id)
|
||||||
|
return CHAPTER_DAILY_CHALLENGE_CFG[id]
|
||||||
end
|
end
|
||||||
--@endregion
|
--@endregion
|
||||||
return DailyChallengeData
|
return DailyChallengeData
|
||||||
Loading…
x
Reference in New Issue
Block a user