rename FlyCircle -> FlyAttackLoop, for accuracy; new FlyCircleto fly a hold
This commit is contained in:
@@ -52,11 +52,11 @@ namespace OpenRA.Mods.RA.Air
|
||||
}
|
||||
}
|
||||
|
||||
public class FlyCircle : CancelableActivity
|
||||
public class FlyAttackLoop : CancelableActivity
|
||||
{
|
||||
int2 Target;
|
||||
|
||||
public FlyCircle(int2 target) { Target = target; }
|
||||
public FlyAttackLoop(int2 target) { Target = target; }
|
||||
|
||||
public override IActivity Tick(Actor self)
|
||||
{
|
||||
|
||||
43
OpenRA.Mods.RA/Air/FlyCircle.cs
Normal file
43
OpenRA.Mods.RA/Air/FlyCircle.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Traits.Activities;
|
||||
|
||||
namespace OpenRA.Mods.RA.Air
|
||||
{
|
||||
public class FlyCircle : CancelableActivity
|
||||
{
|
||||
public override IActivity Tick(Actor self)
|
||||
{
|
||||
var cruiseAltitude = self.Info.Traits.Get<PlaneInfo>().CruiseAltitude;
|
||||
|
||||
if (IsCanceled) return NextActivity;
|
||||
|
||||
var aircraft = self.Trait<Aircraft>();
|
||||
|
||||
var desiredFacing = aircraft.Facing + 64; // we can't possibly turn this fast.
|
||||
if (aircraft.Altitude == cruiseAltitude)
|
||||
aircraft.Facing = Util.TickFacing(aircraft.Facing, desiredFacing, aircraft.ROT);
|
||||
|
||||
if (aircraft.Altitude < cruiseAltitude)
|
||||
++aircraft.Altitude;
|
||||
|
||||
FlyUtil.Fly(self, cruiseAltitude);
|
||||
return this;
|
||||
}
|
||||
|
||||
public override IEnumerable<float2> GetCurrentPath()
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,7 @@ namespace OpenRA.Mods.RA
|
||||
new AltitudeInit( Rules.Info["badr"].Traits.Get<AircraftInfo>().CruiseAltitude ),
|
||||
});
|
||||
plane.CancelActivity();
|
||||
plane.QueueActivity(new FlyCircle(p));
|
||||
plane.QueueActivity(new FlyAttackLoop(p));
|
||||
plane.Trait<ParaDrop>().SetLZ(p);
|
||||
plane.Trait<Cargo>().Load(plane, crate);
|
||||
});
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
<Compile Include="Activities\Demolish.cs" />
|
||||
<Compile Include="Activities\Enter.cs" />
|
||||
<Compile Include="Activities\EnterTransport.cs" />
|
||||
<Compile Include="Air\FlyCircle.cs" />
|
||||
<Compile Include="Buildings\Sellable.cs" />
|
||||
<Compile Include="Effects\CashTick.cs" />
|
||||
<Compile Include="ProductionBar.cs" />
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace OpenRA.Mods.RA
|
||||
});
|
||||
|
||||
a.CancelActivity();
|
||||
a.QueueActivity(new FlyCircle(order.TargetLocation));
|
||||
a.QueueActivity(new FlyAttackLoop(order.TargetLocation));
|
||||
a.Trait<ParaDrop>().SetLZ(order.TargetLocation);
|
||||
|
||||
var cargo = a.Trait<Cargo>();
|
||||
|
||||
Reference in New Issue
Block a user