示例#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 CharacterCandy CandyGen()
        {
            List <string> Name = new List <string>
            {
                "Penguin",
                "Elf",
                "Human",
                "Aurin",
                "Granok",
                "Mordesh",
                "Dwarf",
                "Pandaren"
            };
            string         name  = Name[rand.Next(Name.Count)];
            int            value = rand.Next(1000, 5000);
            CharacterCandy cC    = new CharacterCandy(name, value);

            return(cC);
        }