예제 #1
0
    private IEnumerator StandardAttack()
    {
        animationController.Play("Attack Animation");

        yield return(new WaitForSeconds(1));

        if (turnController.GetForestConversion())
        {
            damageText.text = "FOREST CONVERSION";

            damageText.enabled = true;

            yield return(new WaitForSeconds(1));

            StartCoroutine(TakeDamage(Random.Range(attackPower - (attackPower / 2), attackPower + (attackPower / 2)), false));

            yield return(new WaitForSeconds(1));

            damageText.enabled = false;

            turnController.SetForestConversion(true);
        }
        else
        {
            chance = Random.Range(1, 3);

            switch (chance)
            {
            case 1:
                paladinController.StartCoroutine(paladinController.TakeDamage(Random.Range(attackPower - (attackPower / 2), attackPower + (attackPower / 2))));
                break;

            case 2:
                valkyrieController.StartCoroutine(valkyrieController.TakeDamage(Random.Range(attackPower - (attackPower / 2), attackPower + (attackPower / 2))));
                break;

            case 3:
                sageController.StartCoroutine(sageController.TakeDamage(Random.Range(attackPower - (attackPower / 2), attackPower + (attackPower / 2))));
                break;
            }
        }
    }