コード例 #1
0
ファイル: CombatLauncher.cs プロジェクト: Shaunf17/Adventure
        public void Combat(Character enemy, Player player)
        {
            enemy = new Goblin();

            Console.Write("You come across a ");
            Colour.Set("red");
            Console.WriteLine(enemy.Name);

            while (enemy.Health > 0)
            {
                Colour.Set("white");
                Console.WriteLine("What do you do?");

                string combatInput = Console.ReadLine();

                switch (combatInput)
                {
                case "attack":
                    CombatLog(player, player.NormalAttack(), enemy);
                    break;

                case "run":
                    //Run();
                    break;
                }
                Console.WriteLine("");
                CombatLog(enemy, enemy.AttackPower, player);
            }

            Console.WriteLine(string.Format("{0} Defeated!", enemy.Name));
        }