diff --git a/OpenRA.Mods.Common/AI/HackyAI.cs b/OpenRA.Mods.Common/AI/HackyAI.cs index 7b73031655..795692ba97 100644 --- a/OpenRA.Mods.Common/AI/HackyAI.cs +++ b/OpenRA.Mods.Common/AI/HackyAI.cs @@ -1108,7 +1108,7 @@ namespace OpenRA.Mods.Common.AI QueueOrder(Order.StartProduction(queue.Actor, name, 1)); } - public void Damaged(Actor self, AttackInfo e) + void INotifyDamage.Damaged(Actor self, AttackInfo e) { if (!IsEnabled || e.Attacker == null) return; diff --git a/OpenRA.Mods.Common/Scripting/ScriptTriggers.cs b/OpenRA.Mods.Common/Scripting/ScriptTriggers.cs index 70706590d1..9fbfd872d0 100644 --- a/OpenRA.Mods.Common/Scripting/ScriptTriggers.cs +++ b/OpenRA.Mods.Common/Scripting/ScriptTriggers.cs @@ -107,7 +107,7 @@ namespace OpenRA.Mods.Common.Scripting } } - public void Damaged(Actor self, AttackInfo e) + void INotifyDamage.Damaged(Actor self, AttackInfo e) { if (world.Disposing) return; diff --git a/OpenRA.Mods.Common/Traits/Player/BaseAttackNotifier.cs b/OpenRA.Mods.Common/Traits/Player/BaseAttackNotifier.cs index 9efb152d6e..63213bce71 100644 --- a/OpenRA.Mods.Common/Traits/Player/BaseAttackNotifier.cs +++ b/OpenRA.Mods.Common/Traits/Player/BaseAttackNotifier.cs @@ -50,7 +50,7 @@ namespace OpenRA.Mods.Common.Traits lastAttackTime = -info.NotifyInterval * 25; } - public void Damaged(Actor self, AttackInfo e) + void INotifyDamage.Damaged(Actor self, AttackInfo e) { if (e.Attacker == null) return; diff --git a/OpenRA.Mods.Common/Traits/Player/HarvesterAttackNotifier.cs b/OpenRA.Mods.Common/Traits/Player/HarvesterAttackNotifier.cs index 69a85ac36f..1597b54464 100644 --- a/OpenRA.Mods.Common/Traits/Player/HarvesterAttackNotifier.cs +++ b/OpenRA.Mods.Common/Traits/Player/HarvesterAttackNotifier.cs @@ -46,7 +46,7 @@ namespace OpenRA.Mods.Common.Traits lastAttackTime = -info.NotifyInterval * 25; } - public void Damaged(Actor self, AttackInfo e) + void INotifyDamage.Damaged(Actor self, AttackInfo e) { // Don't track self-damage if (e.Attacker != null && e.Attacker.Owner == self.Owner) diff --git a/OpenRA.Mods.Common/Traits/Render/WithDamageOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithDamageOverlay.cs index 031ff86caf..bd1ec869a3 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithDamageOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithDamageOverlay.cs @@ -53,7 +53,7 @@ namespace OpenRA.Mods.Common.Traits.Render rs.Add(new AnimationWithOffset(anim, null, () => !isSmoking)); } - public void Damaged(Actor self, AttackInfo e) + void INotifyDamage.Damaged(Actor self, AttackInfo e) { if (info.DamageTypes.Count > 0 && !e.Damage.DamageTypes.Overlaps(info.DamageTypes)) return; diff --git a/OpenRA.Mods.Common/Traits/SelfHealing.cs b/OpenRA.Mods.Common/Traits/SelfHealing.cs index 59e377b658..36022ca4db 100644 --- a/OpenRA.Mods.Common/Traits/SelfHealing.cs +++ b/OpenRA.Mods.Common/Traits/SelfHealing.cs @@ -74,7 +74,7 @@ namespace OpenRA.Mods.Common.Traits } } - public void Damaged(Actor self, AttackInfo e) + void INotifyDamage.Damaged(Actor self, AttackInfo e) { if (e.Damage.Value > 0) damageTicks = Info.DamageCooldown; diff --git a/OpenRA.Mods.Common/TraitsInterfaces.cs b/OpenRA.Mods.Common/TraitsInterfaces.cs index 90a9e10a9a..d1ca0ef513 100644 --- a/OpenRA.Mods.Common/TraitsInterfaces.cs +++ b/OpenRA.Mods.Common/TraitsInterfaces.cs @@ -83,6 +83,7 @@ namespace OpenRA.Mods.Common.Traits [RequireExplicitImplementation] public interface INotifyDamageStateChanged { void DamageStateChanged(Actor self, AttackInfo e); } + [RequireExplicitImplementation] public interface INotifyDamage { void Damaged(Actor self, AttackInfo e); } public interface INotifyKilled { void Killed(Actor self, AttackInfo e); } public interface INotifyAppliedDamage { void AppliedDamage(Actor self, Actor damaged, AttackInfo e); }