Add TurnToDock to Aircraft

Instead of hard-coding a turn before VTOLs
land/dock on resupplier.
This commit is contained in:
reaperrr
2018-11-01 00:17:18 +01:00
committed by abcdefg30
parent e2227b9450
commit 92912c6c94
2 changed files with 10 additions and 3 deletions

View File

@@ -106,7 +106,9 @@ namespace OpenRA.Mods.Common.Activities
{ {
aircraft.MakeReservation(dest); aircraft.MakeReservation(dest);
landingProcedures.Add(new Turn(self, initialFacing)); if (aircraft.Info.TurnToDock)
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)

View File

@@ -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)));
self.QueueActivity(new Turn(self, Info.InitialFacing)); if (Info.TurnToDock)
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));
}; };