コード例 #1
0
ファイル: Shop.cs プロジェクト: RoyWemmers/tba
 public void BuyHealthPotion(ref Player player, ref HealthPotion hp)
 {
     if (player.GetGold() > 10)
     {
         player.SetGold(-10);
         player.PickupItem(hp);
         player.ShowInventory();
     }
     else
     {
         Console.WriteLine("You don't have enough gold!");
     }
 }
コード例 #2
0
 public void StartEncouter(ref Player player, ref Map map)
 {
     Console.WriteLine("The Blood Drake Attacks!");
     do
     {
         Program.HealthUI("Blood Drake", health, maxHealth, stamina, maxStamina, 10);
         CastAbility(ref player);
         FightUI fui = new FightUI();
         health -= fui.ShowFightUI(ref player);
         Console.Clear();
     } while (health > 1);
     Console.WriteLine("The Blood Drake falls down from the sky!");
     Console.ReadLine();
     Console.Clear();
     Console.WriteLine("Congrats! You've defeated the Blood Drake!");
     player.SetGold(10);
     player.SetStamina(-player.GetMaxStamina());
     Console.WriteLine("You get 10G loot!");
 }
コード例 #3
0
 public void StartEncounter(ref Player player, ref Map map)
 {
     Console.WriteLine("The Angry Man Attacks!");
     do
     {
         Program.HealthUI("Angry Man", health, maxHealth, stamina, maxStamina, 10);
         CastAbility(ref player);
         FightUI fui = new FightUI();
         health -= fui.ShowFightUI(ref player);
         Console.Clear();
     } while (health > 1);
     Console.WriteLine("The angry man is knocked down..");
     player.ResetStamina(ref player);
     Console.WriteLine("As his head bounces against the floor he stops breathing.. ");
     Console.ReadLine();
     Console.Clear();
     Console.WriteLine("Congrats! You've killed an innocent man in his own house!");
     Console.WriteLine("");
     player.SetGold(20);
     Console.WriteLine("You stole 20 gold from the man!");
     Console.WriteLine("Press enter to continue...");
     Console.ReadLine();
 }