예제 #1
0
        static void PlayerTurn()
        {
            bool TurnDone = false;

            while (!TurnDone)
            {
                List <string> ViableOptions = new List <string>();
                for (int x = 0; x < FightOptionCosts.Count; x++)
                {
                    if (Player.GetStamina() >= FightOptionCosts[x])
                    {
                        ViableOptions.Add(FightOptions[x]);
                    }
                }
                IO.Options(ViableOptions);
                int Input = MainClass.ChatInput(ViableOptions.Count) + (FightOptions.Count - ViableOptions.Count);
                IO.Options(null);
                int TargetEnemy = 0;
                switch (Input)
                {
                case 1:
                    if (Player.GetStamina() >= FightOptionCosts[Input - 1])
                    {
                        Player.SetStamina(Player.GetStamina() - FightOptionCosts[Input - 1]);
                        TargetEnemy = WhichEnemy();
                        AttackEnemy(TargetEnemy, "Heavy");
                    }
                    else
                    {
                        string Update = "Not Enough Stamina!";
                        IO.GameUpdate(Update);
                    }
                    break;

                case 2:
                    if (Player.GetStamina() >= FightOptionCosts[Input - 1])
                    {
                        Player.SetStamina(Player.GetStamina() - FightOptionCosts[Input - 1]);
                        TargetEnemy = WhichEnemy();
                        AttackEnemy(TargetEnemy, "Light");
                    }
                    else
                    {
                        string Update = "Not Enough Stamina!";
                        IO.GameUpdate(Update);
                    }
                    break;

                case 3:
                    if (Player.GetStamina() >= FightOptionCosts[Input - 1])
                    {
                        Player.SetStamina(Player.GetStamina() - FightOptionCosts[Input - 1]);
                        HealthPotion();
                    }
                    else
                    {
                        string Update = "Not Enough Stamina!";
                        IO.GameUpdate(Update);
                    }
                    break;

                case 4:
                    TurnDone = true;
                    break;

                default:
                    break;
                }
                IO.PlayerStamina(Player.GetStamina(), Player.GetStaminaMax());
                if (!TurnDone)
                {
                    TurnDone = CheckFightStatus();
                    if (!TurnDone && Player.GetStamina() < 3)
                    {
                        TurnDone = true;
                        Thread.Sleep(Settings.GetPauseTime());
                    }
                }
            }
            Player.SetStamina(Player.GetStaminaMax());
            IO.PlayerStamina(Player.GetStamina(), Player.GetStaminaMax());
        }