Beispiel #1
0
    public void InflictDamage(GameObject source, float amount)
    {
        if (_invincible)
        {
            return;
        }

        currentHealth -= amount;

        for (int i = 0; i < amount; i++)
        {
            heartMeter.RemoveHalfHeart();
        }

        Vector3 bloodPos = transform.position;

        TheBloodenerScript.MakeBlood(bloodPos);

        if (currentHealth <= 0)
        {
            Kill();
        }
        else
        {
            _playerMover.DamageKnockBack(source);
            Invincible(invincibleTime);
        }
    }
Beispiel #2
0
    public void Kill()
    {
        Vector3 bloodPos = transform.position;

        TheBloodenerScript.MakeBlood(bloodPos);
        TheBloodenerScript.MakeBlood(bloodPos);
        TheBloodenerScript.MakeBlood(bloodPos);

        currentHealth = 0;
        heartMeter.RemoveAllHearts();
        DeactivatePlayer();
    }
Beispiel #3
0
    public override void Kill()
    {
        _collider.enabled = false;

        Vector3 bloodPos = transform.position;

        bloodPos.y -= 0.3f;
        TheBloodenerScript.MakeBlood(bloodPos);
        TheBloodenerScript.MakeBlood(bloodPos);
        TheBloodenerScript.MakeBlood(bloodPos);

        Destroy(gameObject);
    }
Beispiel #4
0
    public override void InflictDamage(float value)
    {
        currentHealth -= value;

        Vector3 bloodPos = transform.position;

        bloodPos.y -= 0.3f;
        TheBloodenerScript.MakeBlood(bloodPos);

        if (currentHealth <= 0)
        {
            Kill();
        }
    }