This commit is contained in:
puxuan 2025-08-06 20:46:06 +08:00
parent eedbffda2e
commit 93cd085ccf
22 changed files with 16837 additions and 28375 deletions

View File

@ -180,6 +180,8 @@ BIReport.ITEM_GET_TYPE = {
FULL_MOON_TASK = "FullMoonTask", FULL_MOON_TASK = "FullMoonTask",
FULL_MOON_TASK_PROG_REWARD = "FullMoonTaskProgReward", FULL_MOON_TASK_PROG_REWARD = "FullMoonTaskProgReward",
FULL_MOON_SKIN_CHALLENGE_REWARD = "FullMoonSkinChallengeReward", FULL_MOON_SKIN_CHALLENGE_REWARD = "FullMoonSkinChallengeReward",
TASK_ACHIEVEMENT = "task_achievement",
} }
BIReport.ADS_CLICK_TYPE = { BIReport.ADS_CLICK_TYPE = {
@ -378,6 +380,12 @@ local EVENT_BOX_OPEN = "client_box_open"
local EVENT_ACT_OPT = "client_act_opt" local EVENT_ACT_OPT = "client_act_opt"
local EVENT_NAME_RUNES = "client_runes" local EVENT_NAME_RUNES = "client_runes"
BIReport.TASK_OPT = {
TASK_REWARD = "TaskReward",
STAGE_REWARD = "StageReward",
ACHIEVEMENT_REWARD = "AchievementReward",
}
function BIReport:setIsNewPlayer(isNewPlayer) function BIReport:setIsNewPlayer(isNewPlayer)
self.isNewPlayer = isNewPlayer self.isNewPlayer = isNewPlayer
end end
@ -1460,6 +1468,16 @@ function BIReport:postDailyTaskFinish(taskType, cfgId, taskId, refresh)
self:report(EVENT_NAME_DAILY_TASK, args) self:report(EVENT_NAME_DAILY_TASK, args)
end end
function BIReport:postTaskAchievementOpt(id, stage, rewards)
local args = {
opt_type = BIReport.TASK_OPT.ACHIEVEMENT_REWARD,
achievement_id = id,
achievement_stage = stage,
reward_str = rewards and GFunc.getRewardsStr(rewards) or nil,
}
self:report(EVENT_NAME_DAILY_TASK, args)
end
-- 邮箱 -- 邮箱
function BIReport:postMailOpen(mailId) function BIReport:postMailOpen(mailId)
-- IsNew 是否是新用户 -- IsNew 是否是新用户

View File

@ -174,7 +174,7 @@ function DataManager:initWithServerData(data)
self.ArenaBountyData:init(data.arena_bounty) self.ArenaBountyData:init(data.arena_bounty)
self.ArenaData:initGiftInfo(data.act_arena_gift, true) self.ArenaData:initGiftInfo(data.act_arena_gift, true)
-- 任务要在BountyData之后初始化依赖BountyData的数据 -- 任务要在BountyData之后初始化依赖BountyData的数据
self.DailyTaskData:init(data.task_daily) self.DailyTaskData:init(data.task_daily, data.task_achievement)
self.IdleData:init(data.idle) self.IdleData:init(data.idle)
self.SevenDayData:init(data.seven_day) self.SevenDayData:init(data.seven_day)
self.ShopData:initBase() self.ShopData:initBase()

View File

@ -5,10 +5,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=8, ["id"]=5,
["id_for_nothing"]="Xg==", ["id_for_nothing"]="Uw==",
["num"]=1, ["num"]=5,
["num_for_nothing"]="Vw==" ["num_for_nothing"]="Uw=="
} }
} }
}, },
@ -18,10 +18,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=23002, ["id"]=40,
["id_for_nothing"]="VAtcA2c=", ["id_for_nothing"]="Ugg=",
["num"]=10, ["num"]=30,
["num_for_nothing"]="Vwg=" ["num_for_nothing"]="VQg="
} }
} }
}, },
@ -31,8 +31,8 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=10, ["id"]=6,
["id_for_nothing"]="Vwg=", ["id_for_nothing"]="UA==",
["num"]=1, ["num"]=1,
["num_for_nothing"]="Vw==" ["num_for_nothing"]="Vw=="
} }
@ -44,10 +44,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=1, ["id"]=5,
["id_for_nothing"]="Vw==", ["id_for_nothing"]="Uw==",
["num"]=5000, ["num"]=5,
["num_for_nothing"]="UwhcAw==" ["num_for_nothing"]="Uw=="
} }
} }
}, },
@ -57,10 +57,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=2, ["id"]=16,
["id_for_nothing"]="VA==", ["id_for_nothing"]="Vw4=",
["num"]=50, ["num"]=5,
["num_for_nothing"]="Uwg=" ["num_for_nothing"]="Uw=="
} }
} }
}, },
@ -70,10 +70,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=10, ["id"]=41,
["id_for_nothing"]="Vwg=", ["id_for_nothing"]="Ugk=",
["num"]=1, ["num"]=5,
["num_for_nothing"]="Vw==" ["num_for_nothing"]="Uw=="
} }
} }
}, },
@ -96,10 +96,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=1, ["id"]=5,
["id_for_nothing"]="Vw==", ["id_for_nothing"]="Uw==",
["num"]=10000, ["num"]=5,
["num_for_nothing"]="VwhcA2U=" ["num_for_nothing"]="Uw=="
} }
} }
}, },
@ -109,10 +109,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=11, ["id"]=40,
["id_for_nothing"]="Vwk=", ["id_for_nothing"]="Ugg=",
["num"]=1, ["num"]=30,
["num_for_nothing"]="Vw==" ["num_for_nothing"]="VQg="
} }
} }
}, },
@ -122,10 +122,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=2, ["id"]=41,
["id_for_nothing"]="VA==", ["id_for_nothing"]="Ugk=",
["num"]=60, ["num"]=5,
["num_for_nothing"]="UAg=" ["num_for_nothing"]="Uw=="
} }
} }
}, },
@ -135,10 +135,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=54003, ["id"]=6,
["id_for_nothing"]="UwxcA2Y=", ["id_for_nothing"]="UA==",
["num"]=3, ["num"]=1,
["num_for_nothing"]="VQ==" ["num_for_nothing"]="Vw=="
} }
} }
}, },
@ -148,10 +148,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=1, ["id"]=5,
["id_for_nothing"]="Vw==", ["id_for_nothing"]="Uw==",
["num"]=15000, ["num"]=5,
["num_for_nothing"]="Vw1cA2U=" ["num_for_nothing"]="Uw=="
} }
} }
}, },
@ -161,10 +161,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=11, ["id"]=40,
["id_for_nothing"]="Vwk=", ["id_for_nothing"]="Ugg=",
["num"]=1, ["num"]=30,
["num_for_nothing"]="Vw==" ["num_for_nothing"]="VQg="
} }
} }
}, },
@ -174,10 +174,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=2, ["id"]=16,
["id_for_nothing"]="VA==", ["id_for_nothing"]="Vw4=",
["num"]=80, ["num"]=5,
["num_for_nothing"]="Xgg=" ["num_for_nothing"]="Uw=="
} }
} }
}, },
@ -187,10 +187,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=34003, ["id"]=6,
["id_for_nothing"]="VQxcA2Y=", ["id_for_nothing"]="UA==",
["num"]=3, ["num"]=1,
["num_for_nothing"]="VQ==" ["num_for_nothing"]="Vw=="
} }
} }
}, },
@ -200,10 +200,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=1, ["id"]=5,
["id_for_nothing"]="Vw==", ["id_for_nothing"]="Uw==",
["num"]=18000, ["num"]=5,
["num_for_nothing"]="VwBcA2U=" ["num_for_nothing"]="Uw=="
} }
} }
}, },
@ -213,10 +213,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=18, ["id"]=40,
["id_for_nothing"]="VwA=", ["id_for_nothing"]="Ugg=",
["num"]=1, ["num"]=30,
["num_for_nothing"]="Vw==" ["num_for_nothing"]="VQg="
} }
} }
}, },
@ -226,10 +226,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=2, ["id"]=41,
["id_for_nothing"]="VA==", ["id_for_nothing"]="Ugk=",
["num"]=100, ["num"]=5,
["num_for_nothing"]="Vwhc" ["num_for_nothing"]="Uw=="
} }
} }
}, },
@ -239,10 +239,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=24003, ["id"]=6,
["id_for_nothing"]="VAxcA2Y=", ["id_for_nothing"]="UA==",
["num"]=3, ["num"]=1,
["num_for_nothing"]="VQ==" ["num_for_nothing"]="Vw=="
} }
} }
}, },
@ -252,10 +252,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=1, ["id"]=5,
["id_for_nothing"]="Vw==", ["id_for_nothing"]="Uw==",
["num"]=20000, ["num"]=5,
["num_for_nothing"]="VAhcA2U=" ["num_for_nothing"]="Uw=="
} }
} }
}, },
@ -265,10 +265,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=18, ["id"]=40,
["id_for_nothing"]="VwA=", ["id_for_nothing"]="Ugg=",
["num"]=1, ["num"]=30,
["num_for_nothing"]="Vw==" ["num_for_nothing"]="VQg="
} }
} }
}, },
@ -278,10 +278,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=2, ["id"]=16,
["id_for_nothing"]="VA==", ["id_for_nothing"]="Vw4=",
["num"]=120, ["num"]=5,
["num_for_nothing"]="Vwpc" ["num_for_nothing"]="Uw=="
} }
} }
}, },
@ -291,10 +291,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=47, ["id"]=6,
["id_for_nothing"]="Ug8=", ["id_for_nothing"]="UA==",
["num"]=5, ["num"]=1,
["num_for_nothing"]="Uw==" ["num_for_nothing"]="Vw=="
} }
} }
}, },
@ -304,10 +304,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=1, ["id"]=5,
["id_for_nothing"]="Vw==", ["id_for_nothing"]="Uw==",
["num"]=24000, ["num"]=10,
["num_for_nothing"]="VAxcA2U=" ["num_for_nothing"]="Vwg="
} }
} }
}, },
@ -317,8 +317,8 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=18, ["id"]=6,
["id_for_nothing"]="VwA=", ["id_for_nothing"]="UA==",
["num"]=1, ["num"]=1,
["num_for_nothing"]="Vw==" ["num_for_nothing"]="Vw=="
} }
@ -330,10 +330,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=2, ["id"]=41,
["id_for_nothing"]="VA==", ["id_for_nothing"]="Ugk=",
["num"]=150, ["num"]=10,
["num_for_nothing"]="Vw1c" ["num_for_nothing"]="Vwg="
} }
} }
}, },
@ -343,10 +343,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=47, ["id"]=6,
["id_for_nothing"]="Ug8=", ["id_for_nothing"]="UA==",
["num"]=8, ["num"]=1,
["num_for_nothing"]="Xg==" ["num_for_nothing"]="Vw=="
} }
} }
}, },
@ -356,10 +356,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=1, ["id"]=5,
["id_for_nothing"]="Vw==", ["id_for_nothing"]="Uw==",
["num"]=30000, ["num"]=10,
["num_for_nothing"]="VQhcA2U=" ["num_for_nothing"]="Vwg="
} }
} }
}, },
@ -369,8 +369,8 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=18, ["id"]=6,
["id_for_nothing"]="VwA=", ["id_for_nothing"]="UA==",
["num"]=1, ["num"]=1,
["num_for_nothing"]="Vw==" ["num_for_nothing"]="Vw=="
} }
@ -382,10 +382,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=2, ["id"]=16,
["id_for_nothing"]="VA==", ["id_for_nothing"]="Vw4=",
["num"]=180, ["num"]=5,
["num_for_nothing"]="VwBc" ["num_for_nothing"]="Uw=="
} }
} }
}, },
@ -395,10 +395,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=1, ["id"]=41,
["id_for_nothing"]="Vw==", ["id_for_nothing"]="Ugk=",
["num"]=30000, ["num"]=10,
["num_for_nothing"]="VQhcA2U=" ["num_for_nothing"]="Vwg="
} }
} }
}, },
@ -408,8 +408,8 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=14, ["id"]=6,
["id_for_nothing"]="Vww=", ["id_for_nothing"]="UA==",
["num"]=1, ["num"]=1,
["num_for_nothing"]="Vw==" ["num_for_nothing"]="Vw=="
} }
@ -421,10 +421,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=47, ["id"]=17,
["id_for_nothing"]="Ug8=", ["id_for_nothing"]="Vw8=",
["num"]=10, ["num"]=1,
["num_for_nothing"]="Vwg=" ["num_for_nothing"]="Vw=="
} }
} }
}, },
@ -434,10 +434,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=1, ["id"]=5,
["id_for_nothing"]="Vw==", ["id_for_nothing"]="Uw==",
["num"]=40000, ["num"]=10,
["num_for_nothing"]="UghcA2U=" ["num_for_nothing"]="Vwg="
} }
} }
}, },
@ -447,8 +447,8 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=18, ["id"]=6,
["id_for_nothing"]="VwA=", ["id_for_nothing"]="UA==",
["num"]=1, ["num"]=1,
["num_for_nothing"]="Vw==" ["num_for_nothing"]="Vw=="
} }
@ -460,10 +460,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=2, ["id"]=16,
["id_for_nothing"]="VA==", ["id_for_nothing"]="Vw4=",
["num"]=200, ["num"]=5,
["num_for_nothing"]="VAhc" ["num_for_nothing"]="Uw=="
} }
} }
}, },
@ -473,10 +473,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=1, ["id"]=41,
["id_for_nothing"]="Vw==", ["id_for_nothing"]="Ugk=",
["num"]=40000, ["num"]=15,
["num_for_nothing"]="UghcA2U=" ["num_for_nothing"]="Vw0="
} }
} }
}, },
@ -486,8 +486,8 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=15, ["id"]=6,
["id_for_nothing"]="Vw0=", ["id_for_nothing"]="UA==",
["num"]=1, ["num"]=1,
["num_for_nothing"]="Vw==" ["num_for_nothing"]="Vw=="
} }
@ -499,10 +499,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=47, ["id"]=17,
["id_for_nothing"]="Ug8=", ["id_for_nothing"]="Vw8=",
["num"]=12, ["num"]=1,
["num_for_nothing"]="Vwo=" ["num_for_nothing"]="Vw=="
} }
} }
}, },
@ -512,10 +512,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=1, ["id"]=5,
["id_for_nothing"]="Vw==", ["id_for_nothing"]="Uw==",
["num"]=50000, ["num"]=10,
["num_for_nothing"]="UwhcA2U=" ["num_for_nothing"]="Vwg="
} }
} }
}, },
@ -525,8 +525,8 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=18, ["id"]=6,
["id_for_nothing"]="VwA=", ["id_for_nothing"]="UA==",
["num"]=1, ["num"]=1,
["num_for_nothing"]="Vw==" ["num_for_nothing"]="Vw=="
} }
@ -538,10 +538,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=2, ["id"]=16,
["id_for_nothing"]="VA==", ["id_for_nothing"]="Vw4=",
["num"]=300, ["num"]=5,
["num_for_nothing"]="VQhc" ["num_for_nothing"]="Uw=="
} }
} }
}, },
@ -551,10 +551,10 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=1, ["id"]=41,
["id_for_nothing"]="Vw==", ["id_for_nothing"]="Ugk=",
["num"]=50000, ["num"]=15,
["num_for_nothing"]="UwhcA2U=" ["num_for_nothing"]="Vw0="
} }
} }
}, },
@ -564,8 +564,8 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=15, ["id"]=6,
["id_for_nothing"]="Vw0=", ["id_for_nothing"]="UA==",
["num"]=1, ["num"]=1,
["num_for_nothing"]="Vw==" ["num_for_nothing"]="Vw=="
} }
@ -577,15 +577,262 @@ local arena_gift = {
{ {
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=47, ["id"]=17,
["id_for_nothing"]="Ug8=", ["id_for_nothing"]="Vw8=",
["num"]=15, ["num"]=1,
["num_for_nothing"]="Vw0=" ["num_for_nothing"]="Vw=="
}
}
},
[46]={
["score"]=3200,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
}
},
[47]={
["score"]=3300,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
}
},
[48]={
["score"]=3400,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=16,
["id_for_nothing"]="Vw4=",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
[49]={
["score"]=3500,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=42,
["id_for_nothing"]="Ugo=",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
[50]={
["score"]=3600,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
}
},
[51]={
["score"]=3700,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=17,
["id_for_nothing"]="Vw8=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
}
},
[52]={
["score"]=3800,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
}
},
[53]={
["score"]=3900,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
}
},
[54]={
["score"]=4000,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=16,
["id_for_nothing"]="Vw4=",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
[55]={
["score"]=4100,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=42,
["id_for_nothing"]="Ugo=",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
[56]={
["score"]=4200,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
}
},
[57]={
["score"]=4300,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=17,
["id_for_nothing"]="Vw8=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
}
},
[58]={
["score"]=4400,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
}
},
[59]={
["score"]=4500,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
}
},
[60]={
["score"]=4600,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=16,
["id_for_nothing"]="Vw4=",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
[61]={
["score"]=4700,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=42,
["id_for_nothing"]="Ugo=",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
[62]={
["score"]=4800,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
}
},
[63]={
["score"]=4900,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
}
},
[64]={
["score"]=5000,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=17,
["id_for_nothing"]="Vw8=",
["num"]=1,
["num_for_nothing"]="Vw=="
} }
} }
} }
} }
local config = { local config = {
data=arena_gift,count=45 data=arena_gift,count=64
} }
return config return config

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -200,123 +200,123 @@ local fx = {
["bind"]="root" ["bind"]="root"
}, },
[100001]={ [100001]={
["res"]="sfx_m10001_b01", ["res"]="sfx_c1_m10001_01",
["bind"]="root" ["bind"]="root"
}, },
[100002]={ [100002]={
["res"]="sfx_m10001_b02", ["res"]="sfx_c1_m10001_02",
["bind"]="root" ["bind"]="root"
}, },
[100003]={ [100003]={
["res"]="sfx_m10001_b03", ["res"]="sfx_c1_m10001_03",
["bind"]="root" ["bind"]="root"
}, },
[100004]={ [100004]={
["res"]="sfx_m10002_b01", ["res"]="sfx_c1_m10002_01",
["bind"]="root" ["bind"]="root"
}, },
[100005]={ [100005]={
["res"]="sfx_m10002_b02", ["res"]="sfx_c1_m10002_02",
["bind"]="root" ["bind"]="root"
}, },
[100006]={ [100006]={
["res"]="sfx_m10002_b03", ["res"]="sfx_c1_m10002_03",
["bind"]="root" ["bind"]="root"
}, },
[100007]={ [100007]={
["res"]="sfx_m10003_b01", ["res"]="sfx_c1_m10003_01",
["bind"]="root" ["bind"]="root"
}, },
[100008]={ [100008]={
["res"]="sfx_m10003_b02", ["res"]="sfx_c1_m10003_02",
["bind"]="root" ["bind"]="root"
}, },
[100009]={ [100009]={
["res"]="sfx_m10003_b03", ["res"]="sfx_c1_m10003_03",
["bind"]="root" ["bind"]="root"
}, },
[100010]={ [100010]={
["res"]="sfx_m10004_b01", ["res"]="sfx_c1_m10004_01",
["bind"]="root" ["bind"]="root"
}, },
[100011]={ [100011]={
["res"]="sfx_m10004_b02", ["res"]="sfx_c1_m10004_02",
["bind"]="root" ["bind"]="root"
}, },
[100012]={ [100012]={
["res"]="sfx_m10004_b03", ["res"]="sfx_c1_m10004_03",
["bind"]="root" ["bind"]="root"
}, },
[100013]={ [100013]={
["res"]="sfx_m10005_b01", ["res"]="sfx_c1_m10005_01",
["bind"]="root" ["bind"]="root"
}, },
[100014]={ [100014]={
["res"]="sfx_m10009_b01", ["res"]="sfx_c1_m10005_02",
["bind"]="root" ["bind"]="root"
}, },
[100015]={ [100015]={
["res"]="sfx_m10009_b02", ["res"]="sfx_c1_m10005_03",
["bind"]="root" ["bind"]="root"
}, },
[100016]={ [100016]={
["res"]="sfx_m10009_b03", ["res"]="sfx_c1_m10006_01",
["bind"]="root" ["bind"]="root"
}, },
[100017]={ [100017]={
["res"]="sfx_m10010_b01", ["res"]="sfx_c1_m10006_02",
["bind"]="root" ["bind"]="root"
}, },
[100018]={ [100018]={
["res"]="sfx_m10010_b02", ["res"]="sfx_c1_m10006_03",
["bind"]="root" ["bind"]="root"
}, },
[100019]={ [100019]={
["res"]="sfx_m10010_b03", ["res"]="sfx_c1_m10007_01",
["bind"]="root" ["bind"]="root"
}, },
[100020]={ [100020]={
["res"]="sfx_m10012_b01", ["res"]="sfx_c1_m10007_02",
["bind"]="root" ["bind"]="root"
}, },
[100021]={ [100021]={
["res"]="sfx_m10012_b02", ["res"]="sfx_c1_m10007_03",
["bind"]="root" ["bind"]="root"
}, },
[100022]={ [100022]={
["res"]="sfx_m10013_b01", ["res"]="sfx_c1_m10008_01",
["bind"]="root" ["bind"]="root"
}, },
[100023]={ [100023]={
["res"]="sfx_m10013_b02", ["res"]="sfx_c1_m10008_02",
["bind"]="root" ["bind"]="root"
}, },
[100024]={ [100024]={
["res"]="sfx_m10014_b01", ["res"]="sfx_c1_m10008_03",
["bind"]="root" ["bind"]="root"
}, },
[100025]={ [100025]={
["res"]="sfx_m10014_b02", ["res"]="sfx_c1_m10009_01",
["bind"]="root" ["bind"]="root"
}, },
[100026]={ [100026]={
["res"]="sfx_m10015_b01", ["res"]="sfx_c1_m10009_02",
["bind"]="root" ["bind"]="root"
}, },
[100027]={ [100027]={
["res"]="sfx_m10015_b02", ["res"]="sfx_c1_m10009_03",
["bind"]="root" ["bind"]="root"
}, },
[100028]={ [100028]={
["res"]="sfx_m10016_b01", ["res"]="sfx_c1_m10012_01",
["bind"]="root" ["bind"]="root"
}, },
[100029]={ [100029]={
["res"]="sfx_m10016_b02", ["res"]="sfx_c1_m10012_02",
["bind"]="root" ["bind"]="root"
}, },
[100030]={ [100030]={
["res"]="sfx_m10016_b03", ["res"]="sfx_c1_m10012_03",
["bind"]="root" ["bind"]="root"
}, },
[100031]={ [100031]={
@ -1668,7 +1668,7 @@ local fx = {
["bind"]="root" ["bind"]="root"
}, },
[300023]={ [300023]={
["res"]="sfx_c1_p25002_04", ["res"]="sfx_c1_p25002_05",
["bind"]="root" ["bind"]="root"
}, },
[300024]={ [300024]={
@ -1692,63 +1692,83 @@ local fx = {
["bind"]="root" ["bind"]="root"
}, },
[300029]={ [300029]={
["res"]="sfx_c1_p53001_01", ["res"]="sfx_c1_p55001_01",
["bind"]="root" ["bind"]="root"
}, },
[300030]={ [300030]={
["res"]="sfx_c1_p53001_02", ["res"]="sfx_c1_p55001_02",
["bind"]="root" ["bind"]="root"
}, },
[300031]={ [300031]={
["res"]="sfx_c1_p53001_03", ["res"]="sfx_c1_p55001_03",
["bind"]="root" ["bind"]="root"
}, },
[300032]={ [300032]={
["res"]="sfx_c1_p53001_04", ["res"]="sfx_c1_p55001_04",
["bind"]="root" ["bind"]="root"
}, },
[300033]={ [300033]={
["res"]="sfx_c1_p53001_05", ["res"]="sfx_c1_p55001_05",
["bind"]="root"
},
[300034]={
["res"]="sfx_c1_p14001_01",
["bind"]="root"
},
[300035]={
["res"]="sfx_c1_p14001_02",
["bind"]="root"
},
[300036]={
["res"]="sfx_c1_p14001_03",
["bind"]="root"
},
[300037]={
["res"]="sfx_c1_p14001_04",
["bind"]="root"
},
[300038]={
["res"]="sfx_c1_p14001_05",
["bind"]="root" ["bind"]="root"
}, },
[300039]={ [300039]={
["res"]="sfx_p0009_b05", ["res"]="sfx_c1_p15001_01",
["bind"]="root" ["bind"]="root"
}, },
[300040]={ [300040]={
["res"]="sfx_p0010_b01", ["res"]="sfx_c1_p15001_02",
["bind"]="root" ["bind"]="root"
}, },
[300041]={ [300041]={
["res"]="sfx_p0010_b02", ["res"]="sfx_c1_p15001_03",
["bind"]="root" ["bind"]="root"
}, },
[300042]={ [300042]={
["res"]="sfx_p0010_b03", ["res"]="sfx_c1_p15001_04",
["bind"]="root" ["bind"]="root"
}, },
[300043]={ [300043]={
["res"]="sfx_p0010_b04", ["res"]="sfx_c1_p15001_05",
["bind"]="root" ["bind"]="root"
}, },
[300044]={ [300044]={
["res"]="sfx_p0010_b05", ["res"]="sfx_c1_p16001_01",
["bind"]="root" ["bind"]="root"
}, },
[300045]={ [300045]={
["res"]="sfx_p0011_b01", ["res"]="sfx_c1_p16001_02",
["bind"]="root" ["bind"]="root"
}, },
[300046]={ [300046]={
["res"]="sfx_p0011_b02", ["res"]="sfx_c1_p16001_03",
["bind"]="root" ["bind"]="root"
}, },
[300047]={ [300047]={
["res"]="sfx_p0011_b03", ["res"]="sfx_c1_p16001_04",
["bind"]="root" ["bind"]="root"
}, },
[300048]={ [300048]={
["res"]="sfx_p0011_b04", ["res"]="sfx_c1_p16001_05",
["bind"]="root" ["bind"]="root"
}, },
[300049]={ [300049]={
@ -3257,6 +3277,6 @@ local fx = {
} }
} }
local config = { local config = {
data=fx,count=761 data=fx,count=766
} }
return config return config

View File

@ -131,6 +131,894 @@ local item = {
["qlt"]=4, ["qlt"]=4,
["icon"]="20" ["icon"]="20"
}, },
[21]={
["type"]=6,
["qlt"]=2,
["icon"]="21",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[22]={
["type"]=6,
["qlt"]=2,
["icon"]="22",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[23]={
["type"]=6,
["qlt"]=3,
["icon"]="23",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[24]={
["type"]=6,
["qlt"]=3,
["icon"]="24",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[25]={
["type"]=6,
["qlt"]=3,
["icon"]="25",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[26]={
["type"]=6,
["qlt"]=4,
["icon"]="26",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[27]={
["type"]=6,
["qlt"]=4,
["icon"]="27",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[28]={
["type"]=6,
["qlt"]=4,
["icon"]="28",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[29]={
["type"]=6,
["qlt"]=4,
["icon"]="29",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[30]={
["type"]=6,
["qlt"]=5,
["icon"]="30",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[31]={
["type"]=6,
["qlt"]=5,
["icon"]="31",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[32]={
["type"]=6,
["qlt"]=5,
["icon"]="32",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[33]={
["type"]=6,
["qlt"]=5,
["icon"]="33",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[34]={
["type"]=6,
["qlt"]=5,
["icon"]="34",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[35]={
["type"]=6,
["qlt"]=6,
["icon"]="35",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[36]={
["type"]=6,
["qlt"]=6,
["icon"]="36",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[37]={
["type"]=6,
["qlt"]=6,
["icon"]="37",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[38]={
["type"]=6,
["qlt"]=6,
["icon"]="38",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[39]={
["type"]=6,
["qlt"]=6,
["icon"]="39",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[40]={
["type"]=6,
["qlt"]=4,
["icon"]="40",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[41]={
["type"]=6,
["qlt"]=5,
["icon"]="41",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[42]={
["type"]=6,
["qlt"]=5,
["icon"]="42",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[43]={
["type"]=6,
["qlt"]=5,
["icon"]="43",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[44]={
["type"]=6,
["qlt"]=5,
["icon"]="44",
["box_drop"]={
{
["type"]=1,
["id"]=9,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=10,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=11,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=12,
["num"]=1,
["weight"]=100
},
{
["type"]=1,
["id"]=13,
["num"]=1,
["weight"]=100
}
}
},
[13001]={ [13001]={
["type"]=5, ["type"]=5,
["parameter"]=13001, ["parameter"]=13001,
@ -265,6 +1153,6 @@ local item = {
} }
} }
local config = { local config = {
data=item,count=42 data=item,count=66
} }
return config return config

View File

@ -95,42 +95,42 @@ local monster_base = {
["model_ui"]=1.0 ["model_ui"]=1.0
}, },
[20001]={ [20001]={
["model_id"]="m10001", ["model_id"]="m20001",
["body"]=1, ["body"]=1,
["model_ui"]=1.0 ["model_ui"]=1.0
}, },
[20002]={ [20002]={
["model_id"]="m10002", ["model_id"]="m20002",
["body"]=1, ["body"]=1,
["model_ui"]=1.0 ["model_ui"]=1.0
}, },
[20003]={ [20003]={
["model_id"]="m10003", ["model_id"]="m20003",
["body"]=1, ["body"]=1,
["model_ui"]=1.0 ["model_ui"]=1.0
}, },
[20004]={ [20004]={
["model_id"]="m10004", ["model_id"]="m20004",
["body"]=1, ["body"]=1,
["model_ui"]=1.0 ["model_ui"]=1.0
}, },
[20005]={ [20005]={
["model_id"]="m10005", ["model_id"]="m20005",
["body"]=1, ["body"]=1,
["model_ui"]=1.0 ["model_ui"]=1.0
}, },
[20006]={ [20006]={
["model_id"]="m10006", ["model_id"]="m20006",
["body"]=1, ["body"]=1,
["model_ui"]=1.0 ["model_ui"]=1.0
}, },
[20007]={ [20007]={
["model_id"]="m10007", ["model_id"]="m20007",
["body"]=1, ["body"]=1,
["model_ui"]=1.0 ["model_ui"]=1.0
}, },
[20008]={ [20008]={
["model_id"]="m10008", ["model_id"]="m20008",
["body"]=1, ["body"]=1,
["model_ui"]=1.0 ["model_ui"]=1.0
}, },

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,8 @@ local talent = {
["type"]="atk_all", ["type"]="atk_all",
["num"]=200000 ["num"]=200000
} }
} },
["icon"]="talent_1"
}, },
[2]={ [2]={
["qlt"]=1, ["qlt"]=1,
@ -15,7 +16,8 @@ local talent = {
["type"]="attr_hp_all", ["type"]="attr_hp_all",
["num"]=600000 ["num"]=600000
} }
} },
["icon"]="talent_2"
}, },
[3]={ [3]={
["qlt"]=1, ["qlt"]=1,
@ -24,7 +26,8 @@ local talent = {
["type"]="attr_dmgdec_all", ["type"]="attr_dmgdec_all",
["num"]=20000 ["num"]=20000
} }
} },
["icon"]="talent_3"
}, },
[4]={ [4]={
["qlt"]=2, ["qlt"]=2,
@ -33,7 +36,8 @@ local talent = {
["type"]="atk_all", ["type"]="atk_all",
["num"]=300000 ["num"]=300000
} }
} },
["icon"]="talent_4"
}, },
[5]={ [5]={
["qlt"]=2, ["qlt"]=2,
@ -42,7 +46,8 @@ local talent = {
["type"]="attr_hp_all", ["type"]="attr_hp_all",
["num"]=900000 ["num"]=900000
} }
} },
["icon"]="talent_5"
}, },
[6]={ [6]={
["qlt"]=2, ["qlt"]=2,
@ -51,7 +56,8 @@ local talent = {
["type"]="attr_dmgdec_all", ["type"]="attr_dmgdec_all",
["num"]=30000 ["num"]=30000
} }
} },
["icon"]="talent_6"
}, },
[7]={ [7]={
["qlt"]=2, ["qlt"]=2,
@ -60,7 +66,8 @@ local talent = {
["type"]="attr_crit_all", ["type"]="attr_crit_all",
["num"]=100 ["num"]=100
} }
} },
["icon"]="talent_7"
}, },
[8]={ [8]={
["qlt"]=2, ["qlt"]=2,
@ -69,27 +76,32 @@ local talent = {
["type"]="attr_crit_time_all", ["type"]="attr_crit_time_all",
["num"]=500 ["num"]=500
} }
} },
["icon"]="talent_8"
}, },
[9]={ [9]={
["qlt"]=3, ["qlt"]=3,
["value"]=1, ["value"]=1,
["fight"]=1000 ["fight"]=1000,
["icon"]="talent_9"
}, },
[10]={ [10]={
["qlt"]=3, ["qlt"]=3,
["value"]=500000, ["value"]=500000,
["fight"]=500 ["fight"]=500,
["icon"]="talent_10"
}, },
[11]={ [11]={
["qlt"]=3, ["qlt"]=3,
["value"]=1, ["value"]=1,
["fight"]=1000 ["fight"]=1000,
["icon"]="talent_11"
}, },
[12]={ [12]={
["qlt"]=3, ["qlt"]=3,
["value"]=500, ["value"]=500,
["fight"]=1000 ["fight"]=1000,
["icon"]="talent_12"
}, },
[13]={ [13]={
["qlt"]=3, ["qlt"]=3,
@ -98,7 +110,8 @@ local talent = {
["type"]="attr_normal_hurtp_all", ["type"]="attr_normal_hurtp_all",
["num"]=500 ["num"]=500
} }
} },
["icon"]="talent_13"
}, },
[14]={ [14]={
["qlt"]=3, ["qlt"]=3,
@ -107,7 +120,8 @@ local talent = {
["type"]="attr_skill_hurtp_all", ["type"]="attr_skill_hurtp_all",
["num"]=500 ["num"]=500
} }
} },
["icon"]="talent_14"
}, },
[15]={ [15]={
["qlt"]=3, ["qlt"]=3,
@ -116,12 +130,14 @@ local talent = {
["type"]="attr_atkp_all", ["type"]="attr_atkp_all",
["num"]=500 ["num"]=500
} }
} },
["icon"]="talent_15"
}, },
[16]={ [16]={
["qlt"]=3, ["qlt"]=3,
["value"]=1000, ["value"]=1000,
["fight"]=1000 ["fight"]=1000,
["icon"]="talent_16"
} }
} }
local config = { local config = {

View File

@ -1977,4 +1977,35 @@ function GFunc.getFinalAttrValue(allAttrs, fixedId, factorId)
end end
end end
---- 返回一个显示等间距但是数值不等间距的sliderValue
-- defaultValue 值代表第一段少了平均每段的值
function GFunc.getUnevenSliderValue(list, value, defaultValue)
local count = #list
if count <= 0 then
return 0
end
local pervalue = 1 / (count - (defaultValue or 0))
local firstValue = 1 / (defaultValue or 1)
local per = 0
local pervalue2 = 0
for index, v in ipairs(list) do
if index == 1 then
pervalue2 = pervalue / firstValue
else
pervalue2 = pervalue
end
if v <= value then
per = per + pervalue2
else
local before = list[index - 1]
if not before then
before = 0
end
per = per + (value - before) / math.max((v - before), 1) * pervalue2
break
end
end
return per
end
return GFunc return GFunc

View File

@ -1,5 +1,11 @@
local TaskConst = {} local TaskConst = {}
-- 周期类型
TaskConst.ROUTINE_TYPE = {
DAILY = 1,
ACHIEVEMENT = 2,
}
TaskConst.TASK_TYPE = { TaskConst.TASK_TYPE = {
X_WATCH_AD = 1, X_WATCH_AD = 1,
X_GOLD_GOT = 2, X_GOLD_GOT = 2,

View File

@ -132,9 +132,6 @@ function TaskManager:addTaskProgress(type, ...)
end end
function TaskManager:dispatchTask(type, count) function TaskManager:dispatchTask(type, count)
if DataManager.DailyTaskData:getIfCanReset() then -- 跨天了
ModuleManager.TaskManager:resetDailyTask()
end
if not self.registerTaskInfo then if not self.registerTaskInfo then
return return
end end
@ -149,6 +146,29 @@ function TaskManager:dispatchTask(type, count)
end end
end end
--@region 成就
function TaskManager:onTaskAchievementReq(taskId, stage)
stage = stage - 1-- 服务器从0开始
-- 一键领取处理
taskId = nil
stage = nil
self:sendMessage(ProtoMsgType.FromMsgEnum.TaskAchievementReq, {task_id = taskId, stage = stage}, {}, self.onTaskAchievementRsp, BIReport.ITEM_GET_TYPE.TASK_ACHIEVEMENT)
end
function TaskManager:onTaskAchievementRsp(result)
if result.err_code ~= GConst.ERROR_STR.SUCCESS then
return
end
GFunc.showRewardBox(result.rewards)
if result.reqData.task_id and result.reqData.stage then
DataManager.DailyTaskData:onAchievementClaimed(result.reqData.task_id, result.reqData.stage + 1)
else
DataManager.DailyTaskData:onAchievementClaimed()
end
BIReport:postTaskAchievementOpt(result.reqData.task_id, result.reqData.stage, result.rewards)
end
--@endregion
------------------------------------------------------ 处理任务 ------------------------------------------------------ ------------------------------------------------------ 处理任务 ------------------------------------------------------
function TaskManager:xKillMonster(count) function TaskManager:xKillMonster(count)
self:dispatchTask(GConst.TaskConst.TASK_TYPE.X_KILL_MONSTER, count) self:dispatchTask(GConst.TaskConst.TASK_TYPE.X_KILL_MONSTER, count)

View File

@ -3,142 +3,133 @@ local ArenaGradingRewardCell = class("ArenaGradingRewardCell", BaseCell)
-- 光效 -- 光效
local EFFECT_LIGHT = "assets/prefabs/effects/ui/vfx_ui_arena_gift_b01.prefab" local EFFECT_LIGHT = "assets/prefabs/effects/ui/vfx_ui_arena_gift_b01.prefab"
local COMMON_GRADING_POSY = 265 local COMMON_GRADING_POSY = 242
local UNLOCK_GRADING_POSY = 375 local UNLOCK_GRADING_POSY = 346
function ArenaGradingRewardCell:init() function ArenaGradingRewardCell:init()
local uiMap = self:getUIMap() local uiMap = self:getUIMap()
-- 段位spine -- 段位spine
self.gradingNode = uiMap["arena_grading_reward_cell.grading"] self.gradingNode = uiMap["arena_grading_reward_cell.grading"]
self.spineGradingRoot = uiMap["arena_grading_reward_cell.grading.spine_root"] self.spineGradingRoot = uiMap["arena_grading_reward_cell.grading.spine_root"]
self.txGrading = uiMap["arena_grading_reward_cell.grading.tx_grading"] self.txGrading = uiMap["arena_grading_reward_cell.grading.tx_grading"]
-- 进度 -- 进度
self.progress = uiMap["arena_grading_reward_cell.progress"] self.progress = uiMap["arena_grading_reward_cell.progress"]
self.imgProgCur = uiMap["arena_grading_reward_cell.progress.img_prog_cur"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER) self.imgProgCur = uiMap["arena_grading_reward_cell.progress.img_prog_cur"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
self.imgProgMax = uiMap["arena_grading_reward_cell.progress.img_prog_max"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER) self.imgProgMax = uiMap["arena_grading_reward_cell.progress.img_prog_max"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
self.txGradingValue = uiMap["arena_grading_reward_cell.progress.tx_value"] self.txGradingValue = uiMap["arena_grading_reward_cell.progress.tx_value"]
-- 游标 -- 游标
self.tagProg = uiMap["arena_grading_reward_cell.cur_prog"] self.tagProg = uiMap["arena_grading_reward_cell.cur_prog"]
self.txTag = uiMap["arena_grading_reward_cell.cur_prog.tx_tag"] self.txTag = uiMap["arena_grading_reward_cell.cur_prog.tx_tag"]
-- 通用奖励 -- 通用奖励
self.commonReward = uiMap["arena_grading_reward_cell.common_reward"] self.commonReward = uiMap["arena_grading_reward_cell.common_reward"]
self.txDesc = uiMap["arena_grading_reward_cell.common_reward.tx_desc"] self.txDesc = uiMap["arena_grading_reward_cell.common_reward.tx_desc"]
self.maskReward = uiMap["arena_grading_reward_cell.common_reward.mask"] self.maskReward = uiMap["arena_grading_reward_cell.common_reward.mask"]
self.rootEffect = uiMap["arena_grading_reward_cell.common_reward.root_effect"] self.rootEffect = uiMap["arena_grading_reward_cell.common_reward.root_effect"]
self.rewards = {} self.rewards = {}
for i = 1, 4 do for i = 1, 4 do
table.insert(self.rewards, uiMap["arena_grading_reward_cell.common_reward.rewards.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)) table.insert(self.rewards, uiMap["arena_grading_reward_cell.common_reward.rewards.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL))
end end
-- 英雄解锁
self.heroUnlock = uiMap["arena_grading_reward_cell.hero_unlock"]
self.txUnlock = uiMap["arena_grading_reward_cell.hero_unlock.tx_unlock"]
self.heroList = uiMap["arena_grading_reward_cell.hero_unlock.hero_list"]
self.heros = {}
for i = 1, 6 do
table.insert(self.heros, uiMap["arena_grading_reward_cell.hero_unlock.hero_list.item_hero_" .. i])
end
self.commonReward:addClickListener(function() self.commonReward:addClickListener(function()
if DataManager.ArenaData:canGetGradingReward(self.id) and not DataManager.ArenaData:isReceivedGradingReward(self.id) then if DataManager.ArenaData:canGetGradingReward(self.id) and not DataManager.ArenaData:isReceivedGradingReward(self.id) then
ModuleManager.ArenaManager:reqGradingReward(self.id) ModuleManager.ArenaManager:reqGradingReward(self.id)
end end
end) end)
end end
function ArenaGradingRewardCell:setUI(root) function ArenaGradingRewardCell:setUI(root)
self.uiRoot = root self.uiRoot = root
end end
function ArenaGradingRewardCell:refresh(id) function ArenaGradingRewardCell:refresh(id)
self.id = id self.id = id
local cfg = DataManager.ArenaData:getGradingRewardCfg()[self.id] local cfg = DataManager.ArenaData:getGradingRewardCfg()[self.id]
local curPoint = DataManager.ArenaData:getScore() local curPoint = DataManager.ArenaData:getScore()
local maxPoint = DataManager.ArenaData:getMaxScore() local maxPoint = DataManager.ArenaData:getMaxScore()
local curProg = DataManager.ArenaData:getGradingRewardProgressByScore(self.id, curPoint) local curProg = DataManager.ArenaData:getGradingRewardProgressByScore(self.id, curPoint)
local maxProg = DataManager.ArenaData:getGradingRewardProgressByScore(self.id, maxPoint) local maxProg = DataManager.ArenaData:getGradingRewardProgressByScore(self.id, maxPoint)
-- Logger.logHighlight(id.."当前进度:"..cfg.score.."/" .. curProg .."/"..maxProg) -- Logger.logHighlight(id.."当前进度:"..cfg.score.."/" .. curProg .."/"..maxProg)
self.spineGradingRoot:removeAllChildren() -- self.spineGradingRoot:removeAllChildren()
local gradingId = DataManager.ArenaData:getGradingIdFromScore(cfg.score) local gradingId = DataManager.ArenaData:getGradingIdFromScore(cfg.score)
SpineManager:loadUISpineWidgetAsync(DataManager.ArenaData:getGradingIconName(gradingId).."_spine", self.spineGradingRoot, function(spineObject) -- SpineManager:loadUISpineWidgetAsync(DataManager.ArenaData:getGradingIconName(gradingId).."_spine", self.spineGradingRoot, function(spineObject)
spineObject:setSkin(DataManager.ArenaData:getGradingNumName(gradingId)) -- spineObject:setSkin(DataManager.ArenaData:getGradingNumName(gradingId))
spineObject:playAnim("idle", true) -- spineObject:playAnim("idle", true)
end) -- end)
self.txGrading:setText(DataManager.ArenaData:getGradingName(gradingId)) self.txGrading:setText(DataManager.ArenaData:getGradingName(gradingId))
self.baseObject:setSizeDeltaY(DataManager.ArenaData:getGradingRewardItemHeight(self.id)) self.baseObject:setSizeDeltaY(DataManager.ArenaData:getGradingRewardItemHeight(self.id))
if DataManager.ArenaData:isGradingMin(self.id) then if DataManager.ArenaData:isGradingMin(self.id) then
self.gradingNode:setActive(true) self.gradingNode:setActive(true)
self.gradingNode:setAnchoredPositionY(COMMON_GRADING_POSY) self.gradingNode:setAnchoredPositionY(COMMON_GRADING_POSY)
else else
self.gradingNode:setActive(false) self.gradingNode:setActive(false)
end end
self.heroUnlock:setActive(false)
local minScore = DataManager.ArenaData:getSeasonGradingMinScore() local minScore = DataManager.ArenaData:getSeasonGradingMinScore()
self.txTag:setText(curPoint - minScore) self.txTag:setText(curPoint - minScore)
self.txGradingValue:setText(cfg.score - minScore) self.txGradingValue:setText(cfg.score - minScore)
self.imgProgCur.value = curProg self.imgProgCur.value = curProg
self.imgProgMax.value = maxProg self.imgProgMax.value = maxProg
if DataManager.ArenaData:getCurGradingRewardId() == self.id then if DataManager.ArenaData:getCurGradingRewardId() == self.id then
self.tagProg:setVisible(true) self.tagProg:setVisible(true)
local rootHeight = self.baseObject:fastGetSizeDeltaY() local rootHeight = self.baseObject:fastGetSizeDeltaY()
local posY = rootHeight * curProg local posY = rootHeight * curProg
-- 高度超框处理 -- 高度超框处理
if self.id == 1 or self.id == #DataManager.ArenaData:getGradingRewardCfg() then if self.id == 1 or self.id == #DataManager.ArenaData:getGradingRewardCfg() then
local tagHeight = self.tagProg:fastGetSizeDeltaY() local tagHeight = self.tagProg:fastGetSizeDeltaY()
if posY < tagHeight / 2 then if posY < tagHeight / 2 then
posY = tagHeight / 2 posY = tagHeight / 2
end end
end end
self.tagProg:setAnchoredPositionY(posY) self.tagProg:setAnchoredPositionY(posY)
self.baseObject:getTransform():SetAsLastSibling() self.baseObject:getTransform():SetAsLastSibling()
else else
self.tagProg:setVisible(false) self.tagProg:setVisible(false)
end end
local canGet = DataManager.ArenaData:canGetGradingReward(self.id) local canGet = DataManager.ArenaData:canGetGradingReward(self.id)
local isReceived = DataManager.ArenaData:isReceivedGradingReward(self.id) local isReceived = DataManager.ArenaData:isReceivedGradingReward(self.id)
self.maskReward:setVisible(not canGet) self.maskReward:setVisible(not canGet)
if canGet then if canGet then
if isReceived then if isReceived then
self.txDesc:setText(I18N:getGlobalText(I18N.GlobalConst.COLLECTION_DESC_5)) self.txDesc:setText(I18N:getGlobalText(I18N.GlobalConst.COLLECTION_DESC_5))
else else
self.txDesc:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_42)) self.txDesc:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_42))
end end
else else
self.txDesc:setText(I18N:getGlobalText(I18N.GlobalConst.COLLECTION_DESC_6)) self.txDesc:setText(I18N:getGlobalText(I18N.GlobalConst.COLLECTION_DESC_6))
end end
self.rootEffect:removeAllChildren() self.rootEffect:removeAllChildren()
if canGet and not isReceived then if canGet and not isReceived then
EffectManager:loadUIEffectAsync(EFFECT_LIGHT, self.uiRoot, self.rootEffect, GConst.UI_EFFECT_ORDER.LEVEL5, function(obj) -- EffectManager:loadUIEffectAsync(EFFECT_LIGHT, self.uiRoot, self.rootEffect, GConst.UI_EFFECT_ORDER.LEVEL5, function(obj)
obj:setAnchoredPosition(0, 0) -- obj:setAnchoredPosition(0, 0)
obj:play() -- obj:play()
end) -- end)
end end
for idx, reward in ipairs(self.rewards) do for idx, reward in ipairs(self.rewards) do
if cfg.reward[idx] then if cfg.reward[idx] then
reward:addClickListener(nil) reward:addClickListener(nil)
reward:setVisible(true) reward:setVisible(true)
reward:refreshByConfig(cfg.reward[idx], isReceived, isReceived) reward:refreshByConfig(cfg.reward[idx], isReceived, isReceived)
reward:showLight(canGet and not isReceived, self.uiRoot) reward:showLight(canGet and not isReceived, self.uiRoot)
if canGet and not isReceived then if canGet and not isReceived then
reward:addClickListener(function() reward:addClickListener(function()
if DataManager.ArenaData:canGetGradingReward(self.id) and not DataManager.ArenaData:isReceivedGradingReward(self.id) then if DataManager.ArenaData:canGetGradingReward(self.id) and not DataManager.ArenaData:isReceivedGradingReward(self.id) then
ModuleManager.ArenaManager:reqGradingReward(self.id) ModuleManager.ArenaManager:reqGradingReward(self.id)
end end
end) end)
end end
else else
reward:setVisible(false) reward:setVisible(false)
end end
end end
end end
return ArenaGradingRewardCell return ArenaGradingRewardCell

View File

@ -145,8 +145,7 @@ function MainComp:init()
self:refresh() self:refresh()
end) end)
self.leftBtn:addClickListener(function() self.leftBtn:addClickListener(function()
-- GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.CHAPTER_DESC_2)) ModuleManager.IdleManager:showIdleDropUI()
GFunc.showToast("游历")
end) end)
self.rightBtn:addClickListener(function() self.rightBtn:addClickListener(function()
GFunc.showToast("限时祈愿") GFunc.showToast("限时祈愿")

View File

@ -787,7 +787,7 @@ function MainCityUI:refreshTask()
return return
end end
self.taskBtn:setVisible(true) self.taskBtn:setVisible(true)
local showRedPoint = DataManager.DailyTaskData:getIsShowRedPoint() local showRedPoint = DataManager.DailyTaskData:showRedPoint()
if showRedPoint then if showRedPoint then
self.taskBtn:addRedPoint(38, 34, 0.7) self.taskBtn:addRedPoint(38, 34, 0.7)
else else

View File

@ -10,7 +10,6 @@ function PopHeroCell:init()
self.progressTx = uiMap["pop_hero_cell.progress_bg.progress_tx"] self.progressTx = uiMap["pop_hero_cell.progress_bg.progress_tx"]
self.lvUpArrow = uiMap["pop_hero_cell.effect_node.ui_spine_obj"] self.lvUpArrow = uiMap["pop_hero_cell.effect_node.ui_spine_obj"]
self.fragmenImg = uiMap["pop_hero_cell.progress_bg.fragment_img"] self.fragmenImg = uiMap["pop_hero_cell.progress_bg.fragment_img"]
self.sImg = uiMap["pop_hero_cell.s"]
self.newBg = uiMap["pop_hero_cell.new_bg"] self.newBg = uiMap["pop_hero_cell.new_bg"]
self.newTx = uiMap["pop_hero_cell.new_bg.text"] self.newTx = uiMap["pop_hero_cell.new_bg.text"]
self.numTx = uiMap["pop_hero_cell.num_tx"] self.numTx = uiMap["pop_hero_cell.num_tx"]
@ -91,7 +90,6 @@ function PopHeroCell:_refresh(heroInfo)
self.bg:setSprite(GConst.ATLAS_PATH.ICON_ITEM, GConst.FRAME_QLT[heroInfo.qlt]) self.bg:setSprite(GConst.ATLAS_PATH.ICON_ITEM, GConst.FRAME_QLT[heroInfo.qlt])
self.icon:setSprite(GConst.ATLAS_PATH.ICON_HERO, tostring(heroInfo.icon)) self.icon:setSprite(GConst.ATLAS_PATH.ICON_HERO, tostring(heroInfo.icon))
self.matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[heroInfo.position]) self.matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[heroInfo.position])
self.sImg:setVisible(heroInfo.qlt >= 4)
end end
function PopHeroCell:addClickListener(callback) function PopHeroCell:addClickListener(callback)

View File

@ -0,0 +1,73 @@
local AchievementTaskCell = class("AchievementTaskCell", BaseCell)
function AchievementTaskCell:init()
local uiMap = self.baseObject:genAllChildren()
self.nameTx = uiMap["achievement_cell.name_tx"]
self.progress = uiMap["achievement_cell.progress_bg.progress"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
self.progressTx = uiMap["achievement_cell.progress_bg.progress_tx"]
self.getBtn = uiMap["achievement_cell.get_btn"]
self.getBtnTx = uiMap["achievement_cell.get_btn.text"]
self.progressBg = uiMap["achievement_cell.progress_bg"]
self.rewardCells = {}
for i = 1, 3 do
self.rewardCells[i] = CellManager:addCellComp(uiMap["achievement_cell.reward_cell_" .. i], GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
end
self.getBtn:addClickListener(function()
if DataManager.DailyTaskData:canClaimAchievement(self.taskId, self.taskStage) then
ModuleManager.TaskManager:onTaskAchievementReq(self.taskId, self.taskStage)
else
-- ModuleManager.TaskManager:goToTask(self.taskType)
ModuleManager.TaskManager:onTaskAchievementReq(self.taskId, self.taskStage)
end
end)
end
function AchievementTaskCell:refresh(taskId)
self.taskId = taskId
self.taskType = DataManager.DailyTaskData:getTaskTypeByAchievementId(self.taskId)
self.taskStage = DataManager.DailyTaskData:getAchievementStage(self.taskId)
local taskTarget = DataManager.DailyTaskData:getAchievementCondition(self.taskId, self.taskStage)
local taskProg = DataManager.DailyTaskData:getAchievementProg(self.taskId)
taskProg = taskProg > taskTarget and taskTarget or taskProg
self.progress.value = taskProg / taskTarget
self.progressTx:setText(taskProg.."/"..taskTarget)
local rewards = {DataManager.DailyTaskData:getAchievementReward(self.taskId, self.taskStage)}
for i = 1, 3 do
if rewards[i] then
self.rewardCells[i]:setActive(true)
self.rewardCells[i]:refreshByConfig(rewards[i])
else
self.rewardCells[i]:setActive(false)
end
end
if DataManager.DailyTaskData:isAchievementReceived(self.taskId, self.taskStage) then
-- 已完成
-- self.mask:setActive(true)
self.getBtn:setTouchEnable(false)
self.getBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_DONE))
self.getBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_grey_1")
-- self.nameTx:setText("<color=#574A40>" .. GFunc.getTaskDesc(self.taskType, taskTarget) .. "</color>")
self.nameTx:setText(GFunc.getTaskDesc(self.taskType, taskTarget))
else
-- 未完成 or 可领取
-- self.mask:setActive(false)
self.getBtn:setTouchEnable(true)
-- self.nameTx:setText("<color=#5C3A2D>" .. GFunc.getTaskDesc(self.taskType, taskTarget) .. "</color>")
self.nameTx:setText(GFunc.getTaskDesc(self.taskType, taskTarget))
if DataManager.DailyTaskData:isAchievementFinished(self.taskId, self.taskStage) then
self.getBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_CLAIM))
self.getBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_blue_1")
else
self.getBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_21))
self.getBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_yellow_1")
end
end
end
return AchievementTaskCell

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: f40fcf9dd2dca4562a70efd453825092
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -5,115 +5,56 @@ function DailyTaskCell:init()
self.icon = uiMap["task_cell.icon"] self.icon = uiMap["task_cell.icon"]
self.nameTx = uiMap["task_cell.name_tx"] self.nameTx = uiMap["task_cell.name_tx"]
self.progressBg = uiMap["task_cell.progress_bg"] self.progressBg = uiMap["task_cell.progress_bg"]
self.progress = uiMap["task_cell.progress_bg.progress"] self.progress = uiMap["task_cell.progress_bg.progress"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
self.progressTx = uiMap["task_cell.progress_bg.progress_tx"] self.progressTx = uiMap["task_cell.progress_bg.progress_tx"]
self.getBtnRoot = uiMap["task_cell.get_btn"] self.pointTx = uiMap["task_cell.point_tx"]
local getBtn = uiMap["task_cell.get_btn.btn"] self.getBtn = uiMap["task_cell.get_btn"]
getBtn:addClickListener(function() self.getBtnTx = uiMap["task_cell.get_btn.text"]
if self.taskId then self.getBtn:addClickListener(function()
ModuleManager.TaskManager:claimDailyTask(self.taskId) if DataManager.DailyTaskData:canClaimTask(self.taskId) then
end ModuleManager.TaskManager:claimDailyTask(self.taskId)
else
-- ModuleManager.TaskManager:goToTask(self.taskType)
end
end) end)
self.getBtnTx = uiMap["task_cell.get_btn.btn.text"]
self.getBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_CLAIM))
self.refreshBtnRoot = uiMap["task_cell.refresh_btn"]
local refreshBtn = uiMap["task_cell.refresh_btn.btn"]
refreshBtn:addClickListener(function()
if self.taskId then
ModuleManager.TaskManager:refreshDailyTask(self.taskId)
end
end)
self.adBtnRoot = uiMap["task_cell.ad_btn"]
local adBtn = uiMap["task_cell.ad_btn.btn"]
adBtn:addClickListener(function()
if self.taskId then
ModuleManager.TaskManager:watchTaskSpecialAd()
end
end)
self.refreshBtnTx = uiMap["task_cell.refresh_btn.btn.text"]
self.refreshBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.STR_REFRESH))
self.rewardCellComp = uiMap["task_cell.reward_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
self.lockNode = uiMap["task_cell.lock_node"]
self.lockBg = uiMap["task_cell.lock_bg"]
local lockBtn = uiMap["task_cell.lock_node.lock_btn.btn"]
lockBtn:addClickListener(function()
if DataManager.BountyData:getIsOpen() then
DataManager.BountyData:clearPopBought()
ModuleManager.BountyManager:showBountyMainUI()
end
end)
local lockBtnTx = uiMap["task_cell.lock_node.lock_btn.btn.text"]
lockBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.STR_UNLOCK))
local lockTx = uiMap["task_cell.lock_node.lock_tx"]
lockTx:setText(I18N:getGlobalText(I18N.GlobalConst.TASK_DESC_1))
self.completeNode = uiMap["task_cell.complete"]
local completeTx = uiMap["task_cell.complete.text"]
completeTx:setText(I18N:getGlobalText(I18N.GlobalConst.STR_COMPLETED))
end end
function DailyTaskCell:refresh(task) function DailyTaskCell:refresh(taskId)
self.taskId = task.id self.taskId = taskId
local icon = DataManager.DailyTaskData:getDailyTaskIcon(task.id) self.taskType = DataManager.DailyTaskData:getTaskType(self.taskId)
self.icon:setSprite(GConst.ATLAS_PATH.ICON_TASK, icon) -- local icon = DataManager.DailyTaskData:getDailyTaskIcon(task.id)
local taskDesc = DataManager.DailyTaskData:getDailyTaskDesc(task.id) -- self.icon:setSprite(GConst.ATLAS_PATH.ICON_TASK, icon)
self.nameTx:setText(taskDesc)
if task.lock then local taskTarget = DataManager.DailyTaskData:getTaskTarget(self.taskId)
self.lockNode:setVisible(true) local taskProg = DataManager.DailyTaskData:getTaskProg(self.taskId)
self.lockBg:setVisible(true) taskProg = taskProg > taskTarget and taskTarget or taskProg
self.progressBg:setVisible(false)
self.refreshBtnRoot:setVisible(false) self.pointTx:setText(DataManager.DailyTaskData:getTaskPoint(self.taskId))
self.getBtnRoot:setVisible(false) self.progress.value = taskProg / taskTarget
self.adBtnRoot:setVisible(false) self.progressTx:setText(taskProg.."/"..taskTarget)
self.completeNode:setVisible(false)
if DataManager.DailyTaskData:isTaskReceived(self.taskId) then
-- 已完成
-- self.mask:setActive(true)
self.getBtn:setTouchEnable(false)
self.getBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_DONE))
self.getBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_grey_1")
-- self.nameTx:setText("<color=#574A40>" .. GFunc.getTaskDesc(self.taskType, taskTarget) .. "</color>")
self.nameTx:setText(GFunc.getTaskDesc(self.taskType, taskTarget))
else else
self.lockBg:setVisible(false) -- 未完成 or 可领取
self.lockNode:setVisible(false) -- self.mask:setActive(false)
self.progressBg:setVisible(true) self.getBtn:setTouchEnable(true)
local count = task.progress -- self.nameTx:setText("<color=#5C3A2D>" .. GFunc.getTaskDesc(self.taskType, taskTarget) .. "</color>")
local needCount = task.needProgress self.nameTx:setText(GFunc.getTaskDesc(self.taskType, taskTarget))
if task.claimed then -- 已经领过了
self.completeNode:setVisible(true) if DataManager.DailyTaskData:isTaskFinished(self.taskId) then
self.getBtnRoot:setVisible(false) self.getBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_CLAIM))
self.refreshBtnRoot:setVisible(false) self.getBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_blue_1")
self.adBtnRoot:setVisible(false)
if count >= needCount then
count = needCount
end
else else
self.completeNode:setVisible(false) self.getBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_21))
if count >= needCount then self.getBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_yellow_1")
count = needCount
self.getBtnRoot:setVisible(true)
self.refreshBtnRoot:setVisible(false)
self.adBtnRoot:setVisible(false)
else
self.getBtnRoot:setVisible(false)
local isAdType = DataManager.DailyTaskData:getDailyTaskIsAdType(task.id)
if isAdType then
self.adBtnRoot:setVisible(true)
self.refreshBtnRoot:setVisible(false)
else
self.adBtnRoot:setVisible(false)
local canRefresh = DataManager.DailyTaskData:getDailyTaskCanRefresh(task.id)
if canRefresh then
if task.refresh then -- 刷过了
self.refreshBtnRoot:setVisible(false)
else
self.refreshBtnRoot:setVisible(true)
end
else
self.refreshBtnRoot:setVisible(false)
end
end
end
end end
self.progressTx:setText(count .. "/" .. needCount)
self.progress:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = count/needCount
end
local reward = DataManager.DailyTaskData:getDailyTaskReward(task.id)
if reward and reward[1] then
self.rewardCellComp:refreshByConfig(reward[1])
end end
end end

View File

@ -1,96 +1,19 @@
local TaskMainUI = class("TaskMainUI", BaseUI) local TaskMainUI = class("TaskMainUI", BaseUI)
local PAGE_DAILY = 1 local PAGE_DAILY = 1
local PAGE_CHALLENGE = 2
local TASK_TYPE_DAILY = 1
local DAILY_TASK_CELL = "app/ui/task/cell/daily_task_cell" local DAILY_TASK_CELL = "app/ui/task/cell/daily_task_cell"
local ACHIEVEMENT_TASK_CELL = "app/ui/task/cell/achievement_task_cell"
local function sortTask(taskList)
table.sort(taskList, function(a, b)
if a.claimed == b.claimed then
if a.claimed then
return a.id < b.id
else
local completeA = a.progress >= a.needProgress
local completeB = b.progress >= b.needProgress
if completeA == completeB then
if completeA then
return a.id < b.id
else -- 没有完成的优先显示战令解锁
if a.lock == b.lock then
return a.id < b.id
else
return b.lock
end
end
else
return completeA
end
end
else
return b.claimed
end
end)
end
function TaskMainUI:onPressBackspace() function TaskMainUI:onPressBackspace()
self:closeUI() self:closeUI()
end end
function TaskMainUI:ctor(params)
self.page = params and params.page or PAGE_DAILY
self.dailyTaskList = {}
self.challengeTaskList = {}
self:initTaskList()
if DataManager.DailyTaskData:getIfCanReset() then
ModuleManager.TaskManager:resetDailyTask()
end
end
function TaskMainUI:isFullScreen() function TaskMainUI:isFullScreen()
return false return false
end end
function TaskMainUI:getPrefabPath() function TaskMainUI:getPrefabPath()
return "assets/prefabs/ui/task/task_main_ui.prefab" return "assets/prefabs/ui/task/task_main_ui.prefab"
end
function TaskMainUI:initTaskList()
for i = 1, #self.dailyTaskList do
table.remove(self.dailyTaskList)
end
for i = 1, #self.challengeTaskList do
table.remove(self.challengeTaskList)
end
local taskAdId = DataManager.DailyTaskData:getDailyTaskAdId()
local taskFinalId = DataManager.DailyTaskData:getDailyTaskFinalId()
local dailyTasks = DataManager.DailyTaskData:getDailyTasks()
for k, v in pairs(dailyTasks) do
if k ~= taskAdId and k ~= taskFinalId then
if v.type == TASK_TYPE_DAILY then
table.insert(self.dailyTaskList, v)
else
table.insert(self.challengeTaskList, v)
end
end
end
sortTask(self.dailyTaskList)
sortTask(self.challengeTaskList)
-- 审核模式不显示战令任务
if GFunc.isShenhe() then
for i = #self.dailyTaskList, 1, -1 do
local task = self.dailyTaskList[i]
if task.lock then
table.remove(self.dailyTaskList, i)
end
end
for i = #self.challengeTaskList, 1, -1 do
local task = self.challengeTaskList[i]
if task.lock then
table.remove(self.challengeTaskList, i)
end
end
end
end end
function TaskMainUI:onClose() function TaskMainUI:onClose()
@ -102,15 +25,88 @@ function TaskMainUI:onClose()
end end
end end
function TaskMainUI:ctor(params)
self.page = params and params.page or PAGE_DAILY
self.dailyTaskList = {}
self.achievementTaskList = {}
end
function TaskMainUI:onLoadRootComplete() function TaskMainUI:onLoadRootComplete()
self.uiMap = self.root:genAllChildren() local uiMap = self.root:genAllChildren()
self.uiMap["task_main_ui.bg.close_btn"]:addClickListener(function() uiMap["task_main_ui.bg.close_btn"]:addClickListener(function()
self:closeUI() self:closeUI()
end) end)
self:initTitle() self.titleTx = uiMap["task_main_ui.bg.title_tx"]
self:initPage()
self:initCountDown() self.btnTxs = {
I18N:getGlobalText(I18N.GlobalConst.TASK_DAILY),
I18N:getGlobalText(I18N.GlobalConst.TASK_CHALLENGE),
}
self.pageBtns = {}
self.pageBtnTxs = {}
for i = 1, 2 do
self.pageBtns[i] = uiMap["task_main_ui.bg.page_btn_" .. i]
self.pageBtnTxs[i] = uiMap["task_main_ui.bg.page_btn_" .. i .. ".text"]
self.pageBtns[i] :addClickListener(function()
-- if not self:getIsOpen(i) or self.page == i then
-- return
-- end
self.page = i
self:onRefresh()
end)
end
self.menuOneRedPoint = uiMap["task_main_ui.bg.red_point_1"]
self.menuTwoRedPoint = uiMap["task_main_ui.bg.red_point_2"]
self.dailyNode = uiMap["task_main_ui.bg.daily"]
self.dailyTaskFinalCellNameTx = uiMap["task_main_ui.bg.daily.task_final_cell.name_tx"]
self.dailyTaskFinalCellProgress = uiMap["task_main_ui.bg.daily.task_final_cell.progress"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
self.dailyTaskFinalCellProgressTx = uiMap["task_main_ui.bg.daily.task_final_cell.progress_tx"]
self.boxBtns = {}
self.boxBtnTxs = {}
local stageIds = DataManager.DailyTaskData:getStageIds()
for i = 1, 5 do
self.boxBtns[i] = uiMap["task_main_ui.bg.daily.task_final_cell.box_" .. i]
self.boxBtnTxs[i] = uiMap["task_main_ui.bg.daily.task_final_cell.box_" .. i .. ".text"]
self.boxBtnTxs[i]:setText(DataManager.DailyTaskData:getStageCondition(stageIds[i]))
-- self.boxBtns[i]:addClickListener(function()
-- GFunc.showToast(i)
-- -- local taskId = DataManager.DailyTaskData:getDailyTaskFinalId()
-- -- if DataManager.DailyTaskData:getDailyTaskCanClaimTask(taskId) then
-- -- ModuleManager.TaskManager:claimDailyTask(taskId)
-- -- else
-- -- local reward = DataManager.DailyTaskData:getDailyTaskFinalReward()
-- -- if reward and reward[1] then
-- -- local rewardId = GFunc.getRewardId(reward[1])
-- -- local rewardType = GFunc.getRewardType(reward[1])
-- -- ModuleManager.TipsManager:showRewardTips(rewardId, rewardType, self.dailyTaskFinalCellBox)
-- -- end
-- -- end
-- end)
end
self.dailyTaskScrollRect = uiMap["task_main_ui.bg.daily.scrollrect"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
self.dailyTaskScrollRect:addInitCallback(function()
return DAILY_TASK_CELL
end)
self.dailyTaskScrollRect:addRefreshCallback(function(index, cell)
cell:refresh(self.dailyTaskList[index])
end)
self.dailyTaskScrollRect:clearCells()
self.challengeNode = uiMap["task_main_ui.bg.challenge"]
self.challengeTaskScrollRect = uiMap["task_main_ui.bg.challenge.scrollrect"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
self.challengeTaskScrollRect:addInitCallback(function()
return ACHIEVEMENT_TASK_CELL
end)
self.challengeTaskScrollRect:addRefreshCallback(function(index, cell)
cell:refresh(self.achievementTaskList[index])
end)
self.challengeTaskScrollRect:clearCells()
self.challengeTaskScrollRect:refillCells(#self.achievementTaskList)
self.timeTx = uiMap["task_main_ui.bg.daily.time_tx"]
self:bindData() self:bindData()
self:scheduleGlobal(function() self:scheduleGlobal(function()
self:updateTime() self:updateTime()
@ -118,323 +114,152 @@ function TaskMainUI:onLoadRootComplete()
self:updateTime() self:updateTime()
end end
function TaskMainUI:initTitle()
self.titleTx = self.uiMap["task_main_ui.bg.title"]
self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.TASK_NAME))
end
function TaskMainUI:initPage()
self.menuOne = self.uiMap["task_main_ui.bg.menu_1"]
self.menuOne:addClickListener(function()
self:switchPage(PAGE_DAILY)
end)
self.menuOneOn = self.uiMap["task_main_ui.bg.menu_1.on"]
self.menuOneOff = self.uiMap["task_main_ui.bg.menu_1.off"]
local menuOneOnTx = self.uiMap["task_main_ui.bg.menu_1.on.text"]
menuOneOnTx:setText(I18N:getGlobalText(I18N.GlobalConst.TASK_DAILY))
local menuOneOffTx = self.uiMap["task_main_ui.bg.menu_1.off.text"]
menuOneOffTx:setText(I18N:getGlobalText(I18N.GlobalConst.TASK_DAILY))
self.menuOneRedPoint = self.uiMap["task_main_ui.bg.red_point_1"]
self.menuTwo = self.uiMap["task_main_ui.bg.menu_2"]
self.menuTwo:addClickListener(function()
self:switchPage(PAGE_CHALLENGE)
end)
self.menuTwoOn = self.uiMap["task_main_ui.bg.menu_2.on"]
self.menuTwoOff = self.uiMap["task_main_ui.bg.menu_2.off"]
local menuTwoOnTx = self.uiMap["task_main_ui.bg.menu_2.on.text"]
menuTwoOnTx:setText(I18N:getGlobalText(I18N.GlobalConst.TASK_CHALLENGE))
local menuTwoOffTx = self.uiMap["task_main_ui.bg.menu_2.off.text"]
menuTwoOffTx:setText(I18N:getGlobalText(I18N.GlobalConst.TASK_CHALLENGE))
self.menuTwoRedPoint = self.uiMap["task_main_ui.bg.red_point_2"]
self:initDaily()
self:initChallenge()
end
function TaskMainUI:initDaily()
self.dailyNode = self.uiMap["task_main_ui.bg.daily"]
self:initDailyTaskAdCell()
self:initDailyTaskFinalCell()
end
function TaskMainUI:initDailyTaskAdCell()
self.dailyTaskAdCellNameTx = self.uiMap["task_main_ui.bg.daily.task_ad_cell.name_tx"]
self.dailyTaskAdCellProgress = self.uiMap["task_main_ui.bg.daily.task_ad_cell.progress"]
self.dailyTaskAdCellProgressTx = self.uiMap["task_main_ui.bg.daily.task_ad_cell.progress_tx"]
self.dailyTaskAdCellBox = self.uiMap["task_main_ui.bg.daily.task_ad_cell.box"]
self.dailyTaskAdCellBox:addClickListener(function()
local taskId = DataManager.DailyTaskData:getDailyTaskAdId()
if DataManager.DailyTaskData:getDailyTaskCanClaimTask(taskId) then
ModuleManager.TaskManager:claimDailyTask(taskId)
else
local reward = DataManager.DailyTaskData:getDailyTaskAdReward()
if reward and reward[1] then
local rewardId = GFunc.getRewardId(reward[1])
local rewardType = GFunc.getRewardType(reward[1])
ModuleManager.TipsManager:showRewardTips(rewardId, rewardType, self.dailyTaskAdCellBox)
end
end
end)
self.dailyTaskAdCellBoxInfo = self.uiMap["task_main_ui.bg.daily.task_ad_cell.box.info"]
self.adBoxSpineObj = self.uiMap["task_main_ui.bg.daily.task_ad_cell.box.ui_spine_obj"]
end
function TaskMainUI:initDailyTaskFinalCell()
self.dailyTaskFinalCellNameTx = self.uiMap["task_main_ui.bg.daily.task_final_cell.name_tx"]
self.dailyTaskFinalCellProgress = self.uiMap["task_main_ui.bg.daily.task_final_cell.progress"]
self.dailyTaskFinalCellProgressTx = self.uiMap["task_main_ui.bg.daily.task_final_cell.progress_tx"]
self.dailyTaskFinalCellBox = self.uiMap["task_main_ui.bg.daily.task_final_cell.box"]
self.dailyTaskFinalCellBox:addClickListener(function()
local taskId = DataManager.DailyTaskData:getDailyTaskFinalId()
if DataManager.DailyTaskData:getDailyTaskCanClaimTask(taskId) then
ModuleManager.TaskManager:claimDailyTask(taskId)
else
local reward = DataManager.DailyTaskData:getDailyTaskFinalReward()
if reward and reward[1] then
local rewardId = GFunc.getRewardId(reward[1])
local rewardType = GFunc.getRewardType(reward[1])
ModuleManager.TipsManager:showRewardTips(rewardId, rewardType, self.dailyTaskFinalCellBox)
end
end
end)
self.dailyTaskFinalCellBoxInfo = self.uiMap["task_main_ui.bg.daily.task_final_cell.box.info"]
self.finalBoxSpineObj = self.uiMap["task_main_ui.bg.daily.task_final_cell.box.ui_spine_obj"]
end
function TaskMainUI:initDailyTasks()
self.dailyTaskScrollRect = self.uiMap["task_main_ui.bg.daily.scrollrect"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
self.dailyTaskScrollRect:addInitCallback(function()
return DAILY_TASK_CELL
end)
self.dailyTaskScrollRect:addRefreshCallback(function(index, cell)
cell:refresh(self.dailyTaskList[index])
end)
self.dailyTaskScrollRect:clearCells()
self.dailyTaskScrollRect:refillCells(#self.dailyTaskList)
end
function TaskMainUI:initChallenge()
self.challengeNode = self.uiMap["task_main_ui.bg.challenge"]
end
function TaskMainUI:initChallengeTasks()
self.challengeTaskScrollRect = self.uiMap["task_main_ui.bg.challenge.scrollrect"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
self.challengeTaskScrollRect:addInitCallback(function()
return DAILY_TASK_CELL
end)
self.challengeTaskScrollRect:addRefreshCallback(function(index, cell)
cell:refresh(self.challengeTaskList[index])
end)
self.challengeTaskScrollRect:clearCells()
self.challengeTaskScrollRect:refillCells(#self.challengeTaskList)
end
function TaskMainUI:initCountDown()
local helpBtn = self.uiMap["task_main_ui.bg.time_btn"]
helpBtn:addClickListener(function()
self:showHelp()
end)
self.timeTx = self.uiMap["task_main_ui.bg.time_tx"]
end
function TaskMainUI:bindData() function TaskMainUI:bindData()
self:bind(DataManager.DailyTaskData, "dailyTaskDirty", function() self:bind(DataManager.DailyTaskData, "isDirty", function()
if self.delayRefreshSid then self:onRefresh()
self:unscheduleGlobal(self.delayRefreshSid)
end
self.delayRefreshSid = self:performWithDelayGlobal(function()
self.delayRefreshSid = nil
sortTask(self.dailyTaskList)
sortTask(self.challengeTaskList)
self:onRefresh()
end, 0.1)
end)
self:bind(DataManager.DailyTaskData, "resetFlag", function()
if self.delayRefreshSid then
self:unscheduleGlobal(self.delayRefreshSid)
end
self.delayRefreshSid = self:performWithDelayGlobal(function()
self.delayRefreshSid = nil
self:initTaskList()
self:onRefresh()
end, 0.1)
end) end)
end end
function TaskMainUI:updateTime()
if self.page ~= PAGE_DAILY then
return
end
self.timeTx:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_22, Time:formatNumTimeStr(Time:getTodaySurplusTime())))
end
function TaskMainUI:onRefresh() function TaskMainUI:onRefresh()
self:switchPage(self.page) self:refreshPageBtn()
self:refreshPageInfo()
end end
function TaskMainUI:switchPage(page) function TaskMainUI:refreshPageBtn()
self.page = page for i = 1, 2 do
if page == PAGE_DAILY then if self.page == i then
self.menuOneOn:setVisible(true) self.pageBtns[i]:setSprite(GConst.ATLAS_PATH.COMMON, "common_tab_1")
self.menuOneOff:setVisible(false) self.pageBtnTxs[i]:setText(self.btnTxs[i])
self.menuTwoOn:setVisible(false) else
self.menuTwoOff:setVisible(true) self.pageBtns[i]:setSprite(GConst.ATLAS_PATH.COMMON, "common_tab_2")
self.dailyNode:setAnchoredPositionX(0) self.pageBtnTxs[i]:setText("<color=#72778C>" .. self.btnTxs[i] .. "</color>")
self.challengeNode:setAnchoredPositionX(GConst.NOT_VISIBLE_POS) end
end
end
function TaskMainUI:refreshPageInfo()
self.dailyNode:setActive(self.page == PAGE_DAILY)
self.challengeNode:setActive(self.page ~= PAGE_DAILY)
if self.page == PAGE_DAILY then
self:refreshDaily() self:refreshDaily()
if DataManager.DailyTaskData:getIsShowChallengeTaskRedPoint() then
self.menuTwoRedPoint:setVisible(true)
if self.menuTwoRedPointTween == nil then
self.menuTwoRedPointTween = self:getShakeTween(self.menuTwoRedPoint)
else
self.menuTwoRedPointTween:Restart()
end
else
if self.menuTwoRedPointTween then
self.menuTwoRedPointTween:Pause()
end
self.menuTwoRedPoint:setVisible(false)
end
if self.menuOneRedPointTween then
self.menuOneRedPointTween:Pause()
end
self.menuOneRedPoint:setVisible(false)
else else
self.menuOneOn:setVisible(false)
self.menuOneOff:setVisible(true)
self.menuTwoOn:setVisible(true)
self.menuTwoOff:setVisible(false)
self.dailyNode:setAnchoredPositionX(GConst.NOT_VISIBLE_POS)
self.challengeNode:setAnchoredPositionX(0)
self:refreshChallenge() self:refreshChallenge()
if DataManager.DailyTaskData:getIsShowDailyTaskRedPoint() then
self.menuOneRedPoint:setVisible(true)
if self.menuOneRedPointTween == nil then
self.menuOneRedPointTween = self:getShakeTween(self.menuOneRedPoint)
else
self.menuOneRedPointTween:Restart()
end
else
if self.menuOneRedPointTween then
self.menuOneRedPointTween:Pause()
end
self.menuOneRedPoint:setVisible(false)
end
if self.menuTwoRedPointTween then
self.menuTwoRedPointTween:Pause()
end
self.menuTwoRedPoint:setVisible(false)
end end
end end
function TaskMainUI:refreshDaily() function TaskMainUI:refreshDaily()
self:refreshDailyTaskAdCell() self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.TASK_NAME))
self:refreshDailyTaskFinalCell() local stageIds = DataManager.DailyTaskData:getStageIds()
self:refreshDailyTasks() local curScore = DataManager.DailyTaskData:getCurStageScore()
end local targetList = DataManager.DailyTaskData:getStageTargetList()
self.dailyTaskFinalCellProgressTx:setText(curScore)
self.dailyTaskFinalCellProgress.value = GFunc.getUnevenSliderValue(targetList, curScore)
function TaskMainUI:refreshDailyTaskAdCell() for i, item in ipairs(self.boxBtns) do
local taskId = DataManager.DailyTaskData:getDailyTaskAdId() local stageId = stageIds[i]
local taskDesc = DataManager.DailyTaskData:getDailyTaskDesc(taskId) if stageId then
self.dailyTaskAdCellNameTx:setText(taskDesc) item:setActive(true)
local count, needCount = DataManager.DailyTaskData:getDailyTaskProgress(taskId) -- item:initPrefabHelper()
if count >= needCount then -- local map = item:genAllChildren()
count = needCount -- local spineBox = map["box.spine_box"]
end -- local txNum = map["box.tx_num"]
if DataManager.DailyTaskData:getDailyTaskCanClaimTask(taskId) then
self.dailyTaskAdCellBoxInfo:setVisible(false)
self.dailyTaskAdCellBox:addRedPoint(40, 28, 0.7)
self.adBoxSpineObj:playAnim("ready", true, false)
self.curAdCanGet = true
else
self.dailyTaskAdCellBoxInfo:setVisible(true)
self.dailyTaskAdCellBox:removeRedPoint()
if self.curAdCanGet then -- txNum:setText(DataManager.DailyTaskData:getStageCondition(stageId))
self.adBoxSpineObj:playAnimComplete("open", false, true, function()
self.adBoxSpineObj:playAnim("idle01", true, false)
end)
else
self.adBoxSpineObj:playAnim("idle01", true, false)
end
self.curAdCanGet = false -- if DataManager.DailyTaskData:canClaimStage(stageId) then
end -- spineBox:playAnim("ready", true, false, false)
self.dailyTaskAdCellProgressTx:setText(count .. "/" .. needCount) -- elseif DataManager.DailyTaskData:isStageReceived(stageId) then
self.dailyTaskAdCellProgress:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = count/needCount -- spineBox:playAnim("idle02", true, false, false)
end -- else
-- spineBox:playAnim("idle01", true, false, false)
-- end
function TaskMainUI:refreshDailyTaskFinalCell() if DataManager.DailyTaskData:canClaimStage(stageId) then
local taskId = DataManager.DailyTaskData:getDailyTaskFinalId() item:addClickListener(function()
local taskDesc = DataManager.DailyTaskData:getDailyTaskDesc(taskId) self:onClickBox()
self.dailyTaskFinalCellNameTx:setText(taskDesc)
local count, needCount = DataManager.DailyTaskData:getDailyTaskProgress(taskId)
if count > needCount then
count = needCount
end
if DataManager.DailyTaskData:getDailyTaskCanClaimTask(taskId) then
self.dailyTaskFinalCellBoxInfo:setVisible(false)
self.dailyTaskFinalCellBox:addRedPoint(40, 28, 0.7)
self.finalBoxSpineObj:playAnim("ready", true, false)
self.curFinalCanGet = true
else
self.dailyTaskFinalCellBoxInfo:setVisible(true)
self.dailyTaskFinalCellBox:removeRedPoint()
if DataManager.DailyTaskData:getDailyTaskCalaimed(taskId) then
if self.curFinalCanGet then
self.finalBoxSpineObj:playAnimComplete("open", false, true, function()
self.finalBoxSpineObj:playAnim("idle02", true, false)
end) end)
else else
self.finalBoxSpineObj:playAnim("idle02", true, false) item:addClickListener(function()
ModuleManager.TipsManager:showRewardsTips(DataManager.DailyTaskData:getStageReward(stageId), nil, item)
end)
end end
else else
self.finalBoxSpineObj:playAnim("idle01", true, false) item:setActive(false)
end end
self.curFinalCanGet = false
end end
self.dailyTaskFinalCellProgressTx:setText(count .. "/" .. needCount)
self.dailyTaskFinalCellProgress:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = count/needCount self.dailyTaskList = DataManager.DailyTaskData:getTaskIdsSort()
self.dailyTaskScrollRect:refillCells(#self.dailyTaskList)
-- if DataManager.DailyTaskData:getIsShowDailyTaskRedPoint() then
-- self.menuOneRedPoint:setActive(true)
-- if self.menuOneRedPointTween == nil then
-- self.menuOneRedPointTween = self:getShakeTween(self.menuOneRedPoint)
-- else
-- self.menuOneRedPointTween:Restart()
-- end
-- else
-- if self.menuOneRedPointTween then
-- self.menuOneRedPointTween:Pause()
-- end
-- self.menuOneRedPoint:setActive(false)
-- end
-- if self.menuTwoRedPointTween then
-- self.menuTwoRedPointTween:Pause()
-- end
-- self.menuTwoRedPoint:setActive(false)
end end
function TaskMainUI:refreshDailyTasks() function TaskMainUI:onClickBox()
if self.dailyTaskScrollRect == nil then -- local isFirst = true
self:initDailyTasks() -- local stageIds = DataManager.DailyTaskData:getStageIds()
else -- for i, item in ipairs(self.boxItems) do
if self.dailyTaskScrollRect:getTotalCount() == #self.dailyTaskList then -- local stageId = stageIds[i]
self.dailyTaskScrollRect:updateAllCell() -- if stageId and DataManager.DailyTaskData:canClaimStage(stageId) then
else -- item:initPrefabHelper()
self.dailyTaskScrollRect:clearCells() -- local map = item:genAllChildren()
self.dailyTaskScrollRect:refillCells(#self.dailyTaskList) -- local spineBox = map["box.spine_box"]
end
end -- if isFirst then
-- isFirst = false
-- spineBox:playAnimComplete("open", false, true, function()
-- ModuleManager.TaskManager:reqTaskStageReward(stageId)
-- end)
-- else
-- spineBox:playAnimComplete("open", false, true)
-- end
-- end
-- end
end end
function TaskMainUI:refreshChallenge() function TaskMainUI:refreshChallenge()
if self.challengeTaskScrollRect == nil then -- self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.TASK_NAME))
self:initChallengeTasks() self.titleTx:setText("成就")
else self.achievementTaskList = DataManager.DailyTaskData:getAchievementIdsSort()
if self.challengeTaskScrollRect:getTotalCount() == #self.challengeTaskList then self.challengeTaskScrollRect:refillCells(#self.achievementTaskList)
self.challengeTaskScrollRect:updateAllCell() -- if DataManager.DailyTaskData:getIsShowChallengeTaskRedPoint() then
else -- self.menuTwoRedPoint:setActive(true)
self.challengeTaskScrollRect:clearCells() -- if self.menuTwoRedPointTween == nil then
self.challengeTaskScrollRect:refillCells(#self.challengeTaskList) -- self.menuTwoRedPointTween = self:getShakeTween(self.menuTwoRedPoint)
end -- else
end -- self.menuTwoRedPointTween:Restart()
end -- end
-- else
function TaskMainUI:showHelp() -- if self.menuTwoRedPointTween then
local params = { -- self.menuTwoRedPointTween:Pause()
content = I18N:getGlobalText(I18N.GlobalConst.TASK_HELP_1), -- end
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK, -- self.menuTwoRedPoint:setActive(false)
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK), -- end
} -- if self.menuOneRedPointTween then
GFunc.showMessageBox(params) -- self.menuOneRedPointTween:Pause()
end -- end
-- self.menuOneRedPoint:setActive(false)
function TaskMainUI:updateTime()
local time = DataManager.DailyTaskData:getDailyResetTime()
if self.resetTime == time then
return
end
if DataManager.DailyTaskData:getIfCanReset() then -- 跨天了
ModuleManager.TaskManager:resetDailyTask()
end
self.resetTime = time
self.timeTx:setText(GFunc.getTimeStrWithHMS2(self.resetTime))
end end
function TaskMainUI:getShakeTween(obj) function TaskMainUI:getShakeTween(obj)

View File

@ -1,432 +1,451 @@
local DailyTaskData = class("DailyTaskData", BaseData) local DailyTaskData = class("DailyTaskData", BaseData)
local DAILY_TASK_AD_ID = 1 local TaskDailyCfg = ConfigManager:getConfig("task_daily")
local DAILY_TASK_FINAL_ID = 2 local TaskDailyStageCfg = ConfigManager:getConfig("task_daily_stage")
local DATA_NAME = "DailyTaskData" local TaskAchievementCfg = ConfigManager:getConfig("task_achievement")
function DailyTaskData:ctor() function DailyTaskData:ctor()
self.data.dailyTaskDirty = false self.data.isDirty = false
self.data.resetFlag = false
self.data.redPointFlag = false
self.dailyTaskRedPoint = 0
self.challengeTaskRedPoint = 0
self.isInReset = false
self.taskTypeMap = {}
self.dailyTasks = {}
self.isUnlockBountyDailyTask = false
end end
function DailyTaskData:init(data) function DailyTaskData:clear()
local tasks = data and data.tasks DataManager:unregisterCrossDayFunc("DailyTaskData")
local cfg = self:getDailyTaskCfg() ModuleManager.TaskManager:unRegisterAllModuleTask("DailyTaskData")
local taskCfg = self:getTaskCfg() end
for k, v in pairs(self.dailyTasks) do
self.dailyTasks[k] = nil function DailyTaskData:setDirty()
self.data.isDirty = not self.data.isDirty
end
function DailyTaskData:init(daily, achievement)
daily = daily or {}
achievement = achievement or {}
--任务领取状态&进度
self.dailyTaskData = daily.tasks or {}
-- 活跃度
self.dayPoint = daily.point or 0
-- 活跃度领奖
self.progRewardData = daily.stage_reward_claimed or {}
-- 成就任务
self.achievementData = achievement.tasks or {}
self.achievementRewardData = achievement.task_claimed_stages or {}
-- 任务配置
self.dailyTaskIds = {}
for id, info in pairs(TaskDailyCfg) do
table.insert(self.dailyTaskIds, id)
end end
for k, v in pairs(self.taskTypeMap) do table.sort(self.dailyTaskIds)
for i = 1, #v do -- 阶段配置
table.remove(v) self.dailyStageIds = {}
for id, info in pairs(TaskDailyStageCfg) do
table.insert(self.dailyStageIds, id)
end
table.sort(self.dailyStageIds)
-- 监听任务
for id, info in pairs(TaskDailyCfg) do
ModuleManager.TaskManager:registerTask("DailyTaskData", info.task_type, function(count)
self:addTaskProgress(info.task_type, count)
end)
end
for id, info in pairs(TaskAchievementCfg) do
ModuleManager.TaskManager:registerTask("DailyTaskData", info.type, function(count)
self:addTaskProgress(info.type, count)
end)
end
-- 跨天
DataManager:registerCrossDayFunc("DailyTaskData", function()
-- 重置任务数据
for id, data in pairs(self.dailyTaskData) do
data.claimed = 0
data.progress = 0
end
-- 重置进度奖励数据
for id, claimed in pairs(self.progRewardData) do
self.progRewardData[id] = false
end
self.dayPoint = 0
self:setDirty()
end)
self.dailyRedState = nil
self.achievementRedState = nil
self:showRedPoint()
end
function DailyTaskData:getIsOpen(showToast)
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.TASK, not showToast) then
return false
end
return true
end
function DailyTaskData:showRedPoint()
if self.dailyRedState == nil and self.achievementRedState == nil then
return self:showDailyRedPoint() or self:showAchievementRedPoint()
end
return self.dailyRedState or self.achievementRedState
end
function DailyTaskData:showDailyRedPoint()
for idx, id in pairs(self.dailyTaskIds) do
if self:canClaimTask(id) then
self.dailyRedState = true
return true
end end
end end
self.isUnlockBountyDailyTask = DataManager.BountyData:getBought()
local dailyRedPoint = 0 for idx, id in pairs(self.dailyStageIds) do
local challengeRedPoint = 0 if self:canClaimStage(id) then
ModuleManager.TaskManager:unRegisterAllModuleTask(DATA_NAME) self.dailyRedState = true
for k, v in pairs(cfg) do return true
local task = tasks and tasks[k] or GConst.EMPTY_TABLE end
local taskInfo = taskCfg[task.task_id] end
if taskInfo then
local dailyTaskObj = { self.dailyRedState = false
id = k, return false
taskId = task.task_id, end
progress = task.progress,
needProgress = taskInfo.number, function DailyTaskData:showAchievementRedPoint()
refresh = task.refresh, for id, info in pairs(TaskAchievementCfg) do
claimed = task.claimed, for stage = 1, self:getAchievementTotalStage(id) do
type = v.type, if self:canClaimAchievement(id, stage) then
reset = v.reset self.achievementRedState = true
} return true
if v.bounty then
if self.isUnlockBountyDailyTask then
dailyTaskObj.lock = false
else
dailyTaskObj.lock = true
end
else
dailyTaskObj.lock = false
end end
if dailyTaskObj.lock then end
dailyTaskObj.redPoint = false end
else self.achievementRedState = false
if not dailyTaskObj.claimed and dailyTaskObj.progress >= dailyTaskObj.needProgress then return false
dailyTaskObj.redPoint = true end
if dailyTaskObj.type == 1 then
dailyRedPoint = dailyRedPoint + 1 -- 是否完成全部每日任务
else function DailyTaskData:isAllDailyTaskFinished()
challengeRedPoint = challengeRedPoint + 1 for idx, id in pairs(self.dailyTaskIds) do
end if not self:isTaskReceived(id) then
else return false
dailyTaskObj.redPoint = false end
end end
local list = self.taskTypeMap[taskInfo.type]
if list == nil then for idx, id in pairs(self.dailyStageIds) do
list = {} if not self:isStageReceived(id) then
self.taskTypeMap[taskInfo.type] = list return false
end end
table.insert(list, dailyTaskObj) end
if #list == 1 then
self:registerTaskWithType(taskInfo.type) return true
end
-- 任务 -----------------------------------------------------------------------------------------------------------------------------------------
-- 任务是否开启
function DailyTaskData:isTaskOpen(taskId)
if TaskDailyCfg[taskId].func_open == nil then
return true
end
return ModuleManager:getIsOpen(TaskDailyCfg[taskId].func_open, true)
end
-- 获取任务类型
function DailyTaskData:getTaskType(taskId)
return TaskDailyCfg[taskId].task_type
end
-- 获取任务循环类型
function DailyTaskData:getTaskRoutineType(taskId)
return TaskDailyCfg[taskId].routine_type
end
-- 获取任务目标
function DailyTaskData:getTaskTarget(taskId)
return TaskDailyCfg[taskId].number
end
-- 获取任务奖励点数
function DailyTaskData:getTaskPoint(taskId)
return TaskDailyCfg[taskId].value
end
-- 获取任务当前进度
function DailyTaskData:getTaskProg(taskId)
taskId = tonumber(taskId)
return self.dailyTaskData[taskId] and self.dailyTaskData[taskId].progress or 0
end
-- 任务是否已领取
function DailyTaskData:isTaskReceived(taskId)
taskId = tonumber(taskId)
return self.dailyTaskData[taskId] and self.dailyTaskData[taskId].claimed and self.dailyTaskData[taskId].claimed > 0
end
-- 任务是否已完成
function DailyTaskData:isTaskFinished(taskId)
return self:getTaskProg(taskId) >= self:getTaskTarget(taskId)
end
-- 任务是否可领取
function DailyTaskData:canClaimTask(taskId)
return self:isTaskFinished(taskId) and not self:isTaskReceived(taskId)
end
-- 获取可领奖的所有任务id
function DailyTaskData:getCanClaimTaskIds()
local ids = {}
for idx, taskId in pairs(self.dailyTaskIds) do
if self:canClaimTask(taskId) then
table.insert(ids, taskId)
end
end
return ids
end
-- 获取可展示的每日任务id列表
function DailyTaskData:getTaskIdsSort()
local taskids = self.dailyTaskIds or {}
local temp = {}
for i, id in ipairs(taskids) do
if self:isTaskOpen(id) then
local info = {id = id, sort = id}
if self:canClaimTask(id) then
info.sort = info.sort - 10000
end
if self:isTaskReceived(id) then
info.sort = info.sort + 10000
end
table.insert(temp, info)
end
end
table.sort(temp, function(a, b)
return a.sort < b.sort
end)
local ids = {}
for i, data in ipairs(temp) do
table.insert(ids, data.id)
end
return ids
end
-- 任务进度变化
function DailyTaskData:addTaskProgress(taskType, count)
for taskId, info in pairs(TaskDailyCfg) do
if self:getTaskType(taskId) == taskType then
if self.dailyTaskData[taskId] == nil then
self.dailyTaskData[taskId] = {}
end
if not self:isTaskFinished(taskId) then
-- if table.containValue(GConst.TaskConst.TASK_TARGRT_TYPE, taskType) then
-- self.dailyTaskData[taskId].progress = math.max(self.dailyTaskData[taskId].progress or 0, count)
-- else
self.dailyTaskData[taskId].progress = (self.dailyTaskData[taskId].progress or 0) + count
-- end
end
end
end
for achievementId, info in pairs(TaskAchievementCfg) do
if self:getTaskTypeByAchievementId(achievementId) == taskType then
if not self:isAchievementFinished(achievementId, self:getAchievementTotalStage(achievementId)) then
-- if table.containValue(GConst.TaskConst.TASK_TARGRT_TYPE, taskType) then
-- self.achievementData[achievementId] = math.max(self.achievementData[achievementId] or 0, count)
-- else
self.achievementData[achievementId] = (self.achievementData[achievementId] or 0) + count
-- end
end
end
end
self:setDirty()
end
-- 领奖成功
function DailyTaskData:onTaskClaimed(dayPoint)
self.dayPoint = dayPoint or self.dayPoint
for idx, taskId in pairs(self:getCanClaimTaskIds()) do
self.dailyTaskData[taskId].claimed = 1
end
self.dailyRedState = nil
self:setDirty()
end
-- 阶段 -----------------------------------------------------------------------------------------------------------------------------------------
-- 领取条件
function DailyTaskData:getStageCondition(stageId)
return TaskDailyStageCfg[stageId].point
end
-- 获取奖励
function DailyTaskData:getStageReward(stageId)
return TaskDailyStageCfg[stageId].reward
end
-- 获取循环类型
function DailyTaskData:getStageRoutineType(stageId)
return TaskDailyStageCfg[stageId].routine_type
end
-- 获取阶段id列表
function DailyTaskData:getStageIds()
return self.dailyStageIds
end
-- 获取阶段奖励目标list
function DailyTaskData:getStageTargetList()
local targetList = {}
for i, id in ipairs(self.dailyStageIds) do
table.insert(targetList, self:getStageCondition(id))
end
table.sort(targetList, function(a, b)
return a < b
end)
return targetList
end
-- 获取当前活跃积分
function DailyTaskData:getCurStageScore()
return self.dayPoint
end
-- 是否已领奖
function DailyTaskData:isStageReceived(stageId)
stageId = tonumber(stageId)
return self.progRewardData[stageId] or false
end
-- 是否可领奖
function DailyTaskData:canClaimStage(stageId)
return self:getCurStageScore() >= self:getStageCondition(stageId) and not self:isStageReceived(stageId)
end
-- 领奖成功
function DailyTaskData:onStageClaimed(type, stageId)
if type and stageId == 0 then
for k, id in pairs(self:getStageIdsByType(type)) do
if self:canClaimStage(id) then
self.progRewardData[id] = true
end
end
else
self.progRewardData[stageId] = true
end
self.dailyRedState = nil
self:setDirty()
end
-- 成就 ---------------------------------------------------------------------------------------------------------------------------------------
-- 获取领奖条件
function DailyTaskData:getAchievementCondition(achievementId, stage)
return TaskAchievementCfg[achievementId].number[stage]
end
-- 获取奖励
function DailyTaskData:getAchievementReward(achievementId, stage)
return TaskAchievementCfg[achievementId].reward[stage]
end
function DailyTaskData:getTaskTypeByAchievementId(achievementId)
return TaskAchievementCfg[achievementId].type
end
-- 获取当前进度
function DailyTaskData:getAchievementProg(achievementId)
return self.achievementData[achievementId] or 0
end
-- 获取任务总共阶段
function DailyTaskData:getAchievementTotalStage(achievementId)
return #TaskAchievementCfg[achievementId].number
end
-- 当前所处阶段
function DailyTaskData:getAchievementStage(achievementId)
local cfg = TaskAchievementCfg[achievementId]
local stageNum = #cfg.number
for stage = 1, stageNum do
if self:canClaimAchievement(achievementId, stage) then
return stage
end
if not self:isAchievementFinished(achievementId, stage) then
return stage
end
end
return stageNum
end
-- 是否已完成
function DailyTaskData:isAchievementFinished(achievementId, stage)
return self:getAchievementProg(achievementId) >= self:getAchievementCondition(achievementId, stage)
end
-- 是否已领奖
function DailyTaskData:isAchievementReceived(achievementId, stage)
achievementId = tonumber(achievementId)
return self.achievementRewardData[achievementId] and self.achievementRewardData[achievementId] >= stage or false
end
-- 是否可领奖
function DailyTaskData:canClaimAchievement(achievementId, stage)
if self:isAchievementReceived(achievementId, stage) then
return false
end
if not self:isAchievementFinished(achievementId, stage) then
return false
end
return true
end
function DailyTaskData:getAchievementIdsSort()
local temp = {}
for id, info in ipairs(TaskAchievementCfg) do
local info = {id = id, sort = id}
local stage = self:getAchievementStage(id)
if self:canClaimAchievement(id, stage) then
info.sort = info.sort - 10000
end
if self:isAchievementReceived(id, stage) then
info.sort = info.sort + 10000
end
table.insert(temp, info)
end
table.sort(temp, function(a, b)
return a.sort < b.sort
end)
local ids = {}
for i, data in ipairs(temp) do
table.insert(ids, data.id)
end
return ids
end
-- 领奖成功
function DailyTaskData:onAchievementClaimed(achievementId, stage)
if achievementId == nil or stage == nil then
-- 一键领取
for achievementId, info in ipairs(TaskAchievementCfg) do
for stage = self:getAchievementStage(achievementId), self:getAchievementTotalStage(achievementId) do
if self:canClaimAchievement(achievementId, stage) then
self.achievementRewardData[achievementId] = stage
end end
end end
self.dailyTasks[k] = dailyTaskObj
end end
else
self.achievementRewardData[achievementId] = stage
end end
self.initDay = Time:getBeginningOfServerToday() self.achievementRedState = nil
self.isInReset = false self:setDirty()
self.data.resetFlag = not self.data.resetFlag
local redPointDirty = false
if self.dailyTaskRedPoint ~= dailyRedPoint then
if self.dailyTaskRedPoint > 0 and dailyRedPoint > 0 then
self.dailyTaskRedPoint = dailyRedPoint
else
self.dailyTaskRedPoint = dailyRedPoint
redPointDirty = true
end
end
if self.challengeTaskRedPoint ~= challengeRedPoint then
if self.challengeTaskRedPoint > 0 and challengeRedPoint > 0 then
self.challengeTaskRedPoint = challengeRedPoint
else
self.challengeTaskRedPoint = challengeRedPoint
redPointDirty = true
end
end
if redPointDirty then
self.data.redPointFlag = not self.data.redPointFlag
end
end
function DailyTaskData:refreshDailyTask(task)
local id = task.id
local dailyTaskObj = self.dailyTasks[id]
if dailyTaskObj == nil then
return
end
local taskInfo = self:getTaskCfg()[task.task_id]
if taskInfo == nil then
return
end
local originTaskInfo = self:getTaskCfg()[dailyTaskObj.taskId]
if originTaskInfo == nil then
return
end
local dailyTaskInfo = self:getDailyTaskCfg()[id]
if dailyTaskInfo == nil then
return
end
dailyTaskObj.id = task.id
dailyTaskObj.taskId = task.task_id
dailyTaskObj.progress = task.progress
dailyTaskObj.needProgress = taskInfo.number
dailyTaskObj.refresh = task.refresh
dailyTaskObj.claimed = task.claimed
dailyTaskObj.type = dailyTaskInfo.type
dailyTaskObj.reset = dailyTaskInfo.reset
local redPoint = false
if not dailyTaskObj.lock and not dailyTaskObj.claimed and dailyTaskObj.progress >= dailyTaskObj.needProgress then
redPoint = true
end
local originTaskType = originTaskInfo.type
if not dailyTaskObj.lock and originTaskType ~= taskInfo.type then -- 任务类型变了
self:unregisterTask(id, originTaskType)
self:registerTask(dailyTaskObj, taskInfo.type)
end
self:markDailyTaskDirty()
if dailyTaskObj.redPoint ~= redPoint then
dailyTaskObj.redPoint = redPoint
if redPoint then
if dailyTaskObj.type == 1 then
self.dailyTaskRedPoint = self.dailyTaskRedPoint + 1
else
self.challengeTaskRedPoint = self.challengeTaskRedPoint + 1
end
if self.dailyTaskRedPoint + self.challengeTaskRedPoint == 1 then
self.data.redPointFlag = not self.data.redPointFlag
end
else
if dailyTaskObj.type == 1 then
self.dailyTaskRedPoint = self.dailyTaskRedPoint - 1
else
self.challengeTaskRedPoint = self.challengeTaskRedPoint - 1
end
if self.dailyTaskRedPoint + self.challengeTaskRedPoint == 0 then
self.data.redPointFlag = not self.data.redPointFlag
end
end
end
end
function DailyTaskData:getIsOpen()
return ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.TASK, true)
end
function DailyTaskData:getDailyResetTime()
return 86400 - Time:getServerTime() % 86400
end
function DailyTaskData:getDailyTaskAdReward()
local task = self.dailyTasks[DAILY_TASK_AD_ID]
if task == nil then
return nil
end
local cfg = self:getTaskCfg()
return cfg[task.taskId].reward
end
function DailyTaskData:getDailyTaskAdId()
return DAILY_TASK_AD_ID
end
function DailyTaskData:getDailyTaskFinalReward()
local task = self.dailyTasks[DAILY_TASK_FINAL_ID]
if task == nil then
return nil
end
local cfg = self:getTaskCfg()
return cfg[task.taskId].reward
end
function DailyTaskData:getDailyTaskFinalId()
return DAILY_TASK_FINAL_ID
end
function DailyTaskData:markDailyTaskDirty()
self.data.dailyTaskDirty = not self.data.dailyTaskDirty
end
function DailyTaskData:getDailyTaskProgress(id)
local task = self.dailyTasks[id]
if task == nil then
return 0, 1
end
return task.progress, task.needProgress
end
function DailyTaskData:getDailyTaskDesc(id)
local task = self.dailyTasks[id]
if task == nil then
return GConst.EMPTY_STRING
end
local cfg = self:getTaskI18NCfg()
return cfg[task.taskId].desc
end
function DailyTaskData:getDailyTaskIsLock(id)
local task = self.dailyTasks[id]
if task == nil then
return nil
end
return task.lock
end
function DailyTaskData:getDailyTaskCanRefresh(id)
local cfg = self:getDailyTaskCfg()[id]
if cfg == nil then
return false
end
return cfg.ad_refresh
end
function DailyTaskData:getDailyTaskIsAdType(id)
local task = self.dailyTasks[id]
if task == nil then
return false
end
local cfg = self:getTaskCfg()
return cfg[task.taskId].type == GConst.TaskConst.TASK_TYPE.DAILY_TASK_WATCH_AD_SPECIAL
end
function DailyTaskData:getDailyTaskCanClaimTask(id)
local task = self.dailyTasks[id]
if task == nil then
return false
end
return self:getIfCanClaimTask(task)
end
function DailyTaskData:getDailyTaskIcon(id)
local task = self.dailyTasks[id]
if task == nil then
return GConst.EMPTY_STRING
end
local cfg = self:getTaskCfg()
return cfg[task.taskId].icon
end
function DailyTaskData:getDailyTaskReward(id)
local task = self.dailyTasks[id]
if task == nil then
return GConst.EMPTY_STRING
end
local cfg = self:getTaskCfg()
return cfg[task.taskId].reward
end
function DailyTaskData:getDailyTasks()
return self.dailyTasks
end
function DailyTaskData:getTaskI18NCfg()
return I18N:getConfig("task")
end
function DailyTaskData:getTaskCfg()
if self.taskCfg == nil then
self.taskCfg = ConfigManager:getConfig("task")
end
return self.taskCfg
end
function DailyTaskData:getDailyTaskCfg()
if self.dailyTaskCfg == nil then
self.dailyTaskCfg = ConfigManager:getConfig("task_daily")
end
return self.dailyTaskCfg
end
function DailyTaskData:getTaskListByType(taskType)
return self.taskTypeMap[taskType] or GConst.EMPTY_TABLE
end
function DailyTaskData:getDailyTaskCalaimed(id)
local task = self.dailyTasks[id]
if not task then
return false
end
return task.claimed
end
function DailyTaskData:getIfCanClaimTask(task)
if task.claimed then
return false
end
return task.progress >= task.needProgress
end
function DailyTaskData:addTaskProgress(task, taskType, count)
if task.lock then
return
end
local currProgress = task.progress
if currProgress >= task.needProgress then
return
end
local can = self:getIfCanClaimTask(task)
task.progress = task.progress + count
if not can and self:getIfCanClaimTask(task) then
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.DAILY_TASK_COMPLETE, task.id, task.taskId, currProgress, task.needProgress)
if task.type == 1 and task.reset == 1 and taskType ~= GConst.TaskConst.TASK_TYPE.COMPLETED_DALY_TASK then
ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.COMPLETED_DALY_TASK)
end
BIReport:postDailyTaskFinish(BIReport.TASK_TYPE.DAILY, task.id, task.taskId, task.refresh)
task.redPoint = true
if task.type == 1 then
self.dailyTaskRedPoint = self.dailyTaskRedPoint + 1
else
self.challengeTaskRedPoint = self.challengeTaskRedPoint + 1
end
if self.dailyTaskRedPoint + self.challengeTaskRedPoint == 1 then
self.data.redPointFlag = not self.data.redPointFlag
end
end
self:markDailyTaskDirty()
end
function DailyTaskData:registerTaskWithType(taskType)
ModuleManager.TaskManager:registerTask(DATA_NAME, taskType, function(count)
local list = self:getTaskListByType(taskType)
if #list > 0 then
for _, task in ipairs(list) do
self:addTaskProgress(task, taskType, count)
end
end
end)
end
function DailyTaskData:unregisterTask(id, taskType)
local taskList = self.taskTypeMap[taskType]
if taskList then
for k, v in ipairs(taskList) do
if v.id == id then
table.remove(taskList, k)
break
end
end
if #taskList == 0 then
self:unregisterTaskWithType(taskType)
end
end
end
function DailyTaskData:unregisterTaskWithType(taskType)
ModuleManager.TaskManager:unRegisterTask(DATA_NAME, taskType)
end
function DailyTaskData:registerTask(dailyTaskObj, taskType)
local taskList = self.taskTypeMap[taskType]
if taskList == nil then
taskList = {}
self.taskTypeMap[taskType] = taskList
end
table.insert(taskList, dailyTaskObj)
if #taskList == 1 then
self:registerTaskWithType(taskType)
end
end
function DailyTaskData:getIfCanReset()
return self.initDay < Time:getBeginningOfServerToday()
end
function DailyTaskData:setInReset(isInReset)
self.isInReset = isInReset
end
function DailyTaskData:getIsInReset()
return self.isInReset
end
function DailyTaskData:getIsShowRedPoint()
return self.dailyTaskRedPoint > 0 or self.challengeTaskRedPoint > 0
end
function DailyTaskData:getIsShowDailyTaskRedPoint()
return self.dailyTaskRedPoint > 0
end
function DailyTaskData:getIsShowChallengeTaskRedPoint()
return self.challengeTaskRedPoint > 0
end
function DailyTaskData:unlockBountyTask()
if self.isUnlockBountyDailyTask then
return
end
self.isUnlockBountyDailyTask = true
local dirty = false
local taskCfg = self:getTaskCfg()
for k, v in pairs(self.dailyTasks) do
if v.lock then -- 有锁的要解锁
v.lock = false
dirty = true
self:registerTask(v, taskCfg[v.taskId].type)
end
end
if dirty then
self:markDailyTaskDirty()
end
end end
return DailyTaskData return DailyTaskData