Ejemplo n.º 1
0
        static bool workFlow()
        {
            var x = File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + "config.json");

            cfg = Newtonsoft.Json.JsonConvert.DeserializeObject <ConfigModel>(x);

            //For convenience so that we don't need to delve into chest filling code to affect quantities
            var commonCount    = cfg.CommonCountPerChar * cfg.CharCount;
            var rareCount      = cfg.RareCountPerChar * cfg.CharCount;
            var epicCount      = cfg.EpicCountPerChar * cfg.CharCount;
            var legendaryCount = cfg.LegendaryCountPerChar * cfg.CharCount;


            List <ChestItemModel> personWantedCards = new List <ChestItemModel>();
            var RadiantChestItems = GetRadiantChestContentsAndWantedItems(
                out personWantedCards,
                cfg.StartingLevel,
                commonCount,
                rareCount,
                epicCount,
                legendaryCount,
                cfg.CosmeticsCount,
                cfg.WantAllCards,
                cfg.WantAllCommonForChar,
                cfg.WantAllRareForChar,
                cfg.WantAllEpicForChar,
                cfg.WantAllLegendaryForChar,
                cfg.CharacterName);
            RadiantChestModel chest = new RadiantChestModel(RadiantChestItems, getQualityRatesDictionary(), cfg.ItemsPerchest, cfg.CardUniquePerChest);


            var avgChestsNeeded = getAverageNeededChestCounts(personWantedCards, chest, cfg.AttemptsCount, cfg.DesiredLevel);

            Console.WriteLine(String.Format("Average Chests Needed - {0}", avgChestsNeeded));

            Console.WriteLine("Again? y/n");
            bool again = GetBooleanValueFromConsole();

            return(again);
        }
Ejemplo n.º 2
0
        public static int getAverageNeededChestCounts(List <ChestItemModel> personWantedCards, RadiantChestModel chest, int attemptCount, int desiredLevel)
        {
            var personWantedCardsDictionary = personWantedCards.ToDictionary(x => x.Name, x => x);

            int totalChests = 0;

            #region Opening chests
            //Duh
            for (int i = 0; i < attemptCount; i++)
            {
                int chestCount  = 0;
                int fuckingHell = 0;
                //Open chests until all desired cards are open
                while (!personWantedCards.All(c => c.Level >= desiredLevel))
                {
                    var f**k = chest.RollAll();
                    chestCount++;
                    //Check received stuff, see if any good dupes
                    f**k.ForEach(f =>
                    {
                        if (!personWantedCardsDictionary.ContainsKey(f.Name))
                        {
                            fuckingHell++;
                        }
                        else
                        {
                            //Wooooo f*****g hooo!
                            var personCard = personWantedCardsDictionary[f.Name];
                            personCard.ApplyDupe();
                        }
                        //Console.WriteLine(chestCount.ToString() + " " + personWantedCards.Count(x => x.Level != 5));
                    });
                }

                totalChests += chestCount;
                Console.WriteLine(String.Format("Attempt {0}, ChestCount {1}, Unnecessary Dupes = {2}", i, chestCount, fuckingHell));
                personWantedCards.ForEach(c => c.Reset());
            }
            #endregion
            return(totalChests / attemptCount);
        }