Gunboat non-orderable (move)
- Give Mobile OnRails property - Make hax Move not cancellable
This commit is contained in:
@@ -24,6 +24,7 @@ namespace OpenRA.Traits.Activities
|
||||
public List<int2> path;
|
||||
Func<Actor, Mobile, List<int2>> getPath;
|
||||
public Actor ignoreBuilding;
|
||||
bool cancellable = true;
|
||||
|
||||
MovePart move;
|
||||
int ticksBeforePathing;
|
||||
@@ -48,6 +49,7 @@ namespace OpenRA.Traits.Activities
|
||||
.WithoutLaneBias());
|
||||
this.destination = destination;
|
||||
this.nearEnough = 0;
|
||||
this.cancellable = false;
|
||||
}
|
||||
|
||||
public Move( int2 destination, int nearEnough )
|
||||
@@ -231,6 +233,8 @@ namespace OpenRA.Traits.Activities
|
||||
|
||||
public void Cancel( Actor self )
|
||||
{
|
||||
if (!cancellable) return;
|
||||
|
||||
path = new List<int2>();
|
||||
NextActivity = null;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace OpenRA.Traits
|
||||
public readonly int InitialFacing = 128;
|
||||
public readonly int ROT = 255;
|
||||
public readonly int Speed = 1;
|
||||
public readonly bool OnRails = false;
|
||||
|
||||
public virtual object Create(ActorInitializer init) { return new Mobile(init, this); }
|
||||
}
|
||||
@@ -122,6 +123,8 @@ namespace OpenRA.Traits
|
||||
|
||||
public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor)
|
||||
{
|
||||
if (Info.OnRails) return null;
|
||||
|
||||
if (mi.Button == MouseButton.Left) return null;
|
||||
|
||||
// force-fire should *always* take precedence over move.
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
target = Target.FromOrder(order);
|
||||
|
||||
if (self.HasTrait<Mobile>())
|
||||
if (self.HasTrait<Mobile>() && !self.Info.Traits.Get<MobileInfo>().OnRails)
|
||||
self.QueueActivity( new Follow( target,
|
||||
Math.Max( 0, (int)weapon.Info.Range - RangeTolerance ) ) );
|
||||
}
|
||||
|
||||
@@ -527,6 +527,7 @@ BOAT:
|
||||
InitialFacing:64
|
||||
ROT: 4
|
||||
Speed: 2
|
||||
OnRails: true
|
||||
RevealsShroud:
|
||||
Range: 7
|
||||
Turreted:
|
||||
|
||||
Reference in New Issue
Block a user