diff --git a/OpenRA.Game/GameRules/ActorInfo.cs b/OpenRA.Game/GameRules/ActorInfo.cs
index ccfadccc4c..65d2060c00 100644
--- a/OpenRA.Game/GameRules/ActorInfo.cs
+++ b/OpenRA.Game/GameRules/ActorInfo.cs
@@ -18,7 +18,6 @@ namespace OpenRA
{
///
/// A unit/building inside the game. Every rules starts with one and adds trait to it.
- /// Special actors like world or player are usually defined in system.yaml and affect everything.
///
public class ActorInfo
{
diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj
index 4f91d64281..cc134e0f1f 100644
--- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj
+++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj
@@ -84,6 +84,7 @@
+
diff --git a/OpenRA.Mods.RA/Scripting/Properties/DisguiseProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/DisguiseProperties.cs
new file mode 100644
index 0000000000..b017153b56
--- /dev/null
+++ b/OpenRA.Mods.RA/Scripting/Properties/DisguiseProperties.cs
@@ -0,0 +1,42 @@
+#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.RA.Traits;
+using OpenRA.Scripting;
+using OpenRA.Traits;
+
+namespace OpenRA.Mods.RA.Scripting
+{
+ [ScriptPropertyGroup("Ability")]
+ public class DisguiseProperties : ScriptActorProperties, Requires
+ {
+ readonly Disguise disguise;
+
+ public DisguiseProperties(ScriptContext context, Actor self)
+ : base(context, self)
+ {
+ disguise = Self.Trait();
+ }
+
+ [Desc("Disguises as the target actor.")]
+ public void DisguiseAs(Actor target)
+ {
+ disguise.DisguiseAs(target);
+ }
+
+ [Desc("Disguises as the target type with the specified owner.")]
+ public void DisguiseAsType(string actorType, Player newOwner)
+ {
+ var actorInfo = Self.World.Map.Rules.Actors[actorType];
+ disguise.DisguiseAs(actorInfo, newOwner);
+ }
+ }
+}
diff --git a/OpenRA.Mods.RA/Traits/Disguise.cs b/OpenRA.Mods.RA/Traits/Disguise.cs
index 7dae8aa490..05290108b1 100644
--- a/OpenRA.Mods.RA/Traits/Disguise.cs
+++ b/OpenRA.Mods.RA/Traits/Disguise.cs
@@ -128,7 +128,7 @@ namespace OpenRA.Mods.RA.Traits
return AsPlayer.Color.RGB;
}
- void DisguiseAs(Actor target)
+ public void DisguiseAs(Actor target)
{
var oldDisguiseSetting = Disguised;
var oldEffectiveOwner = AsPlayer;
@@ -159,6 +159,24 @@ namespace OpenRA.Mods.RA.Traits
AsSprite = null;
}
+ HandleDisguise(oldEffectiveOwner, oldDisguiseSetting);
+ }
+
+ public void DisguiseAs(ActorInfo actorInfo, Player newOwner)
+ {
+ var oldDisguiseSetting = Disguised;
+ var oldEffectiveOwner = AsPlayer;
+
+ var renderSprites = actorInfo.Traits.GetOrDefault();
+ AsSprite = renderSprites == null ? null : renderSprites.GetImage(actorInfo, self.World.Map.SequenceProvider, newOwner.Country.Race);
+ AsPlayer = newOwner;
+ AsTooltipInfo = actorInfo.Traits.WithInterface().FirstOrDefault();
+
+ HandleDisguise(oldEffectiveOwner, oldDisguiseSetting);
+ }
+
+ void HandleDisguise(Player oldEffectiveOwner, bool oldDisguiseSetting)
+ {
foreach (var t in self.TraitsImplementing())
t.OnEffectiveOwnerChanged(self, oldEffectiveOwner, AsPlayer);
diff --git a/mods/ra/maps/allies-05a/allies05a.lua b/mods/ra/maps/allies-05a/allies05a.lua
index a90da28896..f93e667f19 100644
--- a/mods/ra/maps/allies-05a/allies05a.lua
+++ b/mods/ra/maps/allies-05a/allies05a.lua
@@ -160,8 +160,6 @@ WarfactoryInfiltrated = function()
end
MissInfiltrated = function()
- CloakProvider.Destroy()
-
for i = 0, 5, 1 do
local sound = Utils.Random(TanyaVoices)
Trigger.AfterDelay(DateTime.Seconds(i), function()
@@ -247,9 +245,8 @@ InitTriggers = function()
if a == Truk then
Trigger.RemoveFootprintTrigger(id)
- CloakProvider = Actor.Create("CloakUpgrade", true, { Owner = greece, Location = Prison.Location })
-
Spy = Actor.Create("spy", true, { Owner = greece, Location = TrukWaypoint5.Location })
+ Spy.DisguiseAsType("e1", ussr)
Spy.Move(SpyWaypoint.Location)
Spy.Infiltrate(Prison)
Media.PlaySoundNotification(greece, SpyVoice)
diff --git a/mods/ra/maps/allies-05a/map.yaml b/mods/ra/maps/allies-05a/map.yaml
index e5ae9d780d..cf66949521 100644
--- a/mods/ra/maps/allies-05a/map.yaml
+++ b/mods/ra/maps/allies-05a/map.yaml
@@ -1694,20 +1694,6 @@ Rules:
Types: Mission Objectives
DisguiseToolTip:
ShowOwnerRow: false
- Cloak@MISS:
- UpgradeTypes: miss
- UpgradeMinEnabledLevel: 1
- InitialDelay: 0
- CloakDelay: 0
- Palette:
- CloakUpgrade:
- AlwaysVisible:
- Immobile:
- OccupiesSpace: false
- BodyOrientation:
- UpgradeActorsNear:
- Upgrades: miss
- Range: 5c512
WEAP:
TargetableBuilding:
TargetTypes: Ground, C4, DetonateAttack, Structure, Mission Objectives