Beispiel #1
0
 public void Shell()
 {
     Console.WriteLine("Welcome to SHELL!!!");
     Console.WriteLine("---------------------\nPress Enter to continue");
     Console.ReadLine();
     Console.WriteLine($"Your health is at {character.Storage.Health -= 15}%");
     Console.WriteLine($"Your fuel is at {character.Storage.Fuel -= 25}%");
     Console.WriteLine($"You have {character.Storage.Coin} coins\nPress Enter to Continue.");
     Console.ReadLine();
     Console.Clear();
     p.marketShell();
 }
Beispiel #2
0
 //Planet Shell
 public void calFuel(Character character)
 {
     try
     {
         double fuel = 100;
         Console.WriteLine("How many do you want to buy?");
         double n = double.Parse(Console.ReadLine());
         if (character.Storage.Coin < fuel)
         {
             Console.WriteLine("Insuficient Funds you cannot buy this item. Please choose a different item.\n Press Enter to continue");
             Console.ReadLine();
             Console.Clear();
             p.marketShell();
         }
         else
         {
             character.Storage.Coin -= n * fuel;
         }
         character.Storage.Fuel += 50 * n;
         Console.WriteLine($"You now have {character.Storage.Coin} coins.");
         Console.WriteLine($"Your Fuel is now at {character.Storage.Fuel}%");
         Console.ReadLine();
     }
     catch (Exception)
     {
         Console.WriteLine("Wrong input use numbers");
         calFuel(character);
     }
 }