英雄竞技场段位解锁

This commit is contained in:
xiekaidong 2023-08-03 18:07:24 +08:00
parent 6cdae47b74
commit 1620d69548
9 changed files with 105 additions and 4 deletions

View File

@ -431,6 +431,7 @@ local LocalizationGlobalConst =
SKIN_GOT_2 = "SKIN_GOT_2", SKIN_GOT_2 = "SKIN_GOT_2",
SKIN_GOT_TIPS = "SKIN_GOT_TIPS", SKIN_GOT_TIPS = "SKIN_GOT_TIPS",
GOTO_COIN_STORE_DESC = "GOTO_COIN_STORE_DESC", GOTO_COIN_STORE_DESC = "GOTO_COIN_STORE_DESC",
HERO_DESC_12 = "HERO_DESC_12",
} }
return LocalizationGlobalConst return LocalizationGlobalConst

View File

@ -431,6 +431,7 @@ local localization_global =
["SKIN_GOT_2"] = "通过<color=#8fff6c>战令</color>获取", ["SKIN_GOT_2"] = "通过<color=#8fff6c>战令</color>获取",
["SKIN_GOT_TIPS"] = "解锁皮肤可领取", ["SKIN_GOT_TIPS"] = "解锁皮肤可领取",
["GOTO_COIN_STORE_DESC"] = "是否前往商城购买金币", ["GOTO_COIN_STORE_DESC"] = "是否前往商城购买金币",
["HERO_DESC_12"] = "竞技场{0}解锁",
} }
return localization_global return localization_global

View File

@ -117,7 +117,7 @@ function ArenaManager:rspSettlement(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then if result.err_code == GConst.ERROR_STR.SUCCESS then
local reqData = result.reqData local reqData = result.reqData
DataManager.ArenaData:onBattleResultReceived(result.settlement) DataManager.ArenaData:onBattleResultReceived(result.settlement, result)
DataManager.ArenaData:initGiftInfo(result.act_arena_gift) DataManager.ArenaData:initGiftInfo(result.act_arena_gift)
local checkCount = 0 local checkCount = 0
if result.settlement.win then if result.settlement.win then

View File

@ -37,6 +37,8 @@ local ProtoMsgType = {
[822918426] = "MatchRsp", [822918426] = "MatchRsp",
[834139466] = "ChapterGoldChallengeStartReq", [834139466] = "ChapterGoldChallengeStartReq",
[834141299] = "ChapterGoldChallengeStartRsp", [834141299] = "ChapterGoldChallengeStartRsp",
[850670891] = "SummerBountyClaimByDiamondReq",
[850672724] = "SummerBountyClaimByDiamondRsp",
[904222760] = "ArenaBountyLevelUnlockReq", [904222760] = "ArenaBountyLevelUnlockReq",
[904224593] = "ArenaBountyLevelUnlockRsp", [904224593] = "ArenaBountyLevelUnlockRsp",
[1008447203] = "DeleteReq", [1008447203] = "DeleteReq",
@ -128,6 +130,8 @@ local ProtoMsgType = {
[3024280247] = "PVPSeasonRewardRsp", [3024280247] = "PVPSeasonRewardRsp",
[3038151923] = "TaskDailyRefreshReq", [3038151923] = "TaskDailyRefreshReq",
[3038153756] = "TaskDailyRefreshRsp", [3038153756] = "TaskDailyRefreshRsp",
[3039097236] = "SummerBountyClaimReq",
[3039099069] = "SummerBountyClaimRsp",
[3058879524] = "PVPRankReq", [3058879524] = "PVPRankReq",
[3058881357] = "PVPRankRsp", [3058881357] = "PVPRankRsp",
[3062745642] = "FundAwardReq", [3062745642] = "FundAwardReq",
@ -171,6 +175,8 @@ local ProtoMsgType = {
[3663247602] = "MallDailyResetNtf", [3663247602] = "MallDailyResetNtf",
[3663314292] = "MallDailyResetReq", [3663314292] = "MallDailyResetReq",
[3663316125] = "MallDailyResetRsp", [3663316125] = "MallDailyResetRsp",
[3739566473] = "SummerDataReq",
[3739568306] = "SummerDataRsp",
[3741702491] = "MallDailyOverDayReq", [3741702491] = "MallDailyOverDayReq",
[3741704324] = "MallDailyOverDayRsp", [3741704324] = "MallDailyOverDayRsp",
[3757169544] = "BountyRewardReq", [3757169544] = "BountyRewardReq",
@ -189,6 +195,8 @@ local ProtoMsgType = {
[4133059579] = "ChapterGoldChallengeFarmRsp", [4133059579] = "ChapterGoldChallengeFarmRsp",
[4152754481] = "PVPChallengeStartReq", [4152754481] = "PVPChallengeStartReq",
[4152756314] = "PVPChallengeStartRsp", [4152756314] = "PVPChallengeStartRsp",
[4155165814] = "SummerTaskClaimReq",
[4155167647] = "SummerTaskClaimRsp",
[4256333947] = "ExistReq", [4256333947] = "ExistReq",
[4256335780] = "ExistRsp", [4256335780] = "ExistRsp",
}, },
@ -230,6 +238,8 @@ local ProtoMsgType = {
MatchRsp = 822918426, MatchRsp = 822918426,
ChapterGoldChallengeStartReq = 834139466, ChapterGoldChallengeStartReq = 834139466,
ChapterGoldChallengeStartRsp = 834141299, ChapterGoldChallengeStartRsp = 834141299,
SummerBountyClaimByDiamondReq = 850670891,
SummerBountyClaimByDiamondRsp = 850672724,
ArenaBountyLevelUnlockReq = 904222760, ArenaBountyLevelUnlockReq = 904222760,
ArenaBountyLevelUnlockRsp = 904224593, ArenaBountyLevelUnlockRsp = 904224593,
DeleteReq = 1008447203, DeleteReq = 1008447203,
@ -321,6 +331,8 @@ local ProtoMsgType = {
PVPSeasonRewardRsp = 3024280247, PVPSeasonRewardRsp = 3024280247,
TaskDailyRefreshReq = 3038151923, TaskDailyRefreshReq = 3038151923,
TaskDailyRefreshRsp = 3038153756, TaskDailyRefreshRsp = 3038153756,
SummerBountyClaimReq = 3039097236,
SummerBountyClaimRsp = 3039099069,
PVPRankReq = 3058879524, PVPRankReq = 3058879524,
PVPRankRsp = 3058881357, PVPRankRsp = 3058881357,
FundAwardReq = 3062745642, FundAwardReq = 3062745642,
@ -364,6 +376,8 @@ local ProtoMsgType = {
MallDailyResetNtf = 3663247602, MallDailyResetNtf = 3663247602,
MallDailyResetReq = 3663314292, MallDailyResetReq = 3663314292,
MallDailyResetRsp = 3663316125, MallDailyResetRsp = 3663316125,
SummerDataReq = 3739566473,
SummerDataRsp = 3739568306,
MallDailyOverDayReq = 3741702491, MallDailyOverDayReq = 3741702491,
MallDailyOverDayRsp = 3741704324, MallDailyOverDayRsp = 3741704324,
BountyRewardReq = 3757169544, BountyRewardReq = 3757169544,
@ -382,6 +396,8 @@ local ProtoMsgType = {
ChapterGoldChallengeFarmRsp = 4133059579, ChapterGoldChallengeFarmRsp = 4133059579,
PVPChallengeStartReq = 4152754481, PVPChallengeStartReq = 4152754481,
PVPChallengeStartRsp = 4152756314, PVPChallengeStartRsp = 4152756314,
SummerTaskClaimReq = 4155165814,
SummerTaskClaimRsp = 4155167647,
ExistReq = 4256333947, ExistReq = 4256333947,
ExistRsp = 4256335780, ExistRsp = 4256335780,
}, },
@ -423,6 +439,8 @@ local ProtoMsgType = {
MatchRsp = "MatchRsp", MatchRsp = "MatchRsp",
ChapterGoldChallengeStartReq = "ChapterGoldChallengeStartReq", ChapterGoldChallengeStartReq = "ChapterGoldChallengeStartReq",
ChapterGoldChallengeStartRsp = "ChapterGoldChallengeStartRsp", ChapterGoldChallengeStartRsp = "ChapterGoldChallengeStartRsp",
SummerBountyClaimByDiamondReq = "SummerBountyClaimByDiamondReq",
SummerBountyClaimByDiamondRsp = "SummerBountyClaimByDiamondRsp",
ArenaBountyLevelUnlockReq = "ArenaBountyLevelUnlockReq", ArenaBountyLevelUnlockReq = "ArenaBountyLevelUnlockReq",
ArenaBountyLevelUnlockRsp = "ArenaBountyLevelUnlockRsp", ArenaBountyLevelUnlockRsp = "ArenaBountyLevelUnlockRsp",
DeleteReq = "DeleteReq", DeleteReq = "DeleteReq",
@ -514,6 +532,8 @@ local ProtoMsgType = {
PVPSeasonRewardRsp = "PVPSeasonRewardRsp", PVPSeasonRewardRsp = "PVPSeasonRewardRsp",
TaskDailyRefreshReq = "TaskDailyRefreshReq", TaskDailyRefreshReq = "TaskDailyRefreshReq",
TaskDailyRefreshRsp = "TaskDailyRefreshRsp", TaskDailyRefreshRsp = "TaskDailyRefreshRsp",
SummerBountyClaimReq = "SummerBountyClaimReq",
SummerBountyClaimRsp = "SummerBountyClaimRsp",
PVPRankReq = "PVPRankReq", PVPRankReq = "PVPRankReq",
PVPRankRsp = "PVPRankRsp", PVPRankRsp = "PVPRankRsp",
FundAwardReq = "FundAwardReq", FundAwardReq = "FundAwardReq",
@ -557,6 +577,8 @@ local ProtoMsgType = {
MallDailyResetNtf = "MallDailyResetNtf", MallDailyResetNtf = "MallDailyResetNtf",
MallDailyResetReq = "MallDailyResetReq", MallDailyResetReq = "MallDailyResetReq",
MallDailyResetRsp = "MallDailyResetRsp", MallDailyResetRsp = "MallDailyResetRsp",
SummerDataReq = "SummerDataReq",
SummerDataRsp = "SummerDataRsp",
MallDailyOverDayReq = "MallDailyOverDayReq", MallDailyOverDayReq = "MallDailyOverDayReq",
MallDailyOverDayRsp = "MallDailyOverDayRsp", MallDailyOverDayRsp = "MallDailyOverDayRsp",
BountyRewardReq = "BountyRewardReq", BountyRewardReq = "BountyRewardReq",
@ -575,6 +597,8 @@ local ProtoMsgType = {
ChapterGoldChallengeFarmRsp = "ChapterGoldChallengeFarmRsp", ChapterGoldChallengeFarmRsp = "ChapterGoldChallengeFarmRsp",
PVPChallengeStartReq = "PVPChallengeStartReq", PVPChallengeStartReq = "PVPChallengeStartReq",
PVPChallengeStartRsp = "PVPChallengeStartRsp", PVPChallengeStartRsp = "PVPChallengeStartRsp",
SummerTaskClaimReq = "SummerTaskClaimReq",
SummerTaskClaimRsp = "SummerTaskClaimRsp",
ExistReq = "ExistReq", ExistReq = "ExistReq",
ExistRsp = "ExistRsp", ExistRsp = "ExistRsp",
}, },

View File

@ -79,8 +79,11 @@ function HeroCell:refresh(heroEntity, isGray)
self.unlockTx:setVisible(true) self.unlockTx:setVisible(true)
self.progressBg:setVisible(false) self.progressBg:setVisible(false)
local unlcokChapter = heroEntity:getUnlcokChapter() local unlcokChapter = heroEntity:getUnlcokChapter()
local unlockDan = heroEntity:getUnlockDan()
if unlcokChapter then if unlcokChapter then
self.unlockTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_10, unlcokChapter)) self.unlockTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_10, unlcokChapter))
elseif unlockDan then
self.unlockTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_12, I18N:getGlobalText(I18N.GlobalConst["ARENA_RANKNAME_" .. unlockDan])))
else else
self.unlockTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_11)) self.unlockTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_11))
end end

View File

@ -87,6 +87,15 @@ function MainComp:refreshModule(selectModule)
if DataManager.ArenaData:needShowPopGift() and DataManager.ArenaData:getGiftId() then if DataManager.ArenaData:needShowPopGift() and DataManager.ArenaData:getGiftId() then
ModuleManager.ArenaManager:showGiftPopUI() ModuleManager.ArenaManager:showGiftPopUI()
end end
-- 是否是否有英雄解锁弹窗
if DataManager.HeroData:getIfCanShowHeroUnlock() then
local list = DataManager.HeroData:getHeroChapterUnlockList()
DataManager.HeroData:markShowHeroUnlock()
if list and #list > 0 then
ModuleManager.HeroManager:showHeroUnlockUI(list)
return
end
end
elseif self.curModuleType == GConst.MainCityConst.MAIN_MODULE.DUNGEON then elseif self.curModuleType == GConst.MainCityConst.MAIN_MODULE.DUNGEON then
if DataManager.TutorialData:getIsInTutorial() then if DataManager.TutorialData:getIsInTutorial() then
local moduleKey = DataManager.TutorialData:getTargetFuncId() local moduleKey = DataManager.TutorialData:getTargetFuncId()

View File

@ -33,6 +33,9 @@ function ArenaData:init(data)
-- 初始化time配置 -- 初始化time配置
self.cfgTime = self:getTimeCfg(self.season) self.cfgTime = self:getTimeCfg(self.season)
if data.highest_score_in_history then
self.maxGradingId = self:getGradingIdFromScore(data.highest_score_in_history)
end
self.curGradingId = self:getGradingIdFromScore(self.score) -- 当前所在段位id self.curGradingId = self:getGradingIdFromScore(self.score) -- 当前所在段位id
DataManager.FormationData:initArena(data.attack_array_heroes, data.defend_array_heroes) DataManager.FormationData:initArena(data.attack_array_heroes, data.defend_array_heroes)
DataManager.PlayerData:initArena(data.today_ticket_buy_count, data.today_ticket_ad_count) DataManager.PlayerData:initArena(data.today_ticket_buy_count, data.today_ticket_ad_count)
@ -370,6 +373,16 @@ function ArenaData:getGradingId()
return self.curGradingId return self.curGradingId
end end
-- 获取当前段位
function ArenaData:getFormartMaxGrading()
local id = self.maxGradingId or self.curGradingId
if not id then
id = 0
end
id = id % 100 -- 取余数
return id
end
-- 获取自己的排名 -- 获取自己的排名
function ArenaData:getRank() function ArenaData:getRank()
return self.rank return self.rank
@ -494,7 +507,7 @@ function ArenaData:onMatchInfoReceived(match)
end end
-- 结算战斗数据 -- 结算战斗数据
function ArenaData:onBattleResultReceived(settlement) function ArenaData:onBattleResultReceived(settlement, result)
self.matchInfo = nil self.matchInfo = nil
-- 战斗记录改变 -- 战斗记录改变
if self.recentBattle == nil then if self.recentBattle == nil then
@ -505,6 +518,13 @@ function ArenaData:onBattleResultReceived(settlement)
-- 积分改变 -- 积分改变
self.score = self.score + settlement.incr_score self.score = self.score + settlement.incr_score
self.curGradingId = self:getGradingIdFromScore(self.score) self.curGradingId = self:getGradingIdFromScore(self.score)
if result.highest_score_in_history then
local beforeMaxGrading = self.maxGradingId
self.maxGradingId = self:getGradingIdFromScore(result.highest_score_in_history)
if beforeMaxGrading ~= self.maxGradingId then
DataManager.HeroData:checkIfCanShowHeroUnlockDan(self:getFormartMaxGrading())
end
end
self:setDirty() self:setDirty()
end end

View File

@ -8,8 +8,12 @@ function HeroData:ctor()
self.matchActiveHeroMap = {} self.matchActiveHeroMap = {}
self.maxHeroLvOnInit = 0 self.maxHeroLvOnInit = 0
self.showHeroUnlockChapter = 0 self.showHeroUnlockChapter = 0
self.showHeroUnlockDan = 0
self.heroChapterUnlockMap = {} self.heroChapterUnlockMap = {}
self.heroChapterUnlockMapBi = {} self.heroChapterUnlockMapBi = {}
self.heroDanUnlockMap = {}
self.heroDanUnlockMapBi = {}
end end
function HeroData:clear() function HeroData:clear()
@ -24,6 +28,12 @@ function HeroData:init(data)
for k, v in pairs(self.heroChapterUnlockMapBi) do for k, v in pairs(self.heroChapterUnlockMapBi) do
self.heroChapterUnlockMapBi[k] = false self.heroChapterUnlockMapBi[k] = false
end end
for k, v in pairs(self.heroDanUnlockMap) do
self.heroDanUnlockMap[k] = false
end
for k, v in pairs(self.heroDanUnlockMapBi) do
self.heroDanUnlockMapBi[k] = false
end
if data then if data then
for id, heroInfo in pairs(data) do for id, heroInfo in pairs(data) do
self:addHero(heroInfo) self:addHero(heroInfo)
@ -49,8 +59,16 @@ function HeroData:init(data)
if info.unlock_chapter then if info.unlock_chapter then
self.heroChapterUnlockMapBi[info.unlock_chapter] = true self.heroChapterUnlockMapBi[info.unlock_chapter] = true
end end
if info.unlock_arena and info.is_show == 1 then
self.heroDanUnlockMap[info.unlock_arena] = true
end
if info.unlock_arena then
self.heroDanUnlockMapBi[info.unlock_arena] = true
end
end end
self.showHeroUnlockChapter = 0 self.showHeroUnlockChapter = 0
self.showHeroUnlockDan = 0
end end
-- 是否是合法的英雄 -- 是否是合法的英雄
@ -190,11 +208,12 @@ function HeroData:getMaxHeroLvOnInit()
end end
function HeroData:getIfCanShowHeroUnlock() function HeroData:getIfCanShowHeroUnlock()
return self.showHeroUnlockChapter > 0 return self.showHeroUnlockChapter > 0 or self.showHeroUnlockDan > 0
end end
function HeroData:markShowHeroUnlock() function HeroData:markShowHeroUnlock()
self.showHeroUnlockChapter = 0 self.showHeroUnlockChapter = 0
self.showHeroUnlockDan = 0
end end
function HeroData:checkIfCanShowHeroUnlock(chapterId) function HeroData:checkIfCanShowHeroUnlock(chapterId)
@ -212,10 +231,25 @@ function HeroData:checkIfCanShowHeroUnlock(chapterId)
self.showHeroUnlockChapter = chapterId self.showHeroUnlockChapter = chapterId
end end
function HeroData:checkIfCanShowHeroUnlockDan(dan)
if self.heroDanUnlockMapBi[dan] then -- 日志上报
for id, entity in pairs(self.heroes) do
if not entity:isActived() and entity:getUnlockDan() == dan then
BIReport:postHeroOpt(id, BIReport.HERO_OPT_TYPE.UNLOCK)
end
end
end
if not self.heroDanUnlockMap[dan] then
return
end
self.showHeroUnlockDan = dan
end
function HeroData:getHeroChapterUnlockList() function HeroData:getHeroChapterUnlockList()
local list = {} local list = {}
for id, entity in pairs(self.heroes) do for id, entity in pairs(self.heroes) do
if not entity:isActived() and entity:getIsShowUnlcokChapter() and entity:getUnlcokChapter() == self.showHeroUnlockChapter then if not entity:isActived() and entity:getIsShowUnlcokChapter() and (entity:getUnlcokChapter() == self.showHeroUnlockChapter or entity:getUnlockDan() == self.showHeroUnlockDan) then
table.insert(list, id) table.insert(list, id)
end end
end end

View File

@ -255,6 +255,11 @@ function HeroEntity:getUnlcokChapter()
return self.config.unlock_chapter return self.config.unlock_chapter
end end
function HeroEntity:getUnlockDan()
return self.config.unlock_arena
end
function HeroEntity:getIsShowUnlcokChapter() function HeroEntity:getIsShowUnlcokChapter()
return self.config.is_show == 1 return self.config.is_show == 1
end end
@ -312,6 +317,10 @@ function HeroEntity:isUnlock()
if unlockChapter and unlockChapter <= DataManager.ChapterData:getMaxChapterId() then if unlockChapter and unlockChapter <= DataManager.ChapterData:getMaxChapterId() then
return true return true
end end
local unlockDan = self:getUnlockDan()
if unlockDan and unlockDan <= DataManager.ArenaData:getFormartMaxGrading() then
return true
end
return false return false
end end