Exemple #1
0
    public void TakeDamageRPC(float amount)
    {
        // Special conditions
        if (statusController.freeze)
        {
            statusController.CleanFreeze();
        }
        if (statusController.parry)
        {
            statusController.ParryHit();
            return;
        }
        if (statusController.invisible)
        {
            statusController.CleanInvisible();
            return;
        }

        currentHealth -= amount;
        if (currentHealth < 0)
        {
            currentHealth = 0;
        }
        if (currentHealth == 0 && isAlive)
        {
            Die();
        }
    }