if c17 gets confused, just fly away

This commit is contained in:
Chris Forbes
2010-10-08 18:57:14 +13:00
parent 40ac5f7b6e
commit ed8a155249
3 changed files with 14 additions and 3 deletions

View File

@@ -12,9 +12,9 @@ using System.Linq;
using OpenRA.FileFormats;
using OpenRA.Mods.RA;
using OpenRA.Mods.RA.Activities;
using OpenRA.Mods.RA.Render;
using OpenRA.Traits;
using OpenRA.Traits.Activities;
using OpenRA.Mods.RA.Render;
namespace OpenRA.Mods.Cnc
{
@@ -33,8 +33,7 @@ namespace OpenRA.Mods.Cnc
// Start and end beyond the edge of the map, to give a finite delay, and ability to land when AFLD is on map edge
var startPos = new int2(owner.World.Map.XOffset + owner.World.Map.Width+5, self.Location.Y);
var endPos = new int2(owner.World.Map.XOffset-5, self.Location.Y);
var endPos = new int2(owner.World.Map.XOffset-5, self.Location.Y);
// Assume a single exit point for simplicity
var exit = self.Info.Traits.WithInterface<ExitInfo>().First();

View File

@@ -37,4 +37,14 @@ namespace OpenRA.Mods.RA
}
}
}
class FlyAwayOnIdleInfo : TraitInfo<FlyAwayOnIdle> { }
class FlyAwayOnIdle : INotifyIdle
{
public void Idle(Actor self)
{
self.QueueActivity(new FlyOffMap());
}
}
}

View File

@@ -562,6 +562,7 @@ C17:
-Selectable:
-Targetable:
-GainsExperience:
FlyAwayOnIdle:
A10:
Inherits: ^Plane
@@ -584,6 +585,7 @@ A10:
Range: 3
-Selectable:
-GainsExperience:
FlyAwayOnIdle:
BOAT:
Inherits: ^Ship