Merge branch 'dev' of http://git.juzugame.com/b6-client/b6-lua into dev
This commit is contained in:
commit
8ecb19d48c
@ -96,7 +96,7 @@ BIReport.ITEM_GET_TYPE = {
|
||||
GOLD_PIG = "GoldPig",
|
||||
BATTLE_SKILL_REFRESH = "BattleSkillRefresh",
|
||||
GROWTH_FUND = "GrowthFund",
|
||||
GROW_UP_GIFT = "GrowUpGift", -- 成长礼包
|
||||
GROW_UP_GIFT_NEW = "GrowUpGiftNew", -- 新成长礼包
|
||||
SEVEN_DAY_TASK = "SevenDayTask",
|
||||
SEVEN_DAY_STEP_REWARD = "SevenDayStepReward",
|
||||
DAILY_CHALLENGE = "DailyChallenge", -- 每日挑战进入战斗扣体力
|
||||
@ -178,7 +178,7 @@ BIReport.GIFT_TYPE = {
|
||||
MALL_TREASURE = "MallTreasure",
|
||||
ACT_CHAPTER_STORE = "ActChapterStore",
|
||||
GROWTH_FUND = "GrowthFund",
|
||||
GROW_UP_GIFT = "GrowUpGift",
|
||||
GROW_UP_GIFT_NEW = "GrowUpGiftNew",
|
||||
ARENA_BOUNTY = "ArenaBounty",
|
||||
INTRODUCTORY_GIFT = "IntroductoryGift",
|
||||
ARENA_GIFT = "ArenaGift",
|
||||
|
||||
@ -147,7 +147,7 @@ function DataManager:initWithServerData(data)
|
||||
self.ShopData:initActGift(data.act) -- 礼包购买信息
|
||||
self.ShopData:initMallDaily(data.mall_daily) -- 每日特惠
|
||||
self.ShopData:initCommonDailyGoldGift(data.mall_idle and data.mall_idle.ad_count) -- 常驻金币礼包
|
||||
self.ShopData:initGrowUpGift(data.act_grow_up_gift, data.now_ts) -- 成长礼包
|
||||
self.ShopData:initGrowUpGift(data.act_grow_up_gift2) -- 成长礼包
|
||||
self.ShopData:initLevelUpGift(data.act_level_up_gift) -- 助力/金币礼包
|
||||
self.ShopData:initIntroductGift(data.act_introductory_gift) -- 入门礼包
|
||||
-- 商店礼包都初始化完了后检查一下每日红点
|
||||
|
||||
@ -4,9 +4,9 @@ PayManager.PURCHARSE_TYPE = {
|
||||
ACT_GIFT = 1,
|
||||
ACT_GOLD_PIG = 2,
|
||||
CHAPTER_GIFT = 3,
|
||||
GROW_UP_GIFT = 4,
|
||||
GROW_UP_GIFT = 4,-- 自0.4.0废弃
|
||||
MALL_TREASURE = 5,
|
||||
ARENA_GIFT = 6,
|
||||
GROW_UP_GIFT_NEW = 6,
|
||||
}
|
||||
|
||||
PayManager.PURCHARSE_ACT_TYPE = {
|
||||
@ -26,7 +26,7 @@ PayManager.PURCHARSE_TYPE_CONFIG = {
|
||||
[PayManager.PURCHARSE_TYPE.ACT_GOLD_PIG] = "act_gold_pig",
|
||||
[PayManager.PURCHARSE_TYPE.MALL_TREASURE] = "mall_treasure",
|
||||
[PayManager.PURCHARSE_TYPE.CHAPTER_GIFT] = "act_chapter_store",
|
||||
[PayManager.PURCHARSE_TYPE.GROW_UP_GIFT] = "act_growup_gift",
|
||||
[PayManager.PURCHARSE_TYPE.GROW_UP_GIFT_NEW] = "act_growup_gift_new",
|
||||
}
|
||||
|
||||
PayManager.BI_ITEM_GET_TYPE = {
|
||||
@ -44,7 +44,7 @@ PayManager.BI_ITEM_GET_TYPE = {
|
||||
[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.CHAPTER_GIFT] = BIReport.ITEM_GET_TYPE.ACT_CHAPTER_STORE,
|
||||
[PayManager.PURCHARSE_TYPE.GROW_UP_GIFT] = BIReport.ITEM_GET_TYPE.GROW_UP_GIFT,
|
||||
[PayManager.PURCHARSE_TYPE.GROW_UP_GIFT_NEW] = BIReport.ITEM_GET_TYPE.GROW_UP_GIFT_NEW,
|
||||
}
|
||||
|
||||
PayManager.BI_GIFT_TYPE = {
|
||||
@ -56,13 +56,13 @@ PayManager.BI_GIFT_TYPE = {
|
||||
[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.BOUNTY] = BIReport.GIFT_TYPE.BOUNTY,
|
||||
[PayManager.PURCHARSE_ACT_TYPE.ARENA_BOUNTY] = BIReport.GIFT_TYPE.ARENA_GIFT,
|
||||
[PayManager.PURCHARSE_ACT_TYPE.ARENA_GIFT] = BIReport.ITEM_GET_TYPE.ARENA_GIFT,
|
||||
[PayManager.PURCHARSE_ACT_TYPE.ARENA_BOUNTY] = BIReport.GIFT_TYPE.ARENA_BOUNTY,
|
||||
[PayManager.PURCHARSE_ACT_TYPE.ARENA_GIFT] = BIReport.GIFT_TYPE.ARENA_GIFT,
|
||||
},
|
||||
[PayManager.PURCHARSE_TYPE.ACT_GOLD_PIG] = BIReport.GIFT_TYPE.GOLD_PIG,
|
||||
[PayManager.PURCHARSE_TYPE.MALL_TREASURE] = BIReport.GIFT_TYPE.MALL_TREASURE,
|
||||
[PayManager.PURCHARSE_TYPE.CHAPTER_GIFT] = BIReport.GIFT_TYPE.ACT_CHAPTER_STORE,
|
||||
[PayManager.PURCHARSE_TYPE.GROW_UP_GIFT] = BIReport.GIFT_TYPE.GROW_UP_GIFT,
|
||||
[PayManager.PURCHARSE_TYPE.GROW_UP_GIFT_NEW] = BIReport.GIFT_TYPE.GROW_UP_GIFT_NEW,
|
||||
}
|
||||
|
||||
function PayManager:getItemGetType(purchaseType, id)
|
||||
|
||||
@ -18,7 +18,7 @@ function ServerPushManager:initWhenLogin()
|
||||
self:addServerPushListener(ProtoMsgType.FromMsgEnum.NewMailNtf, ModuleManager.MailManager, ModuleManager.MailManager.needUpdateMail)
|
||||
self:addServerPushListener(ProtoMsgType.FromMsgEnum.PigLevelUpNtf, ModuleManager.ActivityManager, ModuleManager.ActivityManager.onBoughtGoldPigFinish)
|
||||
self:addServerPushListener(ProtoMsgType.FromMsgEnum.TriggerLevelUpGiftNtf, ModuleManager.ShopManager, ModuleManager.ShopManager.onTriggerLevelUpGift)
|
||||
self:addServerPushListener(ProtoMsgType.FromMsgEnum.TriggerGrowUpGiftNtf, ModuleManager.ShopManager, ModuleManager.ShopManager.onTriggerGrowUpGift)
|
||||
self:addServerPushListener(ProtoMsgType.FromMsgEnum.TriggerGrowUpGift2Ntf, ModuleManager.ShopManager, ModuleManager.ShopManager.onTriggerGrowUpGift)
|
||||
self:addServerPushListener(ProtoMsgType.FromMsgEnum.MallDailyResetNtf, ModuleManager.ShopManager, ModuleManager.ShopManager.onMallDailyReset)
|
||||
self:addServerPushListener(ProtoMsgType.FromMsgEnum.AIHelpUnreadNtf, ModuleManager.GameSettingManager, ModuleManager.GameSettingManager.rspAiHelperNtf)
|
||||
end
|
||||
|
||||
@ -2,7 +2,7 @@ local arena_robot = {
|
||||
[1]={
|
||||
["name"]="Gresham",
|
||||
["score"]=917,
|
||||
["level"]=12,
|
||||
["level"]=9,
|
||||
["avatar"]=3001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -31,7 +31,7 @@ local arena_robot = {
|
||||
[2]={
|
||||
["name"]="Gilroy",
|
||||
["score"]=929,
|
||||
["level"]=13,
|
||||
["level"]=10,
|
||||
["avatar"]=1001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -60,7 +60,7 @@ local arena_robot = {
|
||||
[3]={
|
||||
["name"]="Landry",
|
||||
["score"]=941,
|
||||
["level"]=13,
|
||||
["level"]=10,
|
||||
["avatar"]=4001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -89,7 +89,7 @@ local arena_robot = {
|
||||
[4]={
|
||||
["name"]="Eva",
|
||||
["score"]=953,
|
||||
["level"]=12,
|
||||
["level"]=9,
|
||||
["avatar"]=2001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -118,7 +118,7 @@ local arena_robot = {
|
||||
[5]={
|
||||
["name"]="Prosperous",
|
||||
["score"]=959,
|
||||
["level"]=12,
|
||||
["level"]=9,
|
||||
["avatar"]=5001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -147,7 +147,7 @@ local arena_robot = {
|
||||
[6]={
|
||||
["name"]="Fleming",
|
||||
["score"]=964,
|
||||
["level"]=11,
|
||||
["level"]=8,
|
||||
["avatar"]=4001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -176,7 +176,7 @@ local arena_robot = {
|
||||
[7]={
|
||||
["name"]="Lola",
|
||||
["score"]=969,
|
||||
["level"]=11,
|
||||
["level"]=8,
|
||||
["avatar"]=5001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -205,7 +205,7 @@ local arena_robot = {
|
||||
[8]={
|
||||
["name"]="Frances",
|
||||
["score"]=978,
|
||||
["level"]=12,
|
||||
["level"]=9,
|
||||
["avatar"]=3001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -234,7 +234,7 @@ local arena_robot = {
|
||||
[9]={
|
||||
["name"]="Keith",
|
||||
["score"]=987,
|
||||
["level"]=10,
|
||||
["level"]=7,
|
||||
["avatar"]=2001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -263,7 +263,7 @@ local arena_robot = {
|
||||
[10]={
|
||||
["name"]="Winston",
|
||||
["score"]=996,
|
||||
["level"]=14,
|
||||
["level"]=11,
|
||||
["avatar"]=1001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -292,7 +292,7 @@ local arena_robot = {
|
||||
[11]={
|
||||
["name"]="Halsey",
|
||||
["score"]=1006,
|
||||
["level"]=15,
|
||||
["level"]=12,
|
||||
["avatar"]=5001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -321,7 +321,7 @@ local arena_robot = {
|
||||
[12]={
|
||||
["name"]="Stuart",
|
||||
["score"]=1018,
|
||||
["level"]=17,
|
||||
["level"]=14,
|
||||
["avatar"]=5001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -350,7 +350,7 @@ local arena_robot = {
|
||||
[13]={
|
||||
["name"]="Dark-Haired",
|
||||
["score"]=1029,
|
||||
["level"]=16,
|
||||
["level"]=13,
|
||||
["avatar"]=1001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -379,7 +379,7 @@ local arena_robot = {
|
||||
[14]={
|
||||
["name"]="Hilda",
|
||||
["score"]=1036,
|
||||
["level"]=13,
|
||||
["level"]=10,
|
||||
["avatar"]=2001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -408,7 +408,7 @@ local arena_robot = {
|
||||
[15]={
|
||||
["name"]="Idelle",
|
||||
["score"]=1046,
|
||||
["level"]=16,
|
||||
["level"]=13,
|
||||
["avatar"]=2001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -437,7 +437,7 @@ local arena_robot = {
|
||||
[16]={
|
||||
["name"]="Sibley",
|
||||
["score"]=1055,
|
||||
["level"]=14,
|
||||
["level"]=11,
|
||||
["avatar"]=3001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -466,7 +466,7 @@ local arena_robot = {
|
||||
[17]={
|
||||
["name"]="Wolf",
|
||||
["score"]=1065,
|
||||
["level"]=14,
|
||||
["level"]=11,
|
||||
["avatar"]=1001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -495,7 +495,7 @@ local arena_robot = {
|
||||
[18]={
|
||||
["name"]="Renata",
|
||||
["score"]=1073,
|
||||
["level"]=16,
|
||||
["level"]=13,
|
||||
["avatar"]=3001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -524,7 +524,7 @@ local arena_robot = {
|
||||
[19]={
|
||||
["name"]="Lane",
|
||||
["score"]=1084,
|
||||
["level"]=13,
|
||||
["level"]=10,
|
||||
["avatar"]=4001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -553,7 +553,7 @@ local arena_robot = {
|
||||
[20]={
|
||||
["name"]="Fabian",
|
||||
["score"]=1095,
|
||||
["level"]=16,
|
||||
["level"]=13,
|
||||
["avatar"]=4001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -582,7 +582,7 @@ local arena_robot = {
|
||||
[21]={
|
||||
["name"]="Peace",
|
||||
["score"]=1104,
|
||||
["level"]=17,
|
||||
["level"]=14,
|
||||
["avatar"]=1001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -611,7 +611,7 @@ local arena_robot = {
|
||||
[22]={
|
||||
["name"]="Tanya",
|
||||
["score"]=1110,
|
||||
["level"]=18,
|
||||
["level"]=15,
|
||||
["avatar"]=2001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -640,7 +640,7 @@ local arena_robot = {
|
||||
[23]={
|
||||
["name"]="Trix",
|
||||
["score"]=1118,
|
||||
["level"]=16,
|
||||
["level"]=13,
|
||||
["avatar"]=5001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -669,7 +669,7 @@ local arena_robot = {
|
||||
[24]={
|
||||
["name"]="Eugene",
|
||||
["score"]=1129,
|
||||
["level"]=19,
|
||||
["level"]=16,
|
||||
["avatar"]=5001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -698,7 +698,7 @@ local arena_robot = {
|
||||
[25]={
|
||||
["name"]="Loralie",
|
||||
["score"]=1140,
|
||||
["level"]=17,
|
||||
["level"]=14,
|
||||
["avatar"]=1001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -727,7 +727,7 @@ local arena_robot = {
|
||||
[26]={
|
||||
["name"]="Henrietta",
|
||||
["score"]=1150,
|
||||
["level"]=16,
|
||||
["level"]=13,
|
||||
["avatar"]=3001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -756,7 +756,7 @@ local arena_robot = {
|
||||
[27]={
|
||||
["name"]="Willette",
|
||||
["score"]=1159,
|
||||
["level"]=17,
|
||||
["level"]=14,
|
||||
["avatar"]=4001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -785,7 +785,7 @@ local arena_robot = {
|
||||
[28]={
|
||||
["name"]="Orlena",
|
||||
["score"]=1167,
|
||||
["level"]=17,
|
||||
["level"]=14,
|
||||
["avatar"]=3001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -814,7 +814,7 @@ local arena_robot = {
|
||||
[29]={
|
||||
["name"]="Irving",
|
||||
["score"]=1178,
|
||||
["level"]=18,
|
||||
["level"]=15,
|
||||
["avatar"]=2001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
@ -843,7 +843,7 @@ local arena_robot = {
|
||||
[30]={
|
||||
["name"]="Phyllis",
|
||||
["score"]=1190,
|
||||
["level"]=19,
|
||||
["level"]=16,
|
||||
["avatar"]=4001,
|
||||
["avatar_frame"]=1000,
|
||||
["hero_id"]={
|
||||
|
||||
@ -329,6 +329,7 @@ local localization_global =
|
||||
["ARENA_BATTLEPASS_4"] = "Premium Battle Pass",
|
||||
["ARENA_BATTLEPASS_5"] = "Unlock Premium Battle Pass",
|
||||
["ARENA_BATTLEPASS_6"] = "Obtain Premium Battle Pass for 10 more levels and richer rewards!",
|
||||
["ARENA_BATTLEPASS_7"] = "Upon completing all content of the Arena Battle Pass, you can receive a reward chest for every 1000 points.",
|
||||
}
|
||||
|
||||
return localization_global
|
||||
@ -329,6 +329,7 @@ local localization_global =
|
||||
["ARENA_BATTLEPASS_4"] = "Pase de Batalla Premium",
|
||||
["ARENA_BATTLEPASS_5"] = "Desbloquea Pase de Batalla Premium",
|
||||
["ARENA_BATTLEPASS_6"] = "¡Obtiene Pase de Batalla Premium, gana +10 niveles, y recibe más recompensas ya!",
|
||||
["ARENA_BATTLEPASS_7"] = "Al completar todo el contenido del pase, podrás obtener un cofre de recompensa por cada 1000 puntos.",
|
||||
}
|
||||
|
||||
return localization_global
|
||||
@ -329,6 +329,7 @@ local localization_global =
|
||||
["ARENA_BATTLEPASS_4"] = "Pass Premium",
|
||||
["ARENA_BATTLEPASS_5"] = "Buka Pass Premium",
|
||||
["ARENA_BATTLEPASS_6"] = "Dapat Pass Premium, +10 level dan hadiah lainnya!",
|
||||
["ARENA_BATTLEPASS_7"] = "Dapat menerima peti hadiah untuk setiap 1.000 poin setelah menyelesaikan semua konten Pass Battle Arena.",
|
||||
}
|
||||
|
||||
return localization_global
|
||||
@ -329,6 +329,7 @@ local localization_global =
|
||||
["ARENA_BATTLEPASS_4"] = "プレミアム戦令",
|
||||
["ARENA_BATTLEPASS_5"] = "プレミアム戦令を解放する",
|
||||
["ARENA_BATTLEPASS_6"] = "プレミアム戦令を購入すると、レベルが+10、即座に報酬を獲得できる!",
|
||||
["ARENA_BATTLEPASS_7"] = "全ての闘技場戦令ミッションを達成した後、1000ポイントごとに報酬宝箱を1箱獲得できる",
|
||||
}
|
||||
|
||||
return localization_global
|
||||
@ -329,6 +329,7 @@ local localization_global =
|
||||
["ARENA_BATTLEPASS_4"] = "고급 배틀 패스",
|
||||
["ARENA_BATTLEPASS_5"] = "고급 배틀 패스 잠금 해제",
|
||||
["ARENA_BATTLEPASS_6"] = "고급 배틀 패스를 획득하고 +10 레벨, 즉시 더 많은 보상을 받으세요!",
|
||||
["ARENA_BATTLEPASS_7"] = "아레나 배틀 패스의 모든 콘텐츠를 완료하면 1000포인트마다 보물 상자 하나를 받을 수 있습니다.",
|
||||
}
|
||||
|
||||
return localization_global
|
||||
@ -329,6 +329,7 @@ local localization_global =
|
||||
["ARENA_BATTLEPASS_4"] = "Ordem Premium",
|
||||
["ARENA_BATTLEPASS_5"] = "Desbloquear Ordem Premium",
|
||||
["ARENA_BATTLEPASS_6"] = "Obtenha a Ordem de Batalha Premium, ganhe +10 níveis e receba mais recompensas de imediato!",
|
||||
["ARENA_BATTLEPASS_7"] = "Após completar todo o critério do Ordem da Arena, você pode receber um Baú de Recompensas por cada 1000 pontos.",
|
||||
}
|
||||
|
||||
return localization_global
|
||||
@ -329,6 +329,7 @@ local localization_global =
|
||||
["ARENA_BATTLEPASS_4"] = "ป้ายรบขั้นสูง",
|
||||
["ARENA_BATTLEPASS_5"] = "ปลดล็อกป้ายรบขั้นสูง",
|
||||
["ARENA_BATTLEPASS_6"] = "ได้รับป้ายรบขั้นสูง +10 เลเวล รับรางวัลเพิ่มเติมทันที!",
|
||||
["ARENA_BATTLEPASS_7"] = "เมื่อคุณบรรลุเนื้อหาทั้งหมดของป้ายรบอารีน่า คุณจะได้รับหีบรางวัล 1 หีบสำหรับทุกๆ 1,000 คะแนน",
|
||||
}
|
||||
|
||||
return localization_global
|
||||
@ -329,6 +329,7 @@ local localization_global =
|
||||
["ARENA_BATTLEPASS_4"] = "Chiến Lệnh Cao",
|
||||
["ARENA_BATTLEPASS_5"] = "Mở khóa Chiến Lệnh Cao",
|
||||
["ARENA_BATTLEPASS_6"] = "Nhận được Chiến Lệnh Cao, +10 cấp, nhận ngay thêm phần thưởng!",
|
||||
["ARENA_BATTLEPASS_7"] = "Khi bạn hoàn thành tất cả nội dung của Chiến Lệnh Đấu Trường, cứ 1000 điểm được nhận 1 Rương Thưởng",
|
||||
}
|
||||
|
||||
return localization_global
|
||||
@ -329,6 +329,7 @@ local localization_global =
|
||||
["ARENA_BATTLEPASS_4"] = "高級戰令",
|
||||
["ARENA_BATTLEPASS_5"] = "解鎖高級戰令",
|
||||
["ARENA_BATTLEPASS_6"] = "獲得高級戰令,+10級,立即獲得更多獎勵!",
|
||||
["ARENA_BATTLEPASS_7"] = "當你完成戰令的所有內容,之後每1000積分可以獲取一個獎勵寶箱",
|
||||
}
|
||||
|
||||
return localization_global
|
||||
@ -40,8 +40,7 @@ MainCityConst.RIGHT_SIDE_BARS = {
|
||||
-- "app/ui/main_city/cell/side_bar_first_recharge_cell", 已作废
|
||||
"app/ui/main_city/cell/side_bar_introduct_gift_cell",
|
||||
"app/ui/main_city/cell/side_bar_beginner_gift_cell",
|
||||
"app/ui/main_city/cell/side_bar_grow_up_gift_1_cell",
|
||||
"app/ui/main_city/cell/side_bar_grow_up_gift_2_cell",
|
||||
"app/ui/main_city/cell/side_bar_grow_up_gift_cell",
|
||||
}
|
||||
|
||||
return MainCityConst
|
||||
@ -65,7 +65,7 @@ end
|
||||
|
||||
-- 触发成长礼包
|
||||
function ShopManager:triggerGrowUpGiftPopUI(actId)
|
||||
self:triggerGiftPopUI(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT, actId)
|
||||
self:triggerGiftPopUI(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT_NEW, actId)
|
||||
end
|
||||
|
||||
-- 购买每日特惠商品
|
||||
@ -223,10 +223,11 @@ end
|
||||
|
||||
-- 推送成长礼包
|
||||
function ShopManager:onTriggerGrowUpGift(result)
|
||||
DataManager.ShopData:onTriggerGrowUpGift(result.add_grow_up_gift)
|
||||
DataManager.ShopData:initGrowUpGift(result.group_up_gift)
|
||||
|
||||
-- 有2种情况 1.处于英雄升级/解锁界面 立即触发弹窗 2.购买了成长礼包,此时仅标记,在奖励弹窗结束后再弹
|
||||
if UIManager:getTopUIObj() == UIManager.UI_PATH.HERO_DETAIL_UI then
|
||||
self:triggerGrowUpGiftPopUI(result.add_grow_up_gift.current_grow_up_id)
|
||||
self:triggerGrowUpGiftPopUI(result.group_up_gift.current_grow_up_id)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -95,6 +95,7 @@ local ProtoMsgType = {
|
||||
[2581182822] = "MailListRsp",
|
||||
[2620369240] = "SevenDayRewardReq",
|
||||
[2620371073] = "SevenDayRewardRsp",
|
||||
[2706989220] = "TriggerGrowUpGift2Ntf",
|
||||
[2708281176] = "PVPChallengeSettlementReq",
|
||||
[2708283009] = "PVPChallengeSettlementRsp",
|
||||
[2731281392] = "MailExtractReq",
|
||||
@ -263,6 +264,7 @@ local ProtoMsgType = {
|
||||
MailListRsp = 2581182822,
|
||||
SevenDayRewardReq = 2620369240,
|
||||
SevenDayRewardRsp = 2620371073,
|
||||
TriggerGrowUpGift2Ntf = 2706989220,
|
||||
PVPChallengeSettlementReq = 2708281176,
|
||||
PVPChallengeSettlementRsp = 2708283009,
|
||||
MailExtractReq = 2731281392,
|
||||
@ -431,6 +433,7 @@ local ProtoMsgType = {
|
||||
MailListRsp = "MailListRsp",
|
||||
SevenDayRewardReq = "SevenDayRewardReq",
|
||||
SevenDayRewardRsp = "SevenDayRewardRsp",
|
||||
TriggerGrowUpGift2Ntf = "TriggerGrowUpGift2Ntf",
|
||||
PVPChallengeSettlementReq = "PVPChallengeSettlementReq",
|
||||
PVPChallengeSettlementRsp = "PVPChallengeSettlementRsp",
|
||||
MailExtractReq = "MailExtractReq",
|
||||
|
||||
@ -98,6 +98,7 @@ function ArenaSeasonRewardUI:showSeasonReward()
|
||||
end, 1)
|
||||
|
||||
local ids = DataManager.ArenaData:getGradingIdList()
|
||||
table.sort(ids, function(a, b) return a > b end)
|
||||
self.seasonRewardComp:addInitCallback(function()
|
||||
return "app/ui/arena/cell/arena_season_reward_cell"
|
||||
end)
|
||||
|
||||
@ -1,57 +0,0 @@
|
||||
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
|
||||
local SideBarGrowUpGift1Cell = class("SideBarGrowUpGift1Cell", SideBarBaseCellComp)
|
||||
|
||||
function SideBarGrowUpGift1Cell:getIsOpen()
|
||||
return #DataManager.ShopData:getValidGrowUpGifts() >= 1
|
||||
end
|
||||
|
||||
function SideBarGrowUpGift1Cell:getSpineName()
|
||||
return "ui_main_btn_gift_grow"
|
||||
end
|
||||
|
||||
function SideBarGrowUpGift1Cell:onClick()
|
||||
local gift = DataManager.ShopData:getValidGrowUpGifts()[1]
|
||||
if gift then
|
||||
ModuleManager.ShopManager:showGiftPopUI(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT, gift.current_grow_up_id, true)
|
||||
end
|
||||
end
|
||||
|
||||
function SideBarGrowUpGift1Cell:getIsShowRedPoint()
|
||||
return false
|
||||
end
|
||||
|
||||
function SideBarGrowUpGift1Cell:onRefresh()
|
||||
self.timeBg:setVisible(true)
|
||||
self:_refreshTime()
|
||||
end
|
||||
|
||||
function SideBarGrowUpGift1Cell:updateTime()
|
||||
if self:getIsOpen() then
|
||||
self:_refreshTime()
|
||||
else
|
||||
self:closeBtn()
|
||||
end
|
||||
end
|
||||
|
||||
function SideBarGrowUpGift1Cell:_refreshTime()
|
||||
local gift = DataManager.ShopData:getValidGrowUpGifts()[1]
|
||||
if gift then
|
||||
local cfgInfo = DataManager.ShopData:getActGrowUpGiftConfig()[gift.current_grow_up_id]
|
||||
if cfgInfo then
|
||||
local durationTime = (cfgInfo.limit_time or 0) * 3600
|
||||
local triggerTime = gift.trigger_at // 1000
|
||||
local remainTime = triggerTime + durationTime - Time:getServerTime()
|
||||
if remainTime >= 0 then
|
||||
self.timeTx:setText(GFunc.getTimeStr(remainTime))
|
||||
else
|
||||
self.timeTx:setText("00:00:00")
|
||||
end
|
||||
else
|
||||
self.timeTx:setText("00:00:00")
|
||||
end
|
||||
else
|
||||
self.timeTx:setText("00:00:00")
|
||||
end
|
||||
end
|
||||
|
||||
return SideBarGrowUpGift1Cell
|
||||
@ -1,57 +0,0 @@
|
||||
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
|
||||
local SideBarGrowUpGift2Cell = class("SideBarGrowUpGift2Cell", SideBarBaseCellComp)
|
||||
|
||||
function SideBarGrowUpGift2Cell:getIsOpen()
|
||||
return #DataManager.ShopData:getValidGrowUpGifts() >= 2
|
||||
end
|
||||
|
||||
function SideBarGrowUpGift2Cell:getSpineName()
|
||||
return "ui_main_btn_gift_grow"
|
||||
end
|
||||
|
||||
function SideBarGrowUpGift2Cell:onClick()
|
||||
local gift = DataManager.ShopData:getValidGrowUpGifts()[2]
|
||||
if gift then
|
||||
ModuleManager.ShopManager:showGiftPopUI(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT, gift.current_grow_up_id, true)
|
||||
end
|
||||
end
|
||||
|
||||
function SideBarGrowUpGift2Cell:getIsShowRedPoint()
|
||||
return false
|
||||
end
|
||||
|
||||
function SideBarGrowUpGift2Cell:onRefresh()
|
||||
self.timeBg:setVisible(true)
|
||||
self:_refreshTime()
|
||||
end
|
||||
|
||||
function SideBarGrowUpGift2Cell:updateTime()
|
||||
if self:getIsOpen() then
|
||||
self:_refreshTime()
|
||||
else
|
||||
self:closeBtn()
|
||||
end
|
||||
end
|
||||
|
||||
function SideBarGrowUpGift2Cell:_refreshTime()
|
||||
local gift = DataManager.ShopData:getValidGrowUpGifts()[2]
|
||||
if gift then
|
||||
local cfgInfo = DataManager.ShopData:getActGrowUpGiftConfig()[gift.current_grow_up_id]
|
||||
if cfgInfo then
|
||||
local durationTime = (cfgInfo.limit_time or 0) * 3600
|
||||
local triggerTime = gift.trigger_at // 1000
|
||||
local remainTime = triggerTime + durationTime - Time:getServerTime()
|
||||
if remainTime >= 0 then
|
||||
self.timeTx:setText(GFunc.getTimeStr(remainTime))
|
||||
else
|
||||
self.timeTx:setText("00:00:00")
|
||||
end
|
||||
else
|
||||
self.timeTx:setText("00:00:00")
|
||||
end
|
||||
else
|
||||
self.timeTx:setText("00:00:00")
|
||||
end
|
||||
end
|
||||
|
||||
return SideBarGrowUpGift2Cell
|
||||
@ -1,10 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2dded7533782f8247b5d11e2eedfdd21
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||
55
lua/app/ui/main_city/cell/side_bar_grow_up_gift_cell.lua
Normal file
55
lua/app/ui/main_city/cell/side_bar_grow_up_gift_cell.lua
Normal file
@ -0,0 +1,55 @@
|
||||
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
|
||||
local SideBarGrowUpGiftCell = class("SideBarGrowUpGiftCell", SideBarBaseCellComp)
|
||||
|
||||
function SideBarGrowUpGiftCell:getIsOpen()
|
||||
return DataManager.ShopData:hasGrowUpGift()
|
||||
end
|
||||
|
||||
function SideBarGrowUpGiftCell:getSpineName()
|
||||
return "ui_main_btn_gift_grow"
|
||||
end
|
||||
|
||||
function SideBarGrowUpGiftCell:onClick()
|
||||
local gift = DataManager.ShopData:getGrowUpGift()
|
||||
if gift then
|
||||
ModuleManager.ShopManager:showGiftPopUI(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT_NEW, gift.current_grow_up_id, true)
|
||||
end
|
||||
end
|
||||
|
||||
function SideBarGrowUpGiftCell:getIsShowRedPoint()
|
||||
return false
|
||||
end
|
||||
|
||||
function SideBarGrowUpGiftCell:onRefresh()
|
||||
self.timeBg:setVisible(true)
|
||||
self:_refreshTime()
|
||||
end
|
||||
|
||||
function SideBarGrowUpGiftCell:updateTime()
|
||||
if self:getIsOpen() then
|
||||
self:_refreshTime()
|
||||
else
|
||||
self:closeBtn()
|
||||
end
|
||||
end
|
||||
|
||||
function SideBarGrowUpGiftCell:_refreshTime()
|
||||
local gift = DataManager.ShopData:getGrowUpGift()
|
||||
if gift then
|
||||
local cfgInfo = DataManager.ShopData:getActGrowUpGiftConfig()[gift.current_grow_up_id]
|
||||
if cfgInfo then
|
||||
local remainTime = DataManager.ShopData:getGrowUpGiftRemainTime()
|
||||
if remainTime >= 0 then
|
||||
self.timeTx:setText(GFunc.getTimeStr(remainTime))
|
||||
else
|
||||
self.timeTx:setText("00:00:00")
|
||||
end
|
||||
else
|
||||
self.timeTx:setText("00:00:00")
|
||||
end
|
||||
else
|
||||
self.timeTx:setText("00:00:00")
|
||||
end
|
||||
end
|
||||
|
||||
return SideBarGrowUpGiftCell
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 297d71f3bc4702a40a96511df082c7ad
|
||||
guid: e2737cd4780030247b51d4483700bda6
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
@ -1086,7 +1086,7 @@ function MainCityUI:checkGift()
|
||||
end
|
||||
end
|
||||
-- 特殊的 成长礼包
|
||||
local growUpPopUpGifts = DataManager.ShopData:getPopUpGiftByType(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT)
|
||||
local growUpPopUpGifts = DataManager.ShopData:getPopUpGiftByType(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT_NEW)
|
||||
-- 按顺序弹出(首充/章节/新手/助力/成长/金币顺序)
|
||||
-- 首充礼包
|
||||
-- if firstRechargeIds and #firstRechargeIds > 0 then
|
||||
@ -1115,7 +1115,7 @@ function MainCityUI:checkGift()
|
||||
end
|
||||
-- 成长礼包
|
||||
if growUpPopUpGifts and #growUpPopUpGifts > 0 then
|
||||
ModuleManager.ShopManager:triggerGiftPopUI(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT, growUpPopUpGifts[1])
|
||||
ModuleManager.ShopManager:triggerGiftPopUI(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT_NEW, growUpPopUpGifts[1])
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
@ -72,10 +72,7 @@ function GrowCell:setVisible(visible)
|
||||
end
|
||||
|
||||
function GrowCell:refreshTime()
|
||||
local remainTime = 0
|
||||
local cfgInfo = DataManager.ShopData:getActGrowUpGiftConfig()[self.actId]
|
||||
local triggerTime = self.gift.trigger_at // 1000
|
||||
remainTime = triggerTime + (cfgInfo.limit_time or 0) * 3600 - Time:getServerTime()
|
||||
local remainTime = DataManager.ShopData:getGrowUpGiftRemainTime()
|
||||
if remainTime <= 0 then
|
||||
remainTime = 0
|
||||
end
|
||||
@ -83,7 +80,7 @@ function GrowCell:refreshTime()
|
||||
end
|
||||
|
||||
function GrowCell:onClickGift(id)
|
||||
PayManager:purchasePackage(id, PayManager.PURCHARSE_TYPE.GROW_UP_GIFT)
|
||||
PayManager:purchasePackage(id, PayManager.PURCHARSE_TYPE.GROW_UP_GIFT_NEW)
|
||||
end
|
||||
|
||||
return GrowCell
|
||||
@ -21,7 +21,8 @@ function GrowSellCell:init()
|
||||
end
|
||||
|
||||
function GrowSellCell:refresh()
|
||||
self.actGifts = DataManager.ShopData:getValidGrowUpGifts()
|
||||
self.actGifts = {}
|
||||
table.insert(self.actGifts, DataManager.ShopData:getGrowUpGift())
|
||||
self.scrollRect:refillCells(#self.actGifts)
|
||||
|
||||
self:getBaseObject():setSizeDeltaY(self:getCellHeight())
|
||||
@ -48,7 +49,7 @@ function GrowSellCell:getCellHeight()
|
||||
end
|
||||
|
||||
function GrowSellCell:getIsOpen()
|
||||
return #DataManager.ShopData:getValidGrowUpGifts() > 0
|
||||
return DataManager.ShopData:hasGrowUpGift()
|
||||
end
|
||||
|
||||
function GrowSellCell:setVisible(visible)
|
||||
|
||||
@ -8,7 +8,7 @@ local GIFT_BG_NAME = {
|
||||
[PayManager.PURCHARSE_ACT_TYPE.COIN_GIFT] = "assets/arts/textures/background/shop/shop_gift_banner_6_1.png",
|
||||
},
|
||||
[PayManager.PURCHARSE_TYPE.CHAPTER_GIFT] = "assets/arts/textures/background/shop/shop_gift_banner_2_1.png",
|
||||
[PayManager.PURCHARSE_TYPE.GROW_UP_GIFT] = "assets/arts/textures/background/shop/shop_gift_banner_5_1.png",
|
||||
[PayManager.PURCHARSE_TYPE.GROW_UP_GIFT_NEW] = "assets/arts/textures/background/shop/shop_gift_banner_5_1.png",
|
||||
}
|
||||
local GIFT_TITLE_TEXT = {
|
||||
[PayManager.PURCHARSE_TYPE.ACT_GIFT] = {
|
||||
@ -18,7 +18,7 @@ local GIFT_TITLE_TEXT = {
|
||||
[PayManager.PURCHARSE_ACT_TYPE.COIN_GIFT] = I18N.GlobalConst.SHOP_DESC_14,
|
||||
},
|
||||
[PayManager.PURCHARSE_TYPE.CHAPTER_GIFT] = I18N.GlobalConst.SHOP_DESC_10,
|
||||
[PayManager.PURCHARSE_TYPE.GROW_UP_GIFT] = I18N.GlobalConst.SHOP_DESC_13,
|
||||
[PayManager.PURCHARSE_TYPE.GROW_UP_GIFT_NEW] = I18N.GlobalConst.SHOP_DESC_13,
|
||||
}
|
||||
|
||||
local MAX_ITEM_NUM = 4
|
||||
@ -180,13 +180,9 @@ function GiftPopUI:updateTime()
|
||||
self.timeText:setText(Time:formatNumTime(remainTime))
|
||||
end
|
||||
end
|
||||
elseif self.actType == PayManager.PURCHARSE_TYPE.GROW_UP_GIFT then -- 成长礼包
|
||||
elseif self.actType == PayManager.PURCHARSE_TYPE.GROW_UP_GIFT_NEW then -- 成长礼包
|
||||
hasTime = true
|
||||
local remainTime = 0
|
||||
local cfgInfo = DataManager.ShopData:getActGrowUpGiftConfig()[self.actId]
|
||||
local gift = DataManager.ShopData:getGrowUpGiftByActId(self.actId)
|
||||
local triggerTime = (gift and gift.trigger_at or 0) // 1000
|
||||
remainTime = triggerTime + (cfgInfo.limit_time or 0) * 3600 - Time:getServerTime()
|
||||
local remainTime = DataManager.ShopData:getGrowUpGiftRemainTime()
|
||||
if remainTime <= 0 then
|
||||
remainTime = 0
|
||||
self:checkNextPopGiftOrClose()
|
||||
|
||||
@ -224,11 +224,9 @@ function ShopComp:postEnterPage()
|
||||
end
|
||||
end
|
||||
-- 成长
|
||||
local actIdList = DataManager.ShopData:getValidGrowUpGifts()
|
||||
if actIdList and #actIdList > 0 then
|
||||
for _, id in ipairs(actIdList) do
|
||||
BIReport:postPayUIShow(BIReport.GIFT_TYPE.GROW_UP_GIFT, id)
|
||||
end
|
||||
local act = DataManager.ShopData:getGrowUpGift()
|
||||
if act then
|
||||
BIReport:postPayUIShow(BIReport.GIFT_TYPE.GROW_UP_GIFT_NEW, act.current_grow_up_id)
|
||||
end
|
||||
-- 金币
|
||||
local actId = DataManager.ShopData:getValidCoinGiftId()
|
||||
|
||||
@ -152,7 +152,7 @@ function ArenaData:getSeason()
|
||||
return self.season
|
||||
end
|
||||
|
||||
-- 获取当前赛季段位id列表
|
||||
-- 获取当前赛季段位id列表(升序)
|
||||
function ArenaData:getGradingIdList()
|
||||
local result = table.keys(self.cfgRank)
|
||||
table.sort(result)
|
||||
|
||||
@ -83,6 +83,7 @@ function ShopData:getGiftBoughtNum(actType, actId)
|
||||
return 0
|
||||
end
|
||||
|
||||
-- 礼包购买成功更新
|
||||
function ShopData:updateGiftInfo(gift)
|
||||
local giftType = gift.act_type
|
||||
local giftId = gift.id
|
||||
@ -107,6 +108,8 @@ function ShopData:updateGiftInfo(gift)
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif giftType == PayManager.PURCHARSE_TYPE.GROW_UP_GIFT_NEW then
|
||||
self:onUpGiftBuySuccess()
|
||||
end
|
||||
|
||||
self:setDirty()
|
||||
@ -650,139 +653,53 @@ end
|
||||
-- 成长礼包 **********************************************************************************************
|
||||
|
||||
function ShopData:getActGrowUpGiftConfig()
|
||||
return ConfigManager:getConfig("act_growup_gift")
|
||||
return ConfigManager:getConfig("act_growup_gift_new")
|
||||
end
|
||||
|
||||
-- 初始化成长礼包
|
||||
function ShopData:initGrowUpGift(growUpGift, loginTime)
|
||||
function ShopData:initGrowUpGift(growUpGift)
|
||||
if EDITOR_MODE then
|
||||
Logger.logHighlight("初始化成长礼包 growUpGift -- now_ts:%s", loginTime)
|
||||
Logger.logHighlight("初始化成长礼包 growUpGift -- now_ts:%s", Time:getServerTime())
|
||||
Logger.printTable(growUpGift)
|
||||
end
|
||||
|
||||
growUpGift = growUpGift or {}
|
||||
self.growUpGift = growUpGift
|
||||
if self:hasGrowUpGift() then
|
||||
self:markPopUpGiftForGrowUpGift(self.growUpGift.current_grow_up_id)
|
||||
end
|
||||
|
||||
self.growUpGifts = growUpGift.grow_up_gift or {} -- {hero_id, current_grow_up_id, trigger_at}
|
||||
for _, gift in ipairs(self.growUpGifts) do -- 标记需要弹出的礼包
|
||||
if gift.trigger_at == loginTime then
|
||||
local cfgInfo = self:getActGrowUpGiftConfig()[gift.current_grow_up_id]
|
||||
if cfgInfo then
|
||||
local isMaxLv = false
|
||||
local heroId = cfgInfo.hero_id
|
||||
local heroEntity = DataManager.HeroData:getHeroById(heroId)
|
||||
if heroEntity then
|
||||
isMaxLv = heroEntity:isMaxLv()
|
||||
end
|
||||
if not isMaxLv then
|
||||
self:markPopUpGiftForGrowUpGift(gift.current_grow_up_id)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
self:setDirty()
|
||||
end
|
||||
|
||||
function ShopData:getGrowUpGifts()
|
||||
return self.growUpGifts
|
||||
-- 当前是否有成长礼包
|
||||
function ShopData:hasGrowUpGift()
|
||||
return self.growUpGift ~= nil and self:getGrowUpGiftRemainTime() > 0
|
||||
end
|
||||
|
||||
-- 目前允许显示的最多2个礼包
|
||||
function ShopData:getMaxGrowUpGiftCount()
|
||||
return 2
|
||||
-- 获取当前成长礼包
|
||||
function ShopData:getGrowUpGift()
|
||||
if not self:hasGrowUpGift() then
|
||||
return nil
|
||||
end
|
||||
return self.growUpGift
|
||||
end
|
||||
|
||||
function ShopData:getGrowUpGiftByActId(actId)
|
||||
local list = self:getGrowUpGifts()
|
||||
for _, gift in ipairs(list) do
|
||||
if gift.current_grow_up_id == actId then
|
||||
return gift
|
||||
-- 获取成长礼包倒计时
|
||||
function ShopData:getGrowUpGiftRemainTime()
|
||||
if not self.growUpGift then
|
||||
return -1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- 获取目前时间有效的成长礼包
|
||||
function ShopData:getValidGrowUpGifts()
|
||||
local list = {}
|
||||
for index, gift in ipairs(self:getGrowUpGifts()) do
|
||||
local cfgInfo = self:getActGrowUpGiftConfig()[gift.current_grow_up_id]
|
||||
if cfgInfo then
|
||||
local isValid = false
|
||||
local durationTime = (cfgInfo.limit_time or 0) * 3600
|
||||
local triggerTime = gift.trigger_at // 1000
|
||||
local maxDurationTime = triggerTime + durationTime
|
||||
local buyLimit = cfgInfo.limit or 0
|
||||
-- 是否英雄已满级
|
||||
local isMaxLv = false
|
||||
local heroId = cfgInfo.hero_id
|
||||
local heroEntity = DataManager.HeroData:getHeroById(heroId)
|
||||
if heroEntity then
|
||||
isMaxLv = heroEntity:isMaxLv()
|
||||
end
|
||||
-- 是否在有效范围内
|
||||
local isInDurationTime = Time:getServerTime() < maxDurationTime
|
||||
if not isMaxLv and isInDurationTime then
|
||||
-- 如果是最后一档 默认有效
|
||||
if cfgInfo.last then
|
||||
isValid = true
|
||||
else -- 否则从通用act里找到这个礼包 如果有该礼包且购买次数未达到上限,则有效;如果没有该礼包也有效
|
||||
local actGiftDetailData = self:getActGiftDetailData(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT, gift.current_grow_up_id)
|
||||
|
||||
if actGiftDetailData then
|
||||
local buyCount = actGiftDetailData.buy_count
|
||||
local latestBuyTime = actGiftDetailData.latest_buy_at // 1000
|
||||
if buyLimit > 0 then
|
||||
if buyCount < buyLimit then
|
||||
isValid = true
|
||||
end
|
||||
else
|
||||
isValid = true
|
||||
end
|
||||
else
|
||||
isValid = true
|
||||
end
|
||||
end
|
||||
end
|
||||
if isValid then
|
||||
table.insert(list, gift)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- 按照时间排序
|
||||
table.sort(list, function(a, b)
|
||||
return a.trigger_at < b.trigger_at
|
||||
end)
|
||||
-- 上限2位
|
||||
local limitList = {}
|
||||
for i = 1, self:getMaxGrowUpGiftCount() do
|
||||
if list[i] then
|
||||
table.insert(limitList, list[i])
|
||||
end
|
||||
end
|
||||
return limitList
|
||||
end
|
||||
|
||||
-- 触发了成长礼包
|
||||
function ShopData:onTriggerGrowUpGift(gift)
|
||||
local hasGift = false
|
||||
if self.growUpGifts then
|
||||
for _, ownGift in ipairs(self.growUpGifts) do
|
||||
if ownGift.current_grow_up_id == gift.current_grow_up_id then
|
||||
ownGift.trigger_at = gift.trigger_at
|
||||
ownGift.hero_id = gift.hero_id
|
||||
|
||||
hasGift = true
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
if not hasGift then
|
||||
table.insert(self.growUpGifts, gift)
|
||||
end
|
||||
self:setDirty()
|
||||
return (self.growUpGift.trigger_end_at // 1000) - Time:getServerTime()
|
||||
end
|
||||
|
||||
function ShopData:markPopUpGiftForGrowUpGift(actId)
|
||||
self:markPopUpGift(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT, actId)
|
||||
self:markPopUpGift(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT_NEW, actId)
|
||||
end
|
||||
|
||||
-- 成长礼包购买成功
|
||||
function ShopData:onUpGiftBuySuccess()
|
||||
self.growUpGift.trigger_end_at = -1
|
||||
self:setDirty()
|
||||
end
|
||||
|
||||
-- 成长礼包结束 ----------------------------------------------------------------------------------------------
|
||||
@ -953,8 +870,7 @@ function ShopData:checkShopDiscountRedPoint()
|
||||
self.shopDiscountRedPoint = true
|
||||
return
|
||||
end
|
||||
actIds = self:getValidGrowUpGifts()
|
||||
if actIds and #actIds > 0 then
|
||||
if self:hasGrowUpGift() then
|
||||
self.shopDiscountRedPoint = true
|
||||
return
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user