Ejemplo n.º 1
0
 internal override bool ItemPriceDecisions(TheGame game)
 {
     if (game.playerGold < price)
     {
         TypeWriter.WriteLine("Sorry but you don't have the required gold");
         return(false);
     }
     else
     {
         game.playerGold -= price;
         return(true);
     }
 }
Ejemplo n.º 2
0
 internal override bool DoVerb(string verb, TheGame game)
 {
     if (isSynonymFor(verb, "equip"))
     {
         TypeWriter.WriteLine();
         TypeWriter.WriteLine(new Text($"You {verb} the "),
                              name,
                              new Text(" and you feel cool"));
         if (game.playerWeapon != null)
         {
             game.AddToInventory(game.playerWeapon);
             game.playerWeapon = this;
         }
         else
         {
             game.playerWeapon = this;
         }
         TypeWriter.WriteLine();
         game.playerStats();
         return(true);
     }
     return(false);
 }