public void TraceAttack(CDamageInfo info) { if (!HasFlag(FL_NODAMAGE)) { m_iHealth -= info.GetDamage(); CalculateDeath(); OnTakeDamage(info); if (IsDead()) { OnKilled(info); info.GetAttacker().OnKilledOther(info); } else { OnTakeDamageAlive(info); } } }
public void OnKilledOther(CDamageInfo info) { }
} //called after OnTakeDamage(..), only if still alive public void OnKilled(CDamageInfo info) { CalculateNextRespawnTime(); obj().SetActive(false); }
} //Called after damage is subtracted from health public void OnTakeDamageAlive(CDamageInfo info) { } //called after OnTakeDamage(..), only if still alive
public void OnTakeDamage(CDamageInfo info) { } //Called after damage is subtracted from health
public void Kill() { CDamageInfo info = new CDamageInfo(m_iHealth, this, GetPosition()); TraceAttack(info); }