Merge pull request #6035 from pchote/merge-air-queues

Merge RA aircraft queues
This commit is contained in:
Matthias Mailänder
2014-07-24 22:04:50 +02:00
8 changed files with 44 additions and 37 deletions

View File

@@ -27,6 +27,9 @@ namespace OpenRA.Mods.RA
[Desc("Production queue(s) that can produce this.")] [Desc("Production queue(s) that can produce this.")]
public readonly string[] Queue = { }; public readonly string[] Queue = { };
[Desc("Override the production structure type (from the Production Produces list) that this unit should be built at.")]
public readonly string BuildAtProductionType = null;
[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;

View File

@@ -76,9 +76,15 @@ namespace OpenRA.Mods.RA
protected override bool BuildUnit(string name) protected override bool BuildUnit(string name)
{ {
// Find a production structure to build this actor // Find a production structure to build this actor
var info = self.World.Map.Rules.Actors[name];
var bi = info.Traits.GetOrDefault<BuildableInfo>();
// Some units may request a specific production type, which is ignored if the AllTech cheat is enabled
var type = bi == null || developerMode.AllTech ? Info.Type : bi.BuildAtProductionType ?? Info.Type;
var producers = self.World.ActorsWithTrait<Production>() var producers = self.World.ActorsWithTrait<Production>()
.Where(x => x.Actor.Owner == self.Owner .Where(x => x.Actor.Owner == self.Owner
&& x.Trait.Info.Produces.Contains(Info.Type)) && x.Trait.Info.Produces.Contains(type))
.OrderByDescending(x => x.Actor.IsPrimaryBuilding()) .OrderByDescending(x => x.Actor.IsPrimaryBuilding())
.ThenByDescending(x => x.Actor.ActorID); .ThenByDescending(x => x.Actor.ActorID);
@@ -90,7 +96,7 @@ namespace OpenRA.Mods.RA
foreach (var p in producers.Where(p => !p.Actor.IsDisabled())) foreach (var p in producers.Where(p => !p.Actor.IsDisabled()))
{ {
if (p.Trait.Produce(p.Actor, self.World.Map.Rules.Actors[name], Race)) if (p.Trait.Produce(p.Actor, info, Race))
{ {
FinishProduction(); FinishProduction();
return true; return true;

View File

@@ -74,7 +74,7 @@ namespace OpenRA.Mods.RA
// Will change if the owner changes // Will change if the owner changes
PowerManager playerPower; PowerManager playerPower;
PlayerResources playerResources; PlayerResources playerResources;
DeveloperMode developerMode; protected DeveloperMode developerMode;
// A list of things we could possibly build // A list of things we could possibly build
Dictionary<ActorInfo, ProductionState> produceable; Dictionary<ActorInfo, ProductionState> produceable;

View File

@@ -77,15 +77,13 @@ tabs-selected: tabs.png
allies-Defense: 0,40,27,41 allies-Defense: 0,40,27,41
allies-Infantry: 0,80,27,41 allies-Infantry: 0,80,27,41
allies-Vehicle: 0,120,27,41 allies-Vehicle: 0,120,27,41
allies-Plane: 162,200,27,41 allies-Aircraft: 162,200,27,41
allies-Helicopter: 0,160,27,41
allies-Ship: 0,200,27,41 allies-Ship: 0,200,27,41
soviet-Building: 81,0,27,41 soviet-Building: 81,0,27,41
soviet-Defense: 81,40,27,41 soviet-Defense: 81,40,27,41
soviet-Infantry: 81,80,27,41 soviet-Infantry: 81,80,27,41
soviet-Vehicle: 81,120,27,41 soviet-Vehicle: 81,120,27,41
soviet-Plane: 81,160,27,41 soviet-Aircraft: 81,160,27,41
soviet-Helicopter: 162,80,27,41
soviet-Ship: 81,200,27,41 soviet-Ship: 81,200,27,41
tabs-ready: tabs.png tabs-ready: tabs.png
@@ -93,15 +91,13 @@ tabs-ready: tabs.png
allies-Defense: 27,40,27,41 allies-Defense: 27,40,27,41
allies-Infantry: 27,80,27,41 allies-Infantry: 27,80,27,41
allies-Vehicle: 27,120,27,41 allies-Vehicle: 27,120,27,41
allies-Plane: 162,160,27,41 allies-Aircraft: 162,160,27,41
allies-Helicopter: 27,160,27,41
allies-Ship: 27,200,27,41 allies-Ship: 27,200,27,41
soviet-Building: 108,0,27,41 soviet-Building: 108,0,27,41
soviet-Defense: 108,40,27,41 soviet-Defense: 108,40,27,41
soviet-Infantry: 108,80,27,41 soviet-Infantry: 108,80,27,41
soviet-Vehicle: 108,120,27,41 soviet-Vehicle: 108,120,27,41
soviet-Plane: 108,160,27,41 soviet-Aircraft: 108,160,27,41
soviet-Helicopter: 162,40,27,41
soviet-Ship: 108,200,27,41 soviet-Ship: 108,200,27,41
tabs-normal: tabs.png tabs-normal: tabs.png
@@ -109,15 +105,13 @@ tabs-normal: tabs.png
allies-Defense: 54,40,27,41 allies-Defense: 54,40,27,41
allies-Infantry: 54,80,27,41 allies-Infantry: 54,80,27,41
allies-Vehicle: 54,120,27,41 allies-Vehicle: 54,120,27,41
allies-Plane: 162,120,27,41 allies-Aircraft: 162,120,27,41
allies-Helicopter: 54,160,27,41
allies-Ship: 54,200,27,41 allies-Ship: 54,200,27,41
soviet-Building: 135,0,27,41 soviet-Building: 135,0,27,41
soviet-Defense: 135,40,27,41 soviet-Defense: 135,40,27,41
soviet-Infantry: 135,80,27,41 soviet-Infantry: 135,80,27,41
soviet-Vehicle: 135,120,27,41 soviet-Vehicle: 135,120,27,41
soviet-Plane: 135,160,27,41 soviet-Aircraft: 135,160,27,41
soviet-Helicopter: 162,0,27,41
soviet-Ship: 135,200,27,41 soviet-Ship: 135,200,27,41
# Used for the menu # Used for the menu

View File

@@ -75,9 +75,10 @@ BADR.Bomber:
MIG: MIG:
Inherits: ^Plane Inherits: ^Plane
Buildable: Buildable:
Queue: Plane Queue: Aircraft
BuildAtProductionType: Plane
BuildPaletteOrder: 50 BuildPaletteOrder: 50
Prerequisites: afld, stek, ~techlevel.unrestricted Prerequisites: ~afld, stek, ~techlevel.unrestricted
Hotkey: m Hotkey: m
Valued: Valued:
Cost: 2000 Cost: 2000
@@ -127,9 +128,10 @@ MIG:
YAK: YAK:
Inherits: ^Plane Inherits: ^Plane
Buildable: Buildable:
Queue: Plane Queue: Aircraft
BuildAtProductionType: Plane
BuildPaletteOrder: 30 BuildPaletteOrder: 30
Prerequisites: afld, ~techlevel.medium Prerequisites: ~afld, ~techlevel.medium
Hotkey: y Hotkey: y
Valued: Valued:
Cost: 1000 Cost: 1000
@@ -185,9 +187,10 @@ YAK:
TRAN: TRAN:
Inherits: ^Helicopter Inherits: ^Helicopter
Buildable: Buildable:
Queue: Helicopter Queue: Aircraft
BuildAtProductionType: Helicopter
BuildPaletteOrder: 10 BuildPaletteOrder: 10
Prerequisites: hpad, ~techlevel.medium Prerequisites: ~hpad, ~techlevel.medium
Hotkey: t Hotkey: t
Valued: Valued:
Cost: 900 Cost: 900
@@ -227,9 +230,10 @@ TRAN:
HELI: HELI:
Inherits: ^Helicopter Inherits: ^Helicopter
Buildable: Buildable:
Queue: Helicopter Queue: Aircraft
BuildAtProductionType: Helicopter
BuildPaletteOrder: 40 BuildPaletteOrder: 40
Prerequisites: hpad, atek, ~techlevel.unrestricted Prerequisites: ~hpad, atek, ~techlevel.unrestricted
Hotkey: l Hotkey: l
Valued: Valued:
Cost: 2000 Cost: 2000
@@ -277,9 +281,10 @@ HELI:
HIND: HIND:
Inherits: ^Helicopter Inherits: ^Helicopter
Buildable: Buildable:
Queue: Helicopter Queue: Aircraft
BuildAtProductionType: Helicopter
BuildPaletteOrder: 20 BuildPaletteOrder: 20
Prerequisites: hpad, ~techlevel.medium Prerequisites: ~hpad, ~techlevel.medium
Hotkey: h Hotkey: h
Valued: Valued:
Cost: 1000 Cost: 1000

View File

@@ -34,14 +34,8 @@ Player:
LowPowerSlowdown: 3 LowPowerSlowdown: 3
SpeedUp: True SpeedUp: True
RequireOwner: false RequireOwner: false
ClassicProductionQueue@Plane: ClassicProductionQueue@Aircraft:
Type: Plane Type: Aircraft
BuildSpeed: .4
LowPowerSlowdown: 3
SpeedUp: True
RequireOwner: false
ClassicProductionQueue@Helicopter:
Type: Helicopter
BuildSpeed: .4 BuildSpeed: .4
LowPowerSlowdown: 3 LowPowerSlowdown: 3
SpeedUp: True SpeedUp: True

View File

@@ -2,6 +2,7 @@ SS:
Inherits: ^Ship Inherits: ^Ship
Buildable: Buildable:
Queue: Ship Queue: Ship
BuildAtProductionType: Submarine
BuildPaletteOrder: 30 BuildPaletteOrder: 30
Prerequisites: ~spen, ~techlevel.medium Prerequisites: ~spen, ~techlevel.medium
Hotkey: u Hotkey: u
@@ -54,6 +55,7 @@ MSUB:
Inherits: ^Ship Inherits: ^Ship
Buildable: Buildable:
Queue: Ship Queue: Ship
BuildAtProductionType: Submarine
BuildPaletteOrder: 60 BuildPaletteOrder: 60
Prerequisites: ~spen, stek, ~techlevel.unrestricted Prerequisites: ~spen, stek, ~techlevel.unrestricted
Hotkey: m Hotkey: m
@@ -106,6 +108,7 @@ DD:
Inherits: ^Ship Inherits: ^Ship
Buildable: Buildable:
Queue: Ship Queue: Ship
BuildAtProductionType: Boat
BuildPaletteOrder: 40 BuildPaletteOrder: 40
Prerequisites: ~syrd, dome, ~techlevel.medium Prerequisites: ~syrd, dome, ~techlevel.medium
Hotkey: r Hotkey: r
@@ -155,6 +158,7 @@ CA:
Inherits: ^Ship Inherits: ^Ship
Buildable: Buildable:
Queue: Ship Queue: Ship
BuildAtProductionType: Boat
BuildPaletteOrder: 50 BuildPaletteOrder: 50
Prerequisites: ~syrd, atek, ~techlevel.unrestricted Prerequisites: ~syrd, atek, ~techlevel.unrestricted
Hotkey: c Hotkey: c
@@ -249,6 +253,7 @@ PT:
Inherits: ^Ship Inherits: ^Ship
Buildable: Buildable:
Queue: Ship Queue: Ship
BuildAtProductionType: Boat
BuildPaletteOrder: 20 BuildPaletteOrder: 20
Prerequisites: ~syrd, ~techlevel.medium Prerequisites: ~syrd, ~techlevel.medium
Hotkey: b Hotkey: b

View File

@@ -127,7 +127,7 @@ SPEN:
Facing: 224 Facing: 224
ExitCell: 2,0 ExitCell: 2,0
Production: Production:
Produces: Ship Produces: Ship, Submarine
PrimaryBuilding: PrimaryBuilding:
IronCurtainable: IronCurtainable:
-EmitInfantryOnSell: -EmitInfantryOnSell:
@@ -183,7 +183,7 @@ SYRD:
Facing: 32 Facing: 32
ExitCell: 2,0 ExitCell: 2,0
Production: Production:
Produces: Ship Produces: Ship, Boat
PrimaryBuilding: PrimaryBuilding:
IronCurtainable: IronCurtainable:
-EmitInfantryOnSell: -EmitInfantryOnSell:
@@ -858,7 +858,7 @@ HPAD:
MoveIntoWorld: false MoveIntoWorld: false
RallyPoint: RallyPoint:
Production: Production:
Produces: Helicopter Produces: Aircraft, Helicopter
Reservable: Reservable:
IronCurtainable: IronCurtainable:
ProductionBar: ProductionBar:
@@ -893,7 +893,7 @@ AFLD:
MoveIntoWorld: false MoveIntoWorld: false
RallyPoint: RallyPoint:
Production: Production:
Produces: Plane Produces: Aircraft, Plane
Reservable: Reservable:
IronCurtainable: IronCurtainable:
AirstrikePower: AirstrikePower: