예제 #1
0
        private static void TreadDownPath()
        {
            Console.WriteLine("You decide to not enter the cave. Contining down the path you run into a giant scorpion. Do you [kill] it or [scamper] past it down the path?");
            var choice = Console.ReadLine();

            if (choice.Equals("kill"))
            {
                var scorpion = new Enemy
                {
                    Name       = "The Giant Scorpion",
                    EnemyClass = "scorpion",
                    Health     = 8,
                };
                scorpion.Weapons.Add(new Weapon {
                    Name   = "barbed stinger",
                    Damage = 4
                });
                scorpion.Weapons.Add(new Weapon
                {
                    Name   = "pincer claws",
                    Damage = 3
                });

                var result = _battleService.Fight(PlayerOne, scorpion);
                if (result.Equals(BattleResult.PlayerWon))
                {
                    Console.WriteLine("You slay the giant scorpion!");
                }
                else
                {
                    Console.WriteLine("The giant scorion has cut you in half. You quickly bled out and died. Game over!");
                }
            }
            else if (choice.Equals("scamper"))
            {
                Console.WriteLine("You scamper past the giant scorpion");
            }
            else
            {
                Console.WriteLine("Invalid choice. You died.");
            }
        }