Merge pull request #6634 from abcdefg30/autoharvest

Let harvesters autoharvest when produced
This commit is contained in:
obrakmann
2014-10-02 19:25:50 +02:00
6 changed files with 11 additions and 0 deletions

View File

@@ -33,6 +33,9 @@ namespace OpenRA.Mods.RA
[Desc("Disable production when there are more than this many of this actor on the battlefield. Set to 0 to disable.")]
public readonly int BuildLimit = 0;
[Desc("What the unit should start doing. Warning: If this is not a harvester", "it will break if you use FindResources.")]
public readonly string InitialActivity = null;
// TODO: UI fluff; doesn't belong here
public readonly int BuildPaletteOrder = 9999;
}

View File

@@ -103,6 +103,10 @@ namespace OpenRA.Mods.RA
foreach (var notify in notifyOthers)
notify.Trait.UnitProducedByOther(notify.Actor, self, newUnit);
var bi = newUnit.Info.Traits.GetOrDefault<BuildableInfo>();
if (bi != null && bi.InitialActivity != null)
newUnit.QueueActivity(Game.CreateObject<Activity>(bi.InitialActivity));
});
}

View File

@@ -48,6 +48,7 @@ HARV:
BuildPaletteOrder: 10
Prerequisites: proc
Queue: Vehicle.GDI, Vehicle.Nod
InitialActivity: FindResources
Selectable:
Priority: 7
Bounds: 36,36

View File

@@ -46,6 +46,7 @@ HARVESTER:
Queue: Armor
Prerequisites: ~heavy, refinery
BuildPaletteOrder: 10
InitialActivity: FindResources
Valued:
Cost: 1000
Tooltip:

View File

@@ -240,6 +240,7 @@ HARV:
Queue: Vehicle
BuildPaletteOrder: 10
Prerequisites: proc, ~techlevel.infonly
InitialActivity: FindResources
Valued:
Cost: 1100
Tooltip:

View File

@@ -74,6 +74,7 @@ HARV:
Queue: Vehicle
BuildPaletteOrder: 10
Owner: gdi,nod
InitialActivity: FindResources
Selectable:
Priority: 7
Bounds: 36,36