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.")]
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.")]
public readonly int BuildLimit = 0;

View File

@@ -76,9 +76,15 @@ namespace OpenRA.Mods.RA
protected override bool BuildUnit(string name)
{
// 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>()
.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())
.ThenByDescending(x => x.Actor.ActorID);
@@ -90,7 +96,7 @@ namespace OpenRA.Mods.RA
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();
return true;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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