Ejemplo n.º 1
0
        public static float GetChallengeSkillIndex()
        {
            int num1 = 0;
            int num2 = 0;
            List <ChallengeData> available = new List <ChallengeData>();

            if (!(Level.current is ArcadeLevel arcadeLevel))
            {
                arcadeLevel = ArcadeLevel.currentArcade;
            }
            if (arcadeLevel == null)
            {
                return(0.0f);
            }
            foreach (ArcadeMachine challenge1 in arcadeLevel._challenges)
            {
                foreach (string challenge2 in challenge1.data.challenges)
                {
                    available.Add(Challenges.GetChallenge(challenge2));
                }
            }
            foreach (ChallengeData allChancyChallenge in Challenges.GetAllChancyChallenges(available))
            {
                available.Add(allChancyChallenge);
            }
            foreach (KeyValuePair <string, ChallengeData> challenge in Challenges._challenges)
            {
                if (available.Contains(challenge.Value))
                {
                    num2 += 4;
                    ChallengeSaveData saveData = Challenges.GetSaveData(challenge.Value.levelID, Profiles.active[0], true);
                    if (saveData != null)
                    {
                        num1 += (int)saveData.trophy;
                    }
                }
            }
            return((float)num1 / (float)num2);
        }
Ejemplo n.º 2
0
        public static void CalculateTreeValues()
        {
            ArcadeLevel arcadeLevel = new ArcadeLevel(Content.GetLevelID("arcade"));

            arcadeLevel.InitializeMachines();
            int num1 = 0;

            foreach (ArcadeMachine challenge in arcadeLevel._challenges)
            {
                num1 += challenge.data.challenges.Count;
            }
            int num2  = num1 + Challenges.GetAllChancyChallenges().Count;
            int num3  = num2 * Challenges.valueBronze;
            int num4  = num2 * Challenges.valueSilver;
            int num5  = num2 * Challenges.valueGold;
            int num6  = num2 * Challenges.valuePlatinum;
            int num7  = num3;
            int num8  = num3 + num4;
            int num9  = num3 + num4 + num5;
            int num10 = num3 + num4 + num5 + num6;

            Unlocks.bronzeTotalTickets   = num7;
            Unlocks.silverTotalTickets   = num8;
            Unlocks.goldTotalTickets     = num9;
            Unlocks.platinumTotalTickets = num10;
            int num11 = 0;
            int num12 = 0;
            int num13 = 0;
            int num14 = 0;

            foreach (UnlockData unlock in Unlocks.GetUnlocks(UnlockType.Any))
            {
                if (unlock.priceTier == UnlockPrice.Cheap)
                {
                    ++num11;
                }
                else if (unlock.priceTier == UnlockPrice.Normal)
                {
                    ++num12;
                }
                else if (unlock.priceTier == UnlockPrice.High)
                {
                    ++num13;
                }
                else if (unlock.priceTier == UnlockPrice.Ridiculous)
                {
                    ++num14;
                }
            }
            int num15 = (int)Math.Round((double)num9 * 0.100000001490116);
            int num16 = (int)Math.Round((double)num9 * 0.300000011920929);
            int num17 = (int)Math.Round((double)num9 * 0.400000005960464);
            int num18 = (int)Math.Round((double)num9 * 0.200000002980232);
            int num19 = (int)Math.Round((double)num15 / (double)num11);
            int num20 = (int)Math.Round((double)num16 / (double)num12);
            int num21 = (int)Math.Round((double)num17 / (double)num13);
            int num22 = (int)Math.Round((double)num18 / (double)num14);

            while (num19 * num11 + num20 * num12 + num21 * num13 + num22 * num14 > num9)
            {
                --num22;
            }
            while (num19 * num11 + num20 * num12 + num21 * num13 + num22 * num14 < num9)
            {
                ++num22;
            }
            foreach (UnlockData unlock in Unlocks.GetUnlocks(UnlockType.Any))
            {
                if (unlock.priceTier == UnlockPrice.Cheap)
                {
                    unlock.cost = num19;
                }
                else if (unlock.priceTier == UnlockPrice.Normal)
                {
                    unlock.cost = num20;
                }
                else if (unlock.priceTier == UnlockPrice.High)
                {
                    unlock.cost = num21;
                }
                else if (unlock.priceTier == UnlockPrice.Ridiculous)
                {
                    unlock.cost = num22;
                }
                else if (unlock.priceTier == UnlockPrice.Chancy)
                {
                    unlock.cost = num6;
                }
            }
        }