Пример #1
0
 public static void ProcCommand(string command)
 {
     command = command.ToLower();
     if (Phase == null)
     {
         if (command == "debug")
         {
         }
     }
     else if (subPhase == "Equipping")
     {
         subPhaseEquipping.Parse(command);
     }
     else if (subPhase == "SlotSelection")
     {
         subPhaseSlotSelection.Parse(command);
     }
     else if (subPhase == "Inspecting")
     {
         DM.InspectItem(command);
     }
     else if (subPhase == "Modules")
     {
         subPhaseModules.Parse(command);
     }
     else if (subPhase == "LoadUnload")
     {
         subPhaseLoadUnload.Parse(command);
     }
     else if (subPhase == "StatUpgrade")
     {
         subPhaseStatUpgrade.Parse(command);
     }
     else if (Phase == "Menu")
     {
         phaseMenu.Parse(command);
     }
     else if (Phase == "Init")
     {
         //
     }
     else if (Phase == "RoomFinish")
     {
         phaseRoomFinish.Parse(command);
     }
     else if (Phase == "RoomEnter")
     {
         phaseRoomEnter.Parse(command);
     }
     else if (Phase == "CombatPlayerTurn")
     {
         phaseCombatPlayerTurn.Parse(command);
     }
     else if (Phase == "CombatEnemyTurn")
     {
         // hackerman
     }
 }
Пример #2
0
 public static void CombatPlayerTurn()
 {
     Console.Clear();
     Phase = "CombatPlayerTurn";
     if (room == 6)
     {
         DM.ShowBattleUITurn(player, floorBoss, 0, true);
     }
     else
     {
         DM.ShowBattleUITurn(player, roomMonster, 0, false);
     }
 }
Пример #3
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();
            }
        }
Пример #4
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();
                }
            }
        }