diff --git a/CHANGELOG b/CHANGELOG index fba808efdb..20a70636de 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -83,6 +83,7 @@ NEW: Both Allied and Soviet factions now build general-purpose mines instead of AT and AP mines respectively. Added new attack-move cursor artwork. Added Phase Transport, an Allied high-tech infantry transport which can cloak. + Added Hijacker, a Soviet infantry unit with a vehicle hijacking ability. Attack Dogs, Snipers, Mobile Radar Jammers, Camo Pillboxes, Phase Transports, Radar Domes, and Spy Planes can now detect cloaked units. Removed the submarine detection ability from Cruiser and Transport. Added the submarine detection ability to Submarines and Missile Subs. diff --git a/OpenRA.Mods.RA/Capturable.cs b/OpenRA.Mods.RA/Capturable.cs index 70f9478d65..3d8844ad43 100644 --- a/OpenRA.Mods.RA/Capturable.cs +++ b/OpenRA.Mods.RA/Capturable.cs @@ -9,8 +9,9 @@ #endregion using System.Linq; -using OpenRA.Traits; using OpenRA.FileFormats; +using OpenRA.Mods.RA.Activities; +using OpenRA.Traits; namespace OpenRA.Mods.RA { @@ -24,6 +25,7 @@ namespace OpenRA.Mods.RA public readonly bool AllowEnemies = true; [Desc("Health percentage the target must be at (or below) before it can be captured.")] public readonly float CaptureThreshold = 0.5f; + public readonly bool CancelActivity = false; public bool CanBeTargetedBy(Actor captor, Player owner) { @@ -48,5 +50,17 @@ namespace OpenRA.Mods.RA } } - class Capturable { } + class Capturable : INotifyCapture + { + public void OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner) + { + var info = self.Info.Traits.Get(); + if (info.CancelActivity) + { + var stop = new Order("Stop", self, false); + foreach (var t in self.TraitsImplementing()) + t.ResolveOrder(self, stop); + } + } + } } diff --git a/OpenRA.Mods.RA/BuildingCaptureNotification.cs b/OpenRA.Mods.RA/CaptureNotification.cs similarity index 100% rename from OpenRA.Mods.RA/BuildingCaptureNotification.cs rename to OpenRA.Mods.RA/CaptureNotification.cs diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index dbf02920b1..91ed4ab7b0 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -166,7 +166,7 @@ - + diff --git a/mods/ra/bits/hijackericon.shp b/mods/ra/bits/hijackericon.shp new file mode 100644 index 0000000000..9eac767028 Binary files /dev/null and b/mods/ra/bits/hijackericon.shp differ diff --git a/mods/ra/bits/unitsto.aud b/mods/ra/bits/unitsto.aud new file mode 100644 index 0000000000..7c53219454 Binary files /dev/null and b/mods/ra/bits/unitsto.aud differ diff --git a/mods/ra/notifications.yaml b/mods/ra/notifications.yaml index 7c8a43af9e..5c9fec9f8c 100644 --- a/mods/ra/notifications.yaml +++ b/mods/ra/notifications.yaml @@ -23,6 +23,7 @@ Speech: NavalUnitLost: navylst1 AirUnitLost: aunitl1 BuildingCaptured: strucap1 + UnitStolen: unitsto ReinforcementsArrived: reinfor1 SignalFlareNorth: flaren1 AlliedReinforcementsArrived: aarrive1 diff --git a/mods/ra/rules/defaults.yaml b/mods/ra/rules/defaults.yaml index 63f90a4af1..faa1583d3b 100644 --- a/mods/ra/rules/defaults.yaml +++ b/mods/ra/rules/defaults.yaml @@ -46,6 +46,12 @@ Huntable: LuaScriptEvents: Demolishable: + Capturable: + Type: vehicle + CaptureThreshold: 1 + CancelActivity: True + CaptureNotification: + Notification: UnitStolen ^Tank: AppearsOnRadar: @@ -95,6 +101,12 @@ Huntable: LuaScriptEvents: Demolishable: + Capturable: + Type: vehicle + CaptureThreshold: 1 + CancelActivity: True + CaptureNotification: + Notification: UnitStolen ^Infantry: AppearsOnRadar: diff --git a/mods/ra/rules/infantry.yaml b/mods/ra/rules/infantry.yaml index f3ee7ad74d..08b13bd9b1 100644 --- a/mods/ra/rules/infantry.yaml +++ b/mods/ra/rules/infantry.yaml @@ -425,6 +425,34 @@ THF: TakeCover: -AutoTarget: +HIJACKER: + Inherits: ^Infantry + Buildable: + Queue: Infantry + BuildPaletteOrder: 90 + Owner: soviet + Prerequisites: fix + Hotkey: j + Valued: + Cost: 500 + Tooltip: + Name: Hijacker + Description: Hijacks enemy vehicles. Unarmed\n Strong vs Tanks\n Weak vs Infantry, Aircraft + Selectable: + Voice: ThiefVoice + Bounds: 12,17,0,-9 + Health: + HP: 80 + Mobile: + Speed: 56 + RevealsShroud: + Range: 5c0 + Passenger: + PipType: Yellow + Captures: + CaptureTypes: vehicle + -AutoTarget: + SHOK: Inherits: ^Infantry Buildable: diff --git a/mods/ra/sequences/infantry.yaml b/mods/ra/sequences/infantry.yaml index 37fe1b68b0..0abc867a31 100644 --- a/mods/ra/sequences/infantry.yaml +++ b/mods/ra/sequences/infantry.yaml @@ -587,6 +587,10 @@ thf: die6: electro Start: 0 Length: * + die-crushed: corpse1 + Start: 0 + Length: 6 + Tick: 1600 crawl: Start: 72 Length: 4 @@ -594,6 +598,47 @@ thf: icon: thficon Start: 0 +hijacker: + stand: thf + Start: 0 + Facings: 8 + stand2: thf + Start: 0 + Facings: 8 + run: thf + Start: 8 + Length: 6 + Facings: 8 + Tick: 100 + die1: thf + Start: 139 + Length: 8 + die2: thf + Start: 147 + Length: 8 + die3: thf + Start: 155 + Length: 8 + die4: thf + Start: 163 + Length: 12 + die5: thf + Start: 175 + Length: 18 + die6: electro + Start: 0 + Length: * + die-crushed: corpse1 + Start: 0 + Length: 6 + Tick: 1600 + crawl: thf + Start: 72 + Length: 4 + Facings: 8 + icon: hijackericon + Start: 0 + e7: stand: Start: 0