Add TransformsInto* traits to trigger construction yard undeploy.

This commit is contained in:
Paul Chote
2019-06-05 20:00:27 +00:00
committed by reaperrr
parent 1b026b7e20
commit ecd8dee575
12 changed files with 826 additions and 25 deletions

View File

@@ -10,6 +10,7 @@
#endregion
using System.Collections.Generic;
using OpenRA.Activities;
using OpenRA.Mods.Common.Activities;
using OpenRA.Mods.Common.Orders;
using OpenRA.Traits;
@@ -85,6 +86,18 @@ namespace OpenRA.Mods.Common.Traits
return buildingInfo == null || self.World.CanPlaceBuilding(self.Location + Info.Offset, actorInfo, buildingInfo, self);
}
public Activity GetTransformActivity(Actor self)
{
return new Transform(self, Info.IntoActor)
{
Offset = Info.Offset,
Facing = Info.Facing,
Sounds = Info.TransformSounds,
Notification = Info.TransformNotification,
Faction = faction
};
}
public IEnumerable<IOrderTargeter> Orders
{
get
@@ -127,14 +140,7 @@ namespace OpenRA.Mods.Common.Traits
if (!queued)
self.CancelActivity();
self.QueueActivity(new Transform(self, Info.IntoActor)
{
Offset = Info.Offset,
Facing = Info.Facing,
Sounds = Info.TransformSounds,
Notification = Info.TransformNotification,
Faction = faction
});
self.QueueActivity(GetTransformActivity(self));
}
public void ResolveOrder(Actor self, Order order)