diff --git a/OpenRA.Mods.Common/Activities/Sell.cs b/OpenRA.Mods.Common/Activities/Sell.cs index b8e9ca9cbc..9860a76967 100644 --- a/OpenRA.Mods.Common/Activities/Sell.cs +++ b/OpenRA.Mods.Common/Activities/Sell.cs @@ -48,6 +48,8 @@ namespace OpenRA.Mods.Common.Activities if (showTicks && refund > 0 && self.Owner.IsAlliedWith(self.World.RenderPlayer)) self.World.AddFrameEndTask(w => w.Add(new FloatingText(self.CenterPosition, self.Owner.Color, FloatingText.FormatCashTick(refund), 30))); + Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", sellableInfo.Notification, self.Owner.Faction.InternalName); + self.Dispose(); return false; } diff --git a/OpenRA.Mods.Common/Traits/Sellable.cs b/OpenRA.Mods.Common/Traits/Sellable.cs index 758527cc40..da8ace8abf 100644 --- a/OpenRA.Mods.Common/Traits/Sellable.cs +++ b/OpenRA.Mods.Common/Traits/Sellable.cs @@ -26,6 +26,10 @@ namespace OpenRA.Mods.Common.Traits [Desc("List of audio clips to play when the actor is being sold.")] public readonly string[] SellSounds = { }; + [NotificationReference("Speech")] + [Desc("The audio notification type to play.")] + public string Notification = null; + [Desc("Whether to show the cash tick indicators rising from the actor.")] public readonly bool ShowTicks = true; diff --git a/mods/d2k/rules/defaults.yaml b/mods/d2k/rules/defaults.yaml index 249162af93..d3a8708451 100644 --- a/mods/d2k/rules/defaults.yaml +++ b/mods/d2k/rules/defaults.yaml @@ -456,6 +456,7 @@ Sellable: RequiresCondition: !build-incomplete && !being-demolished SellSounds: BUILD1.WAV + Notification: StructureSold Guardable: Range: 3c0 ThrowsShrapnel: @@ -499,6 +500,7 @@ Sequence: invisible Sellable: RequiresCondition: !being-demolished + Notification: StructureSold WithWallSpriteBody: RequiresCondition: !build-incomplete LineBuildNode: diff --git a/mods/ra/rules/defaults.yaml b/mods/ra/rules/defaults.yaml index 0393d91b7d..3295da22e6 100644 --- a/mods/ra/rules/defaults.yaml +++ b/mods/ra/rules/defaults.yaml @@ -712,6 +712,7 @@ Sellable: RequiresCondition: !build-incomplete && !being-captured && !being-demolished SellSounds: cashturn.aud + Notification: StructureSold WithBuildingRepairDecoration: Image: allyrepair Sequence: repair diff --git a/mods/ts/rules/defaults.yaml b/mods/ts/rules/defaults.yaml index a731b8f5e6..e4cc0c1947 100644 --- a/mods/ts/rules/defaults.yaml +++ b/mods/ts/rules/defaults.yaml @@ -390,6 +390,7 @@ Sellable: RequiresCondition: !build-incomplete && !being-demolished SellSounds: cashturn.aud + Notification: StructureSold WithMakeAnimation: Condition: build-incomplete ThrowsShrapnel@SMALL: