Change mechanics to repair ally-owned husks.

Now uses the goldwrench cursor and keeps the
original owner.
This commit is contained in:
Paul Chote
2018-11-25 09:56:38 +00:00
committed by Oliver Brakmann
parent 89161b61ec
commit 8a95241fd5
5 changed files with 43 additions and 6 deletions

View File

@@ -18,11 +18,14 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Cnc.Traits
{
[Desc("This structure can be infiltrated causing funds to be stolen.")]
[Desc("Transform into a different actor type.")]
class InfiltrateForTransformInfo : ITraitInfo
{
[ActorReference, FieldLoader.Require] public readonly string IntoActor = null;
[ActorReference, FieldLoader.Require]
public readonly string IntoActor = null;
public readonly int ForceHealthPercentage = 0;
public readonly bool SkipMakeAnims = true;
public readonly BitSet<TargetableType> Types = default(BitSet<TargetableType>);
@@ -46,10 +49,17 @@ namespace OpenRA.Mods.Cnc.Traits
if (!info.Types.Overlaps(types))
return;
var transform = new Transform(self, info.IntoActor)
{
ForceHealthPercentage = info.ForceHealthPercentage,
Faction = faction,
SkipMakeAnims = info.SkipMakeAnims
};
var facing = self.TraitOrDefault<IFacing>();
var transform = new Transform(self, info.IntoActor) { ForceHealthPercentage = info.ForceHealthPercentage, Faction = faction };
if (facing != null) transform.Facing = facing.Facing;
transform.SkipMakeAnims = info.SkipMakeAnims;
if (facing != null)
transform.Facing = facing.Facing;
self.CancelActivity();
self.QueueActivity(transform);
}