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); } }
public override void Damage(HitboxValues hitbox) { _healTimer = new Timer(_timeBeforeHeal); CurrentHealth += hitbox.damageValue; if (HealthBar != null) { HealthBar.SetValue(CurrentHealth); } ActivateBuffs(); UpdateHealthTier(); }
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); } }
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)); }
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); } } } }
public override void Damage(HitboxValues hitbox) { CurrentHealth -= hitbox.damageValue; }
public abstract void TakeDamage(HitboxValues hitbox, Entity attacker = null);
//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(); }
public override void TakeDamage(HitboxValues hitbox, Entity attacker) { health.Damage(hitbox); }
public abstract void Damage(HitboxValues hitbox);