diff --git a/OpenRA.Mods.Common/Activities/RepairBridge.cs b/OpenRA.Mods.Common/Activities/RepairBridge.cs index a7f4d93e21..efa4ed021d 100644 --- a/OpenRA.Mods.Common/Activities/RepairBridge.cs +++ b/OpenRA.Mods.Common/Activities/RepairBridge.cs @@ -16,11 +16,13 @@ namespace OpenRA.Mods.Common.Activities class RepairBridge : Enter { readonly BridgeHut hut; + readonly string notification; - public RepairBridge(Actor self, Actor target, EnterBehaviour enterBehaviour) + public RepairBridge(Actor self, Actor target, EnterBehaviour enterBehaviour, string notification) : base(self, target, enterBehaviour) { hut = target.Trait(); + this.notification = notification; } protected override bool CanReserve(Actor self) @@ -34,6 +36,8 @@ namespace OpenRA.Mods.Common.Activities return; hut.Repair(self); + + Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", notification, self.Owner.Faction.InternalName); } } } diff --git a/OpenRA.Mods.Common/Traits/RepairsBridges.cs b/OpenRA.Mods.Common/Traits/RepairsBridges.cs index 608868e02d..ae0d06630c 100644 --- a/OpenRA.Mods.Common/Traits/RepairsBridges.cs +++ b/OpenRA.Mods.Common/Traits/RepairsBridges.cs @@ -31,6 +31,9 @@ namespace OpenRA.Mods.Common.Traits [Desc("Cursor to use when repairing is denied.")] public readonly string TargetBlockedCursor = "goldwrench-blocked"; + [Desc("Speech notification to play when a bridge is repaired.")] + public readonly string RepairNotification = null; + public object Create(ActorInitializer init) { return new RepairsBridges(this); } } @@ -82,7 +85,7 @@ namespace OpenRA.Mods.Common.Traits self.SetTargetLine(Target.FromOrder(self.World, order), Color.Yellow); self.CancelActivity(); - self.QueueActivity(new RepairBridge(self, order.TargetActor, info.EnterBehaviour)); + self.QueueActivity(new RepairBridge(self, order.TargetActor, info.EnterBehaviour, info.RepairNotification)); } } diff --git a/mods/ts/rules/shared-infantry.yaml b/mods/ts/rules/shared-infantry.yaml index 21334c45f5..ffead6617f 100644 --- a/mods/ts/rules/shared-infantry.yaml +++ b/mods/ts/rules/shared-infantry.yaml @@ -55,6 +55,7 @@ ENGINEER: PipType: Yellow EngineerRepair: RepairsBridges: + RepairNotification: BridgeRepaired Captures: CaptureTypes: building -AutoTarget: