This commit is contained in:
xiekaidong 2023-06-26 15:28:43 +08:00
commit f17eeb8e68
62 changed files with 20002 additions and 34 deletions

View File

@ -98,9 +98,13 @@ end
function UISpineObject:playAnimComplete(animName, loop, forceRefresh, complete, forceGetSG) function UISpineObject:playAnimComplete(animName, loop, forceRefresh, complete, forceGetSG)
local spineAnim = self:getAnimation(self:playAnim(animName, loop, forceRefresh, forceGetSG)) local spineAnim = self:getAnimation(self:playAnim(animName, loop, forceRefresh, forceGetSG))
local duration = spineAnim.Duration local duration = spineAnim.Duration
local sequence = self:createBindTweenSequence() if self.playAnimCompleteSeq then
sequence:AppendInterval(duration) self.playAnimCompleteSeq:Kill()
sequence:OnComplete(complete) self.playAnimCompleteSeq = nil
end
self.playAnimCompleteSeq = self:createBindTweenSequence()
self.playAnimCompleteSeq:AppendInterval(duration)
self.playAnimCompleteSeq:OnComplete(complete)
return duration return duration
end end

View File

@ -73,6 +73,9 @@ BIReport.ITEM_GET_TYPE = {
BOUNTY_UNLOCK_LEVEL = "BountyUnlockLevel", BOUNTY_UNLOCK_LEVEL = "BountyUnlockLevel",
BOUNTY_REWARD = "BountyReward", BOUNTY_REWARD = "BountyReward",
BOUNTY = "Bounty", BOUNTY = "Bounty",
ARENA_BOUNTY_UNLOCK_LEVEL = "ArenaBountyUnlockLevel",
ARENA_BOUNTY_REWARD = "ArenaBountyReward",
ARENA_BOUNTY = "ArenaBounty",
IDLE_DROP = "IdleDrop", IDLE_DROP = "IdleDrop",
IDLE_QUICK_DROP = "IdleQuickDrop", IDLE_QUICK_DROP = "IdleQuickDrop",
MAIL = "Mail", MAIL = "Mail",
@ -160,6 +163,7 @@ BIReport.GIFT_TYPE = {
ACT_CHAPTER_STORE = "ActChapterStore", ACT_CHAPTER_STORE = "ActChapterStore",
GROWTH_FUND = "GrowthFund", GROWTH_FUND = "GrowthFund",
GROW_UP_GIFT = "GrowUpGift", GROW_UP_GIFT = "GrowUpGift",
ARENA_BOUNTY = "ArenaBounty",
} }
BIReport.COIN_TYPE = { BIReport.COIN_TYPE = {
@ -176,6 +180,8 @@ BIReport.MAIL_OPT_TYPE = {
BIReport.BOUNTY_OPT_TYPE = { BIReport.BOUNTY_OPT_TYPE = {
BOUNTY_LEVEL_UP = "BountyLevelUp", BOUNTY_LEVEL_UP = "BountyLevelUp",
BOUNTY_REWARD = "BountyReward", BOUNTY_REWARD = "BountyReward",
ARENA_BOUNTY_LEVEL_UP = "ArenaBountyLevelUp",
ARENA_BOUNTY_REWARD = "ArenaBountyReward",
} }
BIReport.HERO_OPT_TYPE = { BIReport.HERO_OPT_TYPE = {
@ -218,7 +224,7 @@ local EVENT_NAME_MAIL_OPT = "client_mail_opt"
local EVENT_NAME_HERO_OPT = "client_hero_opt" local EVENT_NAME_HERO_OPT = "client_hero_opt"
local EVENT_NAME_PLAYER_LV_UP = "client_player_lv_up" -- 玩家升级 local EVENT_NAME_PLAYER_LV_UP = "client_player_lv_up" -- 玩家升级
local EVENT_NAME_PAY_UI_SHOW = "client_pay_ui_show" -- 内购相关界面展示 local EVENT_NAME_PAY_UI_SHOW = "client_pay_ui_show" -- 内购相关界面展示
local EVENT_NAME_BOUNTY_OPT = "client_bounty_opt" -- 战令事件 local EVENT_NAME_BOUNTY_OPT = "client_bounty_opt" -- 通用战令事件(包括常规,竞技场等)
local EVENT_NAME_NETWORK_OPT = "client_network_opt" -- 网络操作 local EVENT_NAME_NETWORK_OPT = "client_network_opt" -- 网络操作
local EVENT_NAME_APPLOVIN_AD_REVENUE = "client_applovin_ad_revenue" -- applovin广告收入 local EVENT_NAME_APPLOVIN_AD_REVENUE = "client_applovin_ad_revenue" -- applovin广告收入
local EVENT_NAME_DAILY_CHALLENGE_OPT = "client_daily_challenge_opt" local EVENT_NAME_DAILY_CHALLENGE_OPT = "client_daily_challenge_opt"
@ -966,6 +972,30 @@ function BIReport:postBountyReward(bountyType, level, exp, season, rewardLevelId
self:report(EVENT_NAME_BOUNTY_OPT, args) self:report(EVENT_NAME_BOUNTY_OPT, args)
end end
function BIReport:postArenaBountyLevelUp(bountyType, level, exp, season)
local args = {
event_type = BIReport.BOUNTY_OPT_TYPE.ARENA_BOUNTY_LEVEL_UP,
season = season,
bounty_level_id = level,
exp = exp,
bounty_type = bountyType,
}
self:report(EVENT_NAME_BOUNTY_OPT, args)
end
function BIReport:postArenaBountyReward(bountyType, level, exp, season, rewardLevelId, isPro)
local args = {
event_type = BIReport.BOUNTY_OPT_TYPE.ARENA_BOUNTY_REWARD,
season = season,
level = level,
exp = exp,
bounty_type = bountyType,
level_id = rewardLevelId,
is_pro = isPro,
}
self:report(EVENT_NAME_BOUNTY_OPT, args)
end
function BIReport:postNetWorkOpt(optType, uiName, errorCode, disconnectTime) function BIReport:postNetWorkOpt(optType, uiName, errorCode, disconnectTime)
local args = { local args = {
event_type = optType, event_type = optType,

View File

@ -20,6 +20,7 @@ function DataManager:init()
self:initManager("ActivityData", "app/userdata/activity/activity_data") self:initManager("ActivityData", "app/userdata/activity/activity_data")
self:initManager("GoldPigData", "app/userdata/activity/gold_pig/gold_pig_data") self:initManager("GoldPigData", "app/userdata/activity/gold_pig/gold_pig_data")
self:initManager("BountyData", "app/userdata/bounty/bounty_data") self:initManager("BountyData", "app/userdata/bounty/bounty_data")
self:initManager("ArenaBountyData", "app/userdata/arena/arena_bounty_data")
self:initManager("TaskData", "app/userdata/task/task_data") self:initManager("TaskData", "app/userdata/task/task_data")
self:initManager("DailyTaskData", "app/userdata/task/daily_task_data") self:initManager("DailyTaskData", "app/userdata/task/daily_task_data")
self:initManager("IdleData", "app/userdata/idle/idle_data") self:initManager("IdleData", "app/userdata/idle/idle_data")
@ -95,6 +96,7 @@ function DataManager:clear()
self.MailData:clear() self.MailData:clear()
self.GoldPigData:clear() self.GoldPigData:clear()
self.BountyData:clear() self.BountyData:clear()
self.ArenaBountyData:clear()
self.DailyTaskData:clear() self.DailyTaskData:clear()
self.IdleData:clear() self.IdleData:clear()
self.GrowthFundData:clear() self.GrowthFundData:clear()
@ -131,6 +133,7 @@ function DataManager:initWithServerData(data)
self.ActivityData:init() self.ActivityData:init()
self.GoldPigData:init(data.pig, true) self.GoldPigData:init(data.pig, true)
self.BountyData:init(data.bounty) self.BountyData:init(data.bounty)
self.ArenaBountyData:init(data.arena_bounty)
-- 任务要在BountyData之后初始化依赖BountyData的数据 -- 任务要在BountyData之后初始化依赖BountyData的数据
self.DailyTaskData:init(data.task_daily) self.DailyTaskData:init(data.task_daily)
self.IdleData:init(data.idle) self.IdleData:init(data.idle)

View File

@ -33,6 +33,7 @@ local LOCAL_DATA_KEY = {
CHALLENGE_TASK_POP_TIME = "CHALLENGE_TASK_POP_TIME", CHALLENGE_TASK_POP_TIME = "CHALLENGE_TASK_POP_TIME",
NEW_AVATAR_AND_FRAME = "NEW_AVATAR_AND_FRAME", NEW_AVATAR_AND_FRAME = "NEW_AVATAR_AND_FRAME",
SHOP_DISCOUNT_RED_POINT_TIME = "SHOP_DISCOUNT_RED_POINT_TIME", SHOP_DISCOUNT_RED_POINT_TIME = "SHOP_DISCOUNT_RED_POINT_TIME",
ARENA_BOUNTY_POP_TIME = "ARENA_BOUNTY_POP_TIME",
} }
LocalData.KEYS = LOCAL_DATA_KEY LocalData.KEYS = LOCAL_DATA_KEY
@ -393,4 +394,12 @@ function LocalData:setNewAvatarAndFrame(info)
self:setString(LOCAL_DATA_KEY.NEW_AVATAR_AND_FRAME, str) self:setString(LOCAL_DATA_KEY.NEW_AVATAR_AND_FRAME, str)
end end
function LocalData:setArenaBountyPopTime(time)
self:setInt(LOCAL_DATA_KEY.ARENA_BOUNTY_POP_TIME, time)
end
function LocalData:getArenaBountyPopTime()
return self:getInt(LOCAL_DATA_KEY.ARENA_BOUNTY_POP_TIME, 0)
end
return LocalData return LocalData

View File

@ -39,6 +39,8 @@ local MODULE_PATHS = {
CommerceManager = "app/module/commerce/commerce_manager", CommerceManager = "app/module/commerce/commerce_manager",
-- 战令 -- 战令
BountyManager = "app/module/bounty/bounty_manager", BountyManager = "app/module/bounty/bounty_manager",
-- 竞技场战令
ArenaBountyManager = "app/module/arena/arena_bounty_manager",
-- 道具 -- 道具
ItemManager = "app/module/item/item_manager", ItemManager = "app/module/item/item_manager",
-- 商店 -- 商店

View File

@ -15,6 +15,7 @@ PayManager.PURCHARSE_ACT_TYPE = {
LEVEL_UP_GIFT = 5, LEVEL_UP_GIFT = 5,
GROWTH_FUND = 6, GROWTH_FUND = 6,
BOUNTY = 7, BOUNTY = 7,
ARENA_BOUNTY = 8,
} }
PayManager.PURCHARSE_TYPE_CONFIG = { PayManager.PURCHARSE_TYPE_CONFIG = {
@ -33,6 +34,7 @@ PayManager.BI_ITEM_GET_TYPE = {
[PayManager.PURCHARSE_ACT_TYPE.LEVEL_UP_GIFT] = BIReport.ITEM_GET_TYPE.LEVEL_UP_GIFT, [PayManager.PURCHARSE_ACT_TYPE.LEVEL_UP_GIFT] = BIReport.ITEM_GET_TYPE.LEVEL_UP_GIFT,
[PayManager.PURCHARSE_ACT_TYPE.GROWTH_FUND] = BIReport.ITEM_GET_TYPE.GROWTH_FUND, [PayManager.PURCHARSE_ACT_TYPE.GROWTH_FUND] = BIReport.ITEM_GET_TYPE.GROWTH_FUND,
[PayManager.PURCHARSE_ACT_TYPE.BOUNTY] = BIReport.ITEM_GET_TYPE.BOUNTY, [PayManager.PURCHARSE_ACT_TYPE.BOUNTY] = BIReport.ITEM_GET_TYPE.BOUNTY,
[PayManager.PURCHARSE_ACT_TYPE.ARENA_BOUNTY] = BIReport.ITEM_GET_TYPE.ARENA_BOUNTY,
}, },
[PayManager.PURCHARSE_TYPE.ACT_GOLD_PIG] = BIReport.ITEM_GET_TYPE.GOLD_PIG, [PayManager.PURCHARSE_TYPE.ACT_GOLD_PIG] = BIReport.ITEM_GET_TYPE.GOLD_PIG,
[PayManager.PURCHARSE_TYPE.MALL_TREASURE] = BIReport.ITEM_GET_TYPE.MALL_TREASURE, [PayManager.PURCHARSE_TYPE.MALL_TREASURE] = BIReport.ITEM_GET_TYPE.MALL_TREASURE,
@ -48,6 +50,7 @@ PayManager.BI_GIFT_TYPE = {
[PayManager.PURCHARSE_ACT_TYPE.LEVEL_UP_GIFT] = BIReport.GIFT_TYPE.LEVEL_UP_GIFT, [PayManager.PURCHARSE_ACT_TYPE.LEVEL_UP_GIFT] = BIReport.GIFT_TYPE.LEVEL_UP_GIFT,
[PayManager.PURCHARSE_ACT_TYPE.GROWTH_FUND] = BIReport.GIFT_TYPE.GROWTH_FUND, [PayManager.PURCHARSE_ACT_TYPE.GROWTH_FUND] = BIReport.GIFT_TYPE.GROWTH_FUND,
[PayManager.PURCHARSE_ACT_TYPE.BOUNTY] = BIReport.GIFT_TYPE.BOUNTY, [PayManager.PURCHARSE_ACT_TYPE.BOUNTY] = BIReport.GIFT_TYPE.BOUNTY,
[PayManager.PURCHARSE_ACT_TYPE.ARENA_BOUNTY] = BIReport.GIFT_TYPE.ARENA_BOUNTY,
}, },
[PayManager.PURCHARSE_TYPE.ACT_GOLD_PIG] = BIReport.GIFT_TYPE.GOLD_PIG, [PayManager.PURCHARSE_TYPE.ACT_GOLD_PIG] = BIReport.GIFT_TYPE.GOLD_PIG,
[PayManager.PURCHARSE_TYPE.MALL_TREASURE] = BIReport.GIFT_TYPE.MALL_TREASURE, [PayManager.PURCHARSE_TYPE.MALL_TREASURE] = BIReport.GIFT_TYPE.MALL_TREASURE,

View File

@ -14,6 +14,7 @@ end
function ServerPushManager:initWhenLogin() function ServerPushManager:initWhenLogin()
self:addServerPushListener(ProtoMsgType.FromMsgEnum.KickOutNtf, UIManager, UIManager.showKickOut) self:addServerPushListener(ProtoMsgType.FromMsgEnum.KickOutNtf, UIManager, UIManager.showKickOut)
self:addServerPushListener(ProtoMsgType.FromMsgEnum.BountyBoughtNtf, ModuleManager.BountyManager, ModuleManager.BountyManager.onBoughtBountyFinish) self:addServerPushListener(ProtoMsgType.FromMsgEnum.BountyBoughtNtf, ModuleManager.BountyManager, ModuleManager.BountyManager.onBoughtBountyFinish)
self:addServerPushListener(ProtoMsgType.FromMsgEnum.ArenaBountyBoughtNtf, ModuleManager.ArenaBountyManager, ModuleManager.ArenaBountyManager.onBoughtBountyFinish)
self:addServerPushListener(ProtoMsgType.FromMsgEnum.NewMailNtf, ModuleManager.MailManager, ModuleManager.MailManager.needUpdateMail) self:addServerPushListener(ProtoMsgType.FromMsgEnum.NewMailNtf, ModuleManager.MailManager, ModuleManager.MailManager.needUpdateMail)
self:addServerPushListener(ProtoMsgType.FromMsgEnum.PigLevelUpNtf, ModuleManager.ActivityManager, ModuleManager.ActivityManager.onBoughtGoldPigFinish) self:addServerPushListener(ProtoMsgType.FromMsgEnum.PigLevelUpNtf, ModuleManager.ActivityManager, ModuleManager.ActivityManager.onBoughtGoldPigFinish)
self:addServerPushListener(ProtoMsgType.FromMsgEnum.TriggerLevelUpGiftNtf, ModuleManager.ShopManager, ModuleManager.ShopManager.onTriggerLevelUpGift) self:addServerPushListener(ProtoMsgType.FromMsgEnum.TriggerLevelUpGiftNtf, ModuleManager.ShopManager, ModuleManager.ShopManager.onTriggerLevelUpGift)

View File

@ -500,9 +500,21 @@ local act_gift = {
["time_type"]=3, ["time_type"]=3,
["limit"]=1, ["limit"]=1,
["value"]=21 ["value"]=21
},
[80102]={
["type"]=8,
["recharge_id"]=13,
["time_type"]=3,
["value"]=3000
},
[80202]={
["type"]=8,
["recharge_id"]=14,
["time_type"]=3,
["value"]=2000
} }
} }
local config = { local config = {
data=act_gift,count=20 data=act_gift,count=22
} }
return config return config

12006
lua/app/config/arena_board.lua Normal file

File diff suppressed because it is too large Load Diff

View File

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

File diff suppressed because it is too large Load Diff

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -0,0 +1,876 @@
local arena_robot = {
[1]={
["name"]="Gresham",
["score"]=917,
["level"]=15,
["avatar"]=3001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
5
},
{
22001,
5
},
{
32001,
5
},
{
42001,
5
},
{
52001,
5
}
}
},
[2]={
["name"]="Gilroy",
["score"]=929,
["level"]=15,
["avatar"]=1001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
5
},
{
22001,
5
},
{
32001,
5
},
{
42001,
5
},
{
52001,
5
}
}
},
[3]={
["name"]="Landry",
["score"]=946,
["level"]=17,
["avatar"]=4001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
5
},
{
22001,
5
},
{
32001,
5
},
{
42001,
5
},
{
52001,
5
}
}
},
[4]={
["name"]="Eva",
["score"]=957,
["level"]=18,
["avatar"]=2001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
5
},
{
22001,
5
},
{
32001,
5
},
{
42001,
5
},
{
52001,
5
}
}
},
[5]={
["name"]="Prosperous",
["score"]=959,
["level"]=15,
["avatar"]=5001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
5
},
{
22001,
5
},
{
32001,
5
},
{
42001,
5
},
{
52001,
5
}
}
},
[6]={
["name"]="Fleming",
["score"]=964,
["level"]=14,
["avatar"]=4001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
5
},
{
22001,
5
},
{
33001,
5
},
{
43001,
5
},
{
52001,
5
}
}
},
[7]={
["name"]="Lola",
["score"]=964,
["level"]=14,
["avatar"]=5001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
5
},
{
22001,
5
},
{
33001,
5
},
{
43001,
5
},
{
52001,
5
}
}
},
[8]={
["name"]="Frances",
["score"]=967,
["level"]=16,
["avatar"]=3001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
5
},
{
22001,
5
},
{
33001,
5
},
{
43001,
5
},
{
52001,
5
}
}
},
[9]={
["name"]="Keith",
["score"]=971,
["level"]=17,
["avatar"]=2001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
5
},
{
22001,
5
},
{
33001,
5
},
{
43001,
5
},
{
52001,
5
}
}
},
[10]={
["name"]="Winston",
["score"]=988,
["level"]=17,
["avatar"]=1001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
5
},
{
22001,
5
},
{
33001,
5
},
{
43001,
5
},
{
52001,
5
}
}
},
[11]={
["name"]="Halsey",
["score"]=1007,
["level"]=15,
["avatar"]=5001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
6
},
{
22001,
6
},
{
33001,
6
},
{
43001,
6
},
{
53002,
6
}
}
},
[12]={
["name"]="Stuart",
["score"]=1027,
["level"]=19,
["avatar"]=5001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
6
},
{
22001,
6
},
{
33001,
6
},
{
43001,
6
},
{
53002,
6
}
}
},
[13]={
["name"]="Dark-Haired",
["score"]=1029,
["level"]=16,
["avatar"]=1001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
6
},
{
22001,
6
},
{
33001,
6
},
{
43001,
6
},
{
53002,
6
}
}
},
[14]={
["name"]="Hilda",
["score"]=1033,
["level"]=16,
["avatar"]=2001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
6
},
{
22001,
6
},
{
33001,
6
},
{
43001,
6
},
{
53002,
6
}
}
},
[15]={
["name"]="Idelle",
["score"]=1037,
["level"]=19,
["avatar"]=2001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
6
},
{
22001,
6
},
{
33001,
6
},
{
43001,
6
},
{
53002,
6
}
}
},
[16]={
["name"]="Sibley",
["score"]=1082,
["level"]=19,
["avatar"]=3001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
6
},
{
22001,
6
},
{
33001,
6
},
{
43001,
6
},
{
53002,
6
}
}
},
[17]={
["name"]="Wolf",
["score"]=1083,
["level"]=17,
["avatar"]=1001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
6
},
{
22001,
6
},
{
33001,
6
},
{
43001,
6
},
{
53002,
6
}
}
},
[18]={
["name"]="Renata",
["score"]=1092,
["level"]=18,
["avatar"]=3001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
6
},
{
22001,
6
},
{
33001,
6
},
{
43001,
6
},
{
53002,
6
}
}
},
[19]={
["name"]="Lane",
["score"]=1094,
["level"]=15,
["avatar"]=4001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
6
},
{
22001,
6
},
{
33001,
6
},
{
43001,
6
},
{
53002,
6
}
}
},
[20]={
["name"]="Fabian",
["score"]=1098,
["level"]=19,
["avatar"]=4001,
["avatar_frame"]=1000,
["hero_id"]={
{
12001,
6
},
{
22001,
6
},
{
33001,
6
},
{
43001,
6
},
{
53002,
6
}
}
},
[21]={
["name"]="Peace",
["score"]=1101,
["level"]=17,
["avatar"]=1001,
["avatar_frame"]=1000,
["hero_id"]={
{
13002,
7
},
{
23001,
7
},
{
33002,
7
},
{
43001,
7
},
{
53002,
7
}
}
},
[22]={
["name"]="Tanya",
["score"]=1106,
["level"]=19,
["avatar"]=2001,
["avatar_frame"]=1000,
["hero_id"]={
{
13001,
7
},
{
23001,
7
},
{
33002,
7
},
{
43002,
7
},
{
53001,
7
}
}
},
[23]={
["name"]="Trix",
["score"]=1110,
["level"]=15,
["avatar"]=5001,
["avatar_frame"]=1000,
["hero_id"]={
{
13001,
7
},
{
23002,
7
},
{
33001,
7
},
{
43001,
7
},
{
53001,
7
}
}
},
[24]={
["name"]="Eugene",
["score"]=1115,
["level"]=15,
["avatar"]=5001,
["avatar_frame"]=1000,
["hero_id"]={
{
13001,
7
},
{
23001,
7
},
{
33002,
7
},
{
43002,
7
},
{
53001,
7
}
}
},
[25]={
["name"]="Loralie",
["score"]=1125,
["level"]=16,
["avatar"]=1001,
["avatar_frame"]=1000,
["hero_id"]={
{
13001,
7
},
{
23002,
7
},
{
33002,
7
},
{
43002,
7
},
{
53001,
7
}
}
},
[26]={
["name"]="Henrietta",
["score"]=1137,
["level"]=16,
["avatar"]=3001,
["avatar_frame"]=1000,
["hero_id"]={
{
13002,
7
},
{
23001,
7
},
{
33002,
7
},
{
43001,
7
},
{
53001,
7
}
}
},
[27]={
["name"]="Willette",
["score"]=1156,
["level"]=15,
["avatar"]=4001,
["avatar_frame"]=1000,
["hero_id"]={
{
13001,
7
},
{
23002,
7
},
{
33002,
7
},
{
43002,
7
},
{
53001,
7
}
}
},
[28]={
["name"]="Orlena",
["score"]=1161,
["level"]=16,
["avatar"]=3001,
["avatar_frame"]=1000,
["hero_id"]={
{
13002,
7
},
{
23001,
7
},
{
33002,
7
},
{
43002,
7
},
{
53002,
7
}
}
},
[29]={
["name"]="Irving",
["score"]=1170,
["level"]=14,
["avatar"]=2001,
["avatar_frame"]=1000,
["hero_id"]={
{
13002,
7
},
{
23002,
7
},
{
33001,
7
},
{
43002,
7
},
{
53001,
7
}
}
},
[30]={
["name"]="Phyllis",
["score"]=1181,
["level"]=17,
["avatar"]=4001,
["avatar_frame"]=1000,
["hero_id"]={
{
13002,
7
},
{
23001,
7
},
{
33002,
7
},
{
43001,
7
},
{
53001,
7
}
}
}
}
local config = {
data=arena_robot,count=30
}
return config

View File

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

View File

@ -0,0 +1,16 @@
local arena_time = {
[1]={
["season"]=1,
["start_time"]="2023-6-25 00:00:00",
["end_time"]="2023-8-16 00:00:00"
},
[2]={
["season"]=2,
["start_time"]="2023-8-16 00:00:00",
["end_time"]="2023-9-15 00:00:00"
}
}
local config = {
data=arena_time,count=2
}
return config

View File

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

View File

@ -233,9 +233,89 @@ local const = {
["num"]=200, ["num"]=200,
["num_for_nothing"]="VAhc" ["num_for_nothing"]="VAhc"
} }
},
["arena_odds_min"]={
["value"]=4500
},
["arena_odds_max"]={
["value"]=5500
},
["arena_refresh_time"]={
["value"]=5
},
["arena_refresh_ad_times"]={
["value"]=1
},
["arena_refresh_cost"]={
["value"]=10
},
["arena_info_time"]={
["value"]=24
},
["arena_fight_cost"]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=22,
["id_for_nothing"]="VAo=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["arena_notes_diamond_buy"]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=22,
["id_for_nothing"]="VAo=",
["num"]=3,
["num_for_nothing"]="VQ=="
}
},
["arena_notes_diamond_cost"]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=30,
["num_for_nothing"]="VQg="
}
},
["arena_notes_diamond_times"]={
["value"]=3
},
["arena_notes_ad_buy"]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=22,
["id_for_nothing"]="VAo=",
["num"]=2,
["num_for_nothing"]="VA=="
}
},
["arena_notes_ad_times"]={
["value"]=5
},
["arena_first_robot"]={
["value"]=2
},
["arena_bounty_buy_cost"]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=30,
["num_for_nothing"]="VQg="
}
},
["arena_bounty_senior_rise"]={
["value"]=10
} }
} }
local config = { local config = {
data=const,count=48 data=const,count=63
} }
return config return config

View File

@ -61,16 +61,18 @@ local func_open = {
}, },
["dungeon_gold_open"]={ ["dungeon_gold_open"]={
["stage"]=6, ["stage"]=6,
["pop_ups"]=1, ["pop_ups"]=1
["icon"]="module_unlock_dungeongold"
}, },
["dungeon_shards_open"]={ ["dungeon_shards_open"]={
["stage"]=6, ["stage"]=6,
["pop_ups"]=1, ["pop_ups"]=1
["icon"]="module_unlock_dungeonshards" },
["arena_open"]={
["stage"]=10,
["pop_ups"]=1
} }
} }
local config = { local config = {
data=func_open,count=17 data=func_open,count=18
} }
return config return config

View File

@ -351,6 +351,16 @@ local item = {
["qlt"]=5, ["qlt"]=5,
["icon"]="20" ["icon"]="20"
}, },
[21]={
["type"]=1,
["qlt"]=5,
["icon"]="21"
},
[22]={
["type"]=1,
["qlt"]=4,
["icon"]="22"
},
[12001]={ [12001]={
["type"]=5, ["type"]=5,
["parameter"]=12001, ["parameter"]=12001,
@ -503,6 +513,6 @@ local item = {
} }
} }
local config = { local config = {
data=item,count=45 data=item,count=47
} }
return config return config

View File

@ -3,9 +3,13 @@ local recovery = {
["type"]=1, ["type"]=1,
["time"]=600, ["time"]=600,
["limit"]=60 ["limit"]=60
},
[22]={
["type"]=2,
["limit"]=5
} }
} }
local config = { local config = {
data=recovery,count=1 data=recovery,count=2
} }
return config return config

View File

@ -79,6 +79,14 @@ local item = {
["name"]="高级随机碎片", ["name"]="高级随机碎片",
["desc"]="有概率随机获得优秀,稀有或史诗英雄碎片。" ["desc"]="有概率随机获得优秀,稀有或史诗英雄碎片。"
}, },
[21]={
["name"]="竞技战令",
["desc"]="累计战令可升级竞技场战令。"
},
[22]={
["name"]="竞技券",
["desc"]="竞技场挑战时使用。"
},
[12001]={ [12001]={
["name"]="舞娘碎片", ["name"]="舞娘碎片",
["desc"]="舞娘碎片,凑齐可激活或升级。" ["desc"]="舞娘碎片,凑齐可激活或升级。"
@ -181,6 +189,6 @@ local item = {
} }
} }
local config = { local config = {
data=item,count=45 data=item,count=47
} }
return config return config

View File

@ -58,6 +58,12 @@ local item = {
}, },
[20]={ [20]={
},
[21]={
},
[22]={
}, },
[12001]={ [12001]={
@ -136,6 +142,6 @@ local item = {
} }
} }
local config = { local config = {
data=item,count=45 data=item,count=47
} }
return config return config

View File

@ -78,6 +78,12 @@ local item = {
[20]={ [20]={
["name"]="Advanced Random Shard", ["name"]="Advanced Random Shard",
["desc"]="May randomly obtain Shards of Excellent, Rare, or Epic Heroes." ["desc"]="May randomly obtain Shards of Excellent, Rare, or Epic Heroes."
},
[21]={
},
[22]={
}, },
[12001]={ [12001]={
["name"]="Dancer Shard", ["name"]="Dancer Shard",
@ -181,6 +187,6 @@ local item = {
} }
} }
local config = { local config = {
data=item,count=45 data=item,count=47
} }
return config return config

View File

@ -77,6 +77,12 @@ local item = {
}, },
[20]={ [20]={
},
[21]={
},
[22]={
}, },
[12001]={ [12001]={
["name"]="Fragmento de Bailarina", ["name"]="Fragmento de Bailarina",
@ -175,6 +181,6 @@ local item = {
} }
} }
local config = { local config = {
data=item,count=45 data=item,count=47
} }
return config return config

View File

@ -58,6 +58,12 @@ local item = {
}, },
[20]={ [20]={
},
[21]={
},
[22]={
}, },
[12001]={ [12001]={
@ -136,6 +142,6 @@ local item = {
} }
} }
local config = { local config = {
data=item,count=45 data=item,count=47
} }
return config return config

View File

@ -78,6 +78,12 @@ local item = {
[20]={ [20]={
["name"]="Shard Premium Acak", ["name"]="Shard Premium Acak",
["desc"]="Berpeluang mendapat Shard Hero luar biasa, langka, atau epik secara acak." ["desc"]="Berpeluang mendapat Shard Hero luar biasa, langka, atau epik secara acak."
},
[21]={
},
[22]={
}, },
[12001]={ [12001]={
["name"]="Shard Dancer", ["name"]="Shard Dancer",
@ -181,6 +187,6 @@ local item = {
} }
} }
local config = { local config = {
data=item,count=45 data=item,count=47
} }
return config return config

View File

@ -78,6 +78,12 @@ local item = {
[20]={ [20]={
["name"]="高級ランダムピース", ["name"]="高級ランダムピース",
["desc"]="一定の確率でアンコモン、レア又はエピックヒーローのピースを獲得できる。" ["desc"]="一定の確率でアンコモン、レア又はエピックヒーローのピースを獲得できる。"
},
[21]={
},
[22]={
}, },
[12001]={ [12001]={
["name"]="ダンサーのピース", ["name"]="ダンサーのピース",
@ -181,6 +187,6 @@ local item = {
} }
} }
local config = { local config = {
data=item,count=45 data=item,count=47
} }
return config return config

View File

@ -78,6 +78,12 @@ local item = {
[20]={ [20]={
["name"]="랜덤의 고급 파편", ["name"]="랜덤의 고급 파편",
["desc"]="확률적으로 랜덤의 뛰어난 영웅, 희귀 영웅 또는 에픽 영웅 파편을 얻을 수 있습니다." ["desc"]="확률적으로 랜덤의 뛰어난 영웅, 희귀 영웅 또는 에픽 영웅 파편을 얻을 수 있습니다."
},
[21]={
},
[22]={
}, },
[12001]={ [12001]={
["name"]="무희 파편", ["name"]="무희 파편",
@ -181,6 +187,6 @@ local item = {
} }
} }
local config = { local config = {
data=item,count=45 data=item,count=47
} }
return config return config

View File

@ -78,6 +78,12 @@ local item = {
[20]={ [20]={
["name"]="Fragmento Aleatório Avançado", ["name"]="Fragmento Aleatório Avançado",
["desc"]="Possibilidade aleatória de obter fragmentos de heróis excelentes, raros ou épicos." ["desc"]="Possibilidade aleatória de obter fragmentos de heróis excelentes, raros ou épicos."
},
[21]={
},
[22]={
}, },
[12001]={ [12001]={
["name"]="Fragmento de Dançarina", ["name"]="Fragmento de Dançarina",
@ -181,6 +187,6 @@ local item = {
} }
} }
local config = { local config = {
data=item,count=45 data=item,count=47
} }
return config return config

View File

@ -58,6 +58,12 @@ local item = {
}, },
[20]={ [20]={
},
[21]={
},
[22]={
}, },
[12001]={ [12001]={
@ -136,6 +142,6 @@ local item = {
} }
} }
local config = { local config = {
data=item,count=45 data=item,count=47
} }
return config return config

View File

@ -78,6 +78,12 @@ local item = {
[20]={ [20]={
["name"]="มีโอกาสที่จะได้รับเศษฮีโร่ที่ยอดเยี่ยม หายาก หรืออีพิทแบบสุ่ม", ["name"]="มีโอกาสที่จะได้รับเศษฮีโร่ที่ยอดเยี่ยม หายาก หรืออีพิทแบบสุ่ม",
["name"]="มีโอกาสที่จะได้รับเศษฮีโร่ที่ยอดเยี่ยม หายาก หรืออีพิทแบบสุ่ม" ["name"]="มีโอกาสที่จะได้รับเศษฮีโร่ที่ยอดเยี่ยม หายาก หรืออีพิทแบบสุ่ม"
},
[21]={
},
[22]={
}, },
[12001]={ [12001]={
["name"]="เศษสาวเต้น รวบรวมครบจะเปิดใช้งานหรืออัปเลเวลได้", ["name"]="เศษสาวเต้น รวบรวมครบจะเปิดใช้งานหรืออัปเลเวลได้",
@ -181,6 +187,6 @@ local item = {
} }
} }
local config = { local config = {
data=item,count=45 data=item,count=47
} }
return config return config

View File

@ -78,6 +78,12 @@ local item = {
[20]={ [20]={
["name"]="Mảnh Ngẫu Nhiên Cao Cấp", ["name"]="Mảnh Ngẫu Nhiên Cao Cấp",
["desc"]="Có tỷ lệ nhận ngẫu nhiên Mảnh Anh Hùng Ưu Tú, Hiếm hoặc Sử Thi." ["desc"]="Có tỷ lệ nhận ngẫu nhiên Mảnh Anh Hùng Ưu Tú, Hiếm hoặc Sử Thi."
},
[21]={
},
[22]={
}, },
[12001]={ [12001]={
["name"]="Mảnh Vũ Cơ", ["name"]="Mảnh Vũ Cơ",
@ -181,6 +187,6 @@ local item = {
} }
} }
local config = { local config = {
data=item,count=45 data=item,count=47
} }
return config return config

View File

@ -78,6 +78,12 @@ local item = {
[20]={ [20]={
["name"]="高級隨機碎片", ["name"]="高級隨機碎片",
["desc"]="有機率隨機獲得優秀,稀有或史詩英雄碎片。" ["desc"]="有機率隨機獲得優秀,稀有或史詩英雄碎片。"
},
[21]={
},
[22]={
}, },
[12001]={ [12001]={
["name"]="舞孃碎片", ["name"]="舞孃碎片",
@ -181,6 +187,6 @@ local item = {
} }
} }
local config = { local config = {
data=item,count=45 data=item,count=47
} }
return config return config

View File

@ -1355,6 +1355,18 @@ function GFunc.centerImgAndTx(imgObj, txObj, spacing, offset)
txObj:setAnchoredPositionX(w - txW / 2 + offset) txObj:setAnchoredPositionX(w - txW / 2 + offset)
end end
-- centerImgAndTx的位置反向版本
function GFunc.centerTxAndImg(txObj, imgObj, spacing, offset)
spacing = spacing or 0
offset = offset or 0
local imgW = imgObj:getSizeDelta().x
local txW = txObj:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth
txObj:setSizeDeltaX(txW)
local w = (imgW + txW + spacing) / 2
txObj:setAnchoredPositionX(txW / 2 - w + offset)
imgObj:setAnchoredPositionX(w - imgW / 2 + offset)
end
function GFunc.centerTxAndTx(txObj1, txObj2, spacing) function GFunc.centerTxAndTx(txObj1, txObj2, spacing)
spacing = spacing or 0 spacing = spacing or 0
local txW = txObj1:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth local txW = txObj1:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 20c6db8aefd52cf428b93b271823e3c4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,102 @@
local ArenaBountyManager = class("ArenaBountyManager", BaseModule)
function ArenaBountyManager:showBountyMainUI()
UIManager:showUI("app/ui/arena/bounty_main_ui")
end
function ArenaBountyManager:showBountyBuyUI()
DataManager.ArenaBountyData:markPopBought()
UIManager:showUI("app/ui/arena/bounty_buy_ui")
end
function ArenaBountyManager:claimReward(index, isPro)
local args = {
level = index,
is_pro = isPro,
}
self:sendMessage(ProtoMsgType.FromMsgEnum.ArenaBountyRewardReq, args, {}, self.onClaimReward, BIReport.ITEM_GET_TYPE.ARENA_BOUNTY_REWARD)
end
function ArenaBountyManager:onClaimReward(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
if result.rewards then
-- 读表获取该层奖励 如果是箱子走单独奖励展示接口
local isSpecialBox = false
local index = result.reqData.level
local isPro = result.reqData.is_pro
local info = DataManager.ArenaBountyData:getSeasonInfoByLevel(index)
local rewardType
local rewardId
if info then
local reward = isPro and info.reward_pro or info.reward
rewardType = reward and reward.type
rewardId = reward and reward.id
if rewardType == GConst.REWARD_TYPE.ITEM then
local itemCfgInfo = ConfigManager:getConfig("item")[rewardId]
if itemCfgInfo and itemCfgInfo.type == GConst.ItemConst.ITEM_TYPE.BOX then
isSpecialBox = true
end
end
end
if isSpecialBox then
ModuleManager.ShopManager:showBoxOpenUI({type = GConst.ShopConst.BOX_REWARD_TYPE.ARENA_BOUNTY, params = rewardId, rewards = result.rewards})
else
GFunc.showRewardBox(result.rewards)
end
end
if result.reqData.is_pro ~= nil then
local BountyData = DataManager.ArenaBountyData
if result.reqData.is_pro then
BountyData:onClaimProReward(result.reqData.level)
else
BountyData:onClaimReward(result.reqData.level)
end
BIReport:postArenaBountyReward(BountyData:getBountyReportType(), BountyData:getLevel(), BountyData:getExp(), BountyData:getSeason(), result.reqData.level, result.reqData.is_pro)
end
end
end
function ArenaBountyManager:buyBountyLevel()
if not DataManager.ArenaBountyData:getIfCanBuyLevel() then
return
end
local cost = DataManager.ArenaBountyData:getBuyBountyLevelCost()
local costId = GFunc.getRewardId(cost)
local costNum = GFunc.getRewardNum(cost)
if not GFunc.checkCost(costId, costNum, true) then
return
end
local params ={
titleTx = I18N:getGlobalText(I18N.GlobalConst.BOUNTY_BUY_LEVEL_TITLE),
content = I18N:getGlobalText(I18N.GlobalConst.BOUNTY_BUY_LEVEL_COUNTENT),
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL,
showToday = GConst.MESSAGE_BOX_SHOW_TODAY.BOUNTY_BUY_LEVEL,
costId = costId,
costNum = costNum,
okFunc = function()
self:sendMessage(ProtoMsgType.FromMsgEnum.ArenaBountyLevelUnlockReq, {}, {}, self.onBoughtBountyLevel, BIReport.ITEM_GET_TYPE.ARENA_BOUNTY_UNLOCK_LEVEL)
end,
}
GFunc.showMessageBox(params)
end
function ArenaBountyManager:onBoughtBountyLevel(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.ArenaBountyData:onBoughtLevel()
end
end
function ArenaBountyManager:buyBounty(advanced)
if not DataManager.ArenaBountyData:getIsOpen() then
return
end
PayManager:purchasePackage(DataManager.ArenaBountyData:getGiftId(advanced), PayManager.PURCHARSE_TYPE.ACT_GIFT)
end
function ArenaBountyManager:onBoughtBountyFinish(result)
if result.status == 0 then
DataManager.ArenaBountyData:setBought(result.season, result.level)
end
end
return ArenaBountyManager

View File

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

View File

@ -693,7 +693,7 @@ end
function BattleController:enterRoundBegin() function BattleController:enterRoundBegin()
self.needWaitingBoardOver = nil self.needWaitingBoardOver = nil
self.waveRoundCount[self.waveIndex] = (self.waveRoundCount[self.waveIndex] or 0) + 1 self.waveRoundCount[self.waveIndex] = (self.waveRoundCount[self.waveIndex] or 0) + 1
self:takeGridEffect() -- self:takeGridEffect()
self:enterEliminationBegin() self:enterEliminationBegin()
table.clear(self.lastRoundBreakedGridType) table.clear(self.lastRoundBreakedGridType)
end end
@ -1447,6 +1447,8 @@ function BattleController:onFillBoardOver(isRoundBeginCheck)
self:tryShowSelectSkillComp(false, true) self:tryShowSelectSkillComp(false, true)
return return
end end
else
self:takeGridEffect()
end end
if self.onFillBoardOverCallback then if self.onFillBoardOverCallback then

View File

@ -58,7 +58,7 @@ function FundManager:claimFundRewards()
local args = { local args = {
id_with_lv = claimRewards id_with_lv = claimRewards
} }
self:sendMessage(ProtoMsgType.FromMsgEnum.FundAwardReq, args, {}, self.onClaimFundRewards, BIReport.ITEM_GET_TYPE.BOUNTY_REWARD) self:sendMessage(ProtoMsgType.FromMsgEnum.FundAwardReq, args, {}, self.onClaimFundRewards, BIReport.ITEM_GET_TYPE.GROWTH_FUND)
end end
function FundManager:onClaimFundRewards(result) function FundManager:onClaimFundRewards(result)

View File

@ -14,6 +14,7 @@ ItemConst.ITEM_ID_BOX_KEY_LV_2 = 14
ItemConst.ITEM_ID_BOX_KEY_LV_3 = 15 ItemConst.ITEM_ID_BOX_KEY_LV_3 = 15
ItemConst.ITEM_ID_BOX_LV_5 = 18 ItemConst.ITEM_ID_BOX_LV_5 = 18
ItemConst.ITEM_ID_RANDOM_FRAGMENT = 19 ItemConst.ITEM_ID_RANDOM_FRAGMENT = 19
ItemConst.ITEM_ID_ARENA_BOUNTY_EXP = 21
ItemConst.ITEM_TYPE = { ItemConst.ITEM_TYPE = {
RES = 1, RES = 1,

View File

@ -13,6 +13,7 @@ ShopConst.MAIN_UI_POP_TYPE = { -- 当触发弹窗时,相关联的类型礼包也
ShopConst.BOX_REWARD_TYPE = { ShopConst.BOX_REWARD_TYPE = {
SUMMON = 1, SUMMON = 1,
BOUNTY = 2, BOUNTY = 2,
ARENA_BOUNTY = 3,
} }
ShopConst.PAGE_TYPE = { ShopConst.PAGE_TYPE = {

View File

@ -9,6 +9,8 @@ local ProtoMsgType = {
[147149505] = "EnergyByADRsp", [147149505] = "EnergyByADRsp",
[236190053] = "ChapterShardsChallengeStartReq", [236190053] = "ChapterShardsChallengeStartReq",
[236191886] = "ChapterShardsChallengeStartRsp", [236191886] = "ChapterShardsChallengeStartRsp",
[252740891] = "PVPOverCDReq",
[252742724] = "PVPOverCDRsp",
[295348381] = "ChangeAvatarReq", [295348381] = "ChangeAvatarReq",
[295350214] = "ChangeAvatarRsp", [295350214] = "ChangeAvatarRsp",
[317272657] = "IdleQuickReq", [317272657] = "IdleQuickReq",
@ -27,8 +29,12 @@ local ProtoMsgType = {
[613795629] = "WatchADRsp", [613795629] = "WatchADRsp",
[737107384] = "BuyMallIdleReq", [737107384] = "BuyMallIdleReq",
[737109217] = "BuyMallIdleRsp", [737109217] = "BuyMallIdleRsp",
[822916593] = "MatchReq",
[822918426] = "MatchRsp",
[834139466] = "ChapterGoldChallengeStartReq", [834139466] = "ChapterGoldChallengeStartReq",
[834141299] = "ChapterGoldChallengeStartRsp", [834141299] = "ChapterGoldChallengeStartRsp",
[904222760] = "ArenaBountyLevelUnlockReq",
[904224593] = "ArenaBountyLevelUnlockRsp",
[1008447203] = "DeleteReq", [1008447203] = "DeleteReq",
[1008449036] = "DeleteRsp", [1008449036] = "DeleteRsp",
[1068769299] = "ReconnectReq", [1068769299] = "ReconnectReq",
@ -56,6 +62,8 @@ local ProtoMsgType = {
[1690299770] = "SummonRsp", [1690299770] = "SummonRsp",
[1746317288] = "IdleInfoReq", [1746317288] = "IdleInfoReq",
[1746319121] = "IdleInfoRsp", [1746319121] = "IdleInfoRsp",
[1751460231] = "PVPHeroesArrayReq",
[1751462064] = "PVPHeroesArrayRsp",
[1901321540] = "PipedReq", [1901321540] = "PipedReq",
[2060508030] = "ChangeAvatarFrameReq", [2060508030] = "ChangeAvatarFrameReq",
[2060509863] = "ChangeAvatarFrameRsp", [2060509863] = "ChangeAvatarFrameRsp",
@ -71,21 +79,33 @@ local ProtoMsgType = {
[2429588216] = "MailCycleRsp", [2429588216] = "MailCycleRsp",
[2494731810] = "TriggerGoldGiftReq", [2494731810] = "TriggerGoldGiftReq",
[2494733643] = "TriggerGoldGiftRsp", [2494733643] = "TriggerGoldGiftRsp",
[2514397758] = "PVPInfoReq",
[2514399591] = "PVPInfoRsp",
[2515553923] = "BuyMallDailyReq", [2515553923] = "BuyMallDailyReq",
[2515555756] = "BuyMallDailyRsp", [2515555756] = "BuyMallDailyRsp",
[2524879713] = "PVPRecordHistoryReq",
[2524881546] = "PVPRecordHistoryRsp",
[2553351971] = "ChapterDailyChallengeStartReq", [2553351971] = "ChapterDailyChallengeStartReq",
[2553353804] = "ChapterDailyChallengeStartRsp", [2553353804] = "ChapterDailyChallengeStartRsp",
[2581180989] = "MailListReq", [2581180989] = "MailListReq",
[2581182822] = "MailListRsp", [2581182822] = "MailListRsp",
[2620369240] = "SevenDayRewardReq", [2620369240] = "SevenDayRewardReq",
[2620371073] = "SevenDayRewardRsp", [2620371073] = "SevenDayRewardRsp",
[2708281176] = "PVPChallengeSettlementReq",
[2708283009] = "PVPChallengeSettlementRsp",
[2731281392] = "MailExtractReq", [2731281392] = "MailExtractReq",
[2731283225] = "MailExtractRsp", [2731283225] = "MailExtractRsp",
[2849800229] = "MailReadReq", [2849800229] = "MailReadReq",
[2849802062] = "MailReadRsp", [2849802062] = "MailReadRsp",
[3003864530] = "ActTriggerGiftNtf", [3003864530] = "ActTriggerGiftNtf",
[3013273736] = "PVPRankHeroesReq",
[3013275569] = "PVPRankHeroesRsp",
[3024278414] = "PVPSeasonRewardReq",
[3024280247] = "PVPSeasonRewardRsp",
[3038151923] = "TaskDailyRefreshReq", [3038151923] = "TaskDailyRefreshReq",
[3038153756] = "TaskDailyRefreshRsp", [3038153756] = "TaskDailyRefreshRsp",
[3058879524] = "PVPRankReq",
[3058881357] = "PVPRankRsp",
[3062745642] = "FundAwardReq", [3062745642] = "FundAwardReq",
[3062747475] = "FundAwardRsp", [3062747475] = "FundAwardRsp",
[3087688987] = "IdleRewardReq", [3087688987] = "IdleRewardReq",
@ -94,6 +114,7 @@ local ProtoMsgType = {
[3137377372] = "ActPayReq", [3137377372] = "ActPayReq",
[3137379205] = "ActPayRsp", [3137379205] = "ActPayRsp",
[3190730044] = "KickOutNtf", [3190730044] = "KickOutNtf",
[3197501935] = "ArenaBountyBoughtNtf",
[3224230499] = "SevenDayTaskRewardReq", [3224230499] = "SevenDayTaskRewardReq",
[3224232332] = "SevenDayTaskRewardRsp", [3224232332] = "SevenDayTaskRewardRsp",
[3309820798] = "HeroPutOnReq", [3309820798] = "HeroPutOnReq",
@ -114,6 +135,8 @@ local ProtoMsgType = {
[3597634953] = "BattleSkillRefreshRsp", [3597634953] = "BattleSkillRefreshRsp",
[3607879254] = "AuthReq", [3607879254] = "AuthReq",
[3607881087] = "AuthRsp", [3607881087] = "AuthRsp",
[3613497485] = "ArenaBountyRewardReq",
[3613499318] = "ArenaBountyRewardRsp",
[3624439233] = "NewMailNtf", [3624439233] = "NewMailNtf",
[3663247602] = "MallDailyResetNtf", [3663247602] = "MallDailyResetNtf",
[3663314292] = "MallDailyResetReq", [3663314292] = "MallDailyResetReq",
@ -132,6 +155,8 @@ local ProtoMsgType = {
[4106157842] = "BountyLevelUnlockRsp", [4106157842] = "BountyLevelUnlockRsp",
[4133057746] = "ChapterGoldChallengeFarmReq", [4133057746] = "ChapterGoldChallengeFarmReq",
[4133059579] = "ChapterGoldChallengeFarmRsp", [4133059579] = "ChapterGoldChallengeFarmRsp",
[4152754481] = "PVPChallengeStartReq",
[4152756314] = "PVPChallengeStartRsp",
[4256333947] = "ExistReq", [4256333947] = "ExistReq",
[4256335780] = "ExistRsp", [4256335780] = "ExistRsp",
}, },
@ -145,6 +170,8 @@ local ProtoMsgType = {
EnergyByADRsp = 147149505, EnergyByADRsp = 147149505,
ChapterShardsChallengeStartReq = 236190053, ChapterShardsChallengeStartReq = 236190053,
ChapterShardsChallengeStartRsp = 236191886, ChapterShardsChallengeStartRsp = 236191886,
PVPOverCDReq = 252740891,
PVPOverCDRsp = 252742724,
ChangeAvatarReq = 295348381, ChangeAvatarReq = 295348381,
ChangeAvatarRsp = 295350214, ChangeAvatarRsp = 295350214,
IdleQuickReq = 317272657, IdleQuickReq = 317272657,
@ -163,8 +190,12 @@ local ProtoMsgType = {
WatchADRsp = 613795629, WatchADRsp = 613795629,
BuyMallIdleReq = 737107384, BuyMallIdleReq = 737107384,
BuyMallIdleRsp = 737109217, BuyMallIdleRsp = 737109217,
MatchReq = 822916593,
MatchRsp = 822918426,
ChapterGoldChallengeStartReq = 834139466, ChapterGoldChallengeStartReq = 834139466,
ChapterGoldChallengeStartRsp = 834141299, ChapterGoldChallengeStartRsp = 834141299,
ArenaBountyLevelUnlockReq = 904222760,
ArenaBountyLevelUnlockRsp = 904224593,
DeleteReq = 1008447203, DeleteReq = 1008447203,
DeleteRsp = 1008449036, DeleteRsp = 1008449036,
ReconnectReq = 1068769299, ReconnectReq = 1068769299,
@ -192,6 +223,8 @@ local ProtoMsgType = {
SummonRsp = 1690299770, SummonRsp = 1690299770,
IdleInfoReq = 1746317288, IdleInfoReq = 1746317288,
IdleInfoRsp = 1746319121, IdleInfoRsp = 1746319121,
PVPHeroesArrayReq = 1751460231,
PVPHeroesArrayRsp = 1751462064,
PipedReq = 1901321540, PipedReq = 1901321540,
ChangeAvatarFrameReq = 2060508030, ChangeAvatarFrameReq = 2060508030,
ChangeAvatarFrameRsp = 2060509863, ChangeAvatarFrameRsp = 2060509863,
@ -207,21 +240,33 @@ local ProtoMsgType = {
MailCycleRsp = 2429588216, MailCycleRsp = 2429588216,
TriggerGoldGiftReq = 2494731810, TriggerGoldGiftReq = 2494731810,
TriggerGoldGiftRsp = 2494733643, TriggerGoldGiftRsp = 2494733643,
PVPInfoReq = 2514397758,
PVPInfoRsp = 2514399591,
BuyMallDailyReq = 2515553923, BuyMallDailyReq = 2515553923,
BuyMallDailyRsp = 2515555756, BuyMallDailyRsp = 2515555756,
PVPRecordHistoryReq = 2524879713,
PVPRecordHistoryRsp = 2524881546,
ChapterDailyChallengeStartReq = 2553351971, ChapterDailyChallengeStartReq = 2553351971,
ChapterDailyChallengeStartRsp = 2553353804, ChapterDailyChallengeStartRsp = 2553353804,
MailListReq = 2581180989, MailListReq = 2581180989,
MailListRsp = 2581182822, MailListRsp = 2581182822,
SevenDayRewardReq = 2620369240, SevenDayRewardReq = 2620369240,
SevenDayRewardRsp = 2620371073, SevenDayRewardRsp = 2620371073,
PVPChallengeSettlementReq = 2708281176,
PVPChallengeSettlementRsp = 2708283009,
MailExtractReq = 2731281392, MailExtractReq = 2731281392,
MailExtractRsp = 2731283225, MailExtractRsp = 2731283225,
MailReadReq = 2849800229, MailReadReq = 2849800229,
MailReadRsp = 2849802062, MailReadRsp = 2849802062,
ActTriggerGiftNtf = 3003864530, ActTriggerGiftNtf = 3003864530,
PVPRankHeroesReq = 3013273736,
PVPRankHeroesRsp = 3013275569,
PVPSeasonRewardReq = 3024278414,
PVPSeasonRewardRsp = 3024280247,
TaskDailyRefreshReq = 3038151923, TaskDailyRefreshReq = 3038151923,
TaskDailyRefreshRsp = 3038153756, TaskDailyRefreshRsp = 3038153756,
PVPRankReq = 3058879524,
PVPRankRsp = 3058881357,
FundAwardReq = 3062745642, FundAwardReq = 3062745642,
FundAwardRsp = 3062747475, FundAwardRsp = 3062747475,
IdleRewardReq = 3087688987, IdleRewardReq = 3087688987,
@ -230,6 +275,7 @@ local ProtoMsgType = {
ActPayReq = 3137377372, ActPayReq = 3137377372,
ActPayRsp = 3137379205, ActPayRsp = 3137379205,
KickOutNtf = 3190730044, KickOutNtf = 3190730044,
ArenaBountyBoughtNtf = 3197501935,
SevenDayTaskRewardReq = 3224230499, SevenDayTaskRewardReq = 3224230499,
SevenDayTaskRewardRsp = 3224232332, SevenDayTaskRewardRsp = 3224232332,
HeroPutOnReq = 3309820798, HeroPutOnReq = 3309820798,
@ -250,6 +296,8 @@ local ProtoMsgType = {
BattleSkillRefreshRsp = 3597634953, BattleSkillRefreshRsp = 3597634953,
AuthReq = 3607879254, AuthReq = 3607879254,
AuthRsp = 3607881087, AuthRsp = 3607881087,
ArenaBountyRewardReq = 3613497485,
ArenaBountyRewardRsp = 3613499318,
NewMailNtf = 3624439233, NewMailNtf = 3624439233,
MallDailyResetNtf = 3663247602, MallDailyResetNtf = 3663247602,
MallDailyResetReq = 3663314292, MallDailyResetReq = 3663314292,
@ -268,6 +316,8 @@ local ProtoMsgType = {
BountyLevelUnlockRsp = 4106157842, BountyLevelUnlockRsp = 4106157842,
ChapterGoldChallengeFarmReq = 4133057746, ChapterGoldChallengeFarmReq = 4133057746,
ChapterGoldChallengeFarmRsp = 4133059579, ChapterGoldChallengeFarmRsp = 4133059579,
PVPChallengeStartReq = 4152754481,
PVPChallengeStartRsp = 4152756314,
ExistReq = 4256333947, ExistReq = 4256333947,
ExistRsp = 4256335780, ExistRsp = 4256335780,
}, },
@ -281,6 +331,8 @@ local ProtoMsgType = {
EnergyByADRsp = "EnergyByADRsp", EnergyByADRsp = "EnergyByADRsp",
ChapterShardsChallengeStartReq = "ChapterShardsChallengeStartReq", ChapterShardsChallengeStartReq = "ChapterShardsChallengeStartReq",
ChapterShardsChallengeStartRsp = "ChapterShardsChallengeStartRsp", ChapterShardsChallengeStartRsp = "ChapterShardsChallengeStartRsp",
PVPOverCDReq = "PVPOverCDReq",
PVPOverCDRsp = "PVPOverCDRsp",
ChangeAvatarReq = "ChangeAvatarReq", ChangeAvatarReq = "ChangeAvatarReq",
ChangeAvatarRsp = "ChangeAvatarRsp", ChangeAvatarRsp = "ChangeAvatarRsp",
IdleQuickReq = "IdleQuickReq", IdleQuickReq = "IdleQuickReq",
@ -299,8 +351,12 @@ local ProtoMsgType = {
WatchADRsp = "WatchADRsp", WatchADRsp = "WatchADRsp",
BuyMallIdleReq = "BuyMallIdleReq", BuyMallIdleReq = "BuyMallIdleReq",
BuyMallIdleRsp = "BuyMallIdleRsp", BuyMallIdleRsp = "BuyMallIdleRsp",
MatchReq = "MatchReq",
MatchRsp = "MatchRsp",
ChapterGoldChallengeStartReq = "ChapterGoldChallengeStartReq", ChapterGoldChallengeStartReq = "ChapterGoldChallengeStartReq",
ChapterGoldChallengeStartRsp = "ChapterGoldChallengeStartRsp", ChapterGoldChallengeStartRsp = "ChapterGoldChallengeStartRsp",
ArenaBountyLevelUnlockReq = "ArenaBountyLevelUnlockReq",
ArenaBountyLevelUnlockRsp = "ArenaBountyLevelUnlockRsp",
DeleteReq = "DeleteReq", DeleteReq = "DeleteReq",
DeleteRsp = "DeleteRsp", DeleteRsp = "DeleteRsp",
ReconnectReq = "ReconnectReq", ReconnectReq = "ReconnectReq",
@ -328,6 +384,8 @@ local ProtoMsgType = {
SummonRsp = "SummonRsp", SummonRsp = "SummonRsp",
IdleInfoReq = "IdleInfoReq", IdleInfoReq = "IdleInfoReq",
IdleInfoRsp = "IdleInfoRsp", IdleInfoRsp = "IdleInfoRsp",
PVPHeroesArrayReq = "PVPHeroesArrayReq",
PVPHeroesArrayRsp = "PVPHeroesArrayRsp",
PipedReq = "PipedReq", PipedReq = "PipedReq",
ChangeAvatarFrameReq = "ChangeAvatarFrameReq", ChangeAvatarFrameReq = "ChangeAvatarFrameReq",
ChangeAvatarFrameRsp = "ChangeAvatarFrameRsp", ChangeAvatarFrameRsp = "ChangeAvatarFrameRsp",
@ -343,21 +401,33 @@ local ProtoMsgType = {
MailCycleRsp = "MailCycleRsp", MailCycleRsp = "MailCycleRsp",
TriggerGoldGiftReq = "TriggerGoldGiftReq", TriggerGoldGiftReq = "TriggerGoldGiftReq",
TriggerGoldGiftRsp = "TriggerGoldGiftRsp", TriggerGoldGiftRsp = "TriggerGoldGiftRsp",
PVPInfoReq = "PVPInfoReq",
PVPInfoRsp = "PVPInfoRsp",
BuyMallDailyReq = "BuyMallDailyReq", BuyMallDailyReq = "BuyMallDailyReq",
BuyMallDailyRsp = "BuyMallDailyRsp", BuyMallDailyRsp = "BuyMallDailyRsp",
PVPRecordHistoryReq = "PVPRecordHistoryReq",
PVPRecordHistoryRsp = "PVPRecordHistoryRsp",
ChapterDailyChallengeStartReq = "ChapterDailyChallengeStartReq", ChapterDailyChallengeStartReq = "ChapterDailyChallengeStartReq",
ChapterDailyChallengeStartRsp = "ChapterDailyChallengeStartRsp", ChapterDailyChallengeStartRsp = "ChapterDailyChallengeStartRsp",
MailListReq = "MailListReq", MailListReq = "MailListReq",
MailListRsp = "MailListRsp", MailListRsp = "MailListRsp",
SevenDayRewardReq = "SevenDayRewardReq", SevenDayRewardReq = "SevenDayRewardReq",
SevenDayRewardRsp = "SevenDayRewardRsp", SevenDayRewardRsp = "SevenDayRewardRsp",
PVPChallengeSettlementReq = "PVPChallengeSettlementReq",
PVPChallengeSettlementRsp = "PVPChallengeSettlementRsp",
MailExtractReq = "MailExtractReq", MailExtractReq = "MailExtractReq",
MailExtractRsp = "MailExtractRsp", MailExtractRsp = "MailExtractRsp",
MailReadReq = "MailReadReq", MailReadReq = "MailReadReq",
MailReadRsp = "MailReadRsp", MailReadRsp = "MailReadRsp",
ActTriggerGiftNtf = "ActTriggerGiftNtf", ActTriggerGiftNtf = "ActTriggerGiftNtf",
PVPRankHeroesReq = "PVPRankHeroesReq",
PVPRankHeroesRsp = "PVPRankHeroesRsp",
PVPSeasonRewardReq = "PVPSeasonRewardReq",
PVPSeasonRewardRsp = "PVPSeasonRewardRsp",
TaskDailyRefreshReq = "TaskDailyRefreshReq", TaskDailyRefreshReq = "TaskDailyRefreshReq",
TaskDailyRefreshRsp = "TaskDailyRefreshRsp", TaskDailyRefreshRsp = "TaskDailyRefreshRsp",
PVPRankReq = "PVPRankReq",
PVPRankRsp = "PVPRankRsp",
FundAwardReq = "FundAwardReq", FundAwardReq = "FundAwardReq",
FundAwardRsp = "FundAwardRsp", FundAwardRsp = "FundAwardRsp",
IdleRewardReq = "IdleRewardReq", IdleRewardReq = "IdleRewardReq",
@ -366,6 +436,7 @@ local ProtoMsgType = {
ActPayReq = "ActPayReq", ActPayReq = "ActPayReq",
ActPayRsp = "ActPayRsp", ActPayRsp = "ActPayRsp",
KickOutNtf = "KickOutNtf", KickOutNtf = "KickOutNtf",
ArenaBountyBoughtNtf = "ArenaBountyBoughtNtf",
SevenDayTaskRewardReq = "SevenDayTaskRewardReq", SevenDayTaskRewardReq = "SevenDayTaskRewardReq",
SevenDayTaskRewardRsp = "SevenDayTaskRewardRsp", SevenDayTaskRewardRsp = "SevenDayTaskRewardRsp",
HeroPutOnReq = "HeroPutOnReq", HeroPutOnReq = "HeroPutOnReq",
@ -386,6 +457,8 @@ local ProtoMsgType = {
BattleSkillRefreshRsp = "BattleSkillRefreshRsp", BattleSkillRefreshRsp = "BattleSkillRefreshRsp",
AuthReq = "AuthReq", AuthReq = "AuthReq",
AuthRsp = "AuthRsp", AuthRsp = "AuthRsp",
ArenaBountyRewardReq = "ArenaBountyRewardReq",
ArenaBountyRewardRsp = "ArenaBountyRewardRsp",
NewMailNtf = "NewMailNtf", NewMailNtf = "NewMailNtf",
MallDailyResetNtf = "MallDailyResetNtf", MallDailyResetNtf = "MallDailyResetNtf",
MallDailyResetReq = "MallDailyResetReq", MallDailyResetReq = "MallDailyResetReq",
@ -404,6 +477,8 @@ local ProtoMsgType = {
BountyLevelUnlockRsp = "BountyLevelUnlockRsp", BountyLevelUnlockRsp = "BountyLevelUnlockRsp",
ChapterGoldChallengeFarmReq = "ChapterGoldChallengeFarmReq", ChapterGoldChallengeFarmReq = "ChapterGoldChallengeFarmReq",
ChapterGoldChallengeFarmRsp = "ChapterGoldChallengeFarmRsp", ChapterGoldChallengeFarmRsp = "ChapterGoldChallengeFarmRsp",
PVPChallengeStartReq = "PVPChallengeStartReq",
PVPChallengeStartRsp = "PVPChallengeStartRsp",
ExistReq = "ExistReq", ExistReq = "ExistReq",
ExistRsp = "ExistRsp", ExistRsp = "ExistRsp",
}, },

8
lua/app/ui/arena.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 259dafa85095bbb458070cec914931f5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,116 @@
local BountyBuyUI = class("BountyBuyUI", BaseUI)
function BountyBuyUI:ctor()
self.endTime = DataManager.ArenaBountyData:getEndTime()
end
function BountyBuyUI:isFullScreen()
return false
end
function BountyBuyUI:getPrefabPath()
return "assets/prefabs/ui/arena/bounty_buy_ui.prefab"
end
function BountyBuyUI:onPressBackspace()
self:closeUI()
end
function BountyBuyUI:onLoadRootComplete()
local uiMap = self.root:genAllChildren()
self.uiMap = uiMap
local closeBtn = uiMap["bounty_buy_ui.bg.close_btn"]
closeBtn:addClickListener(function()
self:closeUI()
end)
self:initTitle()
self:initTime()
self:initRewards()
self:initBtns()
self:scheduleGlobal(function()
self:updateTime()
end, 1)
self:updateTime()
end
function BountyBuyUI:initTitle()
self.uiMap["bounty_buy_ui.bg.title_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.BOUNTY_PURCHASE_NAME))
end
function BountyBuyUI:initTime()
self.timeTx = self.uiMap["bounty_buy_ui.bg.time_tx"]
end
function BountyBuyUI:initRewards()
self.uiMap["bounty_buy_ui.bg.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.REWARD_DESC))
local preferredWidth = self.uiMap["bounty_buy_ui.bg.desc_tx"]:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth
self.uiMap["bounty_buy_ui.bg.left_arrow"]:setAnchoredPositionX(-30 - preferredWidth/2)
self.uiMap["bounty_buy_ui.bg.right_arrow"]:setAnchoredPositionX(30 + preferredWidth/2)
local list = DataManager.ArenaBountyData:getAllProRewards()
for i = 1, 10 do
local cell = self.uiMap["bounty_buy_ui.bg.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
if list[i] then
cell:setVisible(true, 0.7)
cell:refreshByConfig(list[i])
else
cell:setVisible(false)
end
end
end
function BountyBuyUI:initBtns()
self.uiMap["bounty_buy_ui.bg.name_1"]:setText(I18N:getGlobalText(I18N.GlobalConst.BOUNTY_PURCHASE_NAME))
self.uiMap["bounty_buy_ui.bg.name_2"]:setText(I18N:getGlobalText(I18N.GlobalConst.BOUNTY_PURCHASE_NAME))
self.uiMap["bounty_buy_ui.bg.desc_tx_1"]:setText(I18N:getGlobalText(I18N.GlobalConst.BOUNTY_DESC_1))
self.uiMap["bounty_buy_ui.bg.desc_tx_2"]:setText(I18N:getGlobalText(I18N.GlobalConst.BOUNTY_DESC_2))
local rechargeId = DataManager.ArenaBountyData:getRechargeId(false)
self.uiMap["bounty_buy_ui.bg.buy_btn.tx"]:setText(GFunc.getFormatPrice(rechargeId))
local proRechargeId = DataManager.ArenaBountyData:getRechargeId(true)
self.uiMap["bounty_buy_ui.bg.buy_btn_advanced.tx"]:setText(GFunc.getFormatPrice(proRechargeId))
local buyBtn = self.uiMap["bounty_buy_ui.bg.buy_btn"]
buyBtn:addClickListener(function()
self:closeUI()
ModuleManager.ArenaBountyManager:buyBounty(false)
end)
local buyBtnAdvanced = self.uiMap["bounty_buy_ui.bg.buy_btn_advanced"]
buyBtnAdvanced:addClickListener(function()
local level = DataManager.ArenaBountyData:getLevel()
local maxLevel = DataManager.ArenaBountyData:getMaxLevel()
local buyProBountyAddLevels = DataManager.ArenaBountyData:getBuyProBountyAddLevelCount()
if level > maxLevel - buyProBountyAddLevels then
local params = {
content = I18N:getGlobalText(I18N.GlobalConst.BOUNTY_DESC_4),
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL,
okFunc = function()
self:closeUI()
ModuleManager.ArenaBountyManager:buyBounty(true)
end
}
GFunc.showMessageBox(params)
else
self:closeUI()
ModuleManager.ArenaBountyManager:buyBounty(true)
end
end)
end
function BountyBuyUI:updateTime()
local remainTime = self.endTime - Time:getServerTime()
if remainTime < 0 then
UIManager:closeUnderUI(self)
return self:closeUI()
end
if remainTime > 86400 then
self.timeTx:setText(GFunc.getTimeStrWithDHM(remainTime))
else
self.timeTx:setText(GFunc.getTimeStrWithHMS2(remainTime))
end
end
return BountyBuyUI

View File

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

View File

@ -0,0 +1,459 @@
local BountyMainUI = class("BountyMainUI", BaseUI)
function BountyMainUI:getPrefabPath()
return "assets/prefabs/ui/arena/bounty_main_ui.prefab"
end
function BountyMainUI:ctor()
self.rewardCellIdx = 0
self.rewardCellNum = 0
self.endTime = DataManager.ArenaBountyData:getEndTime()
self.previewRewardIndex = 1
local maxLevel = DataManager.ArenaBountyData:getMaxLevel()
local info = nil
for i = 2, maxLevel do
info = DataManager.ArenaBountyData:getSeasonInfoByLevel(i)
if info == nil then
break
end
if info.reward_type and info.reward_type == 1 then
self.previewRewardIndex = i
break
end
end
end
function BountyMainUI:onClose()
if self.autoRotateTween then
self.autoRotateTween:Kill()
end
self:clearPreviewRewardAnimation()
if self.rewardsContentMoveTween then
self.rewardsContentMoveTween:Kill()
end
end
function BountyMainUI:onPressBackspace()
self:closeUI()
end
function BountyMainUI:onLoadRootComplete()
local uiMap = self.root:genAllChildren()
self.uiMap = uiMap
local closeBtn = uiMap["bounty_main_ui.bottom_node.close_btn"]
closeBtn:addClickListener(function()
self:closeUI()
end)
self:initTitle()
self:initTime()
self:initLevel()
self:initPayBtn()
self:initPreviewReward()
self:initRewards()
self:bindData()
-- 没有购买通行证的话,每日首次打开战令界面主动弹通行证购买弹窗
if DataManager.ArenaBountyData:getIsPopBought() then
ModuleManager.ArenaBountyManager:showBountyBuyUI()
end
self:scheduleGlobal(function()
self:updateTime()
end, 1)
self:updateTime()
BIReport:postPayUIShow(BIReport.GIFT_TYPE.ARENA_BOUNTY)
end
function BountyMainUI:initTitle()
self.titleSpine = self.uiMap["bounty_main_ui.top_node.ui_spine_obj"]
local trackEntry = self.titleSpine:playAnim("born", false)
local time = self.titleSpine:getAnimation(trackEntry).Duration
self:performWithDelayGlobal(function()
self.titleSpine:playAnim("idle", true)
end, time)
end
function BountyMainUI:initTime()
self.timeIcon = self.uiMap["bounty_main_ui.top_node.time_icon"]
self.timeTx = self.uiMap["bounty_main_ui.top_node.time_tx"]
self.timeTx:setText(GConst.EMPTY_STRING)
self.adjustTimeUI = false
end
function BountyMainUI:initLevel()
self.levelSlider = self.uiMap["bounty_main_ui.top_node.progress_bg.slider"]
self.levelItemImg = self.uiMap["bounty_main_ui.top_node.progress_bg.item_img"]
self.levelSliderTx = self.uiMap["bounty_main_ui.top_node.progress_bg.slider_tx"]
self.lvTx = self.uiMap["bounty_main_ui.top_node.progress_bg.lv_img.lv_tx"]
end
function BountyMainUI:initPayBtn()
self.payBtn = self.uiMap["bounty_main_ui.top_node.buy_btn"]
self.payBtnTx = self.uiMap["bounty_main_ui.top_node.buy_btn.tx"]
self.payBtn:addClickListener(function()
ModuleManager.ArenaBountyManager:showBountyBuyUI()
end)
end
function BountyMainUI:initPreviewReward()
self.previewReward = self.uiMap["bounty_main_ui.mid_node.preview"]
self.uiMap["bounty_main_ui.mid_node.preview.bg"]:addClickListener(function()
if self.rewardsContentSid then
return
end
if self.showPreviewRewardSid then
return
end
if self.previewRewardIndex >= self.scrollrectComp:getTotalCount() then
self:scrollToIndex(self.previewRewardIndex)
else
self:scrollToIndex(self.previewRewardIndex - self.rewardCellNum/2 + 1)
end
end)
self.previewRewardCellComp = self.uiMap["bounty_main_ui.mid_node.preview.bg.reward_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
self.previewRewardLvTx = self.uiMap["bounty_main_ui.mid_node.preview.bg.lv_tx"]
self.previewRewardNumTx = self.uiMap["bounty_main_ui.mid_node.preview.bg.num_tx"]
local previewRewardLight = self.uiMap["bounty_main_ui.mid_node.preview.bg.light"]
self.autoRotateTween = previewRewardLight:getTransform():DOLocalRotate(BF.Vector3(0, 0, -360), 3, CS.DG.Tweening.RotateMode.FastBeyond360):SetEase(CS.DG.Tweening.Ease.Linear)
self.autoRotateTween:SetLoops(-1)
self.uiMap["bounty_main_ui.mid_node.preview.bg.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.REWARD_DESC))
end
function BountyMainUI:initRewards()
self:initRepeatReward()
self.adjustRewardsTitleUI = false
local rewardsLeftTitle = self.uiMap["bounty_main_ui.top_node.left"]
rewardsLeftTitle:setAnchoredPositionX(-GConst.UI_SCREEN_WIDTH/4)
self.rewardsLeftTitleIcon = self.uiMap["bounty_main_ui.top_node.left.icon"]
self.rewardsLeftTitleTx = self.uiMap["bounty_main_ui.top_node.left.text"]
local rewardsRightTitle = self.uiMap["bounty_main_ui.top_node.right"]
rewardsRightTitle:setAnchoredPositionX(GConst.UI_SCREEN_WIDTH/4)
self.rewardsRightTitleIcon = self.uiMap["bounty_main_ui.top_node.right.icon"]
self.rewardsRightTitleTx = self.uiMap["bounty_main_ui.top_node.right.text"]
self.line = self.uiMap["bounty_main_ui.mid_node.scrollrect.viewport.content.line"]
local buyLevelItemIcon = self.uiMap["bounty_main_ui.mid_node.scrollrect.viewport.content.line.btn.item"]
local buyLevelItemTx = self.uiMap["bounty_main_ui.mid_node.scrollrect.viewport.content.line.btn.tx"]
local cost = DataManager.ArenaBountyData:getBuyBountyLevelCost()
local costId = GFunc.getRewardId(cost)
local info = ConfigManager:getConfig("item")[costId]
if info then
buyLevelItemIcon:setSprite(GConst.ATLAS_PATH.ICON_ITEM, info.icon)
end
local costNum = GFunc.getRewardNum(cost)
buyLevelItemTx:setText(tostring(costNum))
GFunc.centerImgAndTx(buyLevelItemIcon, buyLevelItemTx)
self.buyLevelBtn = self.uiMap["bounty_main_ui.mid_node.scrollrect.viewport.content.line.btn"]
self.buyLevelBtn:addClickListener(function()
ModuleManager.ArenaBountyManager:buyBountyLevel()
end)
self.progressBg = self.uiMap["bounty_main_ui.mid_node.scrollrect.viewport.content.progress_bg"]
self.progressComp = self.uiMap["bounty_main_ui.mid_node.scrollrect.viewport.content.progress_bg.progress"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
self.rewardsMaskBg = self.uiMap["bounty_main_ui.mid_node.scrollrect.viewport.content.mask_img"]
self.scrollrect = self.uiMap["bounty_main_ui.mid_node.scrollrect"]
self.scrollrectViewport = self.uiMap["bounty_main_ui.mid_node.scrollrect.viewport"]
self.rewardsContent = self.uiMap["bounty_main_ui.mid_node.scrollrect.viewport.content"]
self.scrollrectComp = self.scrollrect:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
self.scrollrectComp:clearCells()
self.scrollrectComp:setTotalCount(0)
self.scrollrectComp:addInitCallback(function()
self.rewardsMaskBg:getTransform():SetAsLastSibling()
self.line:getTransform():SetAsLastSibling()
self.repeatRewardRoot:getTransform():SetAsLastSibling()
return "app/ui/arena/cell/bounty_cell"
end)
self.scrollrectComp:addRefreshCallback(function(index, cell)
local totalCount = self.scrollrectComp:getTotalCount()
local isFinalCell = index == totalCount
if not self.disablePreviewReward then
if isFinalCell then
self.rewardCellIdx = index
self:hidePreviewReward()
else
if index > self.rewardCellIdx then
self.rewardCellIdx = index
self:showNextPreviewReward()
elseif index < self.rewardCellIdx - self.rewardCellNum then
self.rewardCellIdx = index + self.rewardCellNum
self:showNextPreviewReward()
end
end
end
cell:refresh(index)
end)
self.cellHeight = self.uiMap["bounty_main_ui.mid_node.scrollrect.viewport.content.cell"]:getRectHeight()
local height = self.scrollrect:getRectHeight() - self.scrollrectComp:getTopRecoveryOffset() - self.scrollrectComp:getDownRecoveryOffset()
self.rewardCellNum = math.ceil(height/self.cellHeight)
end
function BountyMainUI:initRepeatReward()
self.repeatRewardRoot = self.uiMap["bounty_main_ui.mid_node.scrollrect.viewport.content.repeat"]
self.uiMap["bounty_main_ui.mid_node.scrollrect.viewport.content.repeat.title_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.REWARD_BOX_DESC))
self.uiMap["bounty_main_ui.mid_node.scrollrect.viewport.content.repeat.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.BOUNTY_DESC_3))
self.repeatBox = self.uiMap["bounty_main_ui.mid_node.scrollrect.viewport.content.repeat.box"]
self.repeatBox:addClickListener(function()
if DataManager.ArenaBountyData:getIfCanClaimRepeatReward() then
local level = DataManager.ArenaBountyData:getLevel()
ModuleManager.ArenaBountyManager:claimReward(level, false)
else
local levelInfo = DataManager.ArenaBountyData:getRepeatLevelInfo()
if levelInfo then
local reward = levelInfo.reward
if reward then
local rewardId = GFunc.getRewardId(reward)
local rewardType = GFunc.getRewardType(reward)
ModuleManager.TipsManager:showRewardTips(rewardId, rewardType, self.repeatBox)
end
end
end
end)
end
function BountyMainUI:bindData()
self:bind(DataManager.ArenaBountyData, "dirty", function()
self:onRefresh()
end)
end
function BountyMainUI:onRefresh()
self:refreshLv()
self:refreshPayBtn()
self:refreshPreviewReward(self.previewRewardIndex)
self:refreshRewards()
end
function BountyMainUI:refreshLv()
local exp = DataManager.ArenaBountyData:getExp()
local lvUpExp = DataManager.ArenaBountyData:getLvUpExp()
local level = DataManager.ArenaBountyData:getLevel()
local maxLevel = DataManager.ArenaBountyData:getMaxLevel()
self.levelSliderTx:setText(exp .. "/" .. lvUpExp)
self.levelSlider:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = exp / lvUpExp
if level >= maxLevel then
self.lvTx:setText(I18N:getGlobalText(I18N.GlobalConst.STR_MAX))
else
self.lvTx:setText(tostring(level))
end
local expItemIcon = DataManager.ArenaBountyData:getExpItemIcon()
self.levelItemImg:setSprite(GConst.ATLAS_PATH.ICON_ITEM, expItemIcon)
end
function BountyMainUI:refreshPayBtn()
if DataManager.ArenaBountyData:getBought() then
self.payBtn:setTouchEnable(false)
self.payBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.ALREADY_ACTIVE))
else
self.payBtn:setTouchEnable(true)
self.payBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.ACTIVE_BOUNTY))
end
end
function BountyMainUI:refreshPreviewReward(idx)
local info = DataManager.ArenaBountyData:getSeasonInfoByLevel(idx)
if info == nil then
return
end
self.previewRewardCellComp:refreshByConfig(info.reward_pro)
self.previewRewardCellComp:setNumTx(GConst.EMPTY_STRING)
self.previewRewardNumTx:setText("X" .. GFunc.getRewardNum(info.reward_pro))
self.previewRewardLvTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, idx))
end
function BountyMainUI:refreshRewards()
self.rewardsLeftTitleTx:setText(I18N:getGlobalText(I18N.GlobalConst.BOUNTY_FREE_NAME))
self.rewardsRightTitleTx:setText(I18N:getGlobalText(I18N.GlobalConst.BOUNTY_PURCHASE_NAME))
if not self.adjustRewardsTitleUI then
self.adjustRewardsTitleUI = true
GFunc.centerImgAndTx(self.rewardsLeftTitleIcon, self.rewardsLeftTitleTx, 10)
GFunc.centerImgAndTx(self.rewardsRightTitleIcon, self.rewardsRightTitleTx, 10)
end
local maxLv = DataManager.ArenaBountyData:getMaxLevel()
local lv = DataManager.ArenaBountyData:getLevel()
if self.scrollrectComp:getTotalCount() <= 0 then -- 打开界面的时候定位到当前可领取的最低等级奖励,如果没有则定位到当前等级
self.scrollrectComp:refillCells(maxLv)
local level = DataManager.ArenaBountyData:getMinUnclaimedRewardIndex()
if level > 1 then
self:scrollToIndex(level)
end
else
self.disablePreviewReward = true
self.scrollrectComp:updateAllCell()
self.disablePreviewReward = false
end
local topRecoveryOffset = self.scrollrectComp:getTopRecoveryOffset()
local downRecoveryOffset = self.scrollrectComp:getDownRecoveryOffset()
local cellHeight = self.scrollrectComp:getCellHeight()
if lv >= maxLv then
self.line:setVisible(false)
else
self.line:setVisible(true)
self.line:setAnchoredPositionY(-topRecoveryOffset - lv*cellHeight)
end
self.progressBg:setAnchoredPositionY((topRecoveryOffset + downRecoveryOffset)/2 - cellHeight/2)
self.progressBg:setSizeDeltaY(cellHeight*(maxLv - 1))
local percent = (lv - 1) / (maxLv - 1)
if percent < 0 then
percent = 0
end
self.progressComp.value = percent
self.rewardsMaskBg:setAnchoredPositionY(-topRecoveryOffset - lv*cellHeight)
self.rewardsMaskBg:setSizeDeltaY(cellHeight*maxLv + GConst.UI_SCREEN_HEIGHT)
self.repeatRewardRoot:setAnchoredPositionY(downRecoveryOffset)
if DataManager.ArenaBountyData:getIfCanClaimRepeatReward() then
self.repeatRewardRoot:addRedPoint(74, 15)
else
self.repeatRewardRoot:removeRedPoint()
end
end
function BountyMainUI:showNextPreviewReward()
local nextRewardIndex = -1
local maxLevel = DataManager.ArenaBountyData:getMaxLevel()
for i = self.rewardCellIdx, maxLevel do
local info = DataManager.ArenaBountyData:getSeasonInfoByLevel(i)
if info and info.reward_type and info.reward_type == 1 then
nextRewardIndex = i
break
end
end
if self.previewRewardIndex == nextRewardIndex then
return
end
self.previewRewardIndex = nextRewardIndex
if nextRewardIndex <= 0 then
self:hidePreviewReward()
else
self.previewReward:setVisible(true)
self:showPreviewRewardAnimation()
end
end
function BountyMainUI:showPreviewRewardAnimation()
local time = 0.3
local maxY = 106
local moveOutTime = 0
local posY = self.previewReward:getAnchoredPositionY()
if posY > 0.1 then
moveOutTime = time/maxY*posY
if self.previewRewardMoveOutTween == nil then
self.previewRewardMoveOutTween = self.previewReward:getTransform():DOAnchorPosY(0, moveOutTime):SetEase(CS.DG.Tweening.Ease.InCubic)
self.previewRewardMoveOutTween:SetAutoKill(false)
else
local CacheVector2 = BF.CacheVector2
CacheVector2.x = 0
CacheVector2.y = 0
self.previewRewardMoveOutTween:ChangeEndValue(CacheVector2, moveOutTime, true)
self.previewRewardMoveOutTween:Restart()
end
end
if self.showPreviewRewardSid then
self:unscheduleGlobal(self.showPreviewRewardSid)
end
self.showPreviewRewardSid = self:performWithDelayGlobal(function()
self.showPreviewRewardSid = nil
if self.previewRewardIndex > 0 then
self:refreshPreviewReward(self.previewRewardIndex)
end
if self.previewRewardMoveInTween == nil then
self.previewRewardMoveInTween = self.previewReward:getTransform():DOAnchorPosY(maxY, time):SetEase(CS.DG.Tweening.Ease.InCubic)
self.previewRewardMoveInTween:SetAutoKill(false)
else
local CacheVector2 = BF.CacheVector2
CacheVector2.x = 0
CacheVector2.y = maxY
self.previewRewardMoveInTween:ChangeEndValue(CacheVector2, time, true)
self.previewRewardMoveInTween:Restart()
end
end, moveOutTime)
end
function BountyMainUI:hidePreviewReward()
self.previewReward:setVisible(false)
if self.previewRewardMoveOutTween then
self.previewRewardMoveOutTween:Pause()
end
if self.previewRewardMoveInTween then
self.previewRewardMoveInTween:Pause()
end
self.previewReward:setAnchoredPositionY(0)
end
function BountyMainUI:clearPreviewRewardAnimation()
if self.previewRewardMoveInTween then
self.previewRewardMoveInTween:Kill()
self.previewRewardMoveInTween = nil
end
if self.previewRewardMoveOutTween then
self.previewRewardMoveOutTween:Kill()
self.previewRewardMoveOutTween = nil
end
if self.showPreviewRewardSid then
self:unscheduleGlobal(self.showPreviewRewardSid)
self.showPreviewRewardSid = nil
end
end
function BountyMainUI:scrollToIndex(targetIndex)
-- 未避免scrollrect没填充完毕延迟一帧执行
if self.rewardsContentSid then
self:unscheduleGlobal(self.rewardsContentSid)
end
self.rewardsContentSid = self:performWithDelayGlobal(function()
self.rewardsContentSid = nil
if self.rewardsContentMaxY == nil then
local maxLv = DataManager.ArenaBountyData:getMaxLevel()
self.rewardsContentMaxY = maxLv*self.cellHeight + self.scrollrectComp:getTopRecoveryOffset() + self.scrollrectComp:getDownRecoveryOffset() - self.scrollrectViewport:getRectHeight()
end
-- 最多移动6格,超过6格就先整体移动后再移动6格
local moveTimePerCell = 0.05
local moveCount = 6
local moveTime = moveCount * moveTimePerCell
if targetIndex > 7 then
local tartgetY = (targetIndex - 7)*self.cellHeight
if tartgetY > self.rewardsContentMaxY then
self.rewardsContent:setAnchoredPositionY(self.rewardsContentMaxY)
return
else
self.rewardsContent:setAnchoredPositionY(tartgetY)
end
else
moveTime = (targetIndex - 1) * moveTimePerCell
end
local y = (targetIndex - 1) * self.cellHeight
if y > self.rewardsContentMaxY then
y = self.rewardsContentMaxY
end
if self.rewardsContentMoveTween == nil then
self.rewardsContentMoveTween = self.rewardsContent:getTransform():DOAnchorPosY(y, moveTime)
self.rewardsContentMoveTween:SetAutoKill(false)
else
local CacheVector2 = BF.CacheVector2
CacheVector2.x = 0
CacheVector2.y = y
self.rewardsContentMoveTween:ChangeEndValue(CacheVector2, moveTime, true)
self.rewardsContentMoveTween:Restart()
end
end, 0)
end
function BountyMainUI:updateTime()
local remainTime = self.endTime - Time:getServerTime()
if remainTime < 0 then
UIManager:closeUnderUI(self)
return self:closeUI()
end
self.timeTx:setText(GFunc.getTimeStr(remainTime))
if not self.adjustTimeUI then
self.adjustTimeUI = true
GFunc.centerImgAndTx(self.timeIcon, self.timeTx, 4)
end
end
return BountyMainUI

View File

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

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: deb33f39641d6714b894f0e1cfc64e99
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,78 @@
local BountyCell = class("BountyCell", BaseCell)
local BOUNTY_REWARD_CELL = "app/ui/arena/cell/bounty_reward_cell"
function BountyCell:init()
local uiMap = self:getUIMap()
self.uiMap = uiMap
uiMap["cell.bg.bounty_reward_cell_1"]:setAnchoredPositionX(-GConst.UI_SCREEN_WIDTH/4)
self.bountyRewardCell1 = uiMap["cell.bg.bounty_reward_cell_1"]:addLuaComponent(BOUNTY_REWARD_CELL)
uiMap["cell.bg.bounty_reward_cell_2"]:setAnchoredPositionX(GConst.UI_SCREEN_WIDTH/4)
self.bountyRewardCell2 = uiMap["cell.bg.bounty_reward_cell_2"]:addLuaComponent(BOUNTY_REWARD_CELL)
self.lvBg = uiMap["cell.bg.lv_bg"]
self.lvTx = uiMap["cell.bg.lv_bg.lv_tx"]
self.bountyRewardCell1:addClickListener(function()
if self.idx == nil then
return
end
local iCslaimed = DataManager.ArenaBountyData:getLevelState(self.idx)
local lv = DataManager.ArenaBountyData:getLevel()
if not iCslaimed and lv >= self.idx then
ModuleManager.ArenaBountyManager:claimReward(self.idx, false)
else
local bountyInfo = DataManager.ArenaBountyData:getSeasonInfoByLevel(self.idx)
ModuleManager.TipsManager:showRewardTips(bountyInfo.reward.id, bountyInfo.reward.type, self.bountyRewardCell1:getBaseObject())
end
end)
self.bountyRewardCell2:addClickListener(function()
if self.idx == nil then
return
end
local isBought = DataManager.ArenaBountyData:getBought()
local iCslaimed = DataManager.ArenaBountyData:getProLevelState(self.idx)
local lv = DataManager.ArenaBountyData:getLevel()
if isBought and not iCslaimed and lv >= self.idx then
ModuleManager.ArenaBountyManager:claimReward(self.idx, true)
else
local bountyInfo = DataManager.ArenaBountyData:getSeasonInfoByLevel(self.idx)
ModuleManager.TipsManager:showRewardTips(bountyInfo.reward_pro.id, bountyInfo.reward_pro.type, self.bountyRewardCell2:getBaseObject())
end
end)
end
function BountyCell:refresh(idx)
self.idx = idx
local bountyInfo = DataManager.ArenaBountyData:getSeasonInfoByLevel(idx)
local lv = DataManager.ArenaBountyData:getLevel()
local state = DataManager.ArenaBountyData:getLevelState(idx)
local proState = DataManager.ArenaBountyData:getProLevelState(idx)
local isBought = DataManager.ArenaBountyData:getBought()
self.lvTx:setText(GFunc.intToString(idx))
self.bountyRewardCell1:refresh(bountyInfo.reward, false, false, state)
self.bountyRewardCell2:refresh(bountyInfo.reward_pro, true, not isBought, proState)
if lv >= idx then
self.lvBg:setImageGray(false)
if state then -- 已经领过了
self.bountyRewardCell1:hideLight()
else
self.bountyRewardCell1:showLight()
end
if isBought and not proState then
self.bountyRewardCell2:showLight()
else
self.bountyRewardCell2:hideLight()
end
else
self.lvBg:setImageGray(true)
self.bountyRewardCell1:hideLight()
self.bountyRewardCell2:hideLight()
end
end
function BountyCell:setVisible(visible)
self.baseObject:setVisible(visible)
end
return BountyCell

View File

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

View File

@ -0,0 +1,101 @@
local BountyRewardCell = class("BountyRewardCell", BaseCell)
function BountyRewardCell:init()
local uiMap = self:getUIMap()
self.bg = uiMap["bounty_reward_cell.bg"]
self.icon = uiMap["bounty_reward_cell.icon"]
self.numTx = uiMap["bounty_reward_cell.num"]
self.check = uiMap["bounty_reward_cell.check"]
self.fragment = uiMap["bounty_reward_cell.fragment"]
self.light = uiMap["bounty_reward_cell.light"]
self.lock = uiMap["bounty_reward_cell.lock"]
self.matchImg = uiMap["bounty_reward_cell.match_img"]
self.sImg = uiMap["bounty_reward_cell.s"]
self:hideLight()
self.baseObject:addClickListener(function()
if self.clickCallback then
self.clickCallback()
elseif self.rewardId ~= nil then
ModuleManager.TipsManager:showRewardTips(self.rewardId, self.rewardType, self.baseObject)
end
end)
end
function BountyRewardCell:refresh(reward, isPro, isLock, showCheck)
self:showCheck(showCheck)
if isPro then
self.bg:setSprite(GConst.ATLAS_PATH.BOUNTY, "bounty_board_2") -- TODOJ
else
self.bg:setSprite(GConst.ATLAS_PATH.BOUNTY, "bounty_board_1") -- TODOJ
end
if isLock then
self.lock:setVisible(true)
else
self.lock:setVisible(false)
end
if reward.type == GConst.REWARD_TYPE.ITEM then
self:_refreshItem(reward)
self.rewardId = reward.id
self.rewardType = reward.type
else
self.rewardId = nil
end
end
function BountyRewardCell:_refreshItem(item)
local info = ConfigManager:getConfig("item")[item.id]
if info == nil then
return
end
self.numTx:setText(item.count or item.num)
if info.type == GConst.ItemConst.ITEM_TYPE.HERO_FRAGMENT then
local heroInfo = ConfigManager:getConfig("hero")[info.parameter]
if heroInfo then
self.icon:setSprite(GConst.ATLAS_PATH.ICON_HERO, heroInfo.icon)
self.matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[heroInfo.position])
self.matchImg:setVisible(true)
self.sImg:setVisible(heroInfo.qlt >= 4)
else
self.icon:setSprite(GConst.ATLAS_PATH.COMMON, "common_alpha")
self.matchImg:setVisible(false)
self.sImg:setVisible(false)
end
self.fragment:setVisible(true)
else
self.icon:setSprite(GConst.ATLAS_PATH.ICON_ITEM, info.icon)
self.fragment:setVisible(false)
self.matchImg:setVisible(false)
self.sImg:setVisible(false)
end
end
function BountyRewardCell:showCheck(show)
self.check:setVisible(show == true)
end
function BountyRewardCell:setVisible(visible)
self.baseObject:setActive(visible)
end
function BountyRewardCell:setAnchoredPositionX(x)
self.baseObject:setAnchoredPositionX(x)
end
function BountyRewardCell:setTouchEnable(enable)
self.baseObject:setTouchEnable(enable)
end
function BountyRewardCell:addClickListener(callback)
self.clickCallback = callback
end
function BountyRewardCell:showLight()
self.light:setVisible(true)
end
function BountyRewardCell:hideLight()
self.light:setVisible(false)
end
return BountyRewardCell

View File

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

View File

@ -49,7 +49,7 @@ function GridCell:refresh(gridEntity, curElement, skillPosId)
spineObj:playAnim(finalAniname, true, false, true) spineObj:playAnim(finalAniname, true, false, true)
end, true) end, true)
else else
spineObj:playAnim(finalAniname, true, false, true) spineObj:playAnimComplete(finalAniname, false, true, nil, true)
end end
end) end)
upBg:setSprite(GConst.ATLAS_PATH.COMMON, "common_alpha") upBg:setSprite(GConst.ATLAS_PATH.COMMON, "common_alpha")

View File

@ -138,6 +138,8 @@ function DungeonDifficultyUI:refreshDifficulty()
self.iconBuff:addClickListener(function() self.iconBuff:addClickListener(function()
ModuleManager.TipsManager:showDescTips(GFunc.getBuffDesc(buff.type, buff.num), self.iconBuff) ModuleManager.TipsManager:showDescTips(GFunc.getBuffDesc(buff.type, buff.num), self.iconBuff)
end) end)
GFunc.centerTxAndImg(self.txbuff, self.iconBuff, 5)
else else
self.buffObj:setActive(false) self.buffObj:setActive(false)
end end

View File

@ -15,6 +15,13 @@ local BOUNTY_SPINE_NAME = {
[18] = "ui_bounty_chestopen_4", [18] = "ui_bounty_chestopen_4",
[10] = "ui_bounty_chestopen_5", [10] = "ui_bounty_chestopen_5",
} }
local ARENA_BOUNTY_SPINE_NAME = {
[8] = "ui_bounty_chestopen_1",
[9] = "ui_bounty_chestopen_2",
[11] = "ui_bounty_chestopen_3",
[18] = "ui_bounty_chestopen_4",
[10] = "ui_bounty_chestopen_5",
}
function BoxOpenUI:ctor(params) function BoxOpenUI:ctor(params)
self.params = params or {} -- 将信息传递给下一个界面 self.params = params or {} -- 将信息传递给下一个界面
@ -45,6 +52,8 @@ function BoxOpenUI:onLoadRootComplete()
spineName = SUMMON_SPINE_NAME[self.index] spineName = SUMMON_SPINE_NAME[self.index]
elseif self.type == GConst.ShopConst.BOX_REWARD_TYPE.BOUNTY then elseif self.type == GConst.ShopConst.BOX_REWARD_TYPE.BOUNTY then
spineName = BOUNTY_SPINE_NAME[self.index] spineName = BOUNTY_SPINE_NAME[self.index]
elseif self.type == GConst.ShopConst.BOX_REWARD_TYPE.ARENA_BOUNTY then
spineName = ARENA_BOUNTY_SPINE_NAME[self.index]
end end
if not spineName then if not spineName then
spineName = DEFAULT_SPINE_NAME spineName = DEFAULT_SPINE_NAME

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e06f9d9230a388843be1aaa5bb3aef31
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,400 @@
local ArenaBountyData = class("ArenaBountyData", BaseData)
local ACT_GIFT_ID_BOUNTY = 80102
local ACT_GIFT_ID_BOUNTY_ADVANCED = 80202
function ArenaBountyData:ctor()
self.data.dirty = false
end
function ArenaBountyData:clear()
DataManager:unregisterCrossDayFunc("ArenaBountyData")
end
function ArenaBountyData:init(data)
data = data or GConst.EMPTY_TABLE
self.season = data.season or 1
self.level = data.level or 1
self.exp = data.exp or 0
self.bought = data.bought
self.isBoughtBase = nil
self.isBoughtAdvance = nil
self.popBoughtTime = LocalData:getArenaBountyPopTime()
self.claimed = data.claimed or {}
self.claimedCount = 0
for k, v in pairs(self.claimed) do
if v then
self.claimedCount = self.claimedCount + 1
end
end
self.proClaimed = data.pro_claimed or {}
self.proClaimedCount = 0
for k, v in pairs(self.proClaimed) do
if v then
self.proClaimedCount = self.proClaimedCount + 1
end
end
self.endTime = 0
self:initBountyTime()
self:initBountyLevelCfg()
DataManager:registerCrossDayFunc("ArenaBountyData", function()
self:checkNextSeason()
self:markDirty()
end)
end
function ArenaBountyData:initBountyTime()
local info = ConfigManager:getConfig("arena_time")[self.season]
if info == nil then
self.endTime = 0
return
end
self.endTime = Time:getCertainTimeByStr(info.end_time)
end
function ArenaBountyData:initBountyLevelCfg()
if self.bountyLevelCfg == nil then
self.bountyLevelCfg = {}
else
for i = 1, #self.bountyLevelCfg do
table.remove(self.bountyLevelCfg)
end
end
if self.proRewards then
for i = 1, #self.proRewards do
table.remove(self.proRewards)
end
end
local cfg = ConfigManager:getConfig("arena_bounty_level")
for k, v in pairs(cfg) do
if v.season == self.season then
self.bountyLevelCfg[k % 100] = v
end
end
self.repeatLevelInfo = table.remove(self.bountyLevelCfg)
end
function ArenaBountyData:checkNextSeason()
if self.endTime > Time:getServerTime() then
return
end
local nextSeason = self.season + 1
local info = ConfigManager:getConfig("arena_time")[nextSeason]
if info == nil then
self.endTime = 0
return
end
self.endTime = Time:getCertainTimeByStr(info.end_time)
self.season = nextSeason
self.level = 1
self.exp = 0
self.bought = false
self.isBoughtBase = nil
self.isBoughtAdvance = nil
for k, v in pairs(self.claimed) do
self.claimed[k] = false
end
self.claimedCount = 0
for k, v in pairs(self.proClaimed) do
self.proClaimed[k] = false
end
self.proClaimedCount = 0
self:initBountyLevelCfg()
end
function ArenaBountyData:getBought()
return self.bought
end
function ArenaBountyData:setBought(season, level)
if self.season ~= season then
return
end
self.bought = true
self.isBoughtBase = nil
self.isBoughtAdvance = nil
level = level or self.level
if self.level ~= level then
self.level = level
BIReport:postArenaBountyLevelUp(self:getBountyReportType(), self.level, self.exp, self.season)
end
DataManager.DailyTaskData:unlockBountyTask()
self:markDirty()
end
function ArenaBountyData:getLevel()
return self.level
end
function ArenaBountyData:getExp()
return self.exp
end
function ArenaBountyData:addExp(num)
self.exp = self.exp + num
local levelBefore = self.level
while true do
local lvUpExp = self:getLvUpExp()
if self.exp >= lvUpExp then
self.exp = self.exp - lvUpExp
self.level = self.level + 1
else
break
end
end
if levelBefore ~= self.level then
BIReport:postArenaBountyLevelUp(self:getBountyReportType(), self.level, self.exp, self.season)
end
self:markDirty()
end
function ArenaBountyData:getLvUpExp()
local info = self:getSeasonInfoByLevel(self.level + 1)
if info == nil then
return self.repeatLevelInfo and self.repeatLevelInfo.exp or 1
end
return info.exp
end
function ArenaBountyData:getRepeatLevelInfo()
return self.repeatLevelInfo
end
function ArenaBountyData:getIsOpen()
if ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.BOUNTY_OPEN, true) and self.endTime > Time:getServerTime() then
return true
end
return false
end
function ArenaBountyData:getBannerName()
return "bounty_btn_main_1" -- TODOJ
end
function ArenaBountyData:getRewardBannerName()
return "bounty_btn_main_0" -- TODOJ
end
function ArenaBountyData:getSeason()
return self.season
end
function ArenaBountyData:getSeasonInfoByLevel(lv)
return self.bountyLevelCfg[lv]
end
function ArenaBountyData:getMaxLevel()
return #self.bountyLevelCfg
end
function ArenaBountyData:getAllProRewards()
if self.proRewards and #self.proRewards > 0 then
return self.proRewards
end
local rewards = {}
for i = 1, #self.bountyLevelCfg do
local cfg = self.bountyLevelCfg[i]
if cfg.reward_pro then
table.insert(rewards, cfg.reward_pro)
end
end
self.proRewards = GFunc.mergeRewards(rewards)
local cfg = ConfigManager:getConfig("item")
table.sort(self.proRewards, function(a, b)
if cfg[a.id].type == cfg[b.id].type then
return a.id > b.id
else
return cfg[a.id].type > cfg[b.id].type
end
end)
return self.proRewards
end
function ArenaBountyData:getLevelState(lv)
return self.claimed[lv]
end
function ArenaBountyData:getProLevelState(lv)
return self.proClaimed[lv]
end
function ArenaBountyData:getIfCanBuyLevel()
local maxLevel = self:getMaxLevel()
if maxLevel > 0 and self.level < maxLevel then
return true
end
return false
end
-- 未领取的最小奖励的index
function ArenaBountyData:getMinUnclaimedRewardIndex()
local level = self.level
local maxLevel = self:getMaxLevel()
if level > maxLevel then
level = maxLevel
end
if self.claimedCount < self.level then
for i = 1, level do
if not self.claimed[i] then
return i
end
end
end
if self.bought and self.proClaimedCount < self:getMaxLevel() then
for i = 1, level do
if not self.proClaimed[i] then
return i
end
end
end
return level
end
-- 是否有未领取的奖励
function ArenaBountyData:getIfCanClaimReward()
if not self:getIsOpen() then
return false
end
if self.claimedCount < self.level then
return true
end
if self.bought and self.level <= self:getMaxLevel() and self.proClaimedCount < self.level then
return true
end
return false
end
-- 是否可以领取重复奖励
function ArenaBountyData:getIfCanClaimRepeatReward()
local maxLevel = self:getMaxLevel()
if maxLevel <= 0 then
return false
end
if self.level <= maxLevel then
return false
end
return not self:getLevelState(self.level)
end
function ArenaBountyData:onClaimReward(level)
if self.claimed[level] then
return
end
self.claimed[level] = true
self.claimedCount = self.claimedCount + 1
self:markDirty()
end
function ArenaBountyData:onClaimProReward(level)
if self.proClaimed[level] then
return
end
self.proClaimed[level] = true
self.proClaimedCount = self.proClaimedCount + 1
self:markDirty()
end
function ArenaBountyData:getBuyBountyLevelCost()
if self.buyBountyLevelCost == nil then
self.buyBountyLevelCost = ConfigManager:getConfig("const")["arena_bounty_buy_cost"].reward
end
return self.buyBountyLevelCost
end
function ArenaBountyData:onBoughtLevel()
self.level = self.level + 1
BIReport:postArenaBountyLevelUp(self:getBountyReportType(), self.level, self.exp, self.season)
self:markDirty()
end
function ArenaBountyData:getGiftId(advanced)
if advanced then
return ACT_GIFT_ID_BOUNTY_ADVANCED
else
return ACT_GIFT_ID_BOUNTY
end
end
function ArenaBountyData:markDirty()
self.data.dirty = not self.data.dirty
end
function ArenaBountyData:getEndTime()
return self.endTime
end
function ArenaBountyData:getExpItemIcon()
local id = GConst.ItemConst.ITEM_ID_BOUNTY_EXP
local info = ConfigManager:getConfig("item")[id]
if info == nil then
return GConst.EMPTY_STRING
end
return info.icon
end
function ArenaBountyData:getIsPopBought()
if not self:getIsOpen() then
return false
end
if self.bought then
return false
end
return self.popBoughtTime < Time:getBeginningOfServerToday()
end
function ArenaBountyData:markPopBought()
if self.popBoughtTime >= Time:getBeginningOfServerToday() then
return
end
self.popBoughtTime = Time:getBeginningOfServerToday()
LocalData:setBountyPopTime(self.popBoughtTime)
end
function ArenaBountyData:clearPopBought()
self.popBoughtTime = 0
end
function ArenaBountyData:getRechargeId(advanced)
local cfg = ConfigManager:getConfig("act_gift")
local id = self:getGiftId(advanced)
if cfg[id] then
return cfg[id].recharge_id
end
return 0
end
function ArenaBountyData:getBuyProBountyAddLevelCount()
if self.buyProBountyAddLevelCount == nil then
self.buyProBountyAddLevelCount = ConfigManager:getConfig("const")["arena_bounty_senior_rise"].value
end
return self.buyProBountyAddLevelCount
end
function ArenaBountyData:getIsBoughtBase()
if self.isBoughtBase == nil then
self.isBoughtBase = DataManager.ShopData:getGiftBoughtNum(PayManager.PURCHARSE_TYPE.ACT_GIFT, ACT_GIFT_ID_BOUNTY) > 0
end
return self.isBoughtBase
end
function ArenaBountyData:getIsBoughtAdvance()
if self.isBoughtAdvance == nil then
self.isBoughtAdvance = DataManager.ShopData:getGiftBoughtNum(PayManager.PURCHARSE_TYPE.ACT_GIFT, ACT_GIFT_ID_BOUNTY_ADVANCED) > 0
end
return self.isBoughtAdvance
end
function ArenaBountyData:getBountyReportType()
if not self.bought then
return 0
end
if self:getIsBoughtBase() then
return 1
end
if self:getIsBoughtAdvance() then
return 2
end
return 0
end
return ArenaBountyData

View File

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

View File

@ -207,6 +207,8 @@ function ItemData:_addItemNumById(id, num)
end end
elseif id == ItemConst.ITEM_ID_BOUNTY_EXP then elseif id == ItemConst.ITEM_ID_BOUNTY_EXP then
DataManager.BountyData:addExp(num) DataManager.BountyData:addExp(num)
elseif id == ItemConst.ITEM_ID_ARENA_BOUNTY_EXP then
DataManager.ArenaBountyData:addExp(num)
elseif id == ItemConst.ITEM_ID_EXP then elseif id == ItemConst.ITEM_ID_EXP then
DataManager.PlayerData:addExp(num) DataManager.PlayerData:addExp(num)
end end

View File

@ -123,16 +123,20 @@ function DungeonData:getOpenDungeons()
end end
local openDungeons = {} local openDungeons = {}
-- 开启且活跃
table.foreach(self.dungeonStage, function(module, s) table.foreach(self.dungeonStage, function(module, s)
if self:isOpen(module) and self:isActive(module) then if self:isOpen(module) and self:isActive(module) then
table.insert(openDungeons, module) table.insert(openDungeons, module)
end end
end) end)
table.foreach(self.dungeonStage, function(module, s) -- 开启且不活跃
if self:isOpen(module) and not self:isActive(module) then if not GFunc.isShenhe() then
table.insert(openDungeons, module) table.foreach(self.dungeonStage, function(module, s)
end if self:isOpen(module) and not self:isActive(module) then
end) table.insert(openDungeons, module)
end
end)
end
-- 碎片和金币顺序特殊处理:策划要求,同时开启时,金币在碎片之上 -- 碎片和金币顺序特殊处理:策划要求,同时开启时,金币在碎片之上
if self:isActive(ModuleManager.MODULE_KEY.DUNGEON_GOLD) and self:isActive(ModuleManager.MODULE_KEY.DUNGEON_SHARDS) then if self:isActive(ModuleManager.MODULE_KEY.DUNGEON_GOLD) and self:isActive(ModuleManager.MODULE_KEY.DUNGEON_SHARDS) then