diff --git a/OpenRA.Mods.Common/Traits/Crates/CrateAction.cs b/OpenRA.Mods.Common/Traits/Crates/CrateAction.cs index d437d009c7..5088e63ca4 100644 --- a/OpenRA.Mods.Common/Traits/Crates/CrateAction.cs +++ b/OpenRA.Mods.Common/Traits/Crates/CrateAction.cs @@ -29,6 +29,9 @@ namespace OpenRA.Mods.Common.Traits [Desc("Audio clip to play when the crate is collected.")] public readonly string Sound = null; + [Desc("Notification to play when the crate is collected.")] + [NotificationReference("Speech")] public readonly string Notification = null; + [Desc("The earliest time (in ticks) that this crate action can occur on.")] public readonly int TimeDelay = 0; @@ -77,6 +80,10 @@ namespace OpenRA.Mods.Common.Traits { Game.Sound.PlayToPlayer(SoundType.World, collector.Owner, Info.Sound); + if (!string.IsNullOrEmpty(Info.Notification)) + Game.Sound.PlayNotification(self.World.Map.Rules, collector.Owner, "Speech", + Info.Notification, collector.Owner.Faction.InternalName); + if (Info.Effect != null) collector.World.AddFrameEndTask(w => w.Add(new CrateEffect(collector, Info.Effect, Info.Palette))); }