Beispiel #1
0
        public static void CombatEnemyTurn()
        {
            Console.Clear();
            Phase = "CombatEnemyTurn";
            if (room == 6)
            {
                DM.ShowBattleUITurn(player, floorBoss, 1, true);
            }
            else
            {
                DM.ShowBattleUITurn(player, roomMonster, 1, false);
            }
            Thread.Sleep(2000);
            int damage;

            if (room == 6)
            {
                damage = EM.CalculateBossMonsterDamage(floorBoss, player);
            }
            else
            {
                damage = EM.CalculateMonsterDamage(roomMonster, player);
            }

            player.CurrentHealth -= damage;
            Console.Clear();
            Console.WriteLine("You took " + damage + " points of damage");
            Thread.Sleep(2000);
            if (EM.CheckGameOver(player))
            {
                GameOver();
            }
            else
            {
                CombatPlayerTurn();
            }
        }
Beispiel #2
0
        public static void RoomEnter()
        {
            Phase = "RoomEnter";
            room++;
            if (room == 8) // finished large treasure room after boss
            {
                room = 0;
                floor++;
                player.CurrentHealth = player.Health;
                player.CurrentMana   = player.Mana;
            }
            if (room == 3 || room == 7) // treasure room
            {
                if (room == 3)          // Regular treasure room
                {
                    List <object> treasure = LM.GenerateTreasure(2, floor, new Random());
                    foreach (object t in treasure)
                    {
                        player.Inventory.Add(t);
                    }
                    DM.DisplayTreasure(treasure);
                    RoomFinish();
                }
                else // Large treasure room
                {
                    List <object> treasure = LM.GenerateTreasure(4, floor, new Random());
                    foreach (object t in treasure)
                    {
                        player.Inventory.Add(t);
                    }
                    DM.DisplayTreasure(treasure);
                    RoomFinish();
                }
            }
            else if (room == 6) // boss room
            {
                floorBoss = EM.GetBossMonster(floor);

                if (player.Dexterity > floorBoss.Dexterity || player.Dexterity == floorBoss.Dexterity)
                {
                    CombatPlayerTurn();
                }
                else if (player.Dexterity < floorBoss.Dexterity)
                {
                    CombatEnemyTurn();
                }
            }
            else if (room == 0) // start of new floor
            {
                RoomFinish();
            }
            else // monster room
            {
                roomMonster = EM.GetMonster(floor);

                if (player.Dexterity > roomMonster.Dexterity || player.Dexterity == roomMonster.Dexterity)
                {
                    CombatPlayerTurn();
                }
                else if (player.Dexterity < roomMonster.Dexterity)
                {
                    CombatEnemyTurn();
                }
            }
        }