Exemple #1
0
        public override void Run()
        {
            Console.WriteLine("Searching for cards...\n");
            bool gotGuaranteedSR = false;

            for (int i = 0; i < 10; ++i)
            {
                var        rand    = new Random();
                var        lottery = rand.Next(100);
                RarityType rarity  = RarityType.R;

                if (lottery < SSRChance)
                {
                    rarity = RarityType.SSR;
                }
                else if (lottery < SRChance)
                {
                    rarity = RarityType.SR;
                }

                if (i == 9 && rarity == RarityType.R && !gotGuaranteedSR)
                {
                    rarity = RarityType.SR;
                }

                while (true)
                {
                    var cardData = CardManager.AllCards().ToArray()[rand.Next(CardManager.AllCards().Count)];

                    if (cardData.Rarity == rarity)
                    {
                        bool   isDupe   = CardManager.Cards().Any(item => item.cardId == cardData.GetID());
                        string dupeText = isDupe ? "                 " : rarityNewString[rarity];
                        var    cardText = $"    {dupeText}{cardData.Name.str} ({cardData.Attribute})";
                        foreach (var c in cardText)
                        {
                            Console.Write(c);
                            Thread.Sleep(2);
                        }
                        Console.Write("\n");

                        CardManager.AddCard(cardData);

                        if (cardData.Rarity != RarityType.R)
                        {
                            gotGuaranteedSR = true;
                        }

                        Thread.Sleep(50);
                        break;
                    }
                }
            }
        }
Exemple #2
0
 public override void Run()
 {
     foreach (var card in CardManager.Cards())
     {
         CardManager.PrintCard(card.cardId);
         foreach (var cardData in CardManager.AllCards())
         {
             if (card.cardId == cardData.GetID())
             {
                 Console.WriteLine($"    Printed [{cardData.Rarity}] {cardData.Name.str}");
                 break;
             }
         }
     }
 }
Exemple #3
0
        public override void Run()
        {
            Console.WriteLine("Searching for cards...\n");
            Console.WriteLine("Do you really want all the cards? [yes/no]: ");
            var response = Console.ReadLine();

            if (response == "yes")
            {
                Console.WriteLine("");
                foreach (var cardData in CardManager.AllCards())
                {
                    bool   isDupe   = CardManager.Cards().Any(item => item.cardId == cardData.GetID());
                    string dupeText = isDupe ? "                 " : rarityNewString[cardData.Rarity];
                    var    cardText = $"    {dupeText}{cardData.Name.str} ({cardData.Attribute})";

                    Console.WriteLine(cardText);
                    CardManager.AddCard(cardData);
                    Thread.Sleep(10);
                }
            }
        }