diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj
index bb56cc9b76..41e5777df6 100644
--- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj
+++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj
@@ -590,6 +590,7 @@
+
diff --git a/OpenRA.Mods.Common/UpdateRules/Rules/20180923/MergeCaptureTraits.cs b/OpenRA.Mods.Common/UpdateRules/Rules/20180923/MergeCaptureTraits.cs
new file mode 100644
index 0000000000..2f18d97a86
--- /dev/null
+++ b/OpenRA.Mods.Common/UpdateRules/Rules/20180923/MergeCaptureTraits.cs
@@ -0,0 +1,154 @@
+#region Copyright & License Information
+/*
+ * Copyright 2007-2018 The OpenRA Developers (see AUTHORS)
+ * This file is part of OpenRA, which is free software. It is made
+ * available to you under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version. For more
+ * information, see COPYING.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace OpenRA.Mods.Common.UpdateRules.Rules
+{
+ public class MergeCaptureTraits : UpdateRule
+ {
+ public override string Name { get { return "Merge and overhaul Captures traits"; } }
+ public override string Description
+ {
+ get
+ {
+ return "The internal and external capturing traits have been merged, and a new\n" +
+ "CaptureManager trait has been added to help manage interactions between\n" +
+ "actors and multiple trait instances. The Sabotage logic has also\n" +
+ "moved from the Capturable trait to the Captures trait.\n" +
+ "The External* traits are renamed, and the CaptureManager added wherever\n" +
+ "the Capturable or Captures trait is used. The locations modified are\n" +
+ "listed for inspection and manual cleanup";
+ }
+ }
+
+ readonly List captureManagerLocations = new List();
+ readonly List externalDelayLocations = new List();
+ readonly List sabotageLocations = new List();
+
+ public override IEnumerable AfterUpdate(ModData modData)
+ {
+ if (captureManagerLocations.Any())
+ yield return "The Captures and Capturable traits now depend on the\n" +
+ "new CaptureManager trait. This trait has automatically been added\n" +
+ "in the following definitions:\n" + UpdateUtils.FormatMessageList(captureManagerLocations) +
+ "\nYou may wish to review these definitions and delete any redundant\n" +
+ "instances that have already been inherited from a parent template.";
+
+ if (sabotageLocations.Any())
+ yield return "The sabotage logic has been disabled by default, which affects\n" +
+ "the following definitions:\n" + UpdateUtils.FormatMessageList(sabotageLocations) +
+ "\nThe sabotage logic is now defined on the Captures trait, via the \n" +
+ "SabotageThreshold field. You may need to define additional capture types\n" +
+ "and Capturable traits if you wish to use multiple capture thresholds.";
+
+ if (externalDelayLocations.Any())
+ yield return "The following actors have had their capture delays reset to 15 seconds:\n" +
+ UpdateUtils.FormatMessageList(sabotageLocations) +
+ "\nThe capture delay is now defined on the Captures trait, via the\n" +
+ "CaptureDelay field. You may need to define additional capture types\n" +
+ "and Capturable traits if you wish to use multiple capture delays.";
+
+ captureManagerLocations.Clear();
+ sabotageLocations.Clear();
+ externalDelayLocations.Clear();
+ }
+
+ public override IEnumerable UpdateActorNode(ModData modData, MiniYamlNode actorNode)
+ {
+ var reportLocation = "{0} ({1})".F(actorNode.Key, actorNode.Location.Filename);
+ var captureManager = actorNode.LastChildMatching("CaptureManager") ?? new MiniYamlNode("CaptureManager", "");
+ var usesCaptureManager = false;
+
+ // Migrate External*
+ foreach (var c in actorNode.ChildrenMatching("ExternalCapturable"))
+ {
+ c.RenameKey("Capturable");
+ if (c.RemoveNodes("CaptureCompleteTime") > 0)
+ externalDelayLocations.Add(reportLocation);
+ }
+
+ foreach (var c in actorNode.ChildrenMatching("ExternalCaptures"))
+ {
+ c.RenameKey("Captures");
+ if (c.Key.StartsWith("-"))
+ continue;
+
+ c.AddNode("CaptureDelay", 375);
+
+ var consumeNode = c.LastChildMatching("ConsumeActor");
+ if (consumeNode != null)
+ consumeNode.RenameKey("ConsumedByCapture");
+ else
+ c.AddNode("ConsumedByCapture", false);
+
+ var conditionNode = c.LastChildMatching("CapturingCondition");
+ if (conditionNode != null)
+ conditionNode.MoveNode(c, captureManager);
+
+ var cursorNode = c.LastChildMatching("CaptureCursor");
+ if (cursorNode != null)
+ cursorNode.RenameKey("EnterCursor");
+ else
+ c.AddNode("EnterCursor", "ability");
+
+ var cursorBlockedNode = c.LastChildMatching("CaptureBlockedCursor");
+ if (cursorBlockedNode != null)
+ cursorBlockedNode.RenameKey("EnterBlockedCursor");
+ else
+ c.AddNode("EnterBlockedCursor", "move-blocked");
+ }
+
+ var addBlinker = false;
+ foreach (var c in actorNode.ChildrenMatching("ExternalCapturableBar"))
+ {
+ c.RenameKey("CapturableProgressBar");
+ addBlinker = true;
+ }
+
+ if (addBlinker)
+ actorNode.AddNode("CapturableProgressBlink", "");
+
+ // Remove any CaptureThreshold nodes and restore the "building" default
+ // These run on converted External* traits too
+ foreach (var traitNode in actorNode.ChildrenMatching("Capturable"))
+ {
+ if (!traitNode.Key.StartsWith("-"))
+ usesCaptureManager = true;
+
+ if (traitNode.RemoveNodes("CaptureThreshold") + traitNode.RemoveNodes("Sabotage") > 0)
+ sabotageLocations.Add(reportLocation);
+
+ if (!traitNode.Key.StartsWith("-") && traitNode.LastChildMatching("Types") == null)
+ traitNode.AddNode("Types", "building");
+ }
+
+ foreach (var traitNode in actorNode.ChildrenMatching("Captures"))
+ {
+ if (!traitNode.Key.StartsWith("-"))
+ usesCaptureManager = true;
+
+ if (traitNode.LastChildMatching("CaptureTypes") == null)
+ traitNode.AddNode("CaptureTypes", "building");
+ }
+
+ if (usesCaptureManager && actorNode.LastChildMatching("CaptureManager") == null)
+ {
+ actorNode.AddNode(captureManager);
+ captureManagerLocations.Add(reportLocation);
+ }
+
+ yield break;
+ }
+ }
+}
diff --git a/OpenRA.Mods.Common/UpdateRules/UpdatePath.cs b/OpenRA.Mods.Common/UpdateRules/UpdatePath.cs
index 2cc6e5e7ab..825031c915 100644
--- a/OpenRA.Mods.Common/UpdateRules/UpdatePath.cs
+++ b/OpenRA.Mods.Common/UpdateRules/UpdatePath.cs
@@ -92,6 +92,7 @@ namespace OpenRA.Mods.Common.UpdateRules
new RenameEditorTilesetFilter(),
new DefineNotificationDefaults(),
new MergeRearmAndRepairAnimation(),
+ new MergeCaptureTraits(),
})
};
diff --git a/mods/cnc/maps/nod03a/rules.yaml b/mods/cnc/maps/nod03a/rules.yaml
index fbce1680f4..00df314dab 100644
--- a/mods/cnc/maps/nod03a/rules.yaml
+++ b/mods/cnc/maps/nod03a/rules.yaml
@@ -97,5 +97,6 @@ RMBO:
MISS:
Tooltip:
Name: Prison
+ CaptureManager:
Capturable:
- CaptureThreshold: 100
+ Types: building
diff --git a/mods/cnc/maps/nod03b/rules.yaml b/mods/cnc/maps/nod03b/rules.yaml
index d364bff3b0..defe9c94e9 100644
--- a/mods/cnc/maps/nod03b/rules.yaml
+++ b/mods/cnc/maps/nod03b/rules.yaml
@@ -96,5 +96,6 @@ RMBO:
MISS:
Tooltip:
Name: Prison
+ CaptureManager:
Capturable:
- CaptureThreshold: 100
+ Types: building
diff --git a/mods/cnc/maps/nod07c/rules.yaml b/mods/cnc/maps/nod07c/rules.yaml
index 768af461cc..b8e7af1a25 100644
--- a/mods/cnc/maps/nod07c/rules.yaml
+++ b/mods/cnc/maps/nod07c/rules.yaml
@@ -138,7 +138,7 @@ HPAD.IN:
ProvidesPrerequisite:
Prerequisite: hpad
Capturable:
- CaptureThreshold: 100
+ Types: building
Building:
Footprint: x_ xx
BuildSounds: placbldg.aud, build5.aud
diff --git a/mods/cnc/maps/nod08a/rules.yaml b/mods/cnc/maps/nod08a/rules.yaml
index 526a7b0ed5..23b7006605 100644
--- a/mods/cnc/maps/nod08a/rules.yaml
+++ b/mods/cnc/maps/nod08a/rules.yaml
@@ -158,7 +158,7 @@ FACTOUT.IN:
ProvidesPrerequisite:
Prerequisite: fact
Capturable:
- CaptureThreshold: 100
+ Types: building
MoneyCrate:
Inherits: ^Crate
@@ -175,7 +175,7 @@ NUKEOUT.IN:
ProvidesPrerequisite:
Prerequisite: anypower
Capturable:
- CaptureThreshold: 100
+ Types: building
PROCOUT.IN:
Inherits: PROC
@@ -186,7 +186,7 @@ PROCOUT.IN:
ProvidesPrerequisite:
Prerequisite: proc
Capturable:
- CaptureThreshold: 100
+ Types: building
TRAN.IN:
Inherits: TRAN
diff --git a/mods/cnc/maps/nod08b/rules.yaml b/mods/cnc/maps/nod08b/rules.yaml
index bd8dd4b346..d60d93a118 100644
--- a/mods/cnc/maps/nod08b/rules.yaml
+++ b/mods/cnc/maps/nod08b/rules.yaml
@@ -186,7 +186,7 @@ FACTOUT.IN:
ProvidesPrerequisite:
Prerequisite: fact
Capturable:
- CaptureThreshold: 100
+ Types: building
MoneyCrate:
Inherits: ^Crate
@@ -203,7 +203,7 @@ NUKEOUT.IN:
ProvidesPrerequisite:
Prerequisite: anypower
Capturable:
- CaptureThreshold: 100
+ Types: building
PROCOUT.IN:
Inherits: PROC
@@ -214,7 +214,7 @@ PROCOUT.IN:
ProvidesPrerequisite:
Prerequisite: proc
Capturable:
- CaptureThreshold: 100
+ Types: building
TRAN.IN:
Inherits: TRAN
diff --git a/mods/cnc/maps/nod09/rules.yaml b/mods/cnc/maps/nod09/rules.yaml
index bfd4ea575a..d8180ea187 100644
--- a/mods/cnc/maps/nod09/rules.yaml
+++ b/mods/cnc/maps/nod09/rules.yaml
@@ -162,7 +162,7 @@ NUKEOUT.IN:
ProvidesPrerequisite:
Prerequisite: anypower
Capturable:
- CaptureThreshold: 100
+ Types: building
PROCOUT.IN:
Inherits: PROC
@@ -173,7 +173,7 @@ PROCOUT.IN:
ProvidesPrerequisite:
Prerequisite: proc
Capturable:
- CaptureThreshold: 100
+ Types: building
RMBO.easy:
Inherits: RMBO
diff --git a/mods/cnc/rules/defaults.yaml b/mods/cnc/rules/defaults.yaml
index 1ed40b0523..229e30f09d 100644
--- a/mods/cnc/rules/defaults.yaml
+++ b/mods/cnc/rules/defaults.yaml
@@ -745,8 +745,9 @@
EngineerRepairable:
Sellable:
SellSounds: cashturn.aud
+ CaptureManager:
Capturable:
- CaptureThreshold: 55
+ Types: building-sabotage
WithMakeAnimation:
WithBuildingRepairDecoration:
Image: allyrepair
@@ -787,7 +788,9 @@
Inherits: ^CivBuilding
OwnerLostAction:
Action: ChangeOwner
+ CaptureManager:
Capturable:
+ Types: building
CaptureNotification:
Notification: CivilianBuildingCaptured
RepairableBuilding:
@@ -1008,9 +1011,9 @@
Targetable:
RequiresForceFire: yes
TargetTypes: Ground, Husk
+ CaptureManager:
Capturable:
Types: husk
- CaptureThreshold: 100
ValidStances: Enemy, Neutral, Ally
TransformOnCapture:
ForceHealthPercentage: 25
diff --git a/mods/cnc/rules/infantry.yaml b/mods/cnc/rules/infantry.yaml
index 1c7958fc75..b460f8858f 100644
--- a/mods/cnc/rules/infantry.yaml
+++ b/mods/cnc/rules/infantry.yaml
@@ -174,7 +174,12 @@ E6:
PipType: Yellow
EngineerRepair:
RepairsBridges:
- Captures:
+ CaptureManager:
+ Captures@SABOTAGE:
+ CaptureTypes: building-sabotage
+ SabotageThreshold: 55
+ PlayerExperience: 50
+ Captures@CAPTURES:
CaptureTypes: building, husk
PlayerExperience: 50
Selectable:
diff --git a/mods/d2k/rules/defaults.yaml b/mods/d2k/rules/defaults.yaml
index cad3ff61a0..9b761b0c5b 100644
--- a/mods/d2k/rules/defaults.yaml
+++ b/mods/d2k/rules/defaults.yaml
@@ -386,8 +386,9 @@
Adjacent: 3
GivesBuildableArea:
AreaTypes: building
+ CaptureManager:
Capturable:
- CaptureThreshold: 100
+ Types: building
SoundOnDamageTransition:
DamagedSounds: EXPLSML1.WAV
DestroyedSounds: EXPLHG1.WAV
diff --git a/mods/d2k/rules/infantry.yaml b/mods/d2k/rules/infantry.yaml
index 0e4805d4fa..f863385c94 100644
--- a/mods/d2k/rules/infantry.yaml
+++ b/mods/d2k/rules/infantry.yaml
@@ -41,8 +41,9 @@ engineer:
Mobile:
Speed: 31
EngineerRepair:
+ CaptureManager:
Captures:
- CaptureTypes: building, husk
+ CaptureTypes: building
PlayerExperience: 50
-RevealOnFire:
Voiced:
diff --git a/mods/ra/maps/allies-03a/rules.yaml b/mods/ra/maps/allies-03a/rules.yaml
index 2a9f06c690..93054f8533 100644
--- a/mods/ra/maps/allies-03a/rules.yaml
+++ b/mods/ra/maps/allies-03a/rules.yaml
@@ -14,11 +14,27 @@ World:
normal: Normal
Default: easy
-^Building:
+FCOM:
Capturable:
- CaptureThreshold: 25
+ Types: ~disabled
-^TechBuilding:
+HOSP:
+ Capturable:
+ Types: ~disabled
+
+MISS:
+ Capturable:
+ Types: ~disabled
+
+FCOM:
+ Capturable:
+ Types: ~disabled
+
+BIO:
+ Capturable:
+ Types: ~disabled
+
+OILB:
Capturable:
Types: ~disabled
@@ -29,9 +45,10 @@ powerproxy.paratroopers:
HACKE6:
Inherits: E6
-RepairsBridges:
- -ExternalCaptures:
Captures:
- CaptureTypes: building
+ -ConsumedByCapture:
+ -EnterCursor:
+ -EnterBlockedCursor:
Targetable:
RequiresCondition: !jail
Targetable@PRISONER:
diff --git a/mods/ra/maps/allies-03b/rules.yaml b/mods/ra/maps/allies-03b/rules.yaml
index 6897dbe3fd..22b4329a93 100644
--- a/mods/ra/maps/allies-03b/rules.yaml
+++ b/mods/ra/maps/allies-03b/rules.yaml
@@ -14,11 +14,27 @@ World:
normal: Normal
Default: easy
-^Building:
+FCOM:
Capturable:
- CaptureThreshold: 25
+ Types: ~disabled
-^TechBuilding:
+HOSP:
+ Capturable:
+ Types: ~disabled
+
+MISS:
+ Capturable:
+ Types: ~disabled
+
+FCOM:
+ Capturable:
+ Types: ~disabled
+
+BIO:
+ Capturable:
+ Types: ~disabled
+
+OILB:
Capturable:
Types: ~disabled
@@ -29,9 +45,10 @@ powerproxy.paratroopers:
HACKE6:
Inherits: E6
-RepairsBridges:
- -ExternalCaptures:
Captures:
- CaptureTypes: building
+ -ConsumedByCapture:
+ -EnterCursor:
+ -EnterBlockedCursor:
WithInfantryBody:
Targetable:
RequiresCondition: !jail
diff --git a/mods/ra/maps/infiltration/rules.yaml b/mods/ra/maps/infiltration/rules.yaml
index 5e8ca7806a..601a6abbde 100644
--- a/mods/ra/maps/infiltration/rules.yaml
+++ b/mods/ra/maps/infiltration/rules.yaml
@@ -59,8 +59,12 @@ SPY.Strong:
Range: 6c0
Infiltrates:
Types: MissionObjective
- ExternalCaptures:
+ CaptureManager:
+ Captures:
CaptureTypes: MissionObjective
+ ConsumedByCapture: False
+ EnterCursor: ability
+ EnterBlockedCursor: move-blocked
Passenger:
DOG.Patrol:
@@ -87,9 +91,8 @@ TRUK.Hijackable:
Targetable:
TargetTypes: Ground, Repair, Vehicle, NoAutoTarget
-Huntable:
- ExternalCapturable:
+ Capturable:
Types: MissionObjective
- CaptureCompleteTime: 1
-DeliversCash:
RenderSprites:
Image: TRUK
diff --git a/mods/ra/maps/intervention/rules.yaml b/mods/ra/maps/intervention/rules.yaml
index c05f1f6174..2599922cb9 100644
--- a/mods/ra/maps/intervention/rules.yaml
+++ b/mods/ra/maps/intervention/rules.yaml
@@ -32,8 +32,8 @@ MISS:
Name: Soviet Air Force HQ
Capturable:
Types: building
- CaptureThreshold: 100
ValidStances: Enemy
+ CaptureManager:
E6.MOD:
Inherits: E6
@@ -41,9 +41,9 @@ E6.MOD:
Prerequisites: ~barracks
Captures:
CaptureTypes: building
- Sabotage: False
RenderSprites:
Image: e6
+ CaptureManager:
E6:
Buildable:
diff --git a/mods/ra/maps/soviet-soldier-volkov-n-chitzkoi/rules.yaml b/mods/ra/maps/soviet-soldier-volkov-n-chitzkoi/rules.yaml
index 875dfaef1a..d0a120e12d 100644
--- a/mods/ra/maps/soviet-soldier-volkov-n-chitzkoi/rules.yaml
+++ b/mods/ra/maps/soviet-soldier-volkov-n-chitzkoi/rules.yaml
@@ -101,8 +101,8 @@ AFAC:
GenericStancePrefix: false
-TooltipDescription@ally:
-TooltipDescription@other:
- -ExternalCapturable:
- -ExternalCapturableBar:
+ Capturable:
+ Types: ~disabled
-EngineerRepairable:
-GpsDot:
RenderSprites:
@@ -117,8 +117,8 @@ CCEN:
GenericName: Control Center
GenericVisibility: Enemy, Ally, Neutral
GenericStancePrefix: false
- -ExternalCapturable:
- -ExternalCapturableBar:
+ Capturable:
+ Types: ~disabled
-EngineerRepairable:
GpsPower:
Prerequisites: ~disabled
diff --git a/mods/ra/rules/civilian.yaml b/mods/ra/rules/civilian.yaml
index 5ef6316e60..b24244f90d 100644
--- a/mods/ra/rules/civilian.yaml
+++ b/mods/ra/rules/civilian.yaml
@@ -91,9 +91,11 @@ FCOM:
RevealsShroud@GAPGEN:
Range: 4c0
WithBuildingBib:
- ExternalCapturable:
- CaptureCompleteTime: 30
- ExternalCapturableBar:
+ CaptureManager:
+ Capturable:
+ Types: building
+ CapturableProgressBar:
+ CapturableProgressBlink:
GivesBuildableArea:
AreaTypes: building
BaseProvider:
@@ -118,8 +120,11 @@ HOSP:
Dimensions: 2,2
Health:
HP: 80000
- ExternalCapturable:
- ExternalCapturableBar:
+ CaptureManager:
+ Capturable:
+ Types: building
+ CapturableProgressBar:
+ CapturableProgressBlink:
EngineerRepairable:
Tooltip:
Name: Hospital
@@ -407,8 +412,11 @@ MISS:
Description: Capture to give visual range.
ValidStances: Neutral, Enemy
WithBuildingBib:
- ExternalCapturable:
- ExternalCapturableBar:
+ CaptureManager:
+ Capturable:
+ Types: building
+ CapturableProgressBar:
+ CapturableProgressBlink:
EngineerRepairable:
WithDeathAnimation:
DeathSequence: dead
@@ -429,8 +437,11 @@ BIO:
Dimensions: 2,2
RevealsShroud:
Range: 4c0
- ExternalCapturable:
- ExternalCapturableBar:
+ CaptureManager:
+ CapturableProgressBlink:
+ Capturable:
+ Types: building
+ CapturableProgressBar:
EngineerRepairable:
Tooltip:
Name: Biological Lab
@@ -465,8 +476,11 @@ OILB:
HP: 80000
RevealsShroud:
Range: 4c0
- ExternalCapturable:
- ExternalCapturableBar:
+ CaptureManager:
+ Capturable:
+ Types: building
+ CapturableProgressBar:
+ CapturableProgressBlink:
EngineerRepairable:
CashTrickler:
Interval: 375
diff --git a/mods/ra/rules/defaults.yaml b/mods/ra/rules/defaults.yaml
index 5093108b88..9eaf159a95 100644
--- a/mods/ra/rules/defaults.yaml
+++ b/mods/ra/rules/defaults.yaml
@@ -266,9 +266,9 @@
Guardable:
Tooltip:
GenericName: Vehicle
+ CaptureManager:
Capturable:
Types: vehicle
- CaptureThreshold: 100
CancelActivity: True
CaptureNotification:
Notification: UnitStolen
@@ -648,8 +648,12 @@
EngineerRepairable:
AcceptsDeliveredCash:
WithMakeAnimation:
- ExternalCapturable:
- ExternalCapturableBar:
+ CaptureManager:
+ BeingCapturedCondition: being-captured
+ Capturable:
+ Types: building
+ CapturableProgressBar:
+ CapturableProgressBlink:
SpawnActorsOnSell:
ActorTypes: e1,e1,e1,tecn,tecn
MustBeDestroyed:
@@ -657,6 +661,7 @@
GpsDot:
String: Structure
Sellable:
+ RequiresCondition: !being-captured
SellSounds: cashturn.aud
WithBuildingRepairDecoration:
Image: allyrepair
@@ -922,9 +927,9 @@
AllowedTerrain: Clear, Rough, Road, Ore, Gems, Beach
Burns:
Damage: 200
+ CaptureManager:
Capturable:
Types: husk
- CaptureThreshold: 100
ValidStances: Enemy, Neutral, Ally
TransformOnCapture:
ForceHealthPercentage: 25
diff --git a/mods/ra/rules/infantry.yaml b/mods/ra/rules/infantry.yaml
index 416c7b2005..cc025ee34c 100644
--- a/mods/ra/rules/infantry.yaml
+++ b/mods/ra/rules/infantry.yaml
@@ -240,9 +240,14 @@ E6:
PipType: Yellow
EngineerRepair:
RepairsBridges:
- ExternalCaptures:
+ CaptureManager:
+ Captures:
CaptureTypes: building
PlayerExperience: 25
+ CaptureDelay: 375
+ ConsumedByCapture: False
+ EnterCursor: ability
+ EnterBlockedCursor: move-blocked
Voiced:
VoiceSet: EngineerVoice
Selectable:
@@ -430,6 +435,7 @@ MECH:
ForceTargetStances: None
AttackFrontal:
Voice: Move
+ CaptureManager:
Captures:
CaptureTypes: husk
PlayerExperience: 25
@@ -536,6 +542,7 @@ HIJACKER:
Range: 5c0
Passenger:
PipType: Blue
+ CaptureManager:
Captures:
CaptureTypes: vehicle
PlayerExperience: 50
diff --git a/mods/ra/rules/structures.yaml b/mods/ra/rules/structures.yaml
index b24d3841f5..3d068f5104 100644
--- a/mods/ra/rules/structures.yaml
+++ b/mods/ra/rules/structures.yaml
@@ -184,6 +184,7 @@ SPEN:
ExitCell: 2,0
ProductionTypes: Ship
Production:
+ PauseOnCondition: being-captured
Produces: Ship, Submarine
PrimaryBuilding:
PrimaryCondition: primary
@@ -301,6 +302,7 @@ SYRD:
ExitCell: 2,0
ProductionTypes: Ship, Boat
Production:
+ PauseOnCondition: being-captured
Produces: Ship, Boat
PrimaryBuilding:
PrimaryCondition: primary
@@ -974,6 +976,7 @@ WEAP:
SpawnOffset: 213,-128,0
ExitCell: 1,2
Production:
+ PauseOnCondition: being-captured
Produces: Vehicle
ProvidesPrerequisite@allies:
Factions: allies, england, france, germany
@@ -1100,7 +1103,8 @@ FACT:
Range: 4c0
WithBuildingBib:
Production:
- Produces: Building,Defense
+ PauseOnCondition: being-captured
+ Produces: Building, Defense
Valued:
Cost: 2500
Tooltip:
@@ -1109,13 +1113,13 @@ FACT:
ActorTypes: e1,e1,e1,tecn,tecn,e6
BaseBuilding:
Transforms:
- PauseOnCondition: chrono-vortex
+ PauseOnCondition: chrono-vortex || being-captured
IntoActor: mcv
Offset: 1,1
Facing: 96
RequiresCondition: factundeploy
Sellable:
- RequiresCondition: !chrono-vortex
+ RequiresCondition: !chrono-vortex && !being-captured
GrantConditionOnPrerequisite@GLOBALFACTUNDEPLOY:
Condition: factundeploy
Prerequisites: global-factundeploy
@@ -1125,6 +1129,7 @@ FACT:
ProductionType: Defense
Color: 8A8A8A
BaseProvider:
+ PauseOnCondition: being-captured
Range: 16c0
WithBuildingPlacedAnimation:
RequiresCondition: !chrono-vortex
@@ -1288,6 +1293,7 @@ HPAD:
Facing: 224
RallyPoint:
Production:
+ PauseOnCondition: being-captured
Produces: Aircraft, Helicopter
Reservable:
ProductionBar:
@@ -1377,6 +1383,7 @@ AFLD:
MoveIntoWorld: false
RallyPoint:
Production:
+ PauseOnCondition: being-captured
Produces: Aircraft, Plane
Reservable:
ProvidesPrerequisite@soviet:
@@ -1647,6 +1654,7 @@ BARR:
ExitCell: 0,2
ProductionTypes: Soldier, Infantry
Production:
+ PauseOnCondition: being-captured
Produces: Infantry, Soldier
PrimaryBuilding:
PrimaryCondition: primary
@@ -1727,6 +1735,7 @@ KENN:
ExitCell: -1,0
ProductionTypes: Dog, Infantry
Production:
+ PauseOnCondition: being-captured
Produces: Infantry, Dog
PrimaryBuilding:
PrimaryCondition: primary
@@ -1785,6 +1794,7 @@ TENT:
ExitCell: 0,2
ProductionTypes: Soldier, Infantry
Production:
+ PauseOnCondition: being-captured
Produces: Infantry, Soldier
PrimaryBuilding:
PrimaryCondition: primary
diff --git a/mods/ts/maps/sunstroke/rules.yaml b/mods/ts/maps/sunstroke/rules.yaml
index 542931cfc3..b549c9f8bb 100644
--- a/mods/ts/maps/sunstroke/rules.yaml
+++ b/mods/ts/maps/sunstroke/rules.yaml
@@ -19,11 +19,15 @@ World:
Scripts: sunstroke.lua
GAOLDCC2:
+ CaptureManager:
Capturable:
+ Types: building
ProvidesPrerequisite@BuildingName:
GAOLDCC3:
+ CaptureManager:
Capturable:
+ Types: building
ProvidesPrerequisite@BuildingName:
4TNK:
diff --git a/mods/ts/rules/civilian-structures.yaml b/mods/ts/rules/civilian-structures.yaml
index 4d463d3f3f..a79192f3ec 100644
--- a/mods/ts/rules/civilian-structures.yaml
+++ b/mods/ts/rules/civilian-structures.yaml
@@ -751,7 +751,9 @@ CAARMR:
Palette: player
ProvidesPrerequisite:
Prerequisite: barracks.upgraded
+ CaptureManager:
Capturable:
+ Types: building
ThrowsShrapnel@SMALL:
Pieces: 6, 9
ThrowsShrapnel@LARGE:
@@ -794,7 +796,9 @@ CAHOSP:
HP: 80000
RenderSprites:
Palette: player
+ CaptureManager:
Capturable:
+ Types: building
CaptureNotification:
ProvidesPrerequisite@BuildingName:
ThrowsShrapnel@SMALL:
diff --git a/mods/ts/rules/defaults.yaml b/mods/ts/rules/defaults.yaml
index 8872509470..415f400875 100644
--- a/mods/ts/rules/defaults.yaml
+++ b/mods/ts/rules/defaults.yaml
@@ -350,7 +350,9 @@
Inherits@2: ^EmpDisable
GivesBuildableArea:
AreaTypes: building
+ CaptureManager:
Capturable:
+ Types: building
RepairableBuilding:
RepairStep: 700
PlayerExperience: 25
@@ -737,9 +739,9 @@
Voice: Move
HiddenUnderFog:
ActorLostNotification:
+ CaptureManager:
Capturable:
Types: Vehicle
- CaptureThreshold: 100
CancelActivity: True
Guard:
Voice: Move
diff --git a/mods/ts/rules/nod-infantry.yaml b/mods/ts/rules/nod-infantry.yaml
index 74205be750..a87929a5e6 100644
--- a/mods/ts/rules/nod-infantry.yaml
+++ b/mods/ts/rules/nod-infantry.yaml
@@ -126,6 +126,7 @@ MHIJACK:
Mobile:
Speed: 99
-Crushable:
+ CaptureManager:
Captures:
CaptureTypes: Vehicle
PlayerExperience: 50
diff --git a/mods/ts/rules/shared-infantry.yaml b/mods/ts/rules/shared-infantry.yaml
index 1d261eed92..d77a77382d 100644
--- a/mods/ts/rules/shared-infantry.yaml
+++ b/mods/ts/rules/shared-infantry.yaml
@@ -58,6 +58,7 @@ ENGINEER:
EngineerRepair:
RepairsBridges:
RepairNotification: BridgeRepaired
+ CaptureManager:
Captures:
CaptureTypes: building
PlayerExperience: 50