Ejemplo n.º 1
0
    public void Damage(float _damage)
    {
        switch (state)
        {
        case CombatStates.BLOCK:
            // 50% damage
            currHealth -= _damage * blockResist;     // should be resistance val
            break;

        case CombatStates.PARRY:
            // 0% damage
            // 100% damage back to enemy
            NonblockableAttack(_damage);
            state      = CombatStates.NONE;
            parryTimer = 0.0f;
            break;

        default:
            // 100% damage
            currHealth -= _damage;
            break;
        }

        stats.UpdateHealthUI(currHealth);
        DebugMobileManager.Log("Player health is: " + currHealth);
        if (currHealth <= 0)
        {
            UnityEngine.SceneManagement.SceneManager.LoadScene(0);
            DebugMobileManager.Log("GAME OVER");
        }
    }