RatioNumberManager = {} local this = RatioNumberManager this.chapterId = 1 this.levelId = 1 this.chapterInfo = nil this.buildIds = 0 this.selectChapterId = 0 this.selectLevelId = 1 this.curPlayerPower= 0 this.playerPower = 0 this.curPlayerHj = 0 this.PlayerHj = 0 this.rewardIdArr = nil this.enemyBuildId = 0 this.palyerBuildId = 0 this.gameIndex = 1 this.protagonist = nil this.playerResStr = { [1] = 8001670, --背景 [2] = 8001680, --基座 [3] = 8001690, --墙壁 [4] = 8001700 --房顶 } this.enemyResStr = { [1] = 8001670, --背景 [2] = 8001680, --基座 [3] = 8001850, --墙壁 [4] = 8001710 --房顶 } function RatioNumberManager.Init(msg) local num = msg.levelId this.gameIndex = msg.levelId this.chapterId = math.floor(num/16) this.levelId = num%16 if this.levelId == 0 then this.levelId = 16 else this.chapterId =this.chapterId + 1 end this.rewardIdArr = msg.rewardIdArr RatioNumberManager.SelectInit() --LogError("num==="..num.." this.chapterId=="..this.chapterId.." this.levelId=="..this.levelId) end function RatioNumberManager.SelectInit() if this.selectChapterId == 0 then this.selectChapterId = RatioNumberLevelManager.GetCurChapter() if this.selectChapterId < this.chapterId then this.selectLevelId = 16 else this.selectChapterId = this.chapterId this.selectLevelId = this.levelId end end end function RatioNumberManager.GetRewardState(rewardId) for _,v in ipairs(this.rewardIdArr) do if v == rewardId then return true end end return false end function RatioNumberManager.RestartGame() this.chapterInfo = ConfigManager.GetConfigData(ConfigName.CompareNumSetting,RatioNumberManager.GetCurGameInxed()) this.buildIds = this.chapterInfo.BuildID local buildInfo = ConfigManager.GetConfigData(ConfigName.CompareNumBuild,this.buildIds[1]) local playerInfo = ConfigManager.GetConfigData(ConfigName.CompareNumItem,buildInfo.Formula[1][1]) this.curPlayerPower = playerInfo.CombatEffectiveness this.playerPower = this.curPlayerPower this.PlayerHj=0 this.curPlayerHj =0 this.enemyBuildId = 2 this.palyerBuildId = 1 end function RatioNumberManager.GetCurGameInxed() return (this.selectChapterId - 1) * 16 + this.selectLevelId end function this.CheckRedPoint() local isShow=false --判断有没有打关卡 if not CheckFunctionOpen(FUNCTION_OPEN_TYPE.Number_Game) then return false end local curLevel=RatioNumberLevelManager.GetChapterLevelInfo(this.chapterId,this.levelId ) if curLevel then local tj=curLevel.LevelLimit local isTrue=true for i = 1, #tj do if tj[i] and tj[i][1]~=0 then if tj[i][1] == 1 then if PlayerManager.level < tj[i][2] then isTrue=false end elseif tj[i][1] == 2 then --没有关卡限制界面关卡没有卡 if FightPointPassManager.curOpenFight <= tj[i][2] then isTrue=false end end end end isShow=isTrue end local reward = RatioNumberLevelManager.GetChapterReward() local curRardId = RatioNumberManager.chapterId * 1000 + RatioNumberManager.levelId - 1 for i = 1,RatioNumberManager.chapterId do for j=1, 3 do local rewardArr = reward[j] --local rewardID = rewardArr[2] local index = i * 1000 + rewardArr[1] local rewardState = RatioNumberManager.GetRewardState(index) --LogError("index=="..index.." rewardState=="..tostring(rewardState).." currewardID=="..curRardId) if rewardState==false and index<=curRardId then return true end end end return isShow end return RatioNumberManager