Add more airfields to destroy in Allies 03, and have reinforcements in Allies 02 and Allies 03 come in gradually.

This commit is contained in:
Scott_NZ
2012-12-01 00:56:56 +13:00
parent 1f92768193
commit f0a4fa7712
4 changed files with 215 additions and 118 deletions

View File

@@ -117,6 +117,7 @@ namespace OpenRA.Mods.RA.Missions
"mcv", "mcv",
"truk", "truk", "truk", "truk", "truk", "truk" "truk", "truk", "truk", "truk", "truk", "truk"
}; };
int currentReinforcement = -1;
const int ParabombTicks = 750; const int ParabombTicks = 750;
@@ -217,6 +218,10 @@ namespace OpenRA.Mods.RA.Missions
YakStrafe(alliedUnitsNearYakPoint); YakStrafe(alliedUnitsNearYakPoint);
} }
} }
if (currentReinforcement > -1 && currentReinforcement < Reinforcements.Length && world.FrameNumber % 25 == 0)
{
SpawnAlliedUnit(Reinforcements[currentReinforcement++]);
}
if (world.FrameNumber % 25 == 0) if (world.FrameNumber % 25 == 0)
{ {
BuildSovietUnits(); BuildSovietUnits();
@@ -419,22 +424,19 @@ namespace OpenRA.Mods.RA.Missions
void ReinforcementsTimerExpired(CountdownTimer countdownTimer) void ReinforcementsTimerExpired(CountdownTimer countdownTimer)
{ {
reinforcementsTimerWidget.Visible = false; reinforcementsTimerWidget.Visible = false;
SendReinforcements(); currentReinforcement++;
Sound.Play("aarrivs1.aud"); Sound.Play("aarrivs1.aud");
} }
void SendReinforcements() void SpawnAlliedUnit(string unit)
{ {
foreach (var unit in Reinforcements) var u = world.CreateActor(unit, new TypeDictionary
{ {
var u = world.CreateActor(unit, new TypeDictionary new LocationInit(reinforcementsEntryPoint.Location),
{ new FacingInit(0),
new LocationInit(reinforcementsEntryPoint.Location), new OwnerInit(allies2)
new FacingInit(0), });
new OwnerInit(allies2) u.QueueActivity(new Move.Move(allies2BasePoint.Location));
});
u.QueueActivity(new Move.Move(allies2BasePoint.Location));
}
} }
void RushSovietUnits() void RushSovietUnits()

View File

@@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA.Missions
Dictionary<int, Objective> objectives = new Dictionary<int, Objective> Dictionary<int, Objective> objectives = new Dictionary<int, Objective>
{ {
{ EvacuateID, new Objective(ObjectiveType.Primary, "Following the rescue of Einstein, the Allies are now being flanked from both sides. Evacuate {0} units before the remaining Allied forces in the area are wiped out.", ObjectiveStatus.InProgress) }, { EvacuateID, new Objective(ObjectiveType.Primary, "Following the rescue of Einstein, the Allies are now being flanked from both sides. Evacuate {0} units before the remaining Allied forces in the area are wiped out.", ObjectiveStatus.InProgress) },
{ AirbaseID, new Objective(ObjectiveType.Secondary, "Destroy the nearby Soviet airbase.", ObjectiveStatus.InProgress) } { AirbaseID, new Objective(ObjectiveType.Secondary, "Destroy the nearby Soviet airbases.", ObjectiveStatus.InProgress) }
}; };
const int EvacuateID = 0; const int EvacuateID = 0;
@@ -74,19 +74,16 @@ namespace OpenRA.Mods.RA.Missions
Actor sovietRallyPoint6; Actor sovietRallyPoint6;
CPos[] sovietRallyPoints; CPos[] sovietRallyPoints;
Actor sovietAirfield1; Actor[] sovietAirfields;
Actor sovietAirfield2;
Actor sovietAirfield3;
Actor sovietAirfield4;
static readonly string[] SovietVehicles1 = { "3tnk", "3tnk", "3tnk", "3tnk", "3tnk", "3tnk", "v2rl", "v2rl", "ftrk", "ftrk", "apc", "apc", "apc" }; static readonly string[] SovietVehicles1 = { "3tnk", "3tnk", "3tnk", "3tnk", "3tnk", "3tnk", "v2rl", "v2rl", "ftrk", "ftrk", "apc", "apc", "apc" };
static readonly string[] SovietVehicles2 = { "4tnk", "4tnk", "4tnk", "3tnk", "3tnk", "3tnk", "3tnk", "3tnk", "v2rl", "v2rl", "ftrk", "apc" }; static readonly string[] SovietVehicles2 = { "4tnk", "4tnk", "4tnk", "3tnk", "3tnk", "3tnk", "3tnk", "3tnk", "v2rl", "v2rl", "ftrk", "apc" };
const int SovietVehicles2Ticks = 1500 * 20; const int SovietVehicles2Ticks = 1500 * 20;
const int SovietGroupSize = 3; const int SovietGroupSize = 3;
const int MaxNumberYaks = 4;
const int ReinforcementsTicks = 1500 * 4; const int ReinforcementsTicks = 1500 * 4;
static readonly string[] Reinforcements = { MggName, MggName, "2tnk", "2tnk", "2tnk", "2tnk", "1tnk", "1tnk", "jeep", "jeep", "e1", "e1", "e1", "e1", "e3", "e3" }; static readonly string[] Reinforcements = { "mgg", "mgg", "2tnk", "2tnk", "2tnk", "2tnk", "1tnk", "1tnk", "jeep", "jeep", "e1", "e1", "e1", "e1", "e3", "e3" };
int currentReinforcement;
int attackAtFrame; int attackAtFrame;
int attackAtFrameIncrement; int attackAtFrameIncrement;
@@ -100,7 +97,6 @@ namespace OpenRA.Mods.RA.Missions
const string McvName = "mcv"; const string McvName = "mcv";
const string YakName = "yak"; const string YakName = "yak";
const string MggName = "mgg";
void MissionFailed(string text) void MissionFailed(string text)
{ {
@@ -136,7 +132,7 @@ namespace OpenRA.Mods.RA.Missions
} }
if (world.FrameNumber == 1) if (world.FrameNumber == 1)
{ {
SpawnAlliedUnitForPlayers(McvName); SpawnAlliedUnit(McvName);
evacuateWidget = new InfoWidget("", new float2(Game.viewport.Width * 0.35f, Game.viewport.Height * 0.9f)); evacuateWidget = new InfoWidget("", new float2(Game.viewport.Width * 0.35f, Game.viewport.Height * 0.9f));
Ui.Root.AddChild(evacuateWidget); Ui.Root.AddChild(evacuateWidget);
UpdateUnitsEvacuated(); UpdateUnitsEvacuated();
@@ -147,10 +143,16 @@ namespace OpenRA.Mods.RA.Missions
attackAtFrame += attackAtFrameIncrement; attackAtFrame += attackAtFrameIncrement;
attackAtFrameIncrement = Math.Max(attackAtFrameIncrement - 5, minAttackAtFrame); attackAtFrameIncrement = Math.Max(attackAtFrameIncrement - 5, minAttackAtFrame);
} }
if (world.FrameNumber == ReinforcementsTicks) if (world.FrameNumber >= ReinforcementsTicks && currentReinforcement < Reinforcements.Length)
{ {
Sound.Play("reinfor1.aud"); if (world.FrameNumber == ReinforcementsTicks)
SpawnReinforcements(); {
Sound.Play("reinfor1.aud");
}
if (world.FrameNumber % 25 == 0)
{
SpawnAlliedUnit(Reinforcements[currentReinforcement++]);
}
} }
if (world.FrameNumber % 25 == 0) if (world.FrameNumber % 25 == 0)
{ {
@@ -229,7 +231,7 @@ namespace OpenRA.Mods.RA.Missions
void BuildSovietAircraft() void BuildSovietAircraft()
{ {
var queue = MissionUtils.FindQueues(world, soviets, "Plane").FirstOrDefault(q => q.CurrentItem() == null); var queue = MissionUtils.FindQueues(world, soviets, "Plane").FirstOrDefault(q => q.CurrentItem() == null);
if (queue == null || SovietAircraft().Count() >= MaxNumberYaks) if (queue == null || SovietAircraft().Count() >= sovietAirfields.Length)
{ {
return; return;
} }
@@ -246,11 +248,7 @@ namespace OpenRA.Mods.RA.Missions
void CheckSovietAirbase() void CheckSovietAirbase()
{ {
if (objectives[AirbaseID].Status != ObjectiveStatus.Completed if (objectives[AirbaseID].Status != ObjectiveStatus.Completed && sovietAirfields.All(a => a.IsDead() || a.Owner != soviets))
&& (sovietAirfield1.Destroyed || sovietAirfield1.Owner != soviets)
&& (sovietAirfield2.Destroyed || sovietAirfield2.Owner != soviets)
&& (sovietAirfield3.Destroyed || sovietAirfield3.Owner != soviets)
&& (sovietAirfield4.Destroyed || sovietAirfield4.Owner != soviets))
{ {
objectives[AirbaseID].Status = ObjectiveStatus.Completed; objectives[AirbaseID].Status = ObjectiveStatus.Completed;
OnObjectivesUpdated(true); OnObjectivesUpdated(true);
@@ -311,15 +309,7 @@ namespace OpenRA.Mods.RA.Missions
} }
} }
void SpawnReinforcements() void SpawnAlliedUnit(string actor)
{
foreach (var unit in Reinforcements)
{
SpawnAlliedUnitForPlayers(unit);
}
}
void SpawnAlliedUnitForPlayers(string actor)
{ {
var unit = world.CreateActor(actor, new TypeDictionary var unit = world.CreateActor(actor, new TypeDictionary
{ {
@@ -426,10 +416,7 @@ namespace OpenRA.Mods.RA.Missions
sovietRallyPoint5 = actors["SovietRallyPoint5"]; sovietRallyPoint5 = actors["SovietRallyPoint5"];
sovietRallyPoint6 = actors["SovietRallyPoint6"]; sovietRallyPoint6 = actors["SovietRallyPoint6"];
sovietRallyPoints = new[] { sovietRallyPoint1, sovietRallyPoint2, sovietRallyPoint3, sovietRallyPoint4, sovietRallyPoint5, sovietRallyPoint6 }.Select(p => p.Location).ToArray(); sovietRallyPoints = new[] { sovietRallyPoint1, sovietRallyPoint2, sovietRallyPoint3, sovietRallyPoint4, sovietRallyPoint5, sovietRallyPoint6 }.Select(p => p.Location).ToArray();
sovietAirfield1 = actors["SovietAirfield1"]; sovietAirfields = actors.Values.Where(a => a.Owner == soviets && a.HasTrait<Production>() && a.Info.Traits.Get<ProductionInfo>().Produces.Contains("Plane")).ToArray();
sovietAirfield2 = actors["SovietAirfield2"];
sovietAirfield3 = actors["SovietAirfield3"];
sovietAirfield4 = actors["SovietAirfield4"];
if (w.LocalPlayer == null || w.LocalPlayer == allies1) if (w.LocalPlayer == null || w.LocalPlayer == allies1)
{ {
Game.MoveViewport(allies1EntryPoint.Location.ToFloat2()); Game.MoveViewport(allies1EntryPoint.Location.ToFloat2());

Binary file not shown.

View File

@@ -114,9 +114,9 @@ Actors:
Actor53: tc03 Actor53: tc03
Location: 138,53 Location: 138,53
Owner: Neutral Owner: Neutral
Actor2: tc05 SovietAirfield5: afld
Location: 64,44 Location: 62,47
Owner: Neutral Owner: Soviets
Actor57: tc04 Actor57: tc04
Location: 43,19 Location: 43,19
Owner: Neutral Owner: Neutral
@@ -420,20 +420,20 @@ Actors:
Actor346: t08 Actor346: t08
Location: 107,28 Location: 107,28
Owner: Neutral Owner: Neutral
Actor327: t07 Actor153: apwr
Location: 68,39 Location: 55,43
Owner: Neutral Owner: Soviets
Actor298: t06 Actor298: t06
Location: 72,50 Location: 72,50
Owner: Neutral Owner: Neutral
Actor30: t01 Actor30: t01
Location: 173,61 Location: 173,61
Owner: Neutral Owner: Neutral
Actor233: tc01 Actor224: ftur
Location: 64,55 Location: 66,60
Owner: Neutral Owner: Soviets
Actor326: t07 Actor203: t16
Location: 69,57 Location: 54,41
Owner: Neutral Owner: Neutral
Actor338: tc04 Actor338: tc04
Location: 28,76 Location: 28,76
@@ -450,9 +450,9 @@ Actors:
Actor283: t05 Actor283: t05
Location: 102,59 Location: 102,59
Owner: Neutral Owner: Neutral
Actor287: t05 SovietAirfield6: afld
Location: 70,47 Location: 62,53
Owner: Neutral Owner: Soviets
Actor284: t05 Actor284: t05
Location: 82,70 Location: 82,70
Owner: Neutral Owner: Neutral
@@ -477,9 +477,9 @@ Actors:
Actor367: tc03 Actor367: tc03
Location: 35,71 Location: 35,71
Owner: Neutral Owner: Neutral
Actor273: t03 Actor236: ftur
Location: 62,61 Location: 62,61
Owner: Neutral Owner: Soviets
Actor302: t06 Actor302: t06
Location: 71,73 Location: 71,73
Owner: Neutral Owner: Neutral
@@ -537,9 +537,9 @@ Actors:
Actor354: t11 Actor354: t11
Location: 73,71 Location: 73,71
Owner: Neutral Owner: Neutral
Actor335: t07 Actor212: barr
Location: 67,62 Location: 69,57
Owner: Neutral Owner: Soviets
Actor365: tc04 Actor365: tc04
Location: 18,56 Location: 18,56
Owner: Neutral Owner: Neutral
@@ -558,8 +558,8 @@ Actors:
Actor186: tc04 Actor186: tc04
Location: 79,34 Location: 79,34
Owner: Neutral Owner: Neutral
Actor203: tc05 Actor179: tc05
Location: 67,64 Location: 59,43
Owner: Neutral Owner: Neutral
Actor350: t10 Actor350: t10
Location: 87,22 Location: 87,22
@@ -627,9 +627,9 @@ Actors:
Actor211: tc02 Actor211: tc02
Location: 75,74 Location: 75,74
Owner: Neutral Owner: Neutral
Actor213: tc04 Actor174: apwr
Location: 55,43 Location: 58,45
Owner: Neutral Owner: Soviets
Actor214: tc02 Actor214: tc02
Location: 79,47 Location: 79,47
Owner: Neutral Owner: Neutral
@@ -651,9 +651,9 @@ Actors:
Actor386: t07 Actor386: t07
Location: 30,62 Location: 30,62
Owner: Neutral Owner: Neutral
Actor161: apwr Actor2: tc05
Location: 154,75 Location: 153,77
Owner: Soviets Owner: Neutral
Actor54: t01 Actor54: t01
Location: 56,76 Location: 56,76
Owner: Neutral Owner: Neutral
@@ -666,8 +666,8 @@ Actors:
Actor402: t02 Actor402: t02
Location: 21,65 Location: 21,65
Owner: Neutral Owner: Neutral
Actor153: t14 Actor175: tc01
Location: 59,45 Location: 62,44
Owner: Neutral Owner: Neutral
Actor375: tc01 Actor375: tc01
Location: 20,61 Location: 20,61
@@ -768,9 +768,9 @@ Actors:
Actor804: t13 Actor804: t13
Location: 125,68 Location: 125,68
Owner: Neutral Owner: Neutral
Actor248: t01 SovietAirfield8: afld
Location: 67,47 Location: 62,51
Owner: Neutral Owner: Soviets
Actor268: t03 Actor268: t03
Location: 95,23 Location: 95,23
Owner: Neutral Owner: Neutral
@@ -963,9 +963,9 @@ Actors:
Exit2ExitPoint: waypoint Exit2ExitPoint: waypoint
Location: 16,29 Location: 16,29
Owner: Neutral Owner: Neutral
Actor177: oilb Actor255: ftur
Location: 86,52 Location: 68,45
Owner: Neutral Owner: Soviets
SovietEntryPoint3: waypoint SovietEntryPoint3: waypoint
Location: 105,79 Location: 105,79
Owner: Neutral Owner: Neutral
@@ -1089,9 +1089,9 @@ Actors:
Actor242: barr Actor242: barr
Location: 159,61 Location: 159,61
Owner: Soviets Owner: Soviets
Actor229: apwr Actor56: tc01
Location: 150,75 Location: 145,71
Owner: Soviets Owner: Neutral
Actor237: dog Actor237: dog
Location: 151,62 Location: 151,62
Owner: Soviets Owner: Soviets
@@ -1108,7 +1108,7 @@ Actors:
Location: 158,53 Location: 158,53
Owner: Soviets Owner: Soviets
Actor18: apwr Actor18: apwr
Location: 150,72 Location: 149,72
Owner: Soviets Owner: Soviets
Actor230: 3tnk Actor230: 3tnk
Location: 157,60 Location: 157,60
@@ -1155,8 +1155,8 @@ Actors:
Actor232: t01 Actor232: t01
Location: 72,43 Location: 72,43
Owner: Neutral Owner: Neutral
Actor224: tc02 Actor176: tc05
Location: 58,46 Location: 69,46
Owner: Neutral Owner: Neutral
Actor170: mine Actor170: mine
Location: 114,55 Location: 114,55
@@ -1182,18 +1182,18 @@ Actors:
Actor171: mine Actor171: mine
Location: 168,73 Location: 168,73
Owner: Neutral Owner: Neutral
Actor176: brl3 Actor248: ftur
Location: 84,51 Location: 64,44
Owner: Neutral Owner: Soviets
Actor172: t10 SovietAirfield7: afld
Location: 61,50 Location: 62,49
Owner: Neutral Owner: Soviets
Actor256: barl Actor256: ftur
Location: 88,56 Location: 74,57
Owner: Neutral Owner: Soviets
Actor255: barl Actor273: brik
Location: 87,51 Location: 72,61
Owner: Neutral Owner: Soviets
Actor44: t11 Actor44: t11
Location: 57,54 Location: 57,54
Owner: Neutral Owner: Neutral
@@ -1203,30 +1203,30 @@ Actors:
Actor245: tc05 Actor245: tc05
Location: 106,43 Location: 106,43
Owner: Neutral Owner: Neutral
Actor179: barl Actor233: ftur
Location: 84,52 Location: 75,54
Owner: Neutral Owner: Soviets
Actor236: brl3 Actor287: brik
Location: 87,55 Location: 72,60
Owner: Neutral Owner: Soviets
Actor258: brl3 Actor258: brik
Location: 88,51 Location: 71,61
Owner: Neutral Owner: Soviets
Actor212: oilb Actor293: brik
Location: 86,56 Location: 70,61
Owner: Neutral Owner: Soviets
Actor174: brl3 Actor177: tc04
Location: 84,55 Location: 59,50
Owner: Neutral
Actor175: barl
Location: 83,55
Owner: Neutral
Actor173: oilb
Location: 82,56
Owner: Neutral
Actor56: oilb
Location: 82,52
Owner: Neutral Owner: Neutral
Actor294: brik
Location: 72,59
Owner: Soviets
Actor213: tsla
Location: 71,59
Owner: Soviets
Actor295: brik
Location: 73,59
Owner: Soviets
Actor180: v01.sniper Actor180: v01.sniper
Location: 100,29 Location: 100,29
Owner: Soviets Owner: Soviets
@@ -1305,6 +1305,114 @@ Actors:
Actor290: mine Actor290: mine
Location: 159,26 Location: 159,26
Owner: Neutral Owner: Neutral
Actor297: brik
Location: 69,61
Owner: Soviets
Actor299: brik
Location: 73,58
Owner: Soviets
Actor300: brik
Location: 69,60
Owner: Soviets
Actor301: brik
Location: 68,60
Owner: Soviets
Actor304: e1
Location: 63,59
Owner: Soviets
Actor305: e1
Location: 71,56
Owner: Soviets
Actor306: e1
Location: 66,46
Owner: Soviets
Actor308: e2
Location: 63,57
Owner: Soviets
Actor309: e2
Location: 69,51
Owner: Soviets
Actor311: e1
Location: 68,58
Owner: Soviets
Actor313: e1
Location: 63,46
Owner: Soviets
Actor316: oilb
Location: 91,50
Owner: Soviets
Actor317: oilb
Location: 91,53
Owner: Soviets
Actor318: oilb
Location: 94,50
Owner: Soviets
Actor319: oilb
Location: 94,53
Owner: Soviets
Actor320: sbag
Location: 91,56
Owner: Soviets
Actor321: sbag
Location: 93,56
Owner: Soviets
Actor324: sbag
Location: 94,56
Owner: Soviets
Actor325: sbag
Location: 95,56
Owner: Soviets
Actor326: sbag
Location: 96,56
Owner: Soviets
Actor327: sbag
Location: 92,56
Owner: Soviets
Actor328: sbag
Location: 97,56
Owner: Soviets
Actor330: sbag
Location: 97,55
Owner: Soviets
Actor332: sbag
Location: 97,54
Owner: Soviets
Actor334: sbag
Location: 97,53
Owner: Soviets
Actor335: sbag
Location: 97,52
Owner: Soviets
Actor336: sbag
Location: 97,51
Owner: Soviets
Actor337: sbag
Location: 97,50
Owner: Soviets
Actor339: e1
Location: 96,49
Owner: Soviets
Actor340: e1
Location: 93,47
Owner: Soviets
Actor341: e1
Location: 89,56
Owner: Soviets
Actor342: e2
Location: 88,55
Owner: Soviets
Actor343: apc
Location: 91,48
Owner: Soviets
Actor344: 3tnk
Location: 67,52
Owner: Soviets
Actor161: brl3
Location: 93,50
Owner: Soviets
Actor172: barl
Location: 90,55
Owner: Soviets
Smudges: Smudges: