示例#1
0
        public static void DemonstrateConsumables()
        {
            Console.WriteLine("Items: \nPotion\nStatus Potion\nCharacter Candy\nGood");
            Character a = CharacterCreator();

            Console.WriteLine("\n" + a.ToString() + "\n");
            int demCon = rand.Next(4);

            switch (demCon)
            {
            case 0:
                Potion p = HealGenerator();
                Console.WriteLine(p.ToString());
                p.Use(a);
                break;

            case 1:
                CharacterCandy cc = CandyGen();
                Console.WriteLine(cc.ToString());
                cc.Use(a);
                break;

            case 2:
                Good g = GoodGen();
                Console.WriteLine(g.ToString());
                g.Use(a);
                break;

            case 3:
                StatusPotion sp = StatusGenerator();
                Console.WriteLine(sp.ToString());
                sp.Use(a);
                break;

            default:
                break;
            }
            Console.WriteLine("\n" + a.ToString() + "\n");
            int choice = CIO.PromptForInt("Would You Like To Attack? 1. Yes 2. No Please Entre Input: ", 1, 2);

            if (choice == 1)
            {
                int damage = a.Attack();
                a.TakeDamage(damage);
                Console.WriteLine();
                Console.WriteLine(a.GetType().Name + " did " + damage + " points of damage to themself.\n");
                Console.WriteLine(a.ToString() + "\n");
            }
            Run();
        }
示例#2
0
        public static StatusPotion StatusGenerator()
        {
            int           value = rand.Next(1, 5);
            List <string> Name  = new List <string>
            {
                "Strength",
                "Dexterity",
                "Intelligence"
            };
            string       name = Name[rand.Next(Name.Count)];
            StatusPotion sp   = new StatusPotion(name, value);

            return(sp);
        }