Harvester now autoharvest when produced
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ HARV:
|
||||
BuildPaletteOrder: 10
|
||||
Prerequisites: proc
|
||||
Queue: Vehicle.GDI, Vehicle.Nod
|
||||
InitialActivity: FindResources
|
||||
Selectable:
|
||||
Priority: 7
|
||||
Bounds: 36,36
|
||||
|
||||
@@ -46,6 +46,7 @@ HARVESTER:
|
||||
Queue: Armor
|
||||
Prerequisites: ~heavy, refinery
|
||||
BuildPaletteOrder: 10
|
||||
InitialActivity: FindResources
|
||||
Valued:
|
||||
Cost: 1000
|
||||
Tooltip:
|
||||
|
||||
@@ -240,6 +240,7 @@ HARV:
|
||||
Queue: Vehicle
|
||||
BuildPaletteOrder: 10
|
||||
Prerequisites: proc, ~techlevel.infonly
|
||||
InitialActivity: FindResources
|
||||
Valued:
|
||||
Cost: 1100
|
||||
Tooltip:
|
||||
|
||||
@@ -74,6 +74,7 @@ HARV:
|
||||
Queue: Vehicle
|
||||
BuildPaletteOrder: 10
|
||||
Owner: gdi,nod
|
||||
InitialActivity: FindResources
|
||||
Selectable:
|
||||
Priority: 7
|
||||
Bounds: 36,36
|
||||
|
||||
Reference in New Issue
Block a user