Пример #1
0
    void Update()
    {
        Debug.Log(currentState);
        CheckHealth(); //cannot let hp go over max
        //Debug.Log(currentBattleNumber);
        if (Input.GetKey("escape"))
        {
            Application.Quit();
        }
        switch (currentState)
        {
        case (BattleStates.START):
            //SETUP BATTLE FUNCTIONS
            if (currentBattleNumber == BattleNumber.ONE)
            {
                battleStateStartScript.PrepareBattle1();
            }
            else if (currentBattleNumber == BattleNumber.TWO)
            {
                battleStateStartScript.PrepareBattle2();
            }
            else if (currentBattleNumber == BattleNumber.THREE)
            {
                battleStateStartScript.PrepareBattle3();
            }
            turnCount = 1;
            break;

        case (BattleStates.PLAYERCHOICE):
            break;

        case (BattleStates.ENEMYCHOICE):
            if (currentBattleNumber == BattleNumber.ONE)
            {
                battleStateStartScript.enemyChoiceScript.EnemyAction(BattleStateStart.Enemy1, BattleStateStart.Enemy2);
            }
            break;

        case (BattleStates.CALCDAMAGE):
            //playerdamage
            battleCalcScript.CalculatePlayerForTurn(usedAbilities[0], usedAbilities[1], usedAbilities[2]);
            //enemy damage
            break;

        case (BattleStates.ENDTURN):
            //count buffs
            turnCount++;
            PlayerParty.Warrior.CurrentTech += 10;
            CheckBuffs();
            currentState = BattleStates.PLAYERCHOICE;
            break;

        case (BattleStates.LOSE):
            Debug.Log("You lose.....");
            break;

        case (BattleStates.WIN):
            Debug.Log("You won.....");
            break;
        }
    }