示例#1
0
    public override void TakeDamage(HitboxValues hitbox, Entity attacker)
    {
        EnableHitstun(hitbox.hitstunTime, hitbox.ignoreArmor);
        GlobalState.state.AudioManager.FloatingEnemyHurtAudio(this.transform.position);
        base.TakeDamage(hitbox, attacker);

        for (int i = 0; i < _healthBar.transform.childCount; i++)
        {
            _healthBar.transform.GetChild(i).gameObject.SetActive(true);
        }
    }
示例#2
0
    public override void Damage(HitboxValues hitbox)
    {
        _healTimer = new Timer(_timeBeforeHeal);

        CurrentHealth += hitbox.damageValue;
        if (HealthBar != null)
        {
            HealthBar.SetValue(CurrentHealth);
        }
        ActivateBuffs();
        UpdateHealthTier();
    }
示例#3
0
    public override void TakeDamage(HitboxValues hitbox, Entity attacker)
    {
        EnableHitstun(hitbox.hitstunTime, hitbox.ignoreArmor);
        base.TakeDamage(hitbox, attacker);

        // Instantiate(_hurtVFX, this.transform.position + new Vector3(0, 1.5f, 0), this.transform.rotation); ;

        if (hitbox.damageValue > 5)
        {
            GlobalState.state.AudioManager.FloatingEnemyHurtAudio(this.transform.position);
        }

        for (int i = 0; i < _healthBar.transform.childCount; i++)
        {
            _healthBar.transform.GetChild(i).gameObject.SetActive(true);
        }
    }
示例#4
0
 public void HitStop(HitboxValues values)
 {
     /*
      * float duration = 0.0f;
      * if (values.damageValue >= _maxDamageHitstopThreshold)
      * {
      *  duration = _maxHitstopTime;
      * }
      * else
      * {
      *  float fraction = values.damageValue / _maxDamageHitstopThreshold;
      *  duration = Mathf.Lerp(_minHitstopTime, _maxHitstopTime, fraction >= 1 ? 1.0f : fraction);
      *  print(duration);
      * }
      */
     StartCoroutine(HitStopCoroutine(values.hitstopTime));
 }
示例#5
0
    private void TakeDamage(Entity target, HitboxValues hitbox)
    {
        if (_parentEntity != null && _parentEntity.modifier != null)
        {
            target.TakeDamage(hitbox * _parentEntity.modifier, _parentEntity);
        }
        else
        {
            target.TakeDamage(hitbox, _parentEntity);
        }

        if (hitbox.hitstopTime > 0)
        {
            if (_parentEntity != null && _parentEntity.GetType() == typeof(PlayerRevamp)) // if the player is attacking, temporary solution
            {
                GlobalState.state.HitStop(hitbox);
            }
            else
            {
                if (hitbox.parryable && target.GetType() == typeof(PlayerRevamp)) // if player is the reciever and is parrying
                {
                    if (!(target as PlayerRevamp).isParrying)
                    {
                        GlobalState.state.HitStop(hitbox);
                    }
                    else
                    {
                        // GlobalState.state.HitStop(hitbox.hitstopTime, hitbox); // parry time
                    }
                }
                else
                {
                    GlobalState.state.HitStop(hitbox);
                }
            }
        }
    }
示例#6
0
 public override void Damage(HitboxValues hitbox)
 {
     CurrentHealth -= hitbox.damageValue;
 }
示例#7
0
文件: Entity.cs 项目: Brenstem/Mara
 public abstract void TakeDamage(HitboxValues hitbox, Entity attacker = null);
示例#8
0
 //basicly lägg in attackstates här och ändra hur den gör skit
 public override void TakeDamage(HitboxValues hitbox, Entity attacker)
 {
     throw new System.NotImplementedException();
 }
示例#9
0
 public override void TakeDamage(HitboxValues hitbox, Entity attacker)
 {
     health.Damage(hitbox);
 }
示例#10
0
 public abstract void Damage(HitboxValues hitbox);