diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj
index 458e1700b5..e817174245 100644
--- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj
+++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj
@@ -296,7 +296,6 @@
-
@@ -324,6 +323,7 @@
+
diff --git a/OpenRA.Mods.Common/Scripting/Properties/DemolitionProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/DemolitionProperties.cs
index 19fe72e7dd..dc488b5bcc 100644
--- a/OpenRA.Mods.Common/Scripting/Properties/DemolitionProperties.cs
+++ b/OpenRA.Mods.Common/Scripting/Properties/DemolitionProperties.cs
@@ -17,21 +17,21 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Scripting
{
[ScriptPropertyGroup("Combat")]
- public class DemolitionProperties : ScriptActorProperties, Requires, Requires
+ public class DemolitionProperties : ScriptActorProperties, Requires, Requires
{
- readonly C4DemolitionInfo info;
+ readonly DemolitionInfo info;
public DemolitionProperties(ScriptContext context, Actor self)
: base(context, self)
{
- info = Self.Info.TraitInfo();
+ info = Self.Info.TraitInfo();
}
[ScriptActorPropertyActivity]
[Desc("Demolish the target actor.")]
public void Demolish(Actor target)
{
- Self.QueueActivity(new Demolish(Self, target, info.EnterBehaviour, info.C4Delay,
+ Self.QueueActivity(new Demolish(Self, target, info.EnterBehaviour, info.DetonationDelay,
info.Flashes, info.FlashesDelay, info.FlashInterval, info.FlashDuration));
}
}
diff --git a/OpenRA.Mods.Common/Traits/C4Demolition.cs b/OpenRA.Mods.Common/Traits/Demolition.cs
similarity index 82%
rename from OpenRA.Mods.Common/Traits/C4Demolition.cs
rename to OpenRA.Mods.Common/Traits/Demolition.cs
index 5c0f97a6af..2fb4c24fae 100644
--- a/OpenRA.Mods.Common/Traits/C4Demolition.cs
+++ b/OpenRA.Mods.Common/Traits/Demolition.cs
@@ -18,11 +18,11 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
- class C4DemolitionInfo : ITraitInfo
+ class DemolitionInfo : ITraitInfo
{
- [Desc("Delay to demolish the target once the C4 is planted. " +
+ [Desc("Delay to demolish the target once the explosive device is planted. " +
"Measured in game ticks. Default is 1.8 seconds.")]
- public readonly int C4Delay = 45;
+ public readonly int DetonationDelay = 45;
[Desc("Number of times to flash the target.")]
public readonly int Flashes = 3;
@@ -43,21 +43,23 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Voice string when planting explosive charges.")]
[VoiceReference] public readonly string Voice = "Action";
- public object Create(ActorInitializer init) { return new C4Demolition(this); }
+ public readonly string Cursor = "c4";
+
+ public object Create(ActorInitializer init) { return new Demolition(this); }
}
- class C4Demolition : IIssueOrder, IResolveOrder, IOrderVoice
+ class Demolition : IIssueOrder, IResolveOrder, IOrderVoice
{
- readonly C4DemolitionInfo info;
+ readonly DemolitionInfo info;
- public C4Demolition(C4DemolitionInfo info)
+ public Demolition(DemolitionInfo info)
{
this.info = info;
}
public IEnumerable Orders
{
- get { yield return new C4DemolitionOrderTargeter(); }
+ get { yield return new DemolitionOrderTargeter(info.Cursor); }
}
public Order IssueOrder(Actor self, IOrderTargeter order, Target target, bool queued)
@@ -88,7 +90,7 @@ namespace OpenRA.Mods.Common.Traits
self.CancelActivity();
self.SetTargetLine(target, Color.Red);
- self.QueueActivity(new Demolish(self, target.Actor, info.EnterBehaviour, info.C4Delay,
+ self.QueueActivity(new Demolish(self, target.Actor, info.EnterBehaviour, info.DetonationDelay,
info.Flashes, info.FlashesDelay, info.FlashInterval, info.FlashDuration));
}
@@ -97,10 +99,10 @@ namespace OpenRA.Mods.Common.Traits
return order.OrderString == "C4" ? info.Voice : null;
}
- class C4DemolitionOrderTargeter : UnitOrderTargeter
+ class DemolitionOrderTargeter : UnitOrderTargeter
{
- public C4DemolitionOrderTargeter()
- : base("C4", 6, "c4", true, false) { }
+ public DemolitionOrderTargeter(string cursor)
+ : base("C4", 6, cursor, true, false) { }
public override bool CanTargetActor(Actor self, Actor target, TargetModifiers modifiers, ref string cursor)
{
diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs
index 8d32a6d8de..4fa6ad33ba 100644
--- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs
+++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs
@@ -777,6 +777,17 @@ namespace OpenRA.Mods.Common.UtilityCommands
node.Value.Nodes.RemoveAll(x => x.Key == "StartsRevealed");
}
+ if (engineVersion < 20160515)
+ {
+ // Use generic naming for building demolition using explosives.
+ if (node.Key == "C4Demolition")
+ node.Key = "Demolition";
+
+ foreach (var n in node.Value.Nodes)
+ if (n.Key == "C4Delay")
+ n.Key = "DetonationDelay";
+ }
+
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
}
}
diff --git a/mods/cnc/rules/infantry.yaml b/mods/cnc/rules/infantry.yaml
index dbf50f99a9..defa48affd 100644
--- a/mods/cnc/rules/infantry.yaml
+++ b/mods/cnc/rules/infantry.yaml
@@ -174,8 +174,8 @@ RMBO:
Range: 6c0
AutoTarget:
ScanRadius: 6
- C4Demolition:
- C4Delay: 45
+ Demolition:
+ DetonationDelay: 45
Voice: Demolish
Armament:
Weapon: Sniper
diff --git a/mods/d2k/rules/infantry.yaml b/mods/d2k/rules/infantry.yaml
index dc9f4fe5f9..428c22c8f2 100644
--- a/mods/d2k/rules/infantry.yaml
+++ b/mods/d2k/rules/infantry.yaml
@@ -241,8 +241,8 @@ saboteur:
HP: 400
Mobile:
Speed: 43
- C4Demolition:
- C4Delay: 0
+ Demolition:
+ DetonationDelay: 0
Flashes: 0
EnterBehaviour: Suicide
-AutoTarget:
diff --git a/mods/ra/rules/infantry.yaml b/mods/ra/rules/infantry.yaml
index c4f49d082f..05304fb609 100644
--- a/mods/ra/rules/infantry.yaml
+++ b/mods/ra/rules/infantry.yaml
@@ -267,8 +267,8 @@ E7:
Voice: Move
RevealsShroud:
Range: 6c0
- C4Demolition:
- C4Delay: 45
+ Demolition:
+ DetonationDelay: 45
Voice: Demolish
Passenger:
PipType: Red
diff --git a/mods/ts/rules/gdi-infantry.yaml b/mods/ts/rules/gdi-infantry.yaml
index 46798d20cd..2d46d946df 100644
--- a/mods/ts/rules/gdi-infantry.yaml
+++ b/mods/ts/rules/gdi-infantry.yaml
@@ -38,7 +38,7 @@ MEDIC:
Voiced:
VoiceSet: Medic
RevealsShroud:
- Range: 6c0
+ Range: 6c0
Mobile:
Speed: 56
Health:
@@ -125,8 +125,8 @@ GHOST:
CrushSound: squishy2.aud
AttackFrontal:
Voice: Attack
- C4Demolition:
- C4Delay: 45
+ Demolition:
+ DetonationDelay: 45
Voice: Attack
WithInfantryBody:
AttackSequence: shoot
diff --git a/mods/ts/rules/nod-infantry.yaml b/mods/ts/rules/nod-infantry.yaml
index cdbea614f6..87e7f63585 100644
--- a/mods/ts/rules/nod-infantry.yaml
+++ b/mods/ts/rules/nod-infantry.yaml
@@ -113,7 +113,7 @@ MHIJACK:
Weapon: TiberiumHeal
Mobile:
Speed: 99
- -Crushable:
+ -Crushable:
Captures:
CaptureTypes: Vehicle
RevealsShroud:
diff --git a/mods/ts/rules/nod-structures.yaml b/mods/ts/rules/nod-structures.yaml
index 4cc99723e6..d7b446389a 100644
--- a/mods/ts/rules/nod-structures.yaml
+++ b/mods/ts/rules/nod-structures.yaml
@@ -149,7 +149,7 @@ NAWEAP:
Health:
HP: 1000
Armor:
- Type: Heavy
+ Type: Heavy
RevealsShroud:
Range: 4c0
RallyPoint:
@@ -428,7 +428,7 @@ NAWAST:
PipCount: 15
Capacity: 56
Power:
- Amount: -40
+ Amount: -40
FreeActor:
Actor: WEED
SpawnOffset: 3,1