每日挑战

This commit is contained in:
puxuan 2025-09-15 17:20:14 +08:00
parent e5e23cc06c
commit e1d389b02d
12 changed files with 311 additions and 255 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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

View File

@ -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,

View File

@ -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

View File

@ -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 = {

View File

@ -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()

View File

@ -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

View File

@ -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",

View File

@ -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

View File

@ -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

View File

@ -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}
@ -24,6 +25,7 @@ function DailyChallengeData:init(data)
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.diffLv = data.level or 1
self:setDirty() self:setDirty()
end end
@ -301,6 +303,10 @@ end
--@region 红点 --@region 红点
function DailyChallengeData:showRedPoint() function DailyChallengeData:showRedPoint()
return self:canGetReward()
end
function DailyChallengeData:canGetReward()
for i = 1, 3 do for i = 1, 3 do
if DataManager.DailyChallengeData:canClaimTask(i) then if DataManager.DailyChallengeData:canClaimTask(i) then
return true return true
@ -308,5 +314,25 @@ function DailyChallengeData:showRedPoint()
end end
return false return false
end 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
--@endregion --@endregion
return DailyChallengeData return DailyChallengeData