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_PROG_REWARD = "FullMoonTaskProgReward",
FULL_MOON_SKIN_CHALLENGE_REWARD = "FullMoonSkinChallengeReward",
TASK_ACHIEVEMENT = "task_achievement",
}
BIReport.ADS_CLICK_TYPE = {
@ -378,6 +380,12 @@ local EVENT_BOX_OPEN = "client_box_open"
local EVENT_ACT_OPT = "client_act_opt"
local EVENT_NAME_RUNES = "client_runes"
BIReport.TASK_OPT = {
TASK_REWARD = "TaskReward",
STAGE_REWARD = "StageReward",
ACHIEVEMENT_REWARD = "AchievementReward",
}
function BIReport:setIsNewPlayer(isNewPlayer)
self.isNewPlayer = isNewPlayer
end
@ -1460,6 +1468,16 @@ function BIReport:postDailyTaskFinish(taskType, cfgId, taskId, refresh)
self:report(EVENT_NAME_DAILY_TASK, args)
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)
-- IsNew 是否是新用户

View File

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

View File

@ -5,10 +5,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=8,
["id_for_nothing"]="Xg==",
["num"]=1,
["num_for_nothing"]="Vw=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
@ -18,10 +18,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=23002,
["id_for_nothing"]="VAtcA2c=",
["num"]=10,
["num_for_nothing"]="Vwg="
["id"]=40,
["id_for_nothing"]="Ugg=",
["num"]=30,
["num_for_nothing"]="VQg="
}
}
},
@ -31,8 +31,8 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=10,
["id_for_nothing"]="Vwg=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -44,10 +44,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=5000,
["num_for_nothing"]="UwhcAw=="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
@ -57,10 +57,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=50,
["num_for_nothing"]="Uwg="
["id"]=16,
["id_for_nothing"]="Vw4=",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
@ -70,10 +70,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=10,
["id_for_nothing"]="Vwg=",
["num"]=1,
["num_for_nothing"]="Vw=="
["id"]=41,
["id_for_nothing"]="Ugk=",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
@ -96,10 +96,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=10000,
["num_for_nothing"]="VwhcA2U="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
@ -109,10 +109,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=11,
["id_for_nothing"]="Vwk=",
["num"]=1,
["num_for_nothing"]="Vw=="
["id"]=40,
["id_for_nothing"]="Ugg=",
["num"]=30,
["num_for_nothing"]="VQg="
}
}
},
@ -122,10 +122,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=60,
["num_for_nothing"]="UAg="
["id"]=41,
["id_for_nothing"]="Ugk=",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
@ -135,10 +135,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=54003,
["id_for_nothing"]="UwxcA2Y=",
["num"]=3,
["num_for_nothing"]="VQ=="
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
}
},
@ -148,10 +148,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=15000,
["num_for_nothing"]="Vw1cA2U="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
@ -161,10 +161,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=11,
["id_for_nothing"]="Vwk=",
["num"]=1,
["num_for_nothing"]="Vw=="
["id"]=40,
["id_for_nothing"]="Ugg=",
["num"]=30,
["num_for_nothing"]="VQg="
}
}
},
@ -174,10 +174,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=80,
["num_for_nothing"]="Xgg="
["id"]=16,
["id_for_nothing"]="Vw4=",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
@ -187,10 +187,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=34003,
["id_for_nothing"]="VQxcA2Y=",
["num"]=3,
["num_for_nothing"]="VQ=="
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
}
},
@ -200,10 +200,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=18000,
["num_for_nothing"]="VwBcA2U="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
@ -213,10 +213,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=18,
["id_for_nothing"]="VwA=",
["num"]=1,
["num_for_nothing"]="Vw=="
["id"]=40,
["id_for_nothing"]="Ugg=",
["num"]=30,
["num_for_nothing"]="VQg="
}
}
},
@ -226,10 +226,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=100,
["num_for_nothing"]="Vwhc"
["id"]=41,
["id_for_nothing"]="Ugk=",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
@ -239,10 +239,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=24003,
["id_for_nothing"]="VAxcA2Y=",
["num"]=3,
["num_for_nothing"]="VQ=="
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
}
},
@ -252,10 +252,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=20000,
["num_for_nothing"]="VAhcA2U="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
@ -265,10 +265,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=18,
["id_for_nothing"]="VwA=",
["num"]=1,
["num_for_nothing"]="Vw=="
["id"]=40,
["id_for_nothing"]="Ugg=",
["num"]=30,
["num_for_nothing"]="VQg="
}
}
},
@ -278,10 +278,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=120,
["num_for_nothing"]="Vwpc"
["id"]=16,
["id_for_nothing"]="Vw4=",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
@ -291,10 +291,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=47,
["id_for_nothing"]="Ug8=",
["num"]=5,
["num_for_nothing"]="Uw=="
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
}
},
@ -304,10 +304,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=24000,
["num_for_nothing"]="VAxcA2U="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
}
},
@ -317,8 +317,8 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=18,
["id_for_nothing"]="VwA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -330,10 +330,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=150,
["num_for_nothing"]="Vw1c"
["id"]=41,
["id_for_nothing"]="Ugk=",
["num"]=10,
["num_for_nothing"]="Vwg="
}
}
},
@ -343,10 +343,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=47,
["id_for_nothing"]="Ug8=",
["num"]=8,
["num_for_nothing"]="Xg=="
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
}
},
@ -356,10 +356,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=30000,
["num_for_nothing"]="VQhcA2U="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
}
},
@ -369,8 +369,8 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=18,
["id_for_nothing"]="VwA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -382,10 +382,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=180,
["num_for_nothing"]="VwBc"
["id"]=16,
["id_for_nothing"]="Vw4=",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
@ -395,10 +395,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=30000,
["num_for_nothing"]="VQhcA2U="
["id"]=41,
["id_for_nothing"]="Ugk=",
["num"]=10,
["num_for_nothing"]="Vwg="
}
}
},
@ -408,8 +408,8 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=14,
["id_for_nothing"]="Vww=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -421,10 +421,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=47,
["id_for_nothing"]="Ug8=",
["num"]=10,
["num_for_nothing"]="Vwg="
["id"]=17,
["id_for_nothing"]="Vw8=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
}
},
@ -434,10 +434,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=40000,
["num_for_nothing"]="UghcA2U="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
}
},
@ -447,8 +447,8 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=18,
["id_for_nothing"]="VwA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -460,10 +460,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=200,
["num_for_nothing"]="VAhc"
["id"]=16,
["id_for_nothing"]="Vw4=",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
@ -473,10 +473,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=40000,
["num_for_nothing"]="UghcA2U="
["id"]=41,
["id_for_nothing"]="Ugk=",
["num"]=15,
["num_for_nothing"]="Vw0="
}
}
},
@ -486,8 +486,8 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=15,
["id_for_nothing"]="Vw0=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -499,10 +499,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=47,
["id_for_nothing"]="Ug8=",
["num"]=12,
["num_for_nothing"]="Vwo="
["id"]=17,
["id_for_nothing"]="Vw8=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
}
},
@ -512,10 +512,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=50000,
["num_for_nothing"]="UwhcA2U="
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
}
},
@ -525,8 +525,8 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=18,
["id_for_nothing"]="VwA=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -538,10 +538,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=300,
["num_for_nothing"]="VQhc"
["id"]=16,
["id_for_nothing"]="Vw4=",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
@ -551,10 +551,10 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=50000,
["num_for_nothing"]="UwhcA2U="
["id"]=41,
["id_for_nothing"]="Ugk=",
["num"]=15,
["num_for_nothing"]="Vw0="
}
}
},
@ -564,8 +564,8 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=15,
["id_for_nothing"]="Vw0=",
["id"]=6,
["id_for_nothing"]="UA==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
@ -577,15 +577,262 @@ local arena_gift = {
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=47,
["id_for_nothing"]="Ug8=",
["num"]=15,
["num_for_nothing"]="Vw0="
["id"]=17,
["id_for_nothing"]="Vw8=",
["num"]=1,
["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 = {
data=arena_gift,count=45
data=arena_gift,count=64
}
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"
},
[100001]={
["res"]="sfx_m10001_b01",
["res"]="sfx_c1_m10001_01",
["bind"]="root"
},
[100002]={
["res"]="sfx_m10001_b02",
["res"]="sfx_c1_m10001_02",
["bind"]="root"
},
[100003]={
["res"]="sfx_m10001_b03",
["res"]="sfx_c1_m10001_03",
["bind"]="root"
},
[100004]={
["res"]="sfx_m10002_b01",
["res"]="sfx_c1_m10002_01",
["bind"]="root"
},
[100005]={
["res"]="sfx_m10002_b02",
["res"]="sfx_c1_m10002_02",
["bind"]="root"
},
[100006]={
["res"]="sfx_m10002_b03",
["res"]="sfx_c1_m10002_03",
["bind"]="root"
},
[100007]={
["res"]="sfx_m10003_b01",
["res"]="sfx_c1_m10003_01",
["bind"]="root"
},
[100008]={
["res"]="sfx_m10003_b02",
["res"]="sfx_c1_m10003_02",
["bind"]="root"
},
[100009]={
["res"]="sfx_m10003_b03",
["res"]="sfx_c1_m10003_03",
["bind"]="root"
},
[100010]={
["res"]="sfx_m10004_b01",
["res"]="sfx_c1_m10004_01",
["bind"]="root"
},
[100011]={
["res"]="sfx_m10004_b02",
["res"]="sfx_c1_m10004_02",
["bind"]="root"
},
[100012]={
["res"]="sfx_m10004_b03",
["res"]="sfx_c1_m10004_03",
["bind"]="root"
},
[100013]={
["res"]="sfx_m10005_b01",
["res"]="sfx_c1_m10005_01",
["bind"]="root"
},
[100014]={
["res"]="sfx_m10009_b01",
["res"]="sfx_c1_m10005_02",
["bind"]="root"
},
[100015]={
["res"]="sfx_m10009_b02",
["res"]="sfx_c1_m10005_03",
["bind"]="root"
},
[100016]={
["res"]="sfx_m10009_b03",
["res"]="sfx_c1_m10006_01",
["bind"]="root"
},
[100017]={
["res"]="sfx_m10010_b01",
["res"]="sfx_c1_m10006_02",
["bind"]="root"
},
[100018]={
["res"]="sfx_m10010_b02",
["res"]="sfx_c1_m10006_03",
["bind"]="root"
},
[100019]={
["res"]="sfx_m10010_b03",
["res"]="sfx_c1_m10007_01",
["bind"]="root"
},
[100020]={
["res"]="sfx_m10012_b01",
["res"]="sfx_c1_m10007_02",
["bind"]="root"
},
[100021]={
["res"]="sfx_m10012_b02",
["res"]="sfx_c1_m10007_03",
["bind"]="root"
},
[100022]={
["res"]="sfx_m10013_b01",
["res"]="sfx_c1_m10008_01",
["bind"]="root"
},
[100023]={
["res"]="sfx_m10013_b02",
["res"]="sfx_c1_m10008_02",
["bind"]="root"
},
[100024]={
["res"]="sfx_m10014_b01",
["res"]="sfx_c1_m10008_03",
["bind"]="root"
},
[100025]={
["res"]="sfx_m10014_b02",
["res"]="sfx_c1_m10009_01",
["bind"]="root"
},
[100026]={
["res"]="sfx_m10015_b01",
["res"]="sfx_c1_m10009_02",
["bind"]="root"
},
[100027]={
["res"]="sfx_m10015_b02",
["res"]="sfx_c1_m10009_03",
["bind"]="root"
},
[100028]={
["res"]="sfx_m10016_b01",
["res"]="sfx_c1_m10012_01",
["bind"]="root"
},
[100029]={
["res"]="sfx_m10016_b02",
["res"]="sfx_c1_m10012_02",
["bind"]="root"
},
[100030]={
["res"]="sfx_m10016_b03",
["res"]="sfx_c1_m10012_03",
["bind"]="root"
},
[100031]={
@ -1668,7 +1668,7 @@ local fx = {
["bind"]="root"
},
[300023]={
["res"]="sfx_c1_p25002_04",
["res"]="sfx_c1_p25002_05",
["bind"]="root"
},
[300024]={
@ -1692,63 +1692,83 @@ local fx = {
["bind"]="root"
},
[300029]={
["res"]="sfx_c1_p53001_01",
["res"]="sfx_c1_p55001_01",
["bind"]="root"
},
[300030]={
["res"]="sfx_c1_p53001_02",
["res"]="sfx_c1_p55001_02",
["bind"]="root"
},
[300031]={
["res"]="sfx_c1_p53001_03",
["res"]="sfx_c1_p55001_03",
["bind"]="root"
},
[300032]={
["res"]="sfx_c1_p53001_04",
["res"]="sfx_c1_p55001_04",
["bind"]="root"
},
[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"
},
[300039]={
["res"]="sfx_p0009_b05",
["res"]="sfx_c1_p15001_01",
["bind"]="root"
},
[300040]={
["res"]="sfx_p0010_b01",
["res"]="sfx_c1_p15001_02",
["bind"]="root"
},
[300041]={
["res"]="sfx_p0010_b02",
["res"]="sfx_c1_p15001_03",
["bind"]="root"
},
[300042]={
["res"]="sfx_p0010_b03",
["res"]="sfx_c1_p15001_04",
["bind"]="root"
},
[300043]={
["res"]="sfx_p0010_b04",
["res"]="sfx_c1_p15001_05",
["bind"]="root"
},
[300044]={
["res"]="sfx_p0010_b05",
["res"]="sfx_c1_p16001_01",
["bind"]="root"
},
[300045]={
["res"]="sfx_p0011_b01",
["res"]="sfx_c1_p16001_02",
["bind"]="root"
},
[300046]={
["res"]="sfx_p0011_b02",
["res"]="sfx_c1_p16001_03",
["bind"]="root"
},
[300047]={
["res"]="sfx_p0011_b03",
["res"]="sfx_c1_p16001_04",
["bind"]="root"
},
[300048]={
["res"]="sfx_p0011_b04",
["res"]="sfx_c1_p16001_05",
["bind"]="root"
},
[300049]={
@ -3257,6 +3277,6 @@ local fx = {
}
}
local config = {
data=fx,count=761
data=fx,count=766
}
return config

View File

@ -131,6 +131,894 @@ local item = {
["qlt"]=4,
["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]={
["type"]=5,
["parameter"]=13001,
@ -265,6 +1153,6 @@ local item = {
}
}
local config = {
data=item,count=42
data=item,count=66
}
return config

View File

@ -95,42 +95,42 @@ local monster_base = {
["model_ui"]=1.0
},
[20001]={
["model_id"]="m10001",
["model_id"]="m20001",
["body"]=1,
["model_ui"]=1.0
},
[20002]={
["model_id"]="m10002",
["model_id"]="m20002",
["body"]=1,
["model_ui"]=1.0
},
[20003]={
["model_id"]="m10003",
["model_id"]="m20003",
["body"]=1,
["model_ui"]=1.0
},
[20004]={
["model_id"]="m10004",
["model_id"]="m20004",
["body"]=1,
["model_ui"]=1.0
},
[20005]={
["model_id"]="m10005",
["model_id"]="m20005",
["body"]=1,
["model_ui"]=1.0
},
[20006]={
["model_id"]="m10006",
["model_id"]="m20006",
["body"]=1,
["model_ui"]=1.0
},
[20007]={
["model_id"]="m10007",
["model_id"]="m20007",
["body"]=1,
["model_ui"]=1.0
},
[20008]={
["model_id"]="m10008",
["model_id"]="m20008",
["body"]=1,
["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",
["num"]=200000
}
}
},
["icon"]="talent_1"
},
[2]={
["qlt"]=1,
@ -15,7 +16,8 @@ local talent = {
["type"]="attr_hp_all",
["num"]=600000
}
}
},
["icon"]="talent_2"
},
[3]={
["qlt"]=1,
@ -24,7 +26,8 @@ local talent = {
["type"]="attr_dmgdec_all",
["num"]=20000
}
}
},
["icon"]="talent_3"
},
[4]={
["qlt"]=2,
@ -33,7 +36,8 @@ local talent = {
["type"]="atk_all",
["num"]=300000
}
}
},
["icon"]="talent_4"
},
[5]={
["qlt"]=2,
@ -42,7 +46,8 @@ local talent = {
["type"]="attr_hp_all",
["num"]=900000
}
}
},
["icon"]="talent_5"
},
[6]={
["qlt"]=2,
@ -51,7 +56,8 @@ local talent = {
["type"]="attr_dmgdec_all",
["num"]=30000
}
}
},
["icon"]="talent_6"
},
[7]={
["qlt"]=2,
@ -60,7 +66,8 @@ local talent = {
["type"]="attr_crit_all",
["num"]=100
}
}
},
["icon"]="talent_7"
},
[8]={
["qlt"]=2,
@ -69,27 +76,32 @@ local talent = {
["type"]="attr_crit_time_all",
["num"]=500
}
}
},
["icon"]="talent_8"
},
[9]={
["qlt"]=3,
["value"]=1,
["fight"]=1000
["fight"]=1000,
["icon"]="talent_9"
},
[10]={
["qlt"]=3,
["value"]=500000,
["fight"]=500
["fight"]=500,
["icon"]="talent_10"
},
[11]={
["qlt"]=3,
["value"]=1,
["fight"]=1000
["fight"]=1000,
["icon"]="talent_11"
},
[12]={
["qlt"]=3,
["value"]=500,
["fight"]=1000
["fight"]=1000,
["icon"]="talent_12"
},
[13]={
["qlt"]=3,
@ -98,7 +110,8 @@ local talent = {
["type"]="attr_normal_hurtp_all",
["num"]=500
}
}
},
["icon"]="talent_13"
},
[14]={
["qlt"]=3,
@ -107,7 +120,8 @@ local talent = {
["type"]="attr_skill_hurtp_all",
["num"]=500
}
}
},
["icon"]="talent_14"
},
[15]={
["qlt"]=3,
@ -116,12 +130,14 @@ local talent = {
["type"]="attr_atkp_all",
["num"]=500
}
}
},
["icon"]="talent_15"
},
[16]={
["qlt"]=3,
["value"]=1000,
["fight"]=1000
["fight"]=1000,
["icon"]="talent_16"
}
}
local config = {

View File

@ -1977,4 +1977,35 @@ function GFunc.getFinalAttrValue(allAttrs, fixedId, factorId)
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

View File

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

View File

@ -132,9 +132,6 @@ function TaskManager:addTaskProgress(type, ...)
end
function TaskManager:dispatchTask(type, count)
if DataManager.DailyTaskData:getIfCanReset() then -- 跨天了
ModuleManager.TaskManager:resetDailyTask()
end
if not self.registerTaskInfo then
return
end
@ -149,6 +146,29 @@ function TaskManager:dispatchTask(type, count)
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)
self:dispatchTask(GConst.TaskConst.TASK_TYPE.X_KILL_MONSTER, count)

View File

@ -3,8 +3,8 @@ local ArenaGradingRewardCell = class("ArenaGradingRewardCell", BaseCell)
-- 光效
local EFFECT_LIGHT = "assets/prefabs/effects/ui/vfx_ui_arena_gift_b01.prefab"
local COMMON_GRADING_POSY = 265
local UNLOCK_GRADING_POSY = 375
local COMMON_GRADING_POSY = 242
local UNLOCK_GRADING_POSY = 346
function ArenaGradingRewardCell:init()
local uiMap = self:getUIMap()
@ -30,14 +30,6 @@ function ArenaGradingRewardCell:init()
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))
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()
if DataManager.ArenaData:canGetGradingReward(self.id) and not DataManager.ArenaData:isReceivedGradingReward(self.id) then
@ -60,12 +52,12 @@ function ArenaGradingRewardCell:refresh(id)
-- Logger.logHighlight(id.."当前进度:"..cfg.score.."/" .. curProg .."/"..maxProg)
self.spineGradingRoot:removeAllChildren()
-- self.spineGradingRoot:removeAllChildren()
local gradingId = DataManager.ArenaData:getGradingIdFromScore(cfg.score)
SpineManager:loadUISpineWidgetAsync(DataManager.ArenaData:getGradingIconName(gradingId).."_spine", self.spineGradingRoot, function(spineObject)
spineObject:setSkin(DataManager.ArenaData:getGradingNumName(gradingId))
spineObject:playAnim("idle", true)
end)
-- SpineManager:loadUISpineWidgetAsync(DataManager.ArenaData:getGradingIconName(gradingId).."_spine", self.spineGradingRoot, function(spineObject)
-- spineObject:setSkin(DataManager.ArenaData:getGradingNumName(gradingId))
-- spineObject:playAnim("idle", true)
-- end)
self.txGrading:setText(DataManager.ArenaData:getGradingName(gradingId))
self.baseObject:setSizeDeltaY(DataManager.ArenaData:getGradingRewardItemHeight(self.id))
@ -75,7 +67,6 @@ function ArenaGradingRewardCell:refresh(id)
else
self.gradingNode:setActive(false)
end
self.heroUnlock:setActive(false)
local minScore = DataManager.ArenaData:getSeasonGradingMinScore()
self.txTag:setText(curPoint - minScore)
@ -116,10 +107,10 @@ function ArenaGradingRewardCell:refresh(id)
self.rootEffect:removeAllChildren()
if canGet and not isReceived then
EffectManager:loadUIEffectAsync(EFFECT_LIGHT, self.uiRoot, self.rootEffect, GConst.UI_EFFECT_ORDER.LEVEL5, function(obj)
obj:setAnchoredPosition(0, 0)
obj:play()
end)
-- EffectManager:loadUIEffectAsync(EFFECT_LIGHT, self.uiRoot, self.rootEffect, GConst.UI_EFFECT_ORDER.LEVEL5, function(obj)
-- obj:setAnchoredPosition(0, 0)
-- obj:play()
-- end)
end
for idx, reward in ipairs(self.rewards) do

View File

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

View File

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

View File

@ -10,7 +10,6 @@ function PopHeroCell:init()
self.progressTx = uiMap["pop_hero_cell.progress_bg.progress_tx"]
self.lvUpArrow = uiMap["pop_hero_cell.effect_node.ui_spine_obj"]
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.newTx = uiMap["pop_hero_cell.new_bg.text"]
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.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.sImg:setVisible(heroInfo.qlt >= 4)
end
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.nameTx = uiMap["task_cell.name_tx"]
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.getBtnRoot = uiMap["task_cell.get_btn"]
local getBtn = uiMap["task_cell.get_btn.btn"]
getBtn:addClickListener(function()
if self.taskId then
self.pointTx = uiMap["task_cell.point_tx"]
self.getBtn = uiMap["task_cell.get_btn"]
self.getBtnTx = uiMap["task_cell.get_btn.text"]
self.getBtn:addClickListener(function()
if DataManager.DailyTaskData:canClaimTask(self.taskId) then
ModuleManager.TaskManager:claimDailyTask(self.taskId)
else
-- ModuleManager.TaskManager:goToTask(self.taskType)
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
function DailyTaskCell:refresh(task)
self.taskId = task.id
local icon = DataManager.DailyTaskData:getDailyTaskIcon(task.id)
self.icon:setSprite(GConst.ATLAS_PATH.ICON_TASK, icon)
local taskDesc = DataManager.DailyTaskData:getDailyTaskDesc(task.id)
self.nameTx:setText(taskDesc)
function DailyTaskCell:refresh(taskId)
self.taskId = taskId
self.taskType = DataManager.DailyTaskData:getTaskType(self.taskId)
-- local icon = DataManager.DailyTaskData:getDailyTaskIcon(task.id)
-- self.icon:setSprite(GConst.ATLAS_PATH.ICON_TASK, icon)
if task.lock then
self.lockNode:setVisible(true)
self.lockBg:setVisible(true)
self.progressBg:setVisible(false)
self.refreshBtnRoot:setVisible(false)
self.getBtnRoot:setVisible(false)
self.adBtnRoot:setVisible(false)
self.completeNode:setVisible(false)
local taskTarget = DataManager.DailyTaskData:getTaskTarget(self.taskId)
local taskProg = DataManager.DailyTaskData:getTaskProg(self.taskId)
taskProg = taskProg > taskTarget and taskTarget or taskProg
self.pointTx:setText(DataManager.DailyTaskData:getTaskPoint(self.taskId))
self.progress.value = taskProg / taskTarget
self.progressTx:setText(taskProg.."/"..taskTarget)
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
self.lockBg:setVisible(false)
self.lockNode:setVisible(false)
self.progressBg:setVisible(true)
local count = task.progress
local needCount = task.needProgress
if task.claimed then -- 已经领过了
self.completeNode:setVisible(true)
self.getBtnRoot:setVisible(false)
self.refreshBtnRoot:setVisible(false)
self.adBtnRoot:setVisible(false)
if count >= needCount then
count = needCount
end
-- 未完成 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:isTaskFinished(self.taskId) then
self.getBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_CLAIM))
self.getBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_blue_1")
else
self.completeNode:setVisible(false)
if count >= needCount then
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)
self.getBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_21))
self.getBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_yellow_1")
end
else
self.refreshBtnRoot:setVisible(false)
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

View File

@ -1,52 +1,13 @@
local TaskMainUI = class("TaskMainUI", BaseUI)
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 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
local ACHIEVEMENT_TASK_CELL = "app/ui/task/cell/achievement_task_cell"
function TaskMainUI:onPressBackspace()
self:closeUI()
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()
return false
end
@ -55,44 +16,6 @@ function TaskMainUI:getPrefabPath()
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
function TaskMainUI:onClose()
if self.menuOneRedPointTween then
self.menuOneRedPointTween:Kill()
@ -102,107 +25,67 @@ function TaskMainUI:onClose()
end
end
function TaskMainUI:ctor(params)
self.page = params and params.page or PAGE_DAILY
self.dailyTaskList = {}
self.achievementTaskList = {}
end
function TaskMainUI:onLoadRootComplete()
self.uiMap = self.root:genAllChildren()
self.uiMap["task_main_ui.bg.close_btn"]:addClickListener(function()
local uiMap = self.root:genAllChildren()
uiMap["task_main_ui.bg.close_btn"]:addClickListener(function()
self:closeUI()
end)
self:initTitle()
self:initPage()
self:initCountDown()
self:bindData()
self:scheduleGlobal(function()
self:updateTime()
end, 1)
self:updateTime()
end
self.titleTx = uiMap["task_main_ui.bg.title_tx"]
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)
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)
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
self.menuOneRedPoint = uiMap["task_main_ui.bg.red_point_1"]
self.menuTwoRedPoint = uiMap["task_main_ui.bg.red_point_2"]
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)
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
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 = uiMap["task_main_ui.bg.daily.scrollrect"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
self.dailyTaskScrollRect:addInitCallback(function()
return DAILY_TASK_CELL
end)
@ -210,231 +93,173 @@ function TaskMainUI:initDailyTasks()
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.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 DAILY_TASK_CELL
return ACHIEVEMENT_TASK_CELL
end)
self.challengeTaskScrollRect:addRefreshCallback(function(index, cell)
cell:refresh(self.challengeTaskList[index])
cell:refresh(self.achievementTaskList[index])
end)
self.challengeTaskScrollRect:clearCells()
self.challengeTaskScrollRect:refillCells(#self.challengeTaskList)
end
self.challengeTaskScrollRect:refillCells(#self.achievementTaskList)
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"]
self.timeTx = uiMap["task_main_ui.bg.daily.time_tx"]
self:bindData()
self:scheduleGlobal(function()
self:updateTime()
end, 1)
self:updateTime()
end
function TaskMainUI:bindData()
self:bind(DataManager.DailyTaskData, "dailyTaskDirty", function()
if self.delayRefreshSid then
self:unscheduleGlobal(self.delayRefreshSid)
end
self.delayRefreshSid = self:performWithDelayGlobal(function()
self.delayRefreshSid = nil
sortTask(self.dailyTaskList)
sortTask(self.challengeTaskList)
self:bind(DataManager.DailyTaskData, "isDirty", function()
self:onRefresh()
end, 0.1)
end)
self:bind(DataManager.DailyTaskData, "resetFlag", function()
if self.delayRefreshSid then
self:unscheduleGlobal(self.delayRefreshSid)
end
function TaskMainUI:updateTime()
if self.page ~= PAGE_DAILY then
return
end
self.delayRefreshSid = self:performWithDelayGlobal(function()
self.delayRefreshSid = nil
self:initTaskList()
self:onRefresh()
end, 0.1)
end)
self.timeTx:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_22, Time:formatNumTimeStr(Time:getTodaySurplusTime())))
end
function TaskMainUI:onRefresh()
self:switchPage(self.page)
self:refreshPageBtn()
self:refreshPageInfo()
end
function TaskMainUI:switchPage(page)
self.page = page
if page == PAGE_DAILY then
self.menuOneOn:setVisible(true)
self.menuOneOff:setVisible(false)
self.menuTwoOn:setVisible(false)
self.menuTwoOff:setVisible(true)
self.dailyNode:setAnchoredPositionX(0)
self.challengeNode:setAnchoredPositionX(GConst.NOT_VISIBLE_POS)
function TaskMainUI:refreshPageBtn()
for i = 1, 2 do
if self.page == i then
self.pageBtns[i]:setSprite(GConst.ATLAS_PATH.COMMON, "common_tab_1")
self.pageBtnTxs[i]:setText(self.btnTxs[i])
else
self.pageBtns[i]:setSprite(GConst.ATLAS_PATH.COMMON, "common_tab_2")
self.pageBtnTxs[i]:setText("<color=#72778C>" .. self.btnTxs[i] .. "</color>")
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()
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
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()
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
function TaskMainUI:refreshDaily()
self:refreshDailyTaskAdCell()
self:refreshDailyTaskFinalCell()
self:refreshDailyTasks()
end
self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.TASK_NAME))
local stageIds = DataManager.DailyTaskData:getStageIds()
local curScore = DataManager.DailyTaskData:getCurStageScore()
local targetList = DataManager.DailyTaskData:getStageTargetList()
self.dailyTaskFinalCellProgressTx:setText(curScore)
self.dailyTaskFinalCellProgress.value = GFunc.getUnevenSliderValue(targetList, curScore)
function TaskMainUI:refreshDailyTaskAdCell()
local taskId = DataManager.DailyTaskData:getDailyTaskAdId()
local taskDesc = DataManager.DailyTaskData:getDailyTaskDesc(taskId)
self.dailyTaskAdCellNameTx:setText(taskDesc)
local count, needCount = DataManager.DailyTaskData:getDailyTaskProgress(taskId)
if count >= needCount then
count = needCount
end
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()
for i, item in ipairs(self.boxBtns) do
local stageId = stageIds[i]
if stageId then
item:setActive(true)
-- item:initPrefabHelper()
-- local map = item:genAllChildren()
-- local spineBox = map["box.spine_box"]
-- local txNum = map["box.tx_num"]
if self.curAdCanGet then
self.adBoxSpineObj:playAnimComplete("open", false, true, function()
self.adBoxSpineObj:playAnim("idle01", true, false)
-- txNum:setText(DataManager.DailyTaskData:getStageCondition(stageId))
-- if DataManager.DailyTaskData:canClaimStage(stageId) then
-- spineBox:playAnim("ready", true, false, false)
-- elseif DataManager.DailyTaskData:isStageReceived(stageId) then
-- spineBox:playAnim("idle02", true, false, false)
-- else
-- spineBox:playAnim("idle01", true, false, false)
-- end
if DataManager.DailyTaskData:canClaimStage(stageId) then
item:addClickListener(function()
self:onClickBox()
end)
else
self.adBoxSpineObj:playAnim("idle01", true, false)
end
self.curAdCanGet = false
end
self.dailyTaskAdCellProgressTx:setText(count .. "/" .. needCount)
self.dailyTaskAdCellProgress:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = count/needCount
end
function TaskMainUI:refreshDailyTaskFinalCell()
local taskId = DataManager.DailyTaskData:getDailyTaskFinalId()
local taskDesc = DataManager.DailyTaskData:getDailyTaskDesc(taskId)
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)
item:addClickListener(function()
ModuleManager.TipsManager:showRewardsTips(DataManager.DailyTaskData:getStageReward(stageId), nil, item)
end)
else
self.finalBoxSpineObj:playAnim("idle02", true, false)
end
else
self.finalBoxSpineObj:playAnim("idle01", true, false)
item:setActive(false)
end
self.curFinalCanGet = false
end
self.dailyTaskFinalCellProgressTx:setText(count .. "/" .. needCount)
self.dailyTaskFinalCellProgress:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = count/needCount
end
function TaskMainUI:refreshDailyTasks()
if self.dailyTaskScrollRect == nil then
self:initDailyTasks()
else
if self.dailyTaskScrollRect:getTotalCount() == #self.dailyTaskList then
self.dailyTaskScrollRect:updateAllCell()
else
self.dailyTaskScrollRect:clearCells()
self.dailyTaskList = DataManager.DailyTaskData:getTaskIdsSort()
self.dailyTaskScrollRect:refillCells(#self.dailyTaskList)
end
end
-- 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
function TaskMainUI:onClickBox()
-- local isFirst = true
-- local stageIds = DataManager.DailyTaskData:getStageIds()
-- for i, item in ipairs(self.boxItems) do
-- local stageId = stageIds[i]
-- if stageId and DataManager.DailyTaskData:canClaimStage(stageId) then
-- item:initPrefabHelper()
-- local map = item:genAllChildren()
-- local spineBox = map["box.spine_box"]
-- 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
function TaskMainUI:refreshChallenge()
if self.challengeTaskScrollRect == nil then
self:initChallengeTasks()
else
if self.challengeTaskScrollRect:getTotalCount() == #self.challengeTaskList then
self.challengeTaskScrollRect:updateAllCell()
else
self.challengeTaskScrollRect:clearCells()
self.challengeTaskScrollRect:refillCells(#self.challengeTaskList)
end
end
end
function TaskMainUI:showHelp()
local params = {
content = I18N:getGlobalText(I18N.GlobalConst.TASK_HELP_1),
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
}
GFunc.showMessageBox(params)
end
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))
-- self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.TASK_NAME))
self.titleTx:setText("成就")
self.achievementTaskList = DataManager.DailyTaskData:getAchievementIdsSort()
self.challengeTaskScrollRect:refillCells(#self.achievementTaskList)
-- if DataManager.DailyTaskData:getIsShowChallengeTaskRedPoint() then
-- self.menuTwoRedPoint:setActive(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:setActive(false)
-- end
-- if self.menuOneRedPointTween then
-- self.menuOneRedPointTween:Pause()
-- end
-- self.menuOneRedPoint:setActive(false)
end
function TaskMainUI:getShakeTween(obj)

View File

@ -1,432 +1,451 @@
local DailyTaskData = class("DailyTaskData", BaseData)
local DAILY_TASK_AD_ID = 1
local DAILY_TASK_FINAL_ID = 2
local DATA_NAME = "DailyTaskData"
local TaskDailyCfg = ConfigManager:getConfig("task_daily")
local TaskDailyStageCfg = ConfigManager:getConfig("task_daily_stage")
local TaskAchievementCfg = ConfigManager:getConfig("task_achievement")
function DailyTaskData:ctor()
self.data.dailyTaskDirty = 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
self.data.isDirty = false
end
function DailyTaskData:init(data)
local tasks = data and data.tasks
local cfg = self:getDailyTaskCfg()
local taskCfg = self:getTaskCfg()
for k, v in pairs(self.dailyTasks) do
self.dailyTasks[k] = nil
end
for k, v in pairs(self.taskTypeMap) do
for i = 1, #v do
table.remove(v)
end
end
self.isUnlockBountyDailyTask = DataManager.BountyData:getBought()
local dailyRedPoint = 0
local challengeRedPoint = 0
ModuleManager.TaskManager:unRegisterAllModuleTask(DATA_NAME)
for k, v in pairs(cfg) do
local task = tasks and tasks[k] or GConst.EMPTY_TABLE
local taskInfo = taskCfg[task.task_id]
if taskInfo then
local dailyTaskObj = {
id = k,
taskId = task.task_id,
progress = task.progress,
needProgress = taskInfo.number,
refresh = task.refresh,
claimed = task.claimed,
type = v.type,
reset = v.reset
}
if v.bounty then
if self.isUnlockBountyDailyTask then
dailyTaskObj.lock = false
else
dailyTaskObj.lock = true
end
else
dailyTaskObj.lock = false
end
if dailyTaskObj.lock then
dailyTaskObj.redPoint = false
else
if not dailyTaskObj.claimed and dailyTaskObj.progress >= dailyTaskObj.needProgress then
dailyTaskObj.redPoint = true
if dailyTaskObj.type == 1 then
dailyRedPoint = dailyRedPoint + 1
else
challengeRedPoint = challengeRedPoint + 1
end
else
dailyTaskObj.redPoint = false
end
local list = self.taskTypeMap[taskInfo.type]
if list == nil then
list = {}
self.taskTypeMap[taskInfo.type] = list
end
table.insert(list, dailyTaskObj)
if #list == 1 then
self:registerTaskWithType(taskInfo.type)
end
end
self.dailyTasks[k] = dailyTaskObj
end
end
self.initDay = Time:getBeginningOfServerToday()
self.isInReset = false
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
function DailyTaskData:clear()
DataManager:unregisterCrossDayFunc("DailyTaskData")
ModuleManager.TaskManager:unRegisterAllModuleTask("DailyTaskData")
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
function DailyTaskData:setDirty()
self.data.isDirty = not self.data.isDirty
end
function DailyTaskData:getIsOpen()
return ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.TASK, true)
end
function DailyTaskData:init(daily, achievement)
daily = daily or {}
achievement = achievement or {}
function DailyTaskData:getDailyResetTime()
return 86400 - Time:getServerTime() % 86400
end
--任务领取状态&进度
self.dailyTaskData = daily.tasks or {}
-- 活跃度
self.dayPoint = daily.point or 0
-- 活跃度领奖
self.progRewardData = daily.stage_reward_claimed or {}
function DailyTaskData:getDailyTaskAdReward()
local task = self.dailyTasks[DAILY_TASK_AD_ID]
if task == nil then
return nil
-- 成就任务
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
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
table.sort(self.dailyTaskIds)
-- 阶段配置
self.dailyStageIds = {}
for id, info in pairs(TaskDailyStageCfg) do
table.insert(self.dailyStageIds, id)
end
local cfg = self:getTaskCfg()
return cfg[task.taskId].reward
end
table.sort(self.dailyStageIds)
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
-- 监听任务
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: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
function DailyTaskData:getIsOpen(showToast)
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.TASK, not showToast) then
return false
end
return true
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)
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: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)
function DailyTaskData:showDailyRedPoint()
for idx, id in pairs(self.dailyTaskIds) do
if self:canClaimTask(id) then
self.dailyRedState = true
return true
end
end
if dirty then
self:markDailyTaskDirty()
for idx, id in pairs(self.dailyStageIds) do
if self:canClaimStage(id) then
self.dailyRedState = true
return true
end
end
self.dailyRedState = false
return false
end
function DailyTaskData:showAchievementRedPoint()
for id, info in pairs(TaskAchievementCfg) do
for stage = 1, self:getAchievementTotalStage(id) do
if self:canClaimAchievement(id, stage) then
self.achievementRedState = true
return true
end
end
end
self.achievementRedState = false
return false
end
-- 是否完成全部每日任务
function DailyTaskData:isAllDailyTaskFinished()
for idx, id in pairs(self.dailyTaskIds) do
if not self:isTaskReceived(id) then
return false
end
end
for idx, id in pairs(self.dailyStageIds) do
if not self:isStageReceived(id) then
return false
end
end
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
else
self.achievementRewardData[achievementId] = stage
end
self.achievementRedState = nil
self:setDirty()
end
return DailyTaskData