diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index 594b30558a..acb3ca3cc0 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -2899,6 +2899,22 @@ namespace OpenRA.Mods.Common.UtilityCommands } } + // Removed arbitrary defaults from InfiltrateForCash + if (engineVersion < 20160118) + { + if (node.Key == "InfiltrateForCash") + { + if (!node.Value.Nodes.Any(n => n.Key == "Percentage")) + node.Value.Nodes.Add(new MiniYamlNode("Percentage", "50")); + + if (!node.Value.Nodes.Any(n => n.Key == "Minimum")) + node.Value.Nodes.Add(new MiniYamlNode("Minimum", "500")); + + if (!node.Value.Nodes.Any(n => n.Key == "SoundToVictim")) + node.Value.Nodes.Add(new MiniYamlNode("SoundToVictim", "credit1.aud")); + } + } + UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1); } } diff --git a/OpenRA.Mods.RA/Traits/Infiltration/InfiltrateForCash.cs b/OpenRA.Mods.RA/Traits/Infiltration/InfiltrateForCash.cs index 71d8906417..1492fc915d 100644 --- a/OpenRA.Mods.RA/Traits/Infiltration/InfiltrateForCash.cs +++ b/OpenRA.Mods.RA/Traits/Infiltration/InfiltrateForCash.cs @@ -19,14 +19,14 @@ namespace OpenRA.Mods.RA.Traits class InfiltrateForCashInfo : ITraitInfo { [Desc("Percentage of the victim's resources that will be stolen.")] - public readonly int Percentage = 50; + public readonly int Percentage = 100; [Desc("Amount of guaranteed funds to claim when the victim does not have enough resources.", "When negative, the production price of the infiltrating actor will be used instead.")] - public readonly int Minimum = 500; + public readonly int Minimum = -1; [Desc("Sound the victim will hear when they get robbed.")] - public readonly string SoundToVictim = "credit1.aud"; + public readonly string SoundToVictim = null; public object Create(ActorInitializer init) { return new InfiltrateForCash(this); } } @@ -49,7 +49,8 @@ namespace OpenRA.Mods.RA.Traits targetResources.TakeCash(toTake); spyResources.GiveCash(toGive); - Game.Sound.PlayToPlayer(self.Owner, info.SoundToVictim); + if (info.SoundToVictim != null) + Game.Sound.PlayToPlayer(self.Owner, info.SoundToVictim); self.World.AddFrameEndTask(w => w.Add(new FloatingText(self.CenterPosition, infiltrator.Owner.Color.RGB, FloatingText.FormatCashTick(toGive), 30))); }