Nod Airfield behavior (fly units from offscreen)

This commit is contained in:
Paul Chote
2010-02-01 20:00:09 +13:00
parent ae751ace98
commit f09bdfc49f
11 changed files with 99 additions and 11 deletions

View File

@@ -8,7 +8,8 @@ namespace OpenRa.Traits.Activities
bool isCanceled;
public Fly(float2 pos) { Pos = pos; }
public Fly(int2 pos) { Pos = Util.CenterOfCell(pos); }
public IActivity NextActivity { get; set; }
const int CruiseAltitude = 20;

View File

@@ -5,7 +5,7 @@ using System.Text;
namespace OpenRa.Traits.Activities
{
class Land : IActivity
public class Land : IActivity
{
readonly float2 Pos;
bool isCanceled;

View File

@@ -5,7 +5,7 @@ using System.Text;
namespace OpenRa.Traits.Activities
{
class UnloadCargo : IActivity
public class UnloadCargo : IActivity
{
public IActivity NextActivity { get; set; }
bool isCanceled;

View File

@@ -4,7 +4,7 @@ using OpenRa.GameRules;
namespace OpenRa.Traits
{
class ProductionInfo : ITraitInfo
public class ProductionInfo : ITraitInfo
{
public readonly int[] SpawnOffset = null;
public readonly string[] Produces = { };
@@ -12,7 +12,7 @@ namespace OpenRa.Traits
public virtual object Create(Actor self) { return new Production(self); }
}
class Production : IIssueOrder, IResolveOrder, IProducer, ITags
public class Production : IIssueOrder, IResolveOrder, IProducer, ITags
{
bool isPrimary = false;
public bool IsPrimary { get { return isPrimary; } }
@@ -29,7 +29,7 @@ namespace OpenRa.Traits
return newUnit.Info.Traits.GetOrDefault<UnitInfo>().InitialFacing;
}
public bool Produce( Actor self, ActorInfo producee )
public virtual bool Produce( Actor self, ActorInfo producee )
{
var location = CreationLocation( self, producee );
if( location == null || self.World.WorldActor.traits.Get<UnitInfluence>().GetUnitsAt( location.Value ).Any() )

View File

@@ -11,7 +11,7 @@ namespace OpenRa.Traits
public object Create(Actor self) { return new RallyPoint(self); }
}
class RallyPoint : IRender, IIssueOrder, IResolveOrder, ITick
public class RallyPoint : IRender, IIssueOrder, IResolveOrder, ITick
{
[Sync]
public int2 rallyPoint;