Esempio n. 1
0
    private void FastPlay()
    {
        int chance;

        switch (currentTurn)
        {
        case Turn.PALADIN:
        {
            if (paladinController.GetSpecial() == 5)
            {
                OnSpecial();
            }
            else
            {
                if (paladinController.GetHealth() < 1500)
                {
                    paladinController.StartCoroutine(paladinController.OnPotion(3750));
                }
                chance = Random.Range(1, 3);
                if (chance == 1)
                {
                    paladinController.StartCoroutine(paladinController.OnMagic());
                }
                else
                {
                    paladinController.StartCoroutine(paladinController.OnAttack());
                }
            }
        }
        break;

        case Turn.VALKYRIE:
        {
            if (valkyrieController.GetSpecial() == 5)
            {
                OnSpecial();
            }
            else
            {
                if (valkyrieController.GetHealth() < 1500)
                {
                    valkyrieController.StartCoroutine(valkyrieController.OnPotion(3750));
                }
                chance = Random.Range(1, 3);
                if (chance == 1)
                {
                    valkyrieController.StartCoroutine(valkyrieController.OnMagic(Random.Range(1, 3) + 1));
                }
                else
                {
                    valkyrieController.StartCoroutine(valkyrieController.OnAttack());
                }
            }
        }
        break;

        case Turn.SAGE:
        {
            if (sageController.GetSpecial() == 5)
            {
                OnSpecial();
            }
            else
            {
                if (sageController.GetHealth() < 1500)
                {
                    sageController.StartCoroutine(sageController.OnPotion(3750));
                }
                chance = Random.Range(1, 3) + 1;
                if (chance == 1 || chance == 2)
                {
                    sageController.StartCoroutine(sageController.OnMagic(Random.Range(1, 3) + 1));
                }
                else
                {
                    sageController.StartCoroutine(sageController.OnAttack());
                }
            }
        }
        break;
        }
    }