示例#1
0
        // Advantage is player advantage, who attacked first
        private void BattleLoop
            (Player p, AbstractEnemy enemy, bool advantage, AbstractArea area)
        {
            rnd.DisplayGameMode(area.GameState);

            if (advantage)
            {
                // Player attack with advantage
            }
            while (enemy.Health > 0)
            {
                Console.WriteLine("You are being attacked");
                enemy.AttackBehaviour.Attack(p, enemy);

                if (p.HP < 0)
                {
                    break;
                }

                rnd.BattleFeed(p, enemy);
                // Player attack menu
            }
        }
示例#2
0
        // Player actions

        // Attack
        public void Attack(AbstractEnemy enemy)
        {
            enemy.Health--;
        }
示例#3
0
 public void BattleFeed(Player p, AbstractEnemy e)
 {
     Console.WriteLine($"Your HP: {p.HP}");
 }