Exemplo n.º 1
0
 private void ShootArrow(int[] rooms)
 {
     Arrows--;
     foreach (int room in rooms)
     {
         Console.WriteLine(room);
         // Shot the wumpus
         if (Map.Wumpus.Position == room)
         {
             Console.WriteLine("Aha! You got the Wumpus!");
             Map.EndGame(true);
             return;
         }
         // Shot yourself
         if (Position == room)
         {
             Console.WriteLine("Ouch! Arrow got you!");
             Map.EndGame(false);
             return;
         }
     }
     Console.WriteLine("Missed!");
     // Ran out of arrows and died
     if (Arrows == 0)
     {
         Console.WriteLine("You ran out of arrows! (and you somehow die from this)");
         Map.EndGame(false);
     }
 }
Exemplo n.º 2
0
 public override void AffectPlayer()
 {
     // Wake up if sleeping
     if (Sleeping)
     {
         Console.WriteLine("... Ooops! Bumped a Wumpus");
         Sleeping = false;
     }
     // Lose the game if awake
     else
     {
         Console.WriteLine("The Wumpus caught you!");
         Map.EndGame(false);
     }
 }
Exemplo n.º 3
0
 public override void AffectPlayer()
 {
     // Lose the game
     Console.WriteLine("YYYIIIIEEEE . . . fell in a pit");
     Map.EndGame(false);
 }