diff --git a/OpenRA.Game/Traits/TraitsInterfaces.cs b/OpenRA.Game/Traits/TraitsInterfaces.cs index b0741a0203..05c67c4dd8 100644 --- a/OpenRA.Game/Traits/TraitsInterfaces.cs +++ b/OpenRA.Game/Traits/TraitsInterfaces.cs @@ -321,12 +321,6 @@ namespace OpenRA.Traits public interface INotifyBecomingIdle { void OnBecomingIdle(Actor self); } public interface INotifyIdle { void TickIdle(Actor self); } - public interface IRenderInfantrySequenceModifier - { - bool IsModifyingSequence { get; } - string SequencePrefix { get; } - } - public interface IRenderAboveWorld { void RenderAboveWorld(Actor self, WorldRenderer wr); } public interface IRenderShroud { void RenderShroud(Shroud shroud, WorldRenderer wr); } public interface IRenderAboveShroud { IEnumerable RenderAboveShroud(Actor self, WorldRenderer wr); } diff --git a/OpenRA.Mods.Common/Traits/Infantry/ScaredyCat.cs b/OpenRA.Mods.Common/Traits/Infantry/ScaredyCat.cs index 612c71fd5a..46ddd68359 100644 --- a/OpenRA.Mods.Common/Traits/Infantry/ScaredyCat.cs +++ b/OpenRA.Mods.Common/Traits/Infantry/ScaredyCat.cs @@ -38,8 +38,8 @@ namespace OpenRA.Mods.Common.Traits [Sync] int panicStartedTick; bool Panicking { get { return panicStartedTick > 0; } } - public bool IsModifyingSequence { get { return Panicking; } } - public string SequencePrefix { get { return info.PanicSequencePrefix; } } + bool IRenderInfantrySequenceModifier.IsModifyingSequence { get { return Panicking; } } + string IRenderInfantrySequenceModifier.SequencePrefix { get { return info.PanicSequencePrefix; } } public ScaredyCat(Actor self, ScaredyCatInfo info) { diff --git a/OpenRA.Mods.Common/Traits/Infantry/TakeCover.cs b/OpenRA.Mods.Common/Traits/Infantry/TakeCover.cs index b47204eab6..62d379e5c2 100644 --- a/OpenRA.Mods.Common/Traits/Infantry/TakeCover.cs +++ b/OpenRA.Mods.Common/Traits/Infantry/TakeCover.cs @@ -45,8 +45,8 @@ namespace OpenRA.Mods.Common.Traits [Sync] int remainingProneTime = 0; bool IsProne { get { return remainingProneTime > 0; } } - public bool IsModifyingSequence { get { return IsProne; } } - public string SequencePrefix { get { return info.ProneSequencePrefix; } } + bool IRenderInfantrySequenceModifier.IsModifyingSequence { get { return IsProne; } } + string IRenderInfantrySequenceModifier.SequencePrefix { get { return info.ProneSequencePrefix; } } public TakeCover(ActorInitializer init, TakeCoverInfo info) : base(init, info) @@ -54,7 +54,7 @@ namespace OpenRA.Mods.Common.Traits this.info = info; } - public void Damaged(Actor self, AttackInfo e) + void INotifyDamage.Damaged(Actor self, AttackInfo e) { if (e.Damage.Value <= 0 || !e.Damage.DamageTypes.Overlaps(info.DamageTriggers)) return; @@ -78,7 +78,7 @@ namespace OpenRA.Mods.Common.Traits get { return true; } } - public int GetDamageModifier(Actor attacker, Damage damage) + int IDamageModifier.GetDamageModifier(Actor attacker, Damage damage) { if (!IsProne) return 100; @@ -90,7 +90,7 @@ namespace OpenRA.Mods.Common.Traits return Util.ApplyPercentageModifiers(100, modifierPercentages); } - public int GetSpeedModifier() + int ISpeedModifier.GetSpeedModifier() { return IsProne ? info.SpeedModifier : 100; } diff --git a/OpenRA.Mods.Common/TraitsInterfaces.cs b/OpenRA.Mods.Common/TraitsInterfaces.cs index 2cc0a67c33..4c1b89effe 100644 --- a/OpenRA.Mods.Common/TraitsInterfaces.cs +++ b/OpenRA.Mods.Common/TraitsInterfaces.cs @@ -195,4 +195,11 @@ namespace OpenRA.Mods.Common.Traits [RequireExplicitImplementation] public interface INotifyRearm { void Rearming(Actor host, Actor other); } + + [RequireExplicitImplementation] + public interface IRenderInfantrySequenceModifier + { + bool IsModifyingSequence { get; } + string SequencePrefix { get; } + } } diff --git a/OpenRA.Mods.TS/Traits/Render/WithPermanentInjury.cs b/OpenRA.Mods.TS/Traits/Render/WithPermanentInjury.cs index 4417e20d71..c3eb9d0abf 100644 --- a/OpenRA.Mods.TS/Traits/Render/WithPermanentInjury.cs +++ b/OpenRA.Mods.TS/Traits/Render/WithPermanentInjury.cs @@ -9,6 +9,7 @@ */ #endregion +using OpenRA.Mods.Common.Traits; using OpenRA.Traits; namespace OpenRA.Mods.TS.Traits.Render @@ -29,15 +30,15 @@ namespace OpenRA.Mods.TS.Traits.Render bool isInjured; - public bool IsModifyingSequence { get { return isInjured; } } - public string SequencePrefix { get { return info.InjuredSequencePrefix; } } + bool IRenderInfantrySequenceModifier.IsModifyingSequence { get { return isInjured; } } + string IRenderInfantrySequenceModifier.SequencePrefix { get { return info.InjuredSequencePrefix; } } public WithPermanentInjury(ActorInitializer init, WithPermanentInjuryInfo info) { this.info = info; } - public void Damaged(Actor self, AttackInfo e) + void INotifyDamage.Damaged(Actor self, AttackInfo e) { if (e.DamageState == info.TriggeringDamageStage) isInjured = true;