diff --git a/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj b/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj
index 3da40b5047..c2b9a91125 100644
--- a/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj
+++ b/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj
@@ -86,7 +86,6 @@
-
diff --git a/OpenRA.Mods.Cnc/Traits/SpawnViceroid.cs b/OpenRA.Mods.Cnc/Traits/SpawnViceroid.cs
deleted file mode 100644
index cdeaf5444c..0000000000
--- a/OpenRA.Mods.Cnc/Traits/SpawnViceroid.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-#region Copyright & License Information
-/*
- * Copyright 2007-2015 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. For more information,
- * see COPYING.
- */
-#endregion
-
-using System.Linq;
-using OpenRA.Mods.Common.Warheads;
-using OpenRA.Primitives;
-using OpenRA.Traits;
-
-namespace OpenRA.Mods.Cnc.Traits
-{
- class SpawnViceroidInfo : ITraitInfo
- {
- [ActorReference] public readonly string ViceroidActor = "vice";
- public readonly int Probability = 10;
- public readonly string Owner = "Creeps";
- public readonly string DeathType = "TiberiumDeath";
-
- public object Create(ActorInitializer init) { return new SpawnViceroid(this); }
- }
-
- class SpawnViceroid : INotifyKilled
- {
- readonly SpawnViceroidInfo info;
-
- public SpawnViceroid(SpawnViceroidInfo info) { this.info = info; }
-
- public void Killed(Actor self, AttackInfo e)
- {
- if (!self.World.LobbyInfo.GlobalSettings.Creeps) return;
- if (self.World.SharedRandom.Next(100) > info.Probability) return;
-
- var warhead = e.Warhead as DamageWarhead;
- if (warhead == null || !warhead.DamageTypes.Contains(info.DeathType))
- return;
-
- self.World.AddFrameEndTask(w =>
- {
- var td = new TypeDictionary
- {
- new LocationInit(self.Location),
- new OwnerInit(self.World.Players.First(p => p.InternalName == info.Owner))
- };
-
- var facing = self.TraitOrDefault();
- if (facing != null)
- td.Add(new FacingInit(facing.Facing));
-
- w.CreateActor(info.ViceroidActor, td);
- });
- }
- }
-}
diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs
index 7a410b164a..7556e5e636 100644
--- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs
+++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs
@@ -527,7 +527,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
if (depth == 2 && parentKey.StartsWith("DeathSounds") && node.Key == "InfDeaths")
node.Key = "DeathTypes";
- if (depth == 2 && parentKey == "SpawnsViceroid" && node.Key == "InfDeath")
+ if (depth == 2 && parentKey == "SpawnViceroid" && node.Key == "InfDeath")
node.Key = "DeathType";
if (depth == 2 && parentKey == "Explodes" && node.Key == "InfDeath")
@@ -1409,7 +1409,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
var modifier = trait.Value.Nodes.FirstOrDefault(n => n.Key == type + "Modifier");
if (upgradeTypes == null || !string.IsNullOrEmpty(upgradeTypes.Value.Value) || modifier == null ||
- !string.IsNullOrEmpty(modifier.Value.Value))
+ !string.IsNullOrEmpty(modifier.Value.Value))
{
var yaml = new MiniYaml(null);
if (modifier == null)
@@ -1687,6 +1687,49 @@ namespace OpenRA.Mods.Common.UtilityCommands
node.Key = "Sequences";
}
+ // SpawnViceroid was replaced by SpawnActorOnDeath
+ // And LeavesHusk was renamed to SpawnActorOnDeath
+ if (engineVersion < 20150809)
+ {
+ if (node.Key == "SpawnViceroid")
+ {
+ node.Key = "SpawnActorOnDeath";
+
+ // The default value of ViceroidActor was vice
+ var actor = node.Value.Nodes.FirstOrDefault(n => n.Key == "ViceroidActor");
+ if (actor != null)
+ actor.Key = "HuskActor";
+ else
+ node.Value.Nodes.Add(new MiniYamlNode("HuskActor", "vice"));
+
+ // The default value of Probability was 10
+ var probability = node.Value.Nodes.FirstOrDefault(n => n.Key == "Probability");
+ if (probability == null)
+ node.Value.Nodes.Add(new MiniYamlNode("Probability", "10"));
+
+ // The default value of Owner was Creeps
+ var owner = node.Value.Nodes.FirstOrDefault(n => n.Key == "Owner");
+ if (owner != null)
+ {
+ node.Value.Nodes.Add(new MiniYamlNode("OwnerType", "InternalName"));
+ owner.Key = "InternalOwner";
+ }
+ else
+ {
+ node.Value.Nodes.Add(new MiniYamlNode("OwnerType", "InternalName"));
+ node.Value.Nodes.Add(new MiniYamlNode("InternalOwner", "Creeps"));
+ }
+
+ // The default value of DeathType was TiberiumDeath
+ var deathType = node.Value.Nodes.FirstOrDefault(n => n.Key == "DeathType");
+ if (deathType == null)
+ node.Value.Nodes.Add(new MiniYamlNode("DeathType", "TiberiumDeath"));
+ }
+
+ if (node.Key == "LeavesHusk")
+ node.Key = "SpawnActorOnDeath";
+ }
+
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
}
}
diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj
index 27d39ab054..61290d4564 100644
--- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj
+++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj
@@ -110,7 +110,7 @@
-
+
diff --git a/OpenRA.Mods.RA/Traits/LeavesHusk.cs b/OpenRA.Mods.RA/Traits/SpawnActorOnDeath.cs
similarity index 56%
rename from OpenRA.Mods.RA/Traits/LeavesHusk.cs
rename to OpenRA.Mods.RA/Traits/SpawnActorOnDeath.cs
index 50d0568b4c..60761a3464 100644
--- a/OpenRA.Mods.RA/Traits/LeavesHusk.cs
+++ b/OpenRA.Mods.RA/Traits/SpawnActorOnDeath.cs
@@ -10,26 +10,47 @@
using System.Linq;
using OpenRA.Mods.Common.Traits;
+using OpenRA.Mods.Common.Warheads;
using OpenRA.Primitives;
using OpenRA.Traits;
namespace OpenRA.Mods.RA.Traits
{
+ public enum OwnerType { Victim, Killer, InternalName }
+
[Desc("Spawn another actor immediately upon death.")]
- public class LeavesHuskInfo : ITraitInfo
+ public class SpawnActorOnDeathInfo : ITraitInfo
{
[ActorReference, FieldLoader.Require]
+ [Desc("Actor to spawn on death.")]
public readonly string HuskActor = null;
- public object Create(ActorInitializer init) { return new LeavesHusk(init, this); }
+ [Desc("Probability the husk actor spawns.")]
+ public readonly int Probability = 100;
+
+ [Desc("Owner of the husk actor. Allowed keywords:" +
+ "'Victim', 'Killer' and 'InternalName'.")]
+ public readonly OwnerType OwnerType = OwnerType.Victim;
+
+ [Desc("Map player to use when 'InternalName' is defined on 'OwnerType'.")]
+ public readonly string InternalOwner = null;
+
+ [Desc("DeathType that triggers the husk actor spawn." +
+ "Leave empty to spawn a husk actor ignoring the DeathTypes.")]
+ public readonly string DeathType = null;
+
+ [Desc("Skips the husk actor's make animations if true.")]
+ public readonly bool SkipMakeAnimations = true;
+
+ public object Create(ActorInitializer init) { return new SpawnActorOnDeath(init, this); }
}
- public class LeavesHusk : INotifyKilled
+ public class SpawnActorOnDeath : INotifyKilled
{
- readonly LeavesHuskInfo info;
+ readonly SpawnActorOnDeathInfo info;
readonly string race;
- public LeavesHusk(ActorInitializer init, LeavesHuskInfo info)
+ public SpawnActorOnDeath(ActorInitializer init, SpawnActorOnDeathInfo info)
{
this.info = info;
@@ -41,6 +62,13 @@ namespace OpenRA.Mods.RA.Traits
if (!self.IsInWorld)
return;
+ if (self.World.SharedRandom.Next(100) > info.Probability)
+ return;
+
+ var warhead = e.Warhead as DamageWarhead;
+ if (info.DeathType != null && warhead != null && !warhead.DamageTypes.Contains(info.DeathType))
+ return;
+
self.World.AddFrameEndTask(w =>
{
var td = new TypeDictionary
@@ -48,11 +76,19 @@ namespace OpenRA.Mods.RA.Traits
new ParentActorInit(self),
new LocationInit(self.Location),
new CenterPositionInit(self.CenterPosition),
- new OwnerInit(self.Owner),
- new FactionInit(race),
- new SkipMakeAnimsInit()
+ new FactionInit(race)
};
+ if (info.OwnerType == OwnerType.Victim)
+ td.Add(new OwnerInit(self.Owner));
+ else if (info.OwnerType == OwnerType.Killer)
+ td.Add(new OwnerInit(e.Attacker.Owner));
+ else
+ td.Add(new OwnerInit(self.World.Players.First(p => p.InternalName == info.InternalOwner)));
+
+ if (info.SkipMakeAnimations)
+ td.Add(new SkipMakeAnimsInit());
+
// Allows the husk to drag to its final position
var mobile = self.TraitOrDefault();
if (mobile != null)
@@ -71,7 +107,8 @@ namespace OpenRA.Mods.RA.Traits
if (turreted != null)
td.Add(new TurretFacingInit(turreted.TurretFacing));
- var chronoshiftable = self.TraitOrDefault(); // TODO: untie this and move to Mods.Common
+ // TODO: untie this and move to Mods.Common
+ var chronoshiftable = self.TraitOrDefault();
if (chronoshiftable != null && chronoshiftable.ReturnTicks > 0)
{
td.Add(new ChronoshiftOriginInit(chronoshiftable.Origin));
diff --git a/mods/cnc/maps/gdi05a/map.yaml b/mods/cnc/maps/gdi05a/map.yaml
index 319c02deeb..874f0a2c86 100644
--- a/mods/cnc/maps/gdi05a/map.yaml
+++ b/mods/cnc/maps/gdi05a/map.yaml
@@ -817,8 +817,7 @@ Rules:
GenericVisibility: Enemy
ShowOwnerRow: false
^Infantry:
- SpawnViceroid:
- Probability: 0
+ -SpawnActorOnDeath:
Tooltip:
GenericVisibility: Enemy
ShowOwnerRow: false
diff --git a/mods/cnc/maps/gdi05b/map.yaml b/mods/cnc/maps/gdi05b/map.yaml
index 89c8062cef..75689ee4cf 100644
--- a/mods/cnc/maps/gdi05b/map.yaml
+++ b/mods/cnc/maps/gdi05b/map.yaml
@@ -662,8 +662,7 @@ Rules:
GenericVisibility: Enemy
ShowOwnerRow: false
^Infantry:
- SpawnViceroid:
- Probability: 0
+ -SpawnActorOnDeath:
Tooltip:
GenericVisibility: Enemy
ShowOwnerRow: false
diff --git a/mods/cnc/rules/aircraft.yaml b/mods/cnc/rules/aircraft.yaml
index 0c86af2b04..27bd4bd84a 100644
--- a/mods/cnc/rules/aircraft.yaml
+++ b/mods/cnc/rules/aircraft.yaml
@@ -33,7 +33,7 @@ TRAN:
Types: Infantry
MaxWeight: 10
PipCount: 10
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: TRAN.Husk
Explodes:
Weapon: HeliExplode
@@ -83,7 +83,7 @@ HELI:
WithRotor:
Offset: 0,0,85
WithMuzzleFlash:
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: HELI.Husk
AutoTarget:
Explodes:
@@ -128,7 +128,7 @@ ORCA:
SelfReloads: true
ReloadCount: 2
SelfReloadTicks: 100
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: ORCA.Husk
AutoTarget:
Explodes:
diff --git a/mods/cnc/rules/civilian-desert.yaml b/mods/cnc/rules/civilian-desert.yaml
index 4d168e4c09..9e30ac48f9 100644
--- a/mods/cnc/rules/civilian-desert.yaml
+++ b/mods/cnc/rules/civilian-desert.yaml
@@ -3,7 +3,7 @@ V20:
Building:
Footprint: xx xx
Dimensions: 2,2
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V20.Husk
EditorTilesetFilter:
RequireTilesets: DESERT
@@ -21,7 +21,7 @@ V21:
Building:
Footprint: xx xx
Dimensions: 2,2
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V21.Husk
EditorTilesetFilter:
RequireTilesets: DESERT
@@ -39,7 +39,7 @@ V22:
Building:
Footprint: xx
Dimensions: 2,1
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V22.Husk
EditorTilesetFilter:
RequireTilesets: DESERT
@@ -54,7 +54,7 @@ V22.Husk:
V23:
Inherits: ^CivBuilding
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V23.Husk
EditorTilesetFilter:
RequireTilesets: DESERT
@@ -69,7 +69,7 @@ V24:
Building:
Footprint: xx xx
Dimensions: 2,2
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V24.Husk
EditorTilesetFilter:
RequireTilesets: DESERT
@@ -89,7 +89,7 @@ V25:
Dimensions: 2,2
Tooltip:
Name: Church
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V25.Husk
EditorTilesetFilter:
RequireTilesets: DESERT
@@ -109,7 +109,7 @@ V26:
Building:
Footprint: xx
Dimensions: 2,1
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V26.Husk
EditorTilesetFilter:
RequireTilesets: DESERT
@@ -124,7 +124,7 @@ V26.Husk:
V27:
Inherits: ^CivBuilding
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V27.Husk
EditorTilesetFilter:
RequireTilesets: DESERT
@@ -136,7 +136,7 @@ V27.Husk:
V28:
Inherits: ^CivBuilding
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V28.Husk
EditorTilesetFilter:
RequireTilesets: DESERT
@@ -148,7 +148,7 @@ V28.Husk:
V29:
Inherits: ^CivBuilding
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V29.Husk
EditorTilesetFilter:
RequireTilesets: DESERT
@@ -163,7 +163,7 @@ V30:
Building:
Footprint: xx
Dimensions: 2,1
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V30.Husk
EditorTilesetFilter:
RequireTilesets: DESERT
@@ -181,7 +181,7 @@ V31:
Building:
Footprint: xx
Dimensions: 2,1
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V31.Husk
EditorTilesetFilter:
RequireTilesets: DESERT
@@ -199,7 +199,7 @@ V32:
Building:
Footprint: xx
Dimensions: 2,1
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V32.Husk
EditorTilesetFilter:
RequireTilesets: DESERT
@@ -217,7 +217,7 @@ V33:
Building:
Footprint: xx
Dimensions: 2,1
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V33.Husk
EditorTilesetFilter:
RequireTilesets: DESERT
@@ -232,7 +232,7 @@ V33.Husk:
V34:
Inherits: ^CivBuilding
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V34.Husk
EditorTilesetFilter:
RequireTilesets: DESERT
@@ -244,7 +244,7 @@ V34.Husk:
V35:
Inherits: ^CivBuilding
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V35.Husk
EditorTilesetFilter:
RequireTilesets: DESERT
@@ -256,7 +256,7 @@ V35.Husk:
V36:
Inherits: ^CivBuilding
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V36.Husk
EditorTilesetFilter:
RequireTilesets: DESERT
@@ -268,7 +268,7 @@ V36.Husk:
V37:
Inherits: ^CivBuilding
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V37.Husk
Building:
Footprint: __xx_ ___xx
diff --git a/mods/cnc/rules/civilian.yaml b/mods/cnc/rules/civilian.yaml
index dfa3aff519..311f23e5b8 100644
--- a/mods/cnc/rules/civilian.yaml
+++ b/mods/cnc/rules/civilian.yaml
@@ -5,7 +5,7 @@ V01:
Dimensions: 2,2
Tooltip:
Name: Church
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V01.Husk
EditorTilesetFilter:
ExcludeTilesets: DESERT
@@ -25,7 +25,7 @@ V02:
Building:
Footprint: xx xx
Dimensions: 2,2
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V02.Husk
EditorTilesetFilter:
ExcludeTilesets: DESERT
@@ -43,7 +43,7 @@ V03:
Building:
Footprint: xx xx
Dimensions: 2,2
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V03.Husk
EditorTilesetFilter:
ExcludeTilesets: DESERT
@@ -61,7 +61,7 @@ V04:
Building:
Footprint: xx xx
Dimensions: 2,2
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V04.Husk
EditorTilesetFilter:
ExcludeTilesets: DESERT
@@ -79,7 +79,7 @@ V05:
Building:
Footprint: xx
Dimensions: 2,1
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V05.Husk
EditorTilesetFilter:
ExcludeTilesets: DESERT
@@ -97,7 +97,7 @@ V06:
Building:
Footprint: xx
Dimensions: 2,1
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V06.Husk
EditorTilesetFilter:
ExcludeTilesets: DESERT
@@ -115,7 +115,7 @@ V07:
Building:
Footprint: xx
Dimensions: 2,1
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V07.Husk
EditorTilesetFilter:
ExcludeTilesets: DESERT
@@ -130,7 +130,7 @@ V07.Husk:
V08:
Inherits: ^CivBuilding
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V08.Husk
EditorTilesetFilter:
ExcludeTilesets: DESERT
@@ -142,7 +142,7 @@ V08.Husk:
V09:
Inherits: ^CivBuilding
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V09.Husk
EditorTilesetFilter:
ExcludeTilesets: DESERT
@@ -154,7 +154,7 @@ V09.Husk:
V10:
Inherits: ^CivBuilding
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V10.Husk
EditorTilesetFilter:
ExcludeTilesets: DESERT
@@ -166,7 +166,7 @@ V10.Husk:
V11:
Inherits: ^CivBuilding
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V11.Husk
EditorTilesetFilter:
ExcludeTilesets: DESERT
@@ -178,7 +178,7 @@ V11.Husk:
V12:
Inherits: ^CivField
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V12.Husk
EditorTilesetFilter:
ExcludeTilesets: DESERT
@@ -190,7 +190,7 @@ V12.Husk:
V13:
Inherits: ^CivField
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V13.Husk
EditorTilesetFilter:
ExcludeTilesets: DESERT
@@ -202,7 +202,7 @@ V13.Husk:
V14:
Inherits: ^CivField
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V14.Husk
EditorTilesetFilter:
ExcludeTilesets: DESERT
@@ -214,7 +214,7 @@ V14.Husk:
V15:
Inherits: ^CivField
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V15.Husk
EditorTilesetFilter:
ExcludeTilesets: DESERT
@@ -226,7 +226,7 @@ V15.Husk:
V16:
Inherits: ^CivField
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V16.Husk
EditorTilesetFilter:
ExcludeTilesets: DESERT
@@ -238,7 +238,7 @@ V16.Husk:
V17:
Inherits: ^CivField
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V17.Husk
EditorTilesetFilter:
ExcludeTilesets: DESERT
@@ -250,7 +250,7 @@ V17.Husk:
V18:
Inherits: ^CivField
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V18.Husk
EditorTilesetFilter:
ExcludeTilesets: DESERT
@@ -265,7 +265,7 @@ ARCO:
Building:
Footprint: xx
Dimensions: 2,1
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: ARCO.Husk
ARCO.Husk:
diff --git a/mods/cnc/rules/defaults.yaml b/mods/cnc/rules/defaults.yaml
index 29ae3b6700..963cd48659 100644
--- a/mods/cnc/rules/defaults.yaml
+++ b/mods/cnc/rules/defaults.yaml
@@ -190,8 +190,12 @@
HiddenUnderFog:
PoisonedByTiberium:
ActorLostNotification:
- SpawnViceroid:
+ SpawnActorOnDeath:
Probability: 10
+ HuskActor: vice
+ OwnerType: InternalName
+ InternalOwner: Creeps
+ DeathType: TiberiumDeath
Crushable:
WarnProbability: 67
CrushSound: squish2.aud
diff --git a/mods/cnc/rules/tech.yaml b/mods/cnc/rules/tech.yaml
index 2a564ba8a1..f6e5c844e1 100644
--- a/mods/cnc/rules/tech.yaml
+++ b/mods/cnc/rules/tech.yaml
@@ -6,7 +6,7 @@ V19:
Dimensions: 1,1
Tooltip:
Name: Oil Derrick
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V19.Husk
V19.Husk:
@@ -37,7 +37,7 @@ HOSP:
HP: 1000
Tooltip:
Name: Hospital
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: HOSP.Husk
Bib:
HasMinibib: Yes
@@ -74,7 +74,7 @@ BIO:
ProductionBar:
RallyPoint:
RallyPoint: -1,-1
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: BIO.Husk
ProvidesPrerequisite@buildingname:
diff --git a/mods/cnc/rules/vehicles.yaml b/mods/cnc/rules/vehicles.yaml
index 11390e070a..a6aa0cdbfa 100644
--- a/mods/cnc/rules/vehicles.yaml
+++ b/mods/cnc/rules/vehicles.yaml
@@ -29,7 +29,7 @@ MCV:
MustBeDestroyed:
RequiredForShortGame: true
BaseBuilding:
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: MCV.Husk
-GainsExperience:
-Cloak:
@@ -67,7 +67,7 @@ HARV:
Type: Heavy
RevealsShroud:
Range: 4c0
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: HARV.Husk
-GainsExperience:
WithHarvestAnimation:
@@ -120,7 +120,7 @@ APC:
Types: Infantry
MaxWeight: 5
PipCount: 5
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: APC.Husk
ARTY:
@@ -151,7 +151,7 @@ ARTY:
WithMuzzleFlash:
AutoTarget:
InitialStance: Defend
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: ARTY.Husk
Explodes:
Weapon: ArtilleryShell
@@ -190,7 +190,7 @@ FTNK:
Explodes:
Weapon: FlametankExplode
EmptyWeapon: FlametankExplode
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: FTNK.Husk
BGGY:
@@ -224,7 +224,7 @@ BGGY:
WithMuzzleFlash:
WithTurret:
AutoTarget:
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: BGGY.Husk
BIKE:
@@ -260,7 +260,7 @@ BIKE:
LocalYaw: 100, -100
AttackFrontal:
AutoTarget:
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: BIKE.Husk
JEEP:
@@ -294,7 +294,7 @@ JEEP:
WithMuzzleFlash:
WithTurret:
AutoTarget:
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: JEEP.Husk
LTNK:
@@ -329,7 +329,7 @@ LTNK:
WithMuzzleFlash:
WithTurret:
AutoTarget:
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: LTNK.Husk
MTNK:
@@ -363,7 +363,7 @@ MTNK:
WithMuzzleFlash:
WithTurret:
AutoTarget:
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: MTNK.Husk
SelectionDecorations:
VisualBounds: 28,28
@@ -413,7 +413,7 @@ HTNK:
Ticks: 10
HealIfBelow: 50%
DamageCooldown: 200
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: HTNK.Husk
SelectionDecorations:
VisualBounds: 34,34,0,-3
@@ -451,7 +451,7 @@ MSAM:
WithTurret:
AimSequence: aim
AutoTarget:
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: MSAM.Husk
MLRS:
@@ -493,7 +493,7 @@ MLRS:
AutoTarget:
InitialStance: Defend
RenderRangeCircle:
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: MLRS.Husk
STNK:
@@ -530,7 +530,7 @@ STNK:
AutoTarget:
InitialStance: HoldFire
TargetableUnit:
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: STNK.Husk
-MustBeDestroyed:
diff --git a/mods/d2k/rules/aircraft.yaml b/mods/d2k/rules/aircraft.yaml
index 0a4bd7a44f..ce1a9b7668 100644
--- a/mods/d2k/rules/aircraft.yaml
+++ b/mods/d2k/rules/aircraft.yaml
@@ -20,7 +20,7 @@ carryall.reinforce:
Repulsable: False
LandAltitude: 100
LandWhenIdle: False
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: carryall.husk
Carryall:
Automatic: False
@@ -58,7 +58,7 @@ carryall.infantry:
Types: Infantry
Tooltip:
Name: Carryall
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: carryall.infantry.husk
RejectsOrders:
RenderSprites:
@@ -116,7 +116,7 @@ orni:
Speed: 280
RepairBuildings: repair
RearmBuildings:
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: orni.husk
SelectionDecorations:
Selectable:
@@ -146,7 +146,7 @@ orni.bomber:
Ammo: 5
Tooltip:
Name: Ornithopter
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: orni.bomber.husk
RejectsOrders:
RenderSprites:
diff --git a/mods/d2k/rules/vehicles.yaml b/mods/d2k/rules/vehicles.yaml
index fccc46aed7..dc962f3a9c 100644
--- a/mods/d2k/rules/vehicles.yaml
+++ b/mods/d2k/rules/vehicles.yaml
@@ -33,7 +33,7 @@ mcv:
Offset: -1,-1
TransformSounds: BUILD1.WAV
NoTransformNotification: CannotDeploy
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: mcv.husk
AttractsWorms:
Intensity: 700
@@ -75,7 +75,7 @@ harvester:
Explodes:
Weapon: SpiceExplosion
EmptyWeapon: UnitExplodeScale
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: Harvester.Husk
WithHarvestOverlay:
Palette: effect50alpha
@@ -193,7 +193,7 @@ siegetank:
InitialStance: Defend
Selectable:
Class: siegetank
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: siegetank.husk
AttractsWorms:
Intensity: 600
@@ -232,7 +232,7 @@ missiletank:
EmptyWeapon: UnitExplodeScale
Selectable:
Class: missiletank
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: missiletank.husk
AttractsWorms:
Intensity: 600
@@ -265,7 +265,7 @@ sonictank:
Explodes:
Weapon: UnitExplodeSmall
EmptyWeapon: UnitExplodeSmall
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: sonictank.husk
AttractsWorms:
Intensity: 600
@@ -302,7 +302,7 @@ devast:
Explodes:
Weapon: UnitExplodeScale
EmptyWeapon: UnitExplodeScale
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: devast.husk
AttractsWorms:
Intensity: 700
@@ -390,7 +390,7 @@ deviatortank:
Explodes:
Weapon: UnitExplodeSmall
EmptyWeapon: UnitExplodeSmall
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: deviatortank.husk
AttractsWorms:
Intensity: 600
@@ -442,7 +442,7 @@ combata:
Prerequisites: ~heavy.atreides
Armament:
Weapon: 90mma
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: combata.husk
combath:
@@ -458,7 +458,7 @@ combath:
Range: 7c0
Health:
HP: 440
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: combath.husk
combato:
@@ -471,6 +471,6 @@ combato:
Speed: 96
ROT: 8
Crushes: crate, infantry
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: combato.husk
diff --git a/mods/ra/maps/allies-05a/map.yaml b/mods/ra/maps/allies-05a/map.yaml
index ea3244f401..de13891713 100644
--- a/mods/ra/maps/allies-05a/map.yaml
+++ b/mods/ra/maps/allies-05a/map.yaml
@@ -1684,7 +1684,7 @@ Rules:
Buildable:
Prerequisites: ~disabled
WithFacingSpriteBody:
- -LeavesHusk:
+ -SpawnActorOnDeath:
-EjectOnDeath:
AutoSelectionSize:
RenderSprites:
diff --git a/mods/ra/maps/monster-tank-madness/map.yaml b/mods/ra/maps/monster-tank-madness/map.yaml
index df78d0750d..43e3704d9f 100644
--- a/mods/ra/maps/monster-tank-madness/map.yaml
+++ b/mods/ra/maps/monster-tank-madness/map.yaml
@@ -2212,7 +2212,7 @@ Rules:
Explodes:
Weapon: MiniNuke
EmptyWeapon: MiniNuke
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: 5TNK.Husk
SelfHealing:
Step: 1
diff --git a/mods/ra/maps/soviet-01/map.yaml b/mods/ra/maps/soviet-01/map.yaml
index d5e2242907..29480b9b3b 100644
--- a/mods/ra/maps/soviet-01/map.yaml
+++ b/mods/ra/maps/soviet-01/map.yaml
@@ -619,7 +619,7 @@ Rules:
ObjectivesPanel:
PanelName: MISSION_OBJECTIVES
V01:
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: healcrate
HEALCRATE:
Tooltip:
diff --git a/mods/ra/rules/aircraft.yaml b/mods/ra/rules/aircraft.yaml
index 343372d13d..b7104165bb 100644
--- a/mods/ra/rules/aircraft.yaml
+++ b/mods/ra/rules/aircraft.yaml
@@ -23,7 +23,7 @@ BADR:
Offset: -432,560,0
Contrail@2:
Offset: -432,-560,0
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: BADR.Husk
SmokeTrailWhenDamaged@0:
Offset: -432,560,0
@@ -61,7 +61,7 @@ BADR.Bomber:
Offset: -432,560,0
Contrail@2:
Offset: -432,-560,0
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: BADR.Husk
SmokeTrailWhenDamaged@0:
Offset: -432,560,0
@@ -123,7 +123,7 @@ MIG:
Offset: -598,-683,0
Contrail@2:
Offset: -598,683,0
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: MIG.Husk
SmokeTrailWhenDamaged:
Offset: -853,0,171
@@ -183,7 +183,7 @@ YAK:
WithMuzzleFlash:
Contrail:
Offset: -853,0,0
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: YAK.Husk
SmokeTrailWhenDamaged:
Offset: -853,0,0
@@ -227,7 +227,7 @@ TRAN:
Types: Infantry
MaxWeight: 8
PipCount: 8
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: TRAN.Husk
HELI:
@@ -271,7 +271,7 @@ HELI:
Ammo: 8
SelectionDecorations:
VisualBounds: 36,28,0,0
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: HELI.Husk
SmokeTrailWhenDamaged:
Offset: -427,0,0
@@ -324,7 +324,7 @@ HIND:
SelectionDecorations:
VisualBounds: 38,32,0,0
WithMuzzleFlash:
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: HIND.Husk
SmokeTrailWhenDamaged:
Offset: -427,0,0
@@ -352,7 +352,7 @@ U2:
Offset: -725,683,0
Contrail@2:
Offset: -725,-683,0
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: U2.Husk
SmokeTrailWhenDamaged:
Offset: -1c43,0,0
diff --git a/mods/ra/rules/civilian.yaml b/mods/ra/rules/civilian.yaml
index d68f1e6779..679d5cf4f6 100644
--- a/mods/ra/rules/civilian.yaml
+++ b/mods/ra/rules/civilian.yaml
@@ -222,7 +222,7 @@ V19:
ExcludeTilesets: DESERT
Tooltip:
Name: Oil Pump
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: V19.Husk
AutoTargetIgnore:
diff --git a/mods/ra/rules/vehicles.yaml b/mods/ra/rules/vehicles.yaml
index 56ded60823..7039a37de3 100644
--- a/mods/ra/rules/vehicles.yaml
+++ b/mods/ra/rules/vehicles.yaml
@@ -63,7 +63,7 @@ V2RL:
WithMuzzleFlash:
WithTurret:
AutoTarget:
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: 1TNK.Husk
ProducibleWithLevel:
Prerequisites: vehicles.upgraded
@@ -100,7 +100,7 @@ V2RL:
WithMuzzleFlash:
WithTurret:
AutoTarget:
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: 2TNK.Husk
SelectionDecorations:
VisualBounds: 28,28
@@ -139,7 +139,7 @@ V2RL:
WithMuzzleFlash:
WithTurret:
AutoTarget:
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: 3TNK.Husk
SelectionDecorations:
VisualBounds: 28,28
@@ -187,7 +187,7 @@ V2RL:
WithMuzzleFlash:
WithTurret:
AutoTarget:
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: 4TNK.Husk
SelfHealing:
Step: 1
@@ -270,7 +270,7 @@ HARV:
WithDockingAnimation:
GpsDot:
String: Harvester
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: HARV.EmptyHusk
HarvesterHuskModifier:
FullHuskActor: HARV.FullHusk
@@ -313,7 +313,7 @@ MCV:
MustBeDestroyed:
RequiredForShortGame: true
BaseBuilding:
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: MCV.Husk
JEEP:
@@ -478,7 +478,7 @@ TRUK:
Range: 3c0
SupplyTruck:
Payload: 500
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: moneycrate
MGG:
@@ -506,7 +506,7 @@ MGG:
CreatesShroud:
Range: 6c0
RenderShroudCircle:
- LeavesHusk:
+ SpawnActorOnDeath:
HuskActor: MGG.Husk
MRJ:
diff --git a/mods/ts/rules/defaults.yaml b/mods/ts/rules/defaults.yaml
index 6cb017838a..e61652ddb4 100644
--- a/mods/ts/rules/defaults.yaml
+++ b/mods/ts/rules/defaults.yaml
@@ -256,8 +256,11 @@
Crushable:
CrushSound: squish6.aud
PoisonedByTiberium:
- SpawnViceroid:
- ViceroidActor: vissml
+ SpawnActorOnDeath:
+ HuskActor: vissml
+ Probability: 10
+ OwnerType: InternalName
+ InternalOwner: Creeps
DeathType: EnergyDeath # TODO: FIX ME! (Tiberium currently uses the wrong damage type!)
Guard:
Voice: Move
diff --git a/mods/ts/rules/nod-infantry.yaml b/mods/ts/rules/nod-infantry.yaml
index e42340f8a3..0ef4b14b4d 100644
--- a/mods/ts/rules/nod-infantry.yaml
+++ b/mods/ts/rules/nod-infantry.yaml
@@ -79,7 +79,7 @@ CYC2:
Mobile:
Speed: 56
Health:
- HP: 500
+ HP: 500
Passenger:
RevealsShroud:
Range: 7c0