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.")]
|
[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;
|
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
|
// TODO: UI fluff; doesn't belong here
|
||||||
public readonly int BuildPaletteOrder = 9999;
|
public readonly int BuildPaletteOrder = 9999;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,6 +103,10 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
foreach (var notify in notifyOthers)
|
foreach (var notify in notifyOthers)
|
||||||
notify.Trait.UnitProducedByOther(notify.Actor, self, newUnit);
|
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
|
BuildPaletteOrder: 10
|
||||||
Prerequisites: proc
|
Prerequisites: proc
|
||||||
Queue: Vehicle.GDI, Vehicle.Nod
|
Queue: Vehicle.GDI, Vehicle.Nod
|
||||||
|
InitialActivity: FindResources
|
||||||
Selectable:
|
Selectable:
|
||||||
Priority: 7
|
Priority: 7
|
||||||
Bounds: 36,36
|
Bounds: 36,36
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ HARVESTER:
|
|||||||
Queue: Armor
|
Queue: Armor
|
||||||
Prerequisites: ~heavy, refinery
|
Prerequisites: ~heavy, refinery
|
||||||
BuildPaletteOrder: 10
|
BuildPaletteOrder: 10
|
||||||
|
InitialActivity: FindResources
|
||||||
Valued:
|
Valued:
|
||||||
Cost: 1000
|
Cost: 1000
|
||||||
Tooltip:
|
Tooltip:
|
||||||
|
|||||||
@@ -240,6 +240,7 @@ HARV:
|
|||||||
Queue: Vehicle
|
Queue: Vehicle
|
||||||
BuildPaletteOrder: 10
|
BuildPaletteOrder: 10
|
||||||
Prerequisites: proc, ~techlevel.infonly
|
Prerequisites: proc, ~techlevel.infonly
|
||||||
|
InitialActivity: FindResources
|
||||||
Valued:
|
Valued:
|
||||||
Cost: 1100
|
Cost: 1100
|
||||||
Tooltip:
|
Tooltip:
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ HARV:
|
|||||||
Queue: Vehicle
|
Queue: Vehicle
|
||||||
BuildPaletteOrder: 10
|
BuildPaletteOrder: 10
|
||||||
Owner: gdi,nod
|
Owner: gdi,nod
|
||||||
|
InitialActivity: FindResources
|
||||||
Selectable:
|
Selectable:
|
||||||
Priority: 7
|
Priority: 7
|
||||||
Bounds: 36,36
|
Bounds: 36,36
|
||||||
|
|||||||
Reference in New Issue
Block a user