英雄竞技场段位解锁
This commit is contained in:
parent
6cdae47b74
commit
1620d69548
@ -431,6 +431,7 @@ local LocalizationGlobalConst =
|
||||
SKIN_GOT_2 = "SKIN_GOT_2",
|
||||
SKIN_GOT_TIPS = "SKIN_GOT_TIPS",
|
||||
GOTO_COIN_STORE_DESC = "GOTO_COIN_STORE_DESC",
|
||||
HERO_DESC_12 = "HERO_DESC_12",
|
||||
}
|
||||
|
||||
return LocalizationGlobalConst
|
||||
@ -431,6 +431,7 @@ local localization_global =
|
||||
["SKIN_GOT_2"] = "通过<color=#8fff6c>战令</color>获取",
|
||||
["SKIN_GOT_TIPS"] = "解锁皮肤可领取",
|
||||
["GOTO_COIN_STORE_DESC"] = "是否前往商城购买金币",
|
||||
["HERO_DESC_12"] = "竞技场{0}解锁",
|
||||
}
|
||||
|
||||
return localization_global
|
||||
@ -117,7 +117,7 @@ function ArenaManager:rspSettlement(result)
|
||||
if result.err_code == GConst.ERROR_STR.SUCCESS then
|
||||
local reqData = result.reqData
|
||||
|
||||
DataManager.ArenaData:onBattleResultReceived(result.settlement)
|
||||
DataManager.ArenaData:onBattleResultReceived(result.settlement, result)
|
||||
DataManager.ArenaData:initGiftInfo(result.act_arena_gift)
|
||||
local checkCount = 0
|
||||
if result.settlement.win then
|
||||
|
||||
@ -37,6 +37,8 @@ local ProtoMsgType = {
|
||||
[822918426] = "MatchRsp",
|
||||
[834139466] = "ChapterGoldChallengeStartReq",
|
||||
[834141299] = "ChapterGoldChallengeStartRsp",
|
||||
[850670891] = "SummerBountyClaimByDiamondReq",
|
||||
[850672724] = "SummerBountyClaimByDiamondRsp",
|
||||
[904222760] = "ArenaBountyLevelUnlockReq",
|
||||
[904224593] = "ArenaBountyLevelUnlockRsp",
|
||||
[1008447203] = "DeleteReq",
|
||||
@ -128,6 +130,8 @@ local ProtoMsgType = {
|
||||
[3024280247] = "PVPSeasonRewardRsp",
|
||||
[3038151923] = "TaskDailyRefreshReq",
|
||||
[3038153756] = "TaskDailyRefreshRsp",
|
||||
[3039097236] = "SummerBountyClaimReq",
|
||||
[3039099069] = "SummerBountyClaimRsp",
|
||||
[3058879524] = "PVPRankReq",
|
||||
[3058881357] = "PVPRankRsp",
|
||||
[3062745642] = "FundAwardReq",
|
||||
@ -171,6 +175,8 @@ local ProtoMsgType = {
|
||||
[3663247602] = "MallDailyResetNtf",
|
||||
[3663314292] = "MallDailyResetReq",
|
||||
[3663316125] = "MallDailyResetRsp",
|
||||
[3739566473] = "SummerDataReq",
|
||||
[3739568306] = "SummerDataRsp",
|
||||
[3741702491] = "MallDailyOverDayReq",
|
||||
[3741704324] = "MallDailyOverDayRsp",
|
||||
[3757169544] = "BountyRewardReq",
|
||||
@ -189,6 +195,8 @@ local ProtoMsgType = {
|
||||
[4133059579] = "ChapterGoldChallengeFarmRsp",
|
||||
[4152754481] = "PVPChallengeStartReq",
|
||||
[4152756314] = "PVPChallengeStartRsp",
|
||||
[4155165814] = "SummerTaskClaimReq",
|
||||
[4155167647] = "SummerTaskClaimRsp",
|
||||
[4256333947] = "ExistReq",
|
||||
[4256335780] = "ExistRsp",
|
||||
},
|
||||
@ -230,6 +238,8 @@ local ProtoMsgType = {
|
||||
MatchRsp = 822918426,
|
||||
ChapterGoldChallengeStartReq = 834139466,
|
||||
ChapterGoldChallengeStartRsp = 834141299,
|
||||
SummerBountyClaimByDiamondReq = 850670891,
|
||||
SummerBountyClaimByDiamondRsp = 850672724,
|
||||
ArenaBountyLevelUnlockReq = 904222760,
|
||||
ArenaBountyLevelUnlockRsp = 904224593,
|
||||
DeleteReq = 1008447203,
|
||||
@ -321,6 +331,8 @@ local ProtoMsgType = {
|
||||
PVPSeasonRewardRsp = 3024280247,
|
||||
TaskDailyRefreshReq = 3038151923,
|
||||
TaskDailyRefreshRsp = 3038153756,
|
||||
SummerBountyClaimReq = 3039097236,
|
||||
SummerBountyClaimRsp = 3039099069,
|
||||
PVPRankReq = 3058879524,
|
||||
PVPRankRsp = 3058881357,
|
||||
FundAwardReq = 3062745642,
|
||||
@ -364,6 +376,8 @@ local ProtoMsgType = {
|
||||
MallDailyResetNtf = 3663247602,
|
||||
MallDailyResetReq = 3663314292,
|
||||
MallDailyResetRsp = 3663316125,
|
||||
SummerDataReq = 3739566473,
|
||||
SummerDataRsp = 3739568306,
|
||||
MallDailyOverDayReq = 3741702491,
|
||||
MallDailyOverDayRsp = 3741704324,
|
||||
BountyRewardReq = 3757169544,
|
||||
@ -382,6 +396,8 @@ local ProtoMsgType = {
|
||||
ChapterGoldChallengeFarmRsp = 4133059579,
|
||||
PVPChallengeStartReq = 4152754481,
|
||||
PVPChallengeStartRsp = 4152756314,
|
||||
SummerTaskClaimReq = 4155165814,
|
||||
SummerTaskClaimRsp = 4155167647,
|
||||
ExistReq = 4256333947,
|
||||
ExistRsp = 4256335780,
|
||||
},
|
||||
@ -423,6 +439,8 @@ local ProtoMsgType = {
|
||||
MatchRsp = "MatchRsp",
|
||||
ChapterGoldChallengeStartReq = "ChapterGoldChallengeStartReq",
|
||||
ChapterGoldChallengeStartRsp = "ChapterGoldChallengeStartRsp",
|
||||
SummerBountyClaimByDiamondReq = "SummerBountyClaimByDiamondReq",
|
||||
SummerBountyClaimByDiamondRsp = "SummerBountyClaimByDiamondRsp",
|
||||
ArenaBountyLevelUnlockReq = "ArenaBountyLevelUnlockReq",
|
||||
ArenaBountyLevelUnlockRsp = "ArenaBountyLevelUnlockRsp",
|
||||
DeleteReq = "DeleteReq",
|
||||
@ -514,6 +532,8 @@ local ProtoMsgType = {
|
||||
PVPSeasonRewardRsp = "PVPSeasonRewardRsp",
|
||||
TaskDailyRefreshReq = "TaskDailyRefreshReq",
|
||||
TaskDailyRefreshRsp = "TaskDailyRefreshRsp",
|
||||
SummerBountyClaimReq = "SummerBountyClaimReq",
|
||||
SummerBountyClaimRsp = "SummerBountyClaimRsp",
|
||||
PVPRankReq = "PVPRankReq",
|
||||
PVPRankRsp = "PVPRankRsp",
|
||||
FundAwardReq = "FundAwardReq",
|
||||
@ -557,6 +577,8 @@ local ProtoMsgType = {
|
||||
MallDailyResetNtf = "MallDailyResetNtf",
|
||||
MallDailyResetReq = "MallDailyResetReq",
|
||||
MallDailyResetRsp = "MallDailyResetRsp",
|
||||
SummerDataReq = "SummerDataReq",
|
||||
SummerDataRsp = "SummerDataRsp",
|
||||
MallDailyOverDayReq = "MallDailyOverDayReq",
|
||||
MallDailyOverDayRsp = "MallDailyOverDayRsp",
|
||||
BountyRewardReq = "BountyRewardReq",
|
||||
@ -575,6 +597,8 @@ local ProtoMsgType = {
|
||||
ChapterGoldChallengeFarmRsp = "ChapterGoldChallengeFarmRsp",
|
||||
PVPChallengeStartReq = "PVPChallengeStartReq",
|
||||
PVPChallengeStartRsp = "PVPChallengeStartRsp",
|
||||
SummerTaskClaimReq = "SummerTaskClaimReq",
|
||||
SummerTaskClaimRsp = "SummerTaskClaimRsp",
|
||||
ExistReq = "ExistReq",
|
||||
ExistRsp = "ExistRsp",
|
||||
},
|
||||
|
||||
@ -79,8 +79,11 @@ function HeroCell:refresh(heroEntity, isGray)
|
||||
self.unlockTx:setVisible(true)
|
||||
self.progressBg:setVisible(false)
|
||||
local unlcokChapter = heroEntity:getUnlcokChapter()
|
||||
local unlockDan = heroEntity:getUnlockDan()
|
||||
if unlcokChapter then
|
||||
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
|
||||
self.unlockTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_11))
|
||||
end
|
||||
|
||||
@ -87,6 +87,15 @@ function MainComp:refreshModule(selectModule)
|
||||
if DataManager.ArenaData:needShowPopGift() and DataManager.ArenaData:getGiftId() then
|
||||
ModuleManager.ArenaManager:showGiftPopUI()
|
||||
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
|
||||
if DataManager.TutorialData:getIsInTutorial() then
|
||||
local moduleKey = DataManager.TutorialData:getTargetFuncId()
|
||||
|
||||
@ -33,6 +33,9 @@ function ArenaData:init(data)
|
||||
-- 初始化time配置
|
||||
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
|
||||
DataManager.FormationData:initArena(data.attack_array_heroes, data.defend_array_heroes)
|
||||
DataManager.PlayerData:initArena(data.today_ticket_buy_count, data.today_ticket_ad_count)
|
||||
@ -370,6 +373,16 @@ function ArenaData:getGradingId()
|
||||
return self.curGradingId
|
||||
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()
|
||||
return self.rank
|
||||
@ -494,7 +507,7 @@ function ArenaData:onMatchInfoReceived(match)
|
||||
end
|
||||
|
||||
-- 结算战斗数据
|
||||
function ArenaData:onBattleResultReceived(settlement)
|
||||
function ArenaData:onBattleResultReceived(settlement, result)
|
||||
self.matchInfo = nil
|
||||
-- 战斗记录改变
|
||||
if self.recentBattle == nil then
|
||||
@ -505,6 +518,13 @@ function ArenaData:onBattleResultReceived(settlement)
|
||||
-- 积分改变
|
||||
self.score = self.score + settlement.incr_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()
|
||||
end
|
||||
|
||||
@ -8,8 +8,12 @@ function HeroData:ctor()
|
||||
self.matchActiveHeroMap = {}
|
||||
self.maxHeroLvOnInit = 0
|
||||
self.showHeroUnlockChapter = 0
|
||||
self.showHeroUnlockDan = 0
|
||||
self.heroChapterUnlockMap = {}
|
||||
self.heroChapterUnlockMapBi = {}
|
||||
|
||||
self.heroDanUnlockMap = {}
|
||||
self.heroDanUnlockMapBi = {}
|
||||
end
|
||||
|
||||
function HeroData:clear()
|
||||
@ -24,6 +28,12 @@ function HeroData:init(data)
|
||||
for k, v in pairs(self.heroChapterUnlockMapBi) do
|
||||
self.heroChapterUnlockMapBi[k] = false
|
||||
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
|
||||
for id, heroInfo in pairs(data) do
|
||||
self:addHero(heroInfo)
|
||||
@ -49,8 +59,16 @@ function HeroData:init(data)
|
||||
if info.unlock_chapter then
|
||||
self.heroChapterUnlockMapBi[info.unlock_chapter] = true
|
||||
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
|
||||
self.showHeroUnlockChapter = 0
|
||||
self.showHeroUnlockDan = 0
|
||||
end
|
||||
|
||||
-- 是否是合法的英雄
|
||||
@ -190,11 +208,12 @@ function HeroData:getMaxHeroLvOnInit()
|
||||
end
|
||||
|
||||
function HeroData:getIfCanShowHeroUnlock()
|
||||
return self.showHeroUnlockChapter > 0
|
||||
return self.showHeroUnlockChapter > 0 or self.showHeroUnlockDan > 0
|
||||
end
|
||||
|
||||
function HeroData:markShowHeroUnlock()
|
||||
self.showHeroUnlockChapter = 0
|
||||
self.showHeroUnlockDan = 0
|
||||
end
|
||||
|
||||
function HeroData:checkIfCanShowHeroUnlock(chapterId)
|
||||
@ -212,10 +231,25 @@ function HeroData:checkIfCanShowHeroUnlock(chapterId)
|
||||
self.showHeroUnlockChapter = chapterId
|
||||
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()
|
||||
local list = {}
|
||||
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)
|
||||
end
|
||||
end
|
||||
|
||||
@ -255,6 +255,11 @@ function HeroEntity:getUnlcokChapter()
|
||||
return self.config.unlock_chapter
|
||||
end
|
||||
|
||||
function HeroEntity:getUnlockDan()
|
||||
return self.config.unlock_arena
|
||||
|
||||
end
|
||||
|
||||
function HeroEntity:getIsShowUnlcokChapter()
|
||||
return self.config.is_show == 1
|
||||
end
|
||||
@ -312,6 +317,10 @@ function HeroEntity:isUnlock()
|
||||
if unlockChapter and unlockChapter <= DataManager.ChapterData:getMaxChapterId() then
|
||||
return true
|
||||
end
|
||||
local unlockDan = self:getUnlockDan()
|
||||
if unlockDan and unlockDan <= DataManager.ArenaData:getFormartMaxGrading() then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user