IEnumerator PlayerHeal()
    {
        playerStats.Heal(10);
        playerHud.SetHp(playerStats.hpCurrent);
        trackerText.text = "You heal 10 points!";
        yield return(new WaitForSeconds(2f));

        combatState = CombatSystem.EnemyTurn;
        StartCoroutine(EnemyTurn());
    }
Example #2
0
    IEnumerator PlayerHeal()
    {
        Instantiate(healEffect, playerSpawn.transform.position, Quaternion.identity);
        playerStats.Heal(10);
        playerHud.SetHp(playerStats.hpCurrent);
        trackerText.text = "You heal 10 points!";
        yield return(new WaitForSeconds(2f));

        combatState = CombatSystem.EnemyTurn;
        StartCoroutine(EnemyTurn());
    }
Example #3
0
    IEnumerator PlayerAttack()
    {
        playerStats.damage = Random.Range(1, 16);
        bool isDead = enemyStats.AttackDamage(playerStats.damage);

        enemyHud.SetHp(enemyStats.hpCurrent);
        trackerText.text = "You deal " + playerStats.damage.ToString() + " damage!";
        yield return(new WaitForSeconds(2f));

        if (isDead)
        {
            combatState = CombatSystem.Win;
            EndFight();
        }

        else
        {
            combatState = CombatSystem.EnemyTurn;
            StartCoroutine(EnemyTurn());
        }
    }