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

@@ -44,7 +44,7 @@ namespace OpenRA.Mods.Common.Traits
{
get
{
yield return new EnterTunnelOrderTargeter(info);
yield return new EnterTunnelOrderTargeter(info.EnterCursor, info.EnterBlockedCursor);
}
}
@@ -78,14 +78,16 @@ namespace OpenRA.Mods.Common.Traits
self.QueueActivity(move.MoveTo(tunnel.Exit.Value, tunnel.NearEnough));
}
class EnterTunnelOrderTargeter : UnitOrderTargeter
public class EnterTunnelOrderTargeter : UnitOrderTargeter
{
readonly EntersTunnelsInfo info;
readonly string enterCursor;
readonly string enterBlockedCursor;
public EnterTunnelOrderTargeter(EntersTunnelsInfo info)
: base("EnterTunnel", 6, info.EnterCursor, true, true)
public EnterTunnelOrderTargeter(string enterCursor, string enterBlockedCursor)
: base("EnterTunnel", 6, enterCursor, true, true)
{
this.info = info;
this.enterCursor = enterCursor;
this.enterBlockedCursor = enterBlockedCursor;
}
public override bool CanTargetActor(Actor self, Actor target, TargetModifiers modifiers, ref string cursor)
@@ -109,11 +111,11 @@ namespace OpenRA.Mods.Common.Traits
if (!tunnel.Exit.HasValue)
{
cursor = info.EnterBlockedCursor;
cursor = enterBlockedCursor;
return false;
}
cursor = info.EnterCursor;
cursor = enterCursor;
return true;
}