local Unlock_Model = {} local private = {} local EventSystem = require('Event/EventSystem') Unlock_Model.FunctionType = { HeroLevelUp = 1, -- 武将升级 Weapon = 2, -- 神兵 Battle3V3 = 3, -- 3v3 Rank = 4, -- 排行榜 Boss = 5, -- Boss挑战 Questionnaire = 6, -- 问卷调查 Advanced = 7, -- 武将进阶 Break = 8, -- 武将突破 RingTask = 9, -- 环任务 RingTaskAuto = 10, -- 环任务自动进行 HeroBiography = 11, -- 武将列传 WorldBoss = 12, -- 世界BOSS Formation = 13, -- 阵容 ArrayInFormation = 14, -- 阵容界面的布阵按钮 Equipment = 15, -- 装备 ClimbTower = 16, -- 爬塔 DrawCard = 18, -- 抽卡系统 SoloFight = 19, -- 异步1v1 AutoFight = 20, -- 自动战斗按钮 Ride = 21, -- 骑马 SettingBack = 22, -- 设置界面返回按钮 Gem = 23, -- 宝石 WarHorse = 24, -- 战骑系统 Friend = 25, -- 好友系统 Bag = 27, -- 背包 CheckPlayerInfo = 28, -- 查看玩家信息 HeroStrenthen = 29, -- 武将修炼 OfficialPosition = 40, -- 官职系统 Achievement = 41, -- 成就系统 HeroLibrary = 42, -- 武将图鉴 TreasurePic = 43, -- 寻宝 Library = 49, -- 官邸图鉴入口 TeamDungeon = 51, -- 组队副本 TeamDungeon2 = 52, -- 组队副本2 FunctionNotice = 53, -- 功能预告 Treasure = 55, -- 宝物系统 PersonalBoss = 56, -- 个人BOSS SyncSolo = 57, -- 同步1v1 SyncSoloBP = 49310, -- 同步1v1 无双对决BP EnergyMaxHint = 58, -- 主城体力满提示 Title = 60, -- 称号 AssistanceFight = 61, -- 阵容助战 FormationTeamWork = 62, -- 阵容连携 Reborn = 63, -- 铸炼系统主城入口 EquipSmelt = 64, -- 装备熔炼 Recast = 65, -- 重生 Mail = 66, -- 邮件 WarZone = 67, -- 战区 FriendsCross = 68, -- 跨服好友 DrawStraws = 72, -- 每日福签 VIPInvitation = 73, -- VIP邀请函 DivineWeaponForge = 75, -- 神兵锻造 WeaponLibrary = 81, -- 神兵图鉴 HorseLibrary = 82, -- 坐骑图鉴 TreasureLibrary = 83, -- 宝物图鉴 StratagemLibrary = 84, -- 计略图鉴 EffectLibrary = 42239, -- 光效图鉴 AppearanceLibrary = 44983, -- 时装图鉴 DyeLibrary = 44984, -- 染色图鉴 HorseSoul = 85, -- 战马魂珠 HorseSoulAwake = 86, -- 魂珠启魂 HorseEquip = 87, -- 战装 PlotReviewLibrary = 88, -- 剧情回顾 KingChallenge = 89, -- 王者挑战 HonorSignet = 90, -- 荣誉印记 AndroidPrivary = 91, -- 安卓隐私政策 IOSPrivacy = 92, -- 苹果隐私政策 EntryRedPoint = 100, -- 入口红点需要依赖该功能解锁才显示 BossChallengeRankingList = 101, -- 挑战副本排行榜 TestWelfare = 102, -- 测试有礼 QQGroup = 103, -- Q群 Resonance = 110, -- 共鸣 Fair3V3AllServer = 154, --3v3全大区排行榜 SyncSoloAllServer = 155, --1v1全大区排行榜 ChangeName = 201, -- 改名系统 ZoneCity = 223, -- 跨服场景(包括单服押镖 WeekendReward = 224, -- 休沐祭礼 Shop = 301, -- 商铺 PayMall = 302, -- 商城入口 GuildMail = 399, -- 军团邮件通知 MaterialLevel = 400, -- 资源副本 Team = 401, -- 组队 Guild = 402, -- 军团 GuildBoss = 403, -- 军团boss GuildAllies = 404, -- 势力争夺 GuildEscort = 407, -- 势力运镖 GuildWar = 410, -- 军团战 GuildParty = 411, -- 上林宴 GuildAuction = 412, -- 军团拍卖行 GuildTarget = 413, -- 公会建设 GuildCultivation = 414, -- 韬略策论 InfoReminder = 418, -- 信息 DailySignin = 419, -- 每日签到 Stratagem = 420, -- 谟略 Country = 421, -- 国家 GuildSalary = 424, -- 势力工资 GuildFamous = 425, -- 名望势力入口 SlgGvE = 427, -- 汉中风云 RebelStrike = 501, -- 叛军突袭 FirstCharge = 600, -- 首充 OnlineReward = 601, -- 在线奖励 EnergyGet = 602, -- 食肆 LevelFund = 603, -- 成长基金 OfficialFund = 604, -- 官职基金 DirectGift = 605, -- 直购礼包 RechargeReturn = 606, -- 充值返利 RechargeReturnTest = 607, -- 内测充值返利 DailyGift = 621, -- 每日礼包 SuperGoldActivity = 631, -- 彩金活动 FestivalLogin = 632, -- 节日限时签到 GuildMine = 650, -- 势力挖矿 ThreeTeamFight = 651, -- 群雄演武 FirstChargeAlipay = 666, -- 首充(国服支付宝) MultiplayerDungeon = 700, -- 多人难度副本 MultiplayerDungeon1 = 701, -- 多人难度副本(董卓)千万不要直接使用 请使用 MDL.MultiplayerDungeon.UnlockFunctionTypeByActivityId(activitiesID) 这种方式判断解锁 MultiplayerDungeon2 = 702, -- 多人难度副本(曹操)千万不要直接使用 请使用 MDL.MultiplayerDungeon.UnlockFunctionTypeByActivityId(activitiesID) 这种方式判断解锁 MultiplayerDungeon3 = 703, -- 多人难度副本(呂布)千万不要直接使用 请使用 MDL.MultiplayerDungeon.UnlockFunctionTypeByActivityId(activitiesID) 这种方式判断解锁 Nobility = 750, -- 爵位 FightThrone = 800, -- 逐鹿中原 HeroRelation = 801, -- 武将羁绊 HeroAppearance = 802, -- 武将皮肤 WeaponAppearance = 803, -- 神兵皮肤 HorseAppearance = 804, -- 坐骑皮肤 HonorOrder = 805, -- 战令 AccumulatingRechargeGJ = 806, -- 累充送郭嘉 HideGoldenHero = 807, -- 屏蔽金将 HideGoldenHeroHorse = 808, -- 屏蔽金坐骑 HideGoldenHeroTreasure = 809, -- 屏蔽金宝物 LightEffect = 810, -- 外观_光效 CountryWorldBoss = 811, -- 战区boss DemonGod = 812, -- 魔神降世(将星临世) WarZoneAuction = 814, -- 大拍卖(战区拍卖) TestWelfare2 = 815, -- 内测福利 TreasureSoul = 816, -- 宝物魂晶系统 Attention = 817, -- 关注有礼 FakeScore = 818, -- 苹果评分 TreasureSoulWash = 819, -- 宝物魂晶系统 —— 洗练 CountryWantedTask = 820, -- 国战悬赏任务 CountryNightBoss = 830, -- 国战晚间boss FairPlayReplay = 831, -- 公平竞技回放全服榜单 Storm = 840, -- 暴风 LiveBroadcast = 897, -- 直播打脸图 SyncFourCountryWar = 841, FollowDouYin = 899, -- 抖音号打脸图 HeroMatch1v1 = 900, -- 天地群雄 HeroMatch3v3 = 34648, -- 天地群雄 3v3 SyncSoloPK = 901, -- 公平竞技1v1切磋 SyncTVTPK = 902, -- 公平竞技3v3切磋 PKRoomWatch = 49716, -- 切磋观战 RecycleFragment = 903, -- 纳灵系统 GodBeastActivity = 910, -- 神兽活动 GoldHeroPreview = 951, -- 金将活动开服预告 RedEnvelopeRain = 960, -- 周年庆红包雨 PushGift = 1000, -- 定向礼包 CycleRecharge = 1504, -- 聚宝赠礼(周期累充) HeroFund = 1501, -- 名将之路 HorseFund = 1502, -- 玉络金鞍(坐骑之路) TreasureFund = 1503, -- 物华天宝(宝物之路) GoldIngotFund = 1505, -- 元宝战令 ThreeBattleVoiceChat = 3001, -- 公平3V3语音开关 EquipmentQuickRefine = 4001, -- 装备一键洗炼 HeroBiographyAutoRefine = 4002, -- 名将列传一键洗练 MaterialLevelAutoRefine = 4003, -- 军需试炼一键洗练 GodBeast = 4004, -- 神兽 GodBeastLibrary = 4005, -- 神兽图鉴 Pet = 4006, -- 宠物 DouYinRechargeReward = 4050, -- 渠道专属充值返利活动 Turntable = 40193, -- 转盘(运营活动) Recharge = 8001, -- 充值 TotalTopUp = 8002, -- 累充 GoldHeroReprint = 10004, -- 日服金将返场抽卡活动 GuildLeaderTask = 42669, -- 势力管理奖励 MonthCard = 20000, -- 月卡 TotalActivityControl = 20001, -- 活动总控(没处理) HegemonyActivity = 20002, -- 霸业之始(没处理) GoldHeroActivity = 20003, -- 金将活动 ReservedGift = 20004, -- 预约豪礼 HorseRear = 20005, -- 养马活动 Monopoly = 20010, -- 大富翁 CommandTheWorld = 20011, -- 号令天下 FreeBuy = 20015, -- 0元购 LuckyLottery = 20016, -- 幸运扭蛋 NewYear = 20017, -- 元旦活动 AnniversaryPrepare = 20018, -- 周年预热 FriendRecharge = 20019, -- 金兰邀约(组队充值) TreasureBowl = 20020, -- 聚宝盆 FunctionUpdateNotice = 20021, -- 版本更新介绍 AnniversaryLuckyDraw = 20022, -- 周年庆抽奖 ExpelMonster = 20023, -- 打年兽 AnnualArchive = 20025, -- 周年回顾 AnnualArchiveJP = 20026, -- 日本周年回顾 GVGFight = 20031, -- 攻城略地 Welfare = 21001, -- 福利(仅用于功能栏) Store = 21002, -- 店铺(仅用于功能栏) FourNationClimbTower = 23942, -- 四国爬塔 CountryOpen = 27200, -- 国家开放 DragonArtery = 27304, -- 龙脉争夺 FairSoloTournament = 30650, -- 天下会武 EquipStar = 33690, --装备套装 VoiceChat = 100000, -- 语音聊天 WebActivity = 20030101, -- 【日股】网页版元旦活动 ChangAnSiege = 20032, -- 长安争夺战 AnchorChallenge = 40675, --主播关卡 AnchorShow = 40676, --主播关卡 RogueLike = 40677, --肉鸽关卡 WeekTotalCharge = 20040, MonthTotalCharge = 20041, WeekAndMonthTotalCharge = 20042, TeamFairChampionship = 41700, -- 天下会武3v3 WeaponForgeSoul = 45245, --神兵铸魂(天命) AppPushGift = 45465, -- 回归奖励 AwakenActivity = 44358, -- 觉醒试炼活动 LaterEnter = 49060, -- 后起之秀 DyeAppearance = 44982, -- 染色外观 SubjectMonth = 46966, -- 主题月活动 } Unlock_Model.DebugSwitchType = { TypeUploadBattleLog3v3 = 1, -- 开启客户度战斗上传调试log,配合子subId使用 TypeBattlePredicate = 20, -- 开启客户端战斗逻辑帧预测开关 TypeBattleCheckDebugLog = 40, -- 战斗校验服上传调试log开关 UserCenter = 101, -- 用户中心 UserCustom = 102, -- 问题反馈 FaceBookFan = 201, -- fb关注 StoreScore = 202, -- 商店评论 BindAccount = 203, -- 账户绑定 DeleteAccount = 204, -- 删除账号 TypeCdKey = 205, -- 礼包码 TypeLoginCode = 208, -- 国服三方商城 PunishForAFK = 44462, -- 挂机惩罚 } --与渠道有关 local DebugUnlockTbl = {} ---服务器游戏玩法开关,与渠道无关 ---通过GMS配置控制,由服务器传过来,需要支持实时刷新 ---key是functionId,value是一个枚举,0是打开,123是关闭的不同处理 --- 默认关闭的值需要提前设置。原因:默认关闭的开关,服务器不会推刷新信息,除非手动打开,这样就会读客户端配置,导致活动误打开。用于很少打开的活动 local ServerUnlockTbl = { [Unlock_Model.FunctionType.Attention] = 2, [Unlock_Model.FunctionType.FollowDouYin] = 2, [Unlock_Model.FunctionType.FakeScore] = 2, [Unlock_Model.FunctionType.LiveBroadcast] = 2, } local ClientUnlockTbl = {} --功能解锁条件被单独监听,不需在playerchange进行计算 local SystemDispathUpdateLockCondtion = { [LuaConst.UnlockConditionType.TeamLevel] = true, [LuaConst.UnlockConditionType.PassedLevel] = true, [LuaConst.UnlockConditionType.HaveGuild] = true, [LuaConst.UnlockConditionType.GuildLevel] = true, } --可能会使已解锁功能变为未解锁的条件,即使已解锁也需重新计算 local MayBackLockCondtion = { [LuaConst.UnlockConditionType.CompleteOfficialPosition] = true, [LuaConst.UnlockConditionType.WarZoneStart] = true, [LuaConst.TriggerType.Country_HasJoin] = true, } function Unlock_Model.OnStartup() NetManager.RegisterMsgCB(MessageEnums.MessageG2CPushDebugSwitchState,private.G2CPushDebugSwitchStateCallback) NetManager.RegisterMsgCB(MessageEnums.MessageG2CPushGameFunctionSwitchState,private.G2CPushGameFunctionSwitchStateCallback) EventSystem.Regist(EventID.UI_Task_Update, Unlock_Model.Update) EventSystem.Regist(EventID.OnConditionChangeFunctionUpdate, private.OnConditionChangeFunctionUpdate) private.curChannelID = tonumber(SDKUtil.ChannelID) private.SetAutoFightIdByABTest() end function Unlock_Model.InitDebugUnlock(list) for i,v in ipairs(list) do if private.curChannelID == v.SwitchChannel then DebugUnlockTbl[v.SwitchType] = v.SwitchState end end end function Unlock_Model.InitServerUnlock(list) for i,v in ipairs(list) do ServerUnlockTbl[v.SwitchType] = v.SwitchState end end function Unlock_Model.GetDebugSwitchState(id) return DebugUnlockTbl[id] == 0 end function Unlock_Model.Update(isInit, id) for k,v in DataSheetManager.FuctionUnlock:GetEnumerator() do local fucId = v.FucID local isUnlock = true if isInit or private.IsNeedReCalculateUnlock(fucId) or id == fucId then for i, condition in ipairs(v.Unlock_Table) do isUnlock = isUnlock and Unlock_Model.IsComplete(condition.UnlockCondition,condition.UnlockConditionParam) end else isUnlock = ClientUnlockTbl[fucId] end private.JudgeIsUnlock(fucId, isUnlock) end --纳灵系统有特殊的解锁逻辑 private.JudgeIsUnlock(Unlock_Model.FunctionType.RecycleFragment, MDL.Reborn.GetRecycleFragmentIsOpen()) end function private.JudgeIsUnlock(fucId, isUnlock) if ServerUnlockTbl[fucId] and ServerUnlockTbl[fucId] ~= 0 then --判断服务器发过来的玩法开关 isUnlock = false end if ClientUnlockTbl[fucId] ~= isUnlock then ClientUnlockTbl[fucId] = isUnlock EventSystem.Dispatch(EventID.FunctionUnlockUpdate, fucId, isUnlock) end end function private.IsNeedReCalculateUnlock(fucId) local unlockTb = DataSheetManager.FuctionUnlock:GetDataByFucID(fucId).Unlock_Table local isSystemDispathCondtion = true for i, condition in ipairs(unlockTb) do if not SystemDispathUpdateLockCondtion[condition.UnlockCondition] then isSystemDispathCondtion = false break end end if isSystemDispathCondtion then --解锁条件均为系统内部派发,跳过计算 return false end if not ClientUnlockTbl[fucId] then return true else for i, condition in ipairs(unlockTb) do if MayBackLockCondtion[condition.UnlockCondition] then return true end end end return false end function private.OnConditionChangeFunctionUpdate(unlockCondition) for k,v in DataSheetManager.FuctionUnlock:GetEnumerator() do local isHasUnlockCondition = false for i, condition in ipairs(v.Unlock_Table) do if condition.UnlockCondition == unlockCondition then isHasUnlockCondition = true end end if isHasUnlockCondition then local isUnlock = true for i, condition in ipairs(v.Unlock_Table) do isUnlock = isUnlock and Unlock_Model.IsComplete(condition.UnlockCondition,condition.UnlockConditionParam) end private.JudgeIsUnlock(v.FucID, isUnlock) end end end function Unlock_Model.IsUnlock(id) return ClientUnlockTbl[id] or false end function Unlock_Model.IsServerUnlock(id) if ServerUnlockTbl[id] and ServerUnlockTbl[id] ~= 0 then return false else return true end end function Unlock_Model.IsClientUnlockWithText(id, tips) local unlockCfgData = DataSheetManager.FuctionUnlock:GetDataByFucID(id) if not unlockCfgData then logging.error(LTAG.ERROR, id) end local isUnlock = true local content = tips or "" for k2, v2 in pairs(unlockCfgData.Unlock_Table) do isUnlock, content = Unlock_Model.IsComplete(v2.UnlockCondition, v2.UnlockConditionParam, tips or "") if isUnlock == false and content then content = UTL.Color.FormatRedColor(content) break end end local isFuncUnlock = Unlock_Model.IsUnlock(id) if isFuncUnlock ~= isUnlock and isFuncUnlock == false then isUnlock = false content = UIUtils.GetLocalizedTxt(Const_IDS.IDS_BossChallenge_NotOpen) end return isUnlock, content end --解锁条件描述 function Unlock_Model.GetUnlockContent(funcID, des) local unlockCfgData = DataSheetManager.FuctionUnlock:GetDataByFucID(funcID) for _, v in pairs(unlockCfgData.Unlock_Table) do if v.UnlockCondition == LuaConst.UnlockConditionType.PassedLevel then --通过关卡 local triggerId = v.UnlockConditionParam local barrierData = DataSheetManager.BarrierChosenData:GetDataByID(triggerId) local result = UIUtils.GetLocalizedTxt(Const_IDS[barrierData.BarrierNum]) local unlockText = des and private.GetText(UIUtils.GetLocalizedTxt(Const_IDS[des]), result) or result return unlockText else local _, tmpContent = Unlock_Model.IsComplete(v.UnlockCondition, v.UnlockConditionParam, des) return tmpContent end end end function Unlock_Model.IsCompleteByUnlockTable(unlockTable) for i, v in ipairs(unlockTable) do if not Unlock_Model.IsComplete(v.UnlockCondition, v.UnlockConditionParam) then return false end end return true end function Unlock_Model.IsTriggerIdComplete(triggerId) local triggerData = DataSheetManager.TriggerID:GetDataByID(triggerId) for i, v in ipairs(triggerData.Unlock_Table) do if Unlock_Model.IsTriggerComplete(v.UnlockCondition, nil, v.UnlockConditionParamA, v.UnlockConditionParamB) == false then return false end end return true end function Unlock_Model.IsTriggerComplete(triggerType, des, paramA, paramB) if triggerType == LuaConst.TriggerType.ClimbTower_Level then return CTL.ClimbTower.IsPassLevel(tonumber(paramA)) elseif triggerType == LuaConst.TriggerType.Weapon_SpecifiedBreakLevel then local heroInfo = MDL.HeroSelect.GetHeroInfo(tonumber(paramB)) if heroInfo then return heroInfo.magicWeaponLevel >= tonumber(paramA) end return false elseif triggerType == LuaConst.TriggerType.Hero_SpecifiedBreakLevel then return CTL.HeroStar.IsHeroReachTargetStar(tonumber(paramB), tonumber(paramA)) elseif triggerType == LuaConst.TriggerType.Fund_Complete then return MDL.GrowthFund.IsCompleteTrigger(tonumber(paramA), tonumber(paramB)) end return Unlock_Model.IsComplete(triggerType, paramA, des) end function Unlock_Model.IsComplete(triggerId, params, des) if triggerId == LuaConst.UnlockConditionType.TeamLevel or triggerId == LuaConst.TriggerType.Team_Level then return Unlock_Model.TeamLevelUnlock(params, des) elseif triggerId == LuaConst.TriggerType.Nobility_Level then return Unlock_Model.TeamRankUnlock(params, des) elseif triggerId == LuaConst.UnlockConditionType.ActivatedHero then --- elseif triggerId == LuaConst.UnlockConditionType.ActivatedHeroCount then return Unlock_Model.ActiveHeroCount(params, des) elseif triggerId == LuaConst.UnlockConditionType.HeroLevel then return Unlock_Model.HeroLevel(params, des) elseif triggerId == LuaConst.UnlockConditionType.PassedLevel or triggerId == LuaConst.TriggerType.MainLevel_Pass then return Unlock_Model.PassedLevel(params, des) elseif triggerId == LuaConst.UnlockConditionType.CompleteMainStory then return Unlock_Model.CompleteMainStory(params, des) elseif triggerId == LuaConst.UnlockConditionType.CompleteMainAndSubStory then return Unlock_Model.CompleteMainAndSubStory(params, des) elseif triggerId == LuaConst.UnlockConditionType.CompleteChallenge then return Unlock_Model.CompleteChallenge(params, des) elseif triggerId == LuaConst.UnlockConditionType.CompleteHeroBiography then return Unlock_Model.CompleteHeroBiography(params, des) elseif triggerId == LuaConst.UnlockConditionType.CompleteHeroBiographyLevel then return Unlock_Model.CompleteHeroBiographyLevel(params, des) elseif triggerId == LuaConst.UnlockConditionType.TeamLevelMin then return Unlock_Model.TeamLevelMinUnlock(params, des) elseif triggerId == LuaConst.UnlockConditionType.NoPassLevel then local isPass , str = Unlock_Model.PassedLevel(params, des) return not isPass, str elseif triggerId == LuaConst.UnlockConditionType.NoCompleteTask then local isPass , str = Unlock_Model.CompleteMainAndSubStory(params, des) return not isPass, str elseif triggerId == LuaConst.UnlockConditionType.CompleteGuide then return MDL.PlayerGuide.IsComplete(params) -- 判断完成的引导步骤 elseif triggerId == LuaConst.UnlockConditionType.OpenUIView then return UIManager.IsViewOpened(params) elseif triggerId == LuaConst.UnlockConditionType.ClimbTowerLevel then return CTL.ClimbTower.IsPassLevel(tonumber(params)) elseif triggerId == LuaConst.UnlockConditionType.NotActiveHero then return not MDL.HeroSelect.IsHasHero(tonumber(params)) elseif triggerId == LuaConst.UnlockConditionType.FunctionUnlock then return Unlock_Model.IsUnlock(params) elseif triggerId == LuaConst.UnlockConditionType.MaterialLevel then return MDL.MaterialLevel.IsThreeStars(params,des) elseif triggerId == LuaConst.TriggerType.Country_HasJoin then return MDL.Country.IsHasCountry(), des and UIUtils.GetLocalizedTxt(Const_IDS[des]) or nil elseif triggerId == LuaConst.UnlockConditionType.CompleteOfficialPosition or triggerId == LuaConst.TriggerType.OfficialPosition_Level then return CTL.OfficialPosition.CheckIfUnlock(params, des) elseif triggerId == LuaConst.UnlockConditionType.GuildLevel then return MDL.Guild.IsReachLevel(params,des) elseif triggerId == LuaConst.UnlockConditionType.CompleteFunctionNoticeExp then return MDL.FunctionNotice.IsExpEnd(params) elseif triggerId == LuaConst.UnlockConditionType.GuildLeader then return MDL.Guild.CheckLeader(params) elseif triggerId == LuaConst.UnlockConditionType.StoreCoinCost then return MDL.Shop.CheckCost(params) elseif triggerId == LuaConst.TriggerType.PayMall_Buy then local param = string.split(params, ";") return CTL.PayMall.UnlockTriggerHasBuy(tonumber(param[1]), tonumber(param[2]), des) elseif triggerId == LuaConst.UnlockConditionType.GuildBuildLevelByType then return MDL.Guild.CheckBuildLevel(params,des) elseif triggerId == LuaConst.UnlockConditionType.HaveGuild then return MDL.Guild.IsHasGuild(), UIUtils.GetLocalizedTxt(Const_IDS.IDS_GoldHeroActivity_SynergyBoss_Help_Hint8) elseif triggerId == LuaConst.UnlockConditionType.ServerDay then return MDL.Player.GetServerDayCount() >= tonumber(params), des and UIUtils.GetLocalizedTxt(Const_IDS[des]) elseif triggerId == LuaConst.UnlockConditionType.HeroWithLevel then return Unlock_Model.HeroCountWithLevel(params, des) elseif triggerId == LuaConst.TriggerType.HeroAwaken_ExistAwakenHero then return MDL.HeroAwaken.GetIsAnyHeroAwaken() elseif triggerId == LuaConst.TriggerType.HeroAwaken_HasAwakenHero then return MDL.HeroAwaken.GetIsHeroAwaken(tonumber(params)) elseif triggerId == LuaConst.TriggerType.HeroAwaken_HasPreAwakenHero then return CTL.HeroAwaken.HasPreAwakenHero() elseif triggerId == LuaConst.TriggerType.HeroAwaken_IsHeroPreAwaken then return CTL.HeroAwaken.IsHeroPreAwaken(tonumber(params)) elseif triggerId == LuaConst.TriggerType.HeroAppearance_Active or triggerId == LuaConst.UnlockConditionType.HeroAppearance_Active then return CTL.Appearance.AppearanceUnlockTrigger(params, des, MDL.Appearance.AppearanceType.Hero) elseif triggerId == LuaConst.TriggerType.WeaponAppearance_Active or triggerId == LuaConst.UnlockConditionType.WeaponAppearance_Active then return CTL.Appearance.AppearanceUnlockTrigger(params, des, MDL.Appearance.AppearanceType.Weapon) elseif triggerId == LuaConst.TriggerType.LightEffect_Active or triggerId == LuaConst.UnlockConditionType.LightEffect_Active then return CTL.LightEffect.LightEffectUnlockTrigger(params, des) elseif triggerId == LuaConst.TriggerType.DyeAppearance_ActiveNum or triggerId == LuaConst.UnlockConditionType.DyeAppearance_ActiveNum then return CTL.DyeAppearance.HasActiveCount(tonumber(params)) elseif triggerId == LuaConst.UnlockConditionType.MonthCard then return Unlock_Model.MonthCardActive(params, des) elseif triggerId == LuaConst.UnlockConditionType.RechargeCredit then return MDL.Currency.GetTotalRechargeCredit() >= tonumber(params) elseif triggerId == LuaConst.UnlockConditionType.SyncSolo_Rank then return MDL.SyncSolo.IsAchieveTargetLevel(tonumber(params)) elseif triggerId == LuaConst.UnlockConditionType.WarZoneStart then local state = CTL.WarZone.IsWarZoneOpen() and "1" or "0" return state == tostring(params) elseif triggerId == LuaConst.UnlockConditionType.SyncSolo_Rank then return MDL.SyncSolo.IsAchieveTargetLevel(tonumber(params)) elseif triggerId == LuaConst.UnlockConditionType.LevelOrTask then return private.IsLevelOrTask(params, des) elseif triggerId == LuaConst.TriggerType.NationClimbTower_Level then return Unlock_Model.IsPassedNationTowerLevel(params) elseif triggerId == LuaConst.UnlockConditionType.NoActiveWeapon then return not private.IsMagicWeaponActive(params) elseif triggerId == LuaConst.UnlockConditionType.CreatePlayerDay then return private.IsMeetCreatePlayerDay(params) ---如果要扩展新类型 请对des做判空处理 des空 则不要使用GetLocalizedTxt等产生字符串的操作 elseif triggerId == LuaConst.TriggerType.NationClimbTowerAllLevel then return Unlock_Model.IsPassedAllNationClimbTowerLevel(tonumber(params), des) else return true end end function Unlock_Model.IsPassedAllNationClimbTowerLevel(param, des) local isUnlock = true for towerType = 1, 4 do if not CTL.NationClimbTower.IsPassLevel(towerType, param) then isUnlock = false break end end if des then des = string.FormatByIdsId(Const_IDS[des], param) end return isUnlock, des end function private.GetText(formatStr ,param1 ,param2) if formatStr then return string.format(formatStr ,param1 ,param2) end return nil end function Unlock_Model.CompleteHeroBiography(biographyId, des) local unlockText = des and private.GetText(UIUtils.GetLocalizedTxt(Const_IDS[des]), UIUtils.GetLocalizedTxt(Const_IDS[DataSheetManager.HeroBiographyData:GetDataByID(tonumber(biographyId)).BiographyName])) or nil return CTL.Biography.IsHeroBiographyPassed(biographyId), unlockText end function Unlock_Model.CompleteHeroBiographyLevel(biographyLevelId, des) biographyLevelId = tonumber(biographyLevelId) local unlockText = des and private.GetText(UIUtils.GetLocalizedTxt(Const_IDS[des]), UIUtils.GetLocalizedTxt(Const_IDS[DataSheetManager.HeroBiographyLevel:GetDataByID(biographyLevelId).LevelName])) or nil local starNums = MDL.Biography.GetBiographyLevelStarNumById(biographyLevelId) return (starNums and starNums > 0), unlockText end function Unlock_Model.CompleteChallenge(challengeId, des) challengeId = tonumber(challengeId) local unlockText = des and private.GetText(UIUtils.GetLocalizedTxt(Const_IDS[des]), UIUtils.GetLocalizedTxt(Const_IDS[DataSheetManager.BossChallengeData:GetDataByID(challengeId).BossChallengeName])) or nil local score = MDL.BossChallenge.GetBossDifficultScoreById(challengeId) return (score and score > 0), unlockText end function Unlock_Model.CompleteMainStory(param, des) local completedTasks = MDL.Task.GetCompletedTask() local unlockText = nil if des then local fatherTaskName = UIUtils.GetLocalizedTxt(Const_IDS[DataSheetManager.TaskFatherData:GetDataByID(param).Brief]) unlockText = des and private.GetText(UIUtils.GetLocalizedTxt(Const_IDS[des]), fatherTaskName) or nil end if completedTasks[param] and completedTasks[param] > 0 then return true, unlockText else return false, unlockText end end function Unlock_Model.CompleteMainAndSubStory(param, des) local completedTasks = MDL.Task.GetCompletedTask() local paramList = string.split(param, ";") paramList[1] = tonumber(paramList[1]) paramList[2] = tonumber(paramList[2]) local childTaskData = DataSheetManager.TaskChildData:GetDataByTaskLineID_TaskChildID(paramList[1], paramList[2]) if not childTaskData then logging.error(LTAG.ERROR, "TaskChildData表中没有TaskLineID:", paramList[1], "TaskChildID:", paramList[2], "为主键的数据,请策划检查!!!") end local unlockText = nil if des then local fatherTaskName = UIUtils.GetLocalizedTxt(Const_IDS[DataSheetManager.TaskFatherData:GetDataByID(paramList[1]).Brief]) local childTaskName = UIUtils.GetLocalizedTxt(Const_IDS[childTaskData.Des]) unlockText = des and private.GetText(UIUtils.GetLocalizedTxt(Const_IDS[des]), fatherTaskName, childTaskName) or nil end --用分号隔开,前者为父任务ID,后者为子任务ID if completedTasks[paramList[1]] and completedTasks[paramList[1]] >= paramList[2] then return true, unlockText else return false, unlockText end end function Unlock_Model.PassedLevel(levelId, des) local levelId = tonumber(levelId) local passedLevel = MDL.LevelSelect.GetAlreadyPassedLevelInfo() local levelData = DataSheetManager.BarrierChosenData:GetDataByID(levelId) if not levelData then logging.error(LTAG.ERROR, "没有找到levelId: ", levelId, "的数据。") return false end local levelName = CTL.LevelSelect.GetLevelWholeNameById(levelId) if passedLevel ~= nil then for k, v in ipairs(passedLevel) do if v.levelId == levelId and MDL.LevelSelect.GetLevelStarNumById(levelId) > 0 then return true, des and private.GetText(UIUtils.GetLocalizedTxt(Const_IDS[des]), levelName) end end end if des then return false, private.GetText(UIUtils.GetLocalizedTxt(Const_IDS[des]), levelName) else local num1 = levelData.BelongToChapter % 100 return false, string.FormatByIdsId(Const_IDS.IDS_Activity_Condition_02, num1 .."-"..levelData.BarrierID) end end function Unlock_Model.TeamLevelUnlock(level, des) if level == 0 then return false end local levelParam = UTL.Item.GetNobilityByTeamLevel(tonumber(level), 2) local unlockText = des and private.GetText(UIUtils.GetLocalizedTxt(Const_IDS[des]), levelParam) or nil local teamLevel = MDL.HeroSelect.GetTeamLevel() return teamLevel >= tonumber(level), unlockText end function Unlock_Model.TeamLevelMinUnlock(level, des) local levelParam = UTL.Item.GetNobilityByTeamLevel(tonumber(level), 2) local unlockText = des and private.GetText(UIUtils.GetLocalizedTxt(Const_IDS[des]), levelParam) or nil local teamLevel = MDL.HeroSelect.GetTeamLevel() return teamLevel <= tonumber(level), unlockText end function Unlock_Model.TeamRankUnlock(rankId, des) local unlockText = des and private.GetText(UIUtils.GetLocalizedTxt(Const_IDS[des]), rankId) or nil return rankId >= MDL.Player.GetRoleRankID(), unlockText end function Unlock_Model.ActiveHeros(ids, des) local heros = MDL.HeroSelect.GetHasHeroList() for _,id in ipairs(ids) do local isExist = false for i,v in ipairs(heros) do if v.heroId == id then isExist = true end end if not isExist then return false end end return true end function Unlock_Model.ActiveHeroCount(count, des) local heroCount = MDL.HeroSelect.GetHasHeroCount() local unlockText = des and private.GetText(UIUtils.GetLocalizedTxt(Const_IDS[des]), count) or nil return heroCount >= count, unlockText end function Unlock_Model.HeroLevel(level, des) local heroes = MDL.HeroSelect.GetHasHeroList() local unlockText = des and private.GetText(UIUtils.GetLocalizedTxt(Const_IDS[des]), level) or nil for i,v in ipairs(heroes) do if v.heroLevel >= level then return true, unlockText end end return false, unlockText end function Unlock_Model.GetUnlockTeamLevel(functionType) local config = DataSheetManager.FuctionUnlock:GetDataByFucID(functionType) for i = 1, #config.Unlock_Table do if config.Unlock_Table[i].UnlockCondition == LuaConst.UnlockConditionType.TeamLevel then return config.Unlock_Table[i].UnlockConditionParam end end return 0 end function Unlock_Model.HeroCountWithLevel(param, des) local split = string.split(param, ";") local count = tonumber(split[1]) local level = tonumber(split[2]) local heroes = MDL.HeroSelect.GetHasHeroList() local unlockText = des and string.FormatByIdsId(Const_IDS[des], count, level) or nil for i, v in ipairs(heroes) do if v.heroLevel >= level then count = count - 1 if count == 0 then return true, unlockText end end end return false, unlockText end function Unlock_Model.IsPassedNationTowerLevel(param) local split = string.split(param, ";") local towerType = tonumber(split[1]) local towerLv = tonumber(split[2]) return CTL.NationClimbTower.IsPassLevel(towerType, towerLv) end function Unlock_Model.MonthCardActive(param, des) local monthCardId = tonumber(param) local monthCardName = DataSheetManager.MonthCard:GetDataByMonthCardID(monthCardId).CardName local unlockText = des and string.FormatByIdsId(Const_IDS[des], UIUtils.GetLocalizedTxt(Const_IDS[monthCardName])) or nil return CTL.MonthCard.IsMonthCardActive(monthCardId), unlockText end function private.IsLevelOrTask(params,des) local split = string.split(params, ";") local level = tonumber(split[1]) local taskId = tonumber(split[2]) local taskChildId = tonumber(split[3]) local unlockText = nil if des then local levelParam = UTL.Item.GetNobilityByTeamLevel(tonumber(level), 2) local fatherTaskName = UIUtils.GetLocalizedTxt(Const_IDS[DataSheetManager.TaskFatherData:GetDataByID(taskId).Brief]) local childTaskData = DataSheetManager.TaskChildData:GetDataByTaskLineID_TaskChildID(taskId, taskChildId) local childTaskName = UIUtils.GetLocalizedTxt(Const_IDS[childTaskData.Des]) unlockText = des and private.GetText(UIUtils.GetLocalizedTxt(Const_IDS[des]), levelParam, fatherTaskName, childTaskName) or nil end local completedTasks = MDL.Task.GetCompletedTask() local taskComplete = completedTasks[taskId] and completedTasks[taskId] >= taskChildId return MDL.HeroSelect.GetTeamLevel() >= tonumber(level) or taskComplete, unlockText end function private.IsMagicWeaponActive(id) local heroInfo = MDL.HeroSelect.GetHeroInfo(id) return heroInfo and heroInfo.isMagicWeaponActive end function private.IsMeetCreatePlayerDay(daysLimit) local days = daysLimit - 1 --daysLimit创角第几天 local time = UTL.Time.GetServerTimestamp() - MDL.Player.GetCreatePlayerTime() local createdDay = math.floor(time / UTL.Time.TotalSecondsOneDay) if createdDay >= days then return true else if days - createdDay == 1 then return false, UIUtils.GetLocalizedTxt(Const_IDS.IDS_LaterEnter_Hint_10) else return false, string.FormatByIdsId(Const_IDS.IDS_LaterEnter_Hint_11, days - createdDay) end end end function private.G2CPushDebugSwitchStateCallback(msg) logging.log(LTAG.LOG," msgResp.DebugSwitchInfo ",msg.newState) if private.curChannelID == msg.newState.SwitchChannel then DebugUnlockTbl[msg.newState.SwitchType] = msg.newState.SwitchState end CompareSyncLogManager.SetNeedSendToServerLog(MDL.Unlock.GetDebugSwitchState(MDL.Unlock.DebugSwitchType.TypeUploadBattleLog3v3)) EventSystem.Dispatch(EventID.UI_SDKUser_Unlock_Update) end function private.G2CPushGameFunctionSwitchStateCallback(msg) --SwitchState在switch.proto里面有枚举,0是开启,123都是关闭的不同处理 local state = msg.newState logging.log(LTAG.LOG, "FunctionId: ", state.SwitchType, "关闭状态(非0则为关闭):", state.SwitchState) ServerUnlockTbl[state.SwitchType] = state.SwitchState Unlock_Model.Update(false, state.SwitchType) end ---通过triggerID表获取描述 ---此方法用于系统功能的TriggerID表使用,通过TriggerID表索引到TriggerType表 ---涉及到运营活动HotGenCondID表相关的请使用CTL.Hegemony.GetTriggerContentById方法 local DigTreasureAnyTypeIDS = 3 function Unlock_Model.GetDesByTriggerID(triggerIDInfo, isUnlock, triggerProgress) local data = triggerIDInfo local param = {data.UnlockConditionParamA, } if data.UnlockCondition == LuaConst.TriggerType.Hero_WithLevel -- 第二个参数可以直接赋值的 or data.UnlockCondition == LuaConst.TriggerType.Hero_WithBreak or data.UnlockCondition == LuaConst.TriggerType.Weapon_WithBreak or data.UnlockCondition == LuaConst.TriggerType.Horse_WithBreak or data.UnlockCondition == LuaConst.TriggerType.Treasure_WithBreak or data.UnlockCondition == LuaConst.TriggerType.Gem_Resonance then table.insert(param, data.UnlockConditionParamB) elseif data.UnlockCondition == LuaConst.TriggerType.MainLevel_PassChapter then local chapterData = DataSheetManager.BarrierChapterData:GetDataByBarrierCharpterID(tonumber(param[1])) param[1] = UIUtils.GetLocalizedTxt(Const_IDS[chapterData.CharpterSortIDS]) elseif data.UnlockCondition == LuaConst.TriggerType.ReusePve_PassTimes or data.UnlockCondition == LuaConst.TriggerType.HonorOrderPve_PassTimes then -- 通关X次组队副本Y local params = string.split(data.UnlockConditionParamB,';') for _, v in ipairs(params) do table.insert(param, UIUtils.GetLocalizedTxt(Const_IDS[DataSheetManager.TeamDungeonData:GetDataByID(tonumber(v)).DungeonName])) end elseif data.UnlockCondition == LuaConst.TriggerType.Hero_WithAdvance then -- 武将:X个武将进阶到达Y local heroAdvanceData = DataSheetManager.HeroAdvance:GetDataByAdvanceID(tonumber(data.UnlockConditionParamB)) if heroAdvanceData then table.insert(param, string.FormatByIdsId(Const_IDS.IDS_HeroAdvanceLevel, heroAdvanceData.Stage, heroAdvanceData.LightStar)) end elseif data.UnlockCondition == LuaConst.TriggerType.Hero_WithQuality -- 武将:拥有X个Y品质武将 or data.UnlockCondition == LuaConst.TriggerType.DrawCard_Count then -- 招募:招募X个不同品质为Y的武将 local qualityData = DataSheetManager.QualityColor:GetDataByID(tonumber(data.UnlockConditionParamB)) table.insert(param, UIUtils.GetLocalizedTxt(Const_IDS[qualityData.ColorText])) elseif data.UnlockCondition == LuaConst.TriggerType.Team_Level then -- 战队等级 param[1] = UTL.Item.GetNobilityByTeamLevel(tonumber(param[1])) -- 爵位转换 elseif data.UnlockCondition == LuaConst.TriggerType.OfficialPosition_Level or data.UnlockCondition == LuaConst.TriggerType.OfficialPosition_Refresh or data.UnlockCondition == LuaConst.TriggerType.OfficialPosition_FirstArrive then -- 官职 for i, v in DataSheetManager.OfficialPosition:GetEnumerator() do if v.GradeID == tonumber(param[1]) then param[1] = CTL.OfficialPosition.GetTitleFullTxt(v) break end end elseif data.UnlockCondition == LuaConst.TriggerType.GoldenHero_PassLevel then -- 金将体验关:通关金将活动关卡X(非历史) local levelType = DataSheetManager.GoldHeroActivityModeData:GetDataByHeroType(tonumber(data.UnlockConditionParamA)).HeroLevelType if levelType == MDL.GoldenHeroMain.LevelType.Story then param[1] = UIUtils.GetLocalizedTxt(Const_IDS[DataSheetManager.GoldHeroActivityLevel:GetDataByID(tonumber(data.UnlockConditionParamB)).BarrierName]) else param[1] = MDL.GoldenHeroAnecdote.GetAnecdoteWholeName(tonumber(data.UnlockConditionParamB)) end elseif data.UnlockCondition == LuaConst.TriggerType.GoldenHero_PassEnding then -- 金将体验关:达成结局X(非历史) param[1] = UIUtils.GetLocalizedTxt(Const_IDS[DataSheetManager.GoldHeroEndingRecord:GetDataByEndingID(tonumber(data.UnlockConditionParamB)).EndingName]) elseif data.UnlockCondition == LuaConst.TriggerType.GoldenHero_ParticipationModelBoss -- 金将体验关:累计参与X模板的Y次协同讨伐(非历史) or data.UnlockCondition == LuaConst.TriggerType.GoldenHero_FindModelBoss -- 金将体验关:累计发现X模板的Y次讨伐目标(非历史) or data.UnlockCondition == LuaConst.TriggerType.GoldenHero_GetModelBossScore -- 金将体验关:协同讨伐中累计获得X模板的Y积分(非历史) or data.UnlockCondition == LuaConst.TriggerType.GoldenHero_KillModelBoss -- 金将体验关:累计击杀讨伐目标X模板的Y次(非历史) or data.UnlockCondition == LuaConst.TriggerType.GoldenHero_PassModelLevel -- 金将体验关:累计通关金将活动X模板的关卡Y次(非历史) or data.UnlockCondition == LuaConst.TriggerType.GoldenHero_SingleHighestBossScore -- 金将体验关:累计通关金将活动X模板的关卡Y次(非历史) or data.UnlockCondition == LuaConst.TriggerType.GoldenHero_GetDailyScore then -- 金将体验关:活动期间累计获得X点日常活跃度(非历史) param[1] = data.UnlockConditionParamB elseif data.UnlockCondition == LuaConst.TriggerType.SuperGold_PassLevel then -- 彩金:累计参与X模板的Y次协同讨伐(非历史) local levelData = DataSheetManager.SuperGoldStoryLevel:GetDataByLevelID(tonumber(param[1])) param[1] = UIUtils.GetLocalizedTxt(Const_IDS[levelData.BarrierName]) elseif data.UnlockCondition == LuaConst.TriggerType.SuperGold_LevelEnding then -- 彩金:累计参与X模板的Y次协同讨伐(非历史) for i, v in pairs(DataSheetManager.SuperGoldEndingRecord) do local id = tonumber(param[1]) local success, excelData = v:TryGetDataByEndingID(id) if success then param[1] = UIUtils.GetLocalizedTxt(Const_IDS[excelData.EndingName]) break end end elseif data.UnlockCondition == LuaConst.TriggerType.ClimbTower_Level then -- 百战雄关 local climbLevelData = DataSheetManager.ClimbTowerLevel:GetDataByID(tonumber(param[1])) param[1] = UIUtils.GetLocalizedTxt(Const_IDS[climbLevelData.LevelName]) elseif data.UnlockCondition == LuaConst.TriggerType.First_Cost -- 首冲 or data.UnlockCondition == LuaConst.TriggerType.DailyFirst_Cost -- 每日首冲 or data.UnlockCondition == LuaConst.TriggerType.Single_Cost then -- 单次充值 param[1] = MDL.Currency.GetFullyIAPPrice(tonumber(param[1])) elseif data.UnlockCondition == LuaConst.TriggerType.Dig_TreasureTimes or data.UnlockCondition == LuaConst.TriggerType.DigTreasureTimes_Count then local param2 = tonumber(data.UnlockConditionParamB) if not param2 then param2 = DigTreasureAnyTypeIDS end param[2] = UIUtils.GetLocalizedTxt(Const_IDS["IDS_DigTreasure_LevelDes" .. param2]) elseif data.UnlockCondition == LuaConst.TriggerType.Hero_SpecifiedBreakLevel then table.insert(param, data.UnlockConditionParamB) local heroData = DataSheetManager.HerNum:GetDataByID(tonumber(param[2])) param[2] = param[1] param[1] = UIUtils.GetLocalizedTxt(Const_IDS[heroData.NameIDS]) elseif data.UnlockCondition == LuaConst.TriggerType.Weapon_SpecifiedBreakLevel then table.insert(param, data.UnlockConditionParamB) local weaponData = DataSheetManager.MagicWeaponData:GetDataByMagicWeaponID(tonumber(param[2])) param[2] = param[1] param[1] = UIUtils.GetLocalizedTxt(Const_IDS[weaponData.MagicWeaponName]) elseif data.UnlockCondition == LuaConst.TriggerType.SlgGvE_OccupyPlot_Level then --SlgGvE:占领X个Y级地块 table.insert(param, data.UnlockConditionParamB) elseif data.UnlockCondition == LuaConst.TriggerType.SlgGvE_OccupyPlot_Type then --SlgGvE:占领X个Z类型地块 local plotName = CTL.SlgGvE.GetTriggrtUnlockConditionPlotName(data) table.insert(param, plotName) elseif data.UnlockCondition == LuaConst.TriggerType.SlgGvE_Talent_Level then --SlgGvE:天赋权柄x到达y级 local cfg = DataSheetManager.SlgGvETalentData:GetDataByGveTalentID(tonumber(param[1])) param[1] = UIUtils.GetLocalizedTxt(Const_IDS[cfg.GveTalentName]) table.insert(param, cfg.GveTalentLevel) elseif data.UnlockCondition == LuaConst.TriggerType.Rogue_HeroReachLevels or data.UnlockCondition == LuaConst.TriggerType.Rogue_HeroPassTimes then local nameIDS = DataSheetManager.HeroNum:GetDataByID(tonumber(param[1])).NameIDS param = {UIUtils.GetLocalizedTxt(Const_IDS[nameIDS]), data.UnlockConditionParamB} elseif data.UnlockCondition == LuaConst.TriggerType.Rogue_LevelReachPoints then local levelId = DataSheetManager.VersionsRoguelikeLevel:GetDataByID(tonumber(param[1])).LevelID local levelNameIDS = DataSheetManager.RogueLevelData:GetDataByLevelID(levelId).LevelNameIDS param = {UIUtils.GetLocalizedTxt(Const_IDS[levelNameIDS]), data.UnlockConditionParamB} elseif data.UnlockCondition == LuaConst.TriggerType.MonthBossChallenge_ReachPoints then local bossData = DataSheetManager.BossChallengeData:GetDataByID(tonumber(param[1])) local bossName = string.split(UIUtils.GetLocalizedTxt(Const_IDS[bossData.BossChallengeName]),"-")[2] param = {bossName, data.UnlockConditionParamB} end if triggerProgress then if isUnlock ~= nil then param[1] = isUnlock and UTL.Color.FormatGreenColor(triggerProgress) .. "/" .. param[1] or UTL.Color.FormatRedColor(triggerProgress) .. "/" .. param[1] else param[1] = triggerProgress .. "/" .. param[1] end else if isUnlock ~= nil then param[1] = isUnlock and UTL.Color.FormatGreenColor(param[1]) or UTL.Color.FormatRedColor(param[1]) if param[2] then param[2] = isUnlock and UTL.Color.FormatGreenColor(param[2]) or UTL.Color.FormatRedColor(param[2]) end end end return string.FormatByIdsKey(data.UnlockConditionDes, unpack(param)) end function Unlock_Model.GetTargetNumberByTriggerID(triggerId) local triggerData = DataSheetManager.TriggerID:GetDataByID(triggerId).Unlock_Table[1] if triggerData.UnlockCondition == LuaConst.TriggerType.Rogue_HeroReachLevels or triggerData.UnlockCondition == LuaConst.TriggerType.Rogue_LevelReachPoints or triggerData.UnlockCondition == LuaConst.TriggerType.Rogue_HeroPassTimes or triggerData.UnlockCondition == LuaConst.TriggerType.MonthBossChallenge_ReachPoints then return tonumber(triggerData.UnlockConditionParamB) else return tonumber(triggerData.UnlockConditionParamA) end end function private.SetAutoFightIdByABTest() if GameAppInfo.IsJapanesePackage() then return end local useNewGuideLevel = CTL.Login.GetLocalABTestMode() if useNewGuideLevel == 1 then --替换新的自动战斗解锁条件 Unlock_Model.FunctionType.AutoFight = 47399 end end return Unlock_Model