Add TurnToDock to Aircraft
Instead of hard-coding a turn before VTOLs land/dock on resupplier.
This commit is contained in:
@@ -106,7 +106,9 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
{
|
{
|
||||||
aircraft.MakeReservation(dest);
|
aircraft.MakeReservation(dest);
|
||||||
|
|
||||||
|
if (aircraft.Info.TurnToDock)
|
||||||
landingProcedures.Add(new Turn(self, initialFacing));
|
landingProcedures.Add(new Turn(self, initialFacing));
|
||||||
|
|
||||||
landingProcedures.Add(new HeliLand(self, false));
|
landingProcedures.Add(new HeliLand(self, false));
|
||||||
landingProcedures.Add(new ResupplyAircraft(self));
|
landingProcedures.Add(new ResupplyAircraft(self));
|
||||||
if (!abortOnResupply)
|
if (!abortOnResupply)
|
||||||
|
|||||||
@@ -69,9 +69,12 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[Desc("Will this actor try to land after it has no more commands?")]
|
[Desc("Will this actor try to land after it has no more commands?")]
|
||||||
public readonly bool LandWhenIdle = true;
|
public readonly bool LandWhenIdle = true;
|
||||||
|
|
||||||
[Desc("Does this actor need to turn before landing?")]
|
[Desc("Does this VTOL actor need to turn before landing (on terrain)?")]
|
||||||
public readonly bool TurnToLand = false;
|
public readonly bool TurnToLand = false;
|
||||||
|
|
||||||
|
[Desc("Does this VTOL actor need to turn before landing on a resupplier?")]
|
||||||
|
public readonly bool TurnToDock = true;
|
||||||
|
|
||||||
[Desc("Does this actor cancel its previous activity after resupplying?")]
|
[Desc("Does this actor cancel its previous activity after resupplying?")]
|
||||||
public readonly bool AbortOnResupply = true;
|
public readonly bool AbortOnResupply = true;
|
||||||
|
|
||||||
@@ -752,7 +755,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
var offset = exit != null ? exit.Info.SpawnOffset : WVec.Zero;
|
var offset = exit != null ? exit.Info.SpawnOffset : WVec.Zero;
|
||||||
|
|
||||||
self.QueueActivity(new HeliFly(self, Target.FromPos(targetActor.CenterPosition + offset)));
|
self.QueueActivity(new HeliFly(self, Target.FromPos(targetActor.CenterPosition + offset)));
|
||||||
|
if (Info.TurnToDock)
|
||||||
self.QueueActivity(new Turn(self, Info.InitialFacing));
|
self.QueueActivity(new Turn(self, Info.InitialFacing));
|
||||||
|
|
||||||
self.QueueActivity(new HeliLand(self, false));
|
self.QueueActivity(new HeliLand(self, false));
|
||||||
self.QueueActivity(new ResupplyAircraft(self));
|
self.QueueActivity(new ResupplyAircraft(self));
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user