From 524bc3d45f2551517b17095929ddbdeaa99b63d4 Mon Sep 17 00:00:00 2001 From: teees Date: Thu, 21 Apr 2016 11:23:50 +0200 Subject: [PATCH] Added INotifyBurstComplete trait interface to notify when a full salvo has been fired --- OpenRA.Mods.Common/Traits/Armament.cs | 3 +++ OpenRA.Mods.Common/TraitsInterfaces.cs | 1 + 2 files changed, 4 insertions(+) diff --git a/OpenRA.Mods.Common/Traits/Armament.cs b/OpenRA.Mods.Common/Traits/Armament.cs index 36f06874cc..a424763389 100644 --- a/OpenRA.Mods.Common/Traits/Armament.cs +++ b/OpenRA.Mods.Common/Traits/Armament.cs @@ -249,6 +249,9 @@ namespace OpenRA.Mods.Common.Traits .Select(m => m.GetReloadModifier()); FireDelay = Util.ApplyPercentageModifiers(Weapon.ReloadDelay, modifiers); Burst = Weapon.Burst; + + foreach (var nbc in self.TraitsImplementing()) + nbc.FiredBurst(self, target, this); } return barrel; diff --git a/OpenRA.Mods.Common/TraitsInterfaces.cs b/OpenRA.Mods.Common/TraitsInterfaces.cs index a996d6e76a..eb9b45e091 100644 --- a/OpenRA.Mods.Common/TraitsInterfaces.cs +++ b/OpenRA.Mods.Common/TraitsInterfaces.cs @@ -35,6 +35,7 @@ namespace OpenRA.Mods.Common.Traits } public interface INotifyAttack { void Attacking(Actor self, Target target, Armament a, Barrel barrel); } + public interface INotifyBurstComplete { void FiredBurst(Actor self, Target target, Armament a); } public interface INotifyCharging { void Charging(Actor self, Target target); } public interface INotifyChat { bool OnChat(string from, string message); } public interface INotifyParachuteLanded { void OnLanded(Actor ignore); }