示例#1
0
        public static void StartGame(Player player, Monster monster)
        {
            //Monster monster = new Monster();
            // monster.GetMonster();
            Generate.Monster(monster);


            Console.WriteLine("You see a " + monster.Name);

            Console.WriteLine();



            //          Combat combat = new Combat();



            while (0 < monster.Health)
            {
                StatBar.DisplayStatBar(player, monster);

                //move to seperate method Combat.Menu() ??
                Console.WriteLine("Combat Menu:");
                Console.WriteLine("a) Attack");
                Console.WriteLine("h) 60% Heal Potion\t\t\t" + HealthPotion.Quantity + " available");
                Console.WriteLine("s) Magic Shield Scroll (50 points)\t" + Scroll.MagicShieldScrollCount + " available");
                Console.WriteLine("d) Death Scroll (Instant Kill)\t\t" + Scroll.DeathScrollCount + " available");
                Console.WriteLine();
                Console.WriteLine("c) Character Sheet");
                Console.WriteLine("i) Inventory");


                ConsoleKey aInput = Console.ReadKey().Key;
                if (aInput == ConsoleKey.Escape)
                {
                    Console.WriteLine("x"); //Escape key seems to delete the first character of the next line
                    Console.WriteLine("are you sure you want to Quit playing? (press Y for yes");

                    ConsoleKey bInput = Console.ReadKey().Key;
                    if (bInput == ConsoleKey.Y)
                    {
                        Environment.Exit(0);
                    }
                }
                if (aInput == ConsoleKey.A)
                {
                    Combat.Start(player, monster);
                }
                if (aInput == ConsoleKey.H)
                {
                    HealthPotion.Cast(player);
                }
                if (aInput == ConsoleKey.S)
                {
                    Scroll.MagicShield(player);
                    Combat.MonsterAttack(player, monster); // attack of opportunity ??
                }
                if (aInput == ConsoleKey.C)
                {
                    CharacterSheet.Display(player);
                }
                if (aInput == ConsoleKey.D)
                {
                    Scroll.Death(monster);
                    Combat.MonsterAttack(player, monster); // attack of opportunity ?? - may need removed - monster should be dead so it is redundant
                }
                if (aInput == ConsoleKey.I)
                {
                    Inventory.Display(player);
                }
            }

            Console.WriteLine("you have slain the " + monster.Name);
            Loot.Roll(player, monster);
            //Generate.Armor();
        }