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); } }
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); } }
public override void AffectPlayer() { // Lose the game Console.WriteLine("YYYIIIIEEEE . . . fell in a pit"); Map.EndGame(false); }