/// <summary> /// Logs a damaging event for this player or creature /// </summary> /// <param name="source">The attacker or source of damage</param> /// <param name="amount">The amount of damage hit for</param> public void Add(WorldObject attacker, DamageType damageType, uint amount) { //Console.WriteLine($"{Creature.Name}.DamageHistory.Add({attacker.Name}, {damageType}, {amount})"); if (amount == 0) { return; } var entry = new DamageHistoryEntry(Creature, attacker.Guid, damageType, -(int)amount); Log.Add(entry); AddInternal(attacker, amount); }
/// <summary> /// Logs a damaging event for this player or creature /// </summary> /// <param name="source">The attacker or source of damage</param> /// <param name="amount">The amount of damage hit for</param> public void Add(WorldObject damager, DamageType damageType, uint amount) { //Console.WriteLine($"DamageHistory.Add({Creature.Name}, {amount})"); if (amount == 0) { return; } var entry = new DamageHistoryEntry(Creature, damager, damageType, -(int)amount); Log.Add(entry); AddInternal(damager, amount); TryPrune(); }