hack in stop order support to various classes. not happy with this.
This commit is contained in:
@@ -109,6 +109,17 @@ namespace OpenRA.Mods.RA.Air
|
|||||||
self.QueueActivity(Info.RearmBuildings.Contains(order.TargetActor.Info.Name)
|
self.QueueActivity(Info.RearmBuildings.Contains(order.TargetActor.Info.Name)
|
||||||
? (IActivity)new Rearm() : new Repair(order.TargetActor));
|
? (IActivity)new Rearm() : new Repair(order.TargetActor));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (order.OrderString == "Stop")
|
||||||
|
{
|
||||||
|
self.CancelActivity();
|
||||||
|
|
||||||
|
if (Info.LandWhenIdle)
|
||||||
|
{
|
||||||
|
self.QueueActivity(new Turn(Info.InitialFacing));
|
||||||
|
self.QueueActivity(new HeliLand(true));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int offsetTicks = 0;
|
int offsetTicks = 0;
|
||||||
|
|||||||
@@ -112,6 +112,11 @@ namespace OpenRA.Mods.RA.Air
|
|||||||
info.RearmBuildings.Contains(order.TargetActor.Info.Name)
|
info.RearmBuildings.Contains(order.TargetActor.Info.Name)
|
||||||
? (IActivity)new Rearm() : new Repair(order.TargetActor));
|
? (IActivity)new Rearm() : new Repair(order.TargetActor));
|
||||||
}
|
}
|
||||||
|
else if (order.OrderString == "Stop")
|
||||||
|
{
|
||||||
|
UnReserve();
|
||||||
|
self.CancelActivity();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Game.Debug("Unreserve due to unhandled order: {0}".F(order.OrderString));
|
// Game.Debug("Unreserve due to unhandled order: {0}".F(order.OrderString));
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ namespace OpenRA.Mods.RA
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResolveOrder(Actor self, Order order)
|
public virtual void ResolveOrder(Actor self, Order order)
|
||||||
{
|
{
|
||||||
if (order.OrderString == "Attack" || order.OrderString == "AttackHold")
|
if (order.OrderString == "Attack" || order.OrderString == "AttackHold")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -53,6 +53,14 @@ namespace OpenRA.Mods.RA
|
|||||||
return new AttackActivity( newTarget );
|
return new AttackActivity( newTarget );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void ResolveOrder(Actor self, Order order)
|
||||||
|
{
|
||||||
|
base.ResolveOrder(self, order);
|
||||||
|
|
||||||
|
if (order.OrderString == "Stop")
|
||||||
|
target = Target.None;
|
||||||
|
}
|
||||||
|
|
||||||
bool buildComplete = false;
|
bool buildComplete = false;
|
||||||
public void BuildingComplete(Actor self) { buildComplete = true; }
|
public void BuildingComplete(Actor self) { buildComplete = true; }
|
||||||
|
|
||||||
|
|||||||
@@ -205,6 +205,11 @@ namespace OpenRA.Mods.RA.Move
|
|||||||
var target = order.TargetLocation.Clamp(self.World.Map.Bounds);
|
var target = order.TargetLocation.Clamp(self.World.Map.Bounds);
|
||||||
PerformMove(self, target, order.Queued && !self.IsIdle);
|
PerformMove(self, target, order.Queued && !self.IsIdle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (order.OrderString == "Stop")
|
||||||
|
{
|
||||||
|
self.CancelActivity();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string VoicePhraseForOrder(Actor self, Order order)
|
public string VoicePhraseForOrder(Actor self, Order order)
|
||||||
|
|||||||
Reference in New Issue
Block a user