diff --git a/EOLib/Domain/Notifiers/IMainCharacterEventNotifier.cs b/EOLib/Domain/Notifiers/IMainCharacterEventNotifier.cs index 97071f6e5..be207f3c6 100644 --- a/EOLib/Domain/Notifiers/IMainCharacterEventNotifier.cs +++ b/EOLib/Domain/Notifiers/IMainCharacterEventNotifier.cs @@ -7,7 +7,7 @@ public interface IMainCharacterEventNotifier { void NotifyGainedExp(int expDifference); - void NotifyTakeDamage(int damageTaken, int playerPercentHealth); + void NotifyTakeDamage(int damageTaken, int playerPercentHealth, bool isHeal); void TakeItemFromMap(short id, int amountTaken); } @@ -17,7 +17,7 @@ public class NoOpMainCharacterEventNotifier : IMainCharacterEventNotifier { public void NotifyGainedExp(int expDifference) { } - public void NotifyTakeDamage(int damageTaken, int playerPercentHealth) { } + public void NotifyTakeDamage(int damageTaken, int playerPercentHealth, bool isHeal) { } public void TakeItemFromMap(short id, int amountTaken) { } } diff --git a/EOLib/PacketHandlers/Effects/MapDebuffHandler.cs b/EOLib/PacketHandlers/Effects/MapDebuffHandler.cs index 5218b894d..8d42c215a 100644 --- a/EOLib/PacketHandlers/Effects/MapDebuffHandler.cs +++ b/EOLib/PacketHandlers/Effects/MapDebuffHandler.cs @@ -67,7 +67,7 @@ public override bool HandlePacket(IPacket packet) _characterRepository.MainCharacter = character; foreach (var notifier in _mainCharacterEventNotifiers) - notifier.NotifyTakeDamage(damage, (int)Math.Round((double)hp / maxHp) * 100); + notifier.NotifyTakeDamage(damage, (int)Math.Round((double)hp / maxHp) * 100, isHeal: false); } break; default: diff --git a/EOLib/PacketHandlers/Effects/MapHpDrainHandler.cs b/EOLib/PacketHandlers/Effects/MapHpDrainHandler.cs index 412e2afb3..96da8ef16 100644 --- a/EOLib/PacketHandlers/Effects/MapHpDrainHandler.cs +++ b/EOLib/PacketHandlers/Effects/MapHpDrainHandler.cs @@ -42,7 +42,7 @@ public override bool HandlePacket(IPacket packet) _characterRepository.MainCharacter = _characterRepository.MainCharacter.WithDamage(damage, hp == 0); foreach (var notifier in _mainCharacterEventNotifiers) - notifier.NotifyTakeDamage(damage, (int)Math.Round((double)hp / maxhp)); + notifier.NotifyTakeDamage(damage, (int)Math.Round((double)hp / maxhp), isHeal: false); while (packet.ReadPosition != packet.Length) { diff --git a/EOLib/PacketHandlers/NPCActionHandler.cs b/EOLib/PacketHandlers/NPCActionHandler.cs index ab50e8932..ccaccda46 100644 --- a/EOLib/PacketHandlers/NPCActionHandler.cs +++ b/EOLib/PacketHandlers/NPCActionHandler.cs @@ -131,7 +131,7 @@ private Optional HandleNPCAttack(IPacket packet, INPC npc) _characterRepository.MainCharacter = characterToUpdate.WithStats(stats).WithRenderProperties(props); foreach (var notifier in _mainCharacterNotifiers) - notifier.NotifyTakeDamage(damageTaken, playerPercentHealth); + notifier.NotifyTakeDamage(damageTaken, playerPercentHealth, isHeal: false); } else { diff --git a/EndlessClient/Subscribers/MainCharacterEventSubscriber.cs b/EndlessClient/Subscribers/MainCharacterEventSubscriber.cs index 559fa2b71..c1905e1f9 100644 --- a/EndlessClient/Subscribers/MainCharacterEventSubscriber.cs +++ b/EndlessClient/Subscribers/MainCharacterEventSubscriber.cs @@ -43,12 +43,12 @@ public void NotifyGainedExp(int expDifference) _chatRepository.AllChat[ChatTab.System].Add(chatData); } - public void NotifyTakeDamage(int damageTaken, int playerPercentHealth) + public void NotifyTakeDamage(int damageTaken, int playerPercentHealth, bool isHeal) { if (_characterRendererProvider.MainCharacterRenderer == null) return; - _characterRendererProvider.MainCharacterRenderer.ShowDamageCounter(damageTaken, playerPercentHealth, isHeal: false); + _characterRendererProvider.MainCharacterRenderer.ShowDamageCounter(damageTaken, playerPercentHealth, isHeal); } public void TakeItemFromMap(short id, int amountTaken)