37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
public class GameRunner {
|
|
static void Main(string[] args) {
|
|
Player player = new Player("Hero", 100, 15);
|
|
player.AddToInventory("potion");
|
|
player.AddToInventory("sword");
|
|
|
|
Enemy goblin = new Enemy("Goblin", 40, 8, EnemyType.Normal);
|
|
Enemy dragon = new Enemy("Dragon", 120, 25, EnemyType.Boss);
|
|
|
|
var battle = new BattleService();
|
|
|
|
Console.WriteLine("=== GAME START ===");
|
|
player.Describe();
|
|
goblin.Describe();
|
|
|
|
Console.WriteLine("\n-- Round 1 --");
|
|
battle.PlayerAttacks(player, goblin);
|
|
battle.EnemyAttacks(goblin, player);
|
|
battle.PlayerAttacks(player, goblin);
|
|
|
|
Console.WriteLine("\n-- Round 2 --");
|
|
player.Describe();
|
|
player.Heal();
|
|
|
|
Console.WriteLine("\n-- Boss Fight --");
|
|
dragon.Describe();
|
|
battle.PlayerAttacks(player, dragon);
|
|
battle.EnemyAttacks(dragon, player);
|
|
battle.PlayerAttacks(player, dragon);
|
|
battle.EnemyAttacks(dragon, player);
|
|
battle.PlayerAttacks(player, dragon);
|
|
|
|
|
|
Console.WriteLine("\n=== RESULT ===");
|
|
player.Describe();
|
|
}
|
|
} |