Add final attack for Soviets
This commit is contained in:
@@ -79,6 +79,8 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
Actor yakEntryPoint;
|
Actor yakEntryPoint;
|
||||||
Actor yakAttackPoint;
|
Actor yakAttackPoint;
|
||||||
Actor yak;
|
Actor yak;
|
||||||
|
Actor sovietReinforcementsEntryPoint1;
|
||||||
|
Actor sovietReinforcementsEntryPoint2;
|
||||||
|
|
||||||
Actor einsteinChinook;
|
Actor einsteinChinook;
|
||||||
|
|
||||||
@@ -92,6 +94,8 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
|
|
||||||
CountdownTimer reinforcementsTimer;
|
CountdownTimer reinforcementsTimer;
|
||||||
CountdownTimerWidget reinforcementsTimerWidget;
|
CountdownTimerWidget reinforcementsTimerWidget;
|
||||||
|
CountdownTimer sovietReinforcementsTimer;
|
||||||
|
CountdownTimerWidget sovietReinforcementsTimerWidget;
|
||||||
|
|
||||||
const string InfantryQueueName = "Infantry";
|
const string InfantryQueueName = "Infantry";
|
||||||
const string VehicleQueueName = "Vehicle";
|
const string VehicleQueueName = "Vehicle";
|
||||||
@@ -104,15 +108,17 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
|
|
||||||
const int ReinforcementsTicks = 1500 * 12;
|
const int ReinforcementsTicks = 1500 * 12;
|
||||||
static readonly string[] Reinforcements =
|
static readonly string[] Reinforcements =
|
||||||
{
|
{
|
||||||
"2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "2tnk",
|
"2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "2tnk",
|
||||||
"1tnk", "1tnk",
|
"1tnk", "1tnk",
|
||||||
"jeep",
|
"jeep",
|
||||||
"e1", "e1", "e1", "e1",
|
"e1", "e1", "e1", "e1",
|
||||||
"e3", "e3",
|
"e3", "e3",
|
||||||
"mcv",
|
"mcv",
|
||||||
"truk", "truk", "truk", "truk", "truk", "truk"
|
"truk", "truk", "truk", "truk", "truk", "truk"
|
||||||
};
|
};
|
||||||
|
const int SovietReinforcementsTicks = 1500 * 22;
|
||||||
|
static readonly string[] SovietReinforcements = { "3tnk", "3tnk", "3tnk", "3tnk", "3tnk", "3tnk", "3tnk", "3tnk", "v2rl", "v2rl" };
|
||||||
|
|
||||||
const int ParatroopersTicks = 1500 * 8;
|
const int ParatroopersTicks = 1500 * 8;
|
||||||
static readonly string[] Badger1Passengers = { "e1", "e1", "e1", "e2", "3tnk" };
|
static readonly string[] Badger1Passengers = { "e1", "e1", "e1", "e2", "3tnk" };
|
||||||
@@ -183,8 +189,10 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
{
|
{
|
||||||
InitializeSovietFactories();
|
InitializeSovietFactories();
|
||||||
StartReinforcementsTimer();
|
StartReinforcementsTimer();
|
||||||
|
StartSovietReinforcementsTimer();
|
||||||
}
|
}
|
||||||
reinforcementsTimer.Tick();
|
reinforcementsTimer.Tick();
|
||||||
|
sovietReinforcementsTimer.Tick();
|
||||||
if (world.FrameNumber == ParatroopersTicks)
|
if (world.FrameNumber == ParatroopersTicks)
|
||||||
{
|
{
|
||||||
MissionUtils.Paradrop(world, soviets, Badger1Passengers, badgerEntryPoint1.Location, badgerDropPoint1.Location);
|
MissionUtils.Paradrop(world, soviets, Badger1Passengers, badgerEntryPoint1.Location, badgerDropPoint1.Location);
|
||||||
@@ -197,7 +205,7 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
}
|
}
|
||||||
if (world.FrameNumber == TanksTicks)
|
if (world.FrameNumber == TanksTicks)
|
||||||
{
|
{
|
||||||
RushSovietTanks();
|
RushSovietUnits();
|
||||||
}
|
}
|
||||||
if (world.FrameNumber == ParabombTicks)
|
if (world.FrameNumber == ParabombTicks)
|
||||||
{
|
{
|
||||||
@@ -400,13 +408,65 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
|
|
||||||
void StartReinforcementsTimer()
|
void StartReinforcementsTimer()
|
||||||
{
|
{
|
||||||
Sound.Play("timergo1.aud");
|
reinforcementsTimer = new CountdownTimer(ReinforcementsTicks, ReinforcementsTimerExpired, false);
|
||||||
reinforcementsTimer = new CountdownTimer(ReinforcementsTicks, ReinforcementsTimerExpired, true);
|
reinforcementsTimerWidget = new CountdownTimerWidget(reinforcementsTimer, "Allied reinforcements arrive in: {0}", new float2(Game.viewport.Width * 0.1f, Game.viewport.Height * 0.8f));
|
||||||
reinforcementsTimerWidget = new CountdownTimerWidget(reinforcementsTimer, "Reinforcements arrive in", new float2(Game.viewport.Width * 0.1f, Game.viewport.Height * 0.8f));
|
|
||||||
Ui.Root.AddChild(reinforcementsTimerWidget);
|
Ui.Root.AddChild(reinforcementsTimerWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RushSovietTanks()
|
void StartSovietReinforcementsTimer()
|
||||||
|
{
|
||||||
|
Sound.Play("timergo1.aud");
|
||||||
|
sovietReinforcementsTimer = new CountdownTimer(SovietReinforcementsTicks, SovietReinforcementsTimerExpired, true);
|
||||||
|
sovietReinforcementsTimerWidget = new CountdownTimerWidget(sovietReinforcementsTimer, "Soviet reinforcements arrive in: {0}", new float2(Game.viewport.Width * 0.1f, Game.viewport.Height * 0.85f));
|
||||||
|
Ui.Root.AddChild(sovietReinforcementsTimerWidget);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SovietReinforcementsTimerExpired(CountdownTimer countdownTimer)
|
||||||
|
{
|
||||||
|
sovietReinforcementsTimerWidget.Visible = false;
|
||||||
|
SendSovietReinforcements();
|
||||||
|
Sound.Play("sovrein1.aud");
|
||||||
|
}
|
||||||
|
|
||||||
|
void SendSovietReinforcements()
|
||||||
|
{
|
||||||
|
foreach (var entryPoint in new[] { sovietReinforcementsEntryPoint1, sovietReinforcementsEntryPoint2 })
|
||||||
|
{
|
||||||
|
foreach (var unit in SovietReinforcements)
|
||||||
|
{
|
||||||
|
var u = world.CreateActor(unit, new TypeDictionary
|
||||||
|
{
|
||||||
|
new LocationInit(entryPoint.Location),
|
||||||
|
new FacingInit(Util.GetFacing(allies2BasePoint.Location - entryPoint.Location, 0)),
|
||||||
|
new OwnerInit(soviets)
|
||||||
|
});
|
||||||
|
u.QueueActivity(new AttackMove.AttackMoveActivity(u, new Move.Move(allies2BasePoint.Location, 5)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReinforcementsTimerExpired(CountdownTimer countdownTimer)
|
||||||
|
{
|
||||||
|
reinforcementsTimerWidget.Visible = false;
|
||||||
|
SendReinforcements();
|
||||||
|
Sound.Play("aarrivs1.aud");
|
||||||
|
}
|
||||||
|
|
||||||
|
void SendReinforcements()
|
||||||
|
{
|
||||||
|
foreach (var unit in Reinforcements)
|
||||||
|
{
|
||||||
|
var u = world.CreateActor(unit, new TypeDictionary
|
||||||
|
{
|
||||||
|
new LocationInit(reinforcementsEntryPoint.Location),
|
||||||
|
new FacingInit(0),
|
||||||
|
new OwnerInit(allies2)
|
||||||
|
});
|
||||||
|
u.QueueActivity(new Move.Move(allies2BasePoint.Location));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RushSovietUnits()
|
||||||
{
|
{
|
||||||
var closestAlliedBuildings = ClosestAlliedBuildings(badgerDropPoint1, 40);
|
var closestAlliedBuildings = ClosestAlliedBuildings(badgerDropPoint1, 40);
|
||||||
if (!closestAlliedBuildings.Any())
|
if (!closestAlliedBuildings.Any())
|
||||||
@@ -444,27 +504,6 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
apc.QueueActivity(new UnloadCargo(true));
|
apc.QueueActivity(new UnloadCargo(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReinforcementsTimerExpired(CountdownTimer countdownTimer)
|
|
||||||
{
|
|
||||||
reinforcementsTimerWidget.Visible = false;
|
|
||||||
SendReinforcements();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SendReinforcements()
|
|
||||||
{
|
|
||||||
Sound.Play("reinfor1.aud");
|
|
||||||
foreach (var unit in Reinforcements)
|
|
||||||
{
|
|
||||||
var actor = world.CreateActor(unit, new TypeDictionary
|
|
||||||
{
|
|
||||||
new LocationInit(reinforcementsEntryPoint.Location),
|
|
||||||
new FacingInit(0),
|
|
||||||
new OwnerInit(allies2)
|
|
||||||
});
|
|
||||||
actor.QueueActivity(new Move.Move(allies2BasePoint.Location));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ExtractEinsteinAtLZ()
|
void ExtractEinsteinAtLZ()
|
||||||
{
|
{
|
||||||
einsteinChinook = MissionUtils.ExtractUnitWithChinook(
|
einsteinChinook = MissionUtils.ExtractUnitWithChinook(
|
||||||
@@ -537,6 +576,8 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
sovietTownAttackPoint2 = actors["SovietTownAttackPoint2"];
|
sovietTownAttackPoint2 = actors["SovietTownAttackPoint2"];
|
||||||
yakEntryPoint = actors["YakEntryPoint"];
|
yakEntryPoint = actors["YakEntryPoint"];
|
||||||
yakAttackPoint = actors["YakAttackPoint"];
|
yakAttackPoint = actors["YakAttackPoint"];
|
||||||
|
sovietReinforcementsEntryPoint1 = actors["SovietReinforcementsEntryPoint1"];
|
||||||
|
sovietReinforcementsEntryPoint2 = actors["SovietReinforcementsEntryPoint2"];
|
||||||
var shroud = w.WorldActor.Trait<Shroud>();
|
var shroud = w.WorldActor.Trait<Shroud>();
|
||||||
shroud.Explore(w, sam1.Location, 2);
|
shroud.Explore(w, sam1.Location, 2);
|
||||||
shroud.Explore(w, sam2.Location, 2);
|
shroud.Explore(w, sam2.Location, 2);
|
||||||
|
|||||||
@@ -72,13 +72,13 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
public class CountdownTimerWidget : Widget
|
public class CountdownTimerWidget : Widget
|
||||||
{
|
{
|
||||||
public CountdownTimer Timer { get; set; }
|
public CountdownTimer Timer { get; set; }
|
||||||
public string Header { get; set; }
|
public string Format { get; set; }
|
||||||
public float2 Position { get; set; }
|
public float2 Position { get; set; }
|
||||||
|
|
||||||
public CountdownTimerWidget(CountdownTimer timer, string header, float2 position)
|
public CountdownTimerWidget(CountdownTimer timer, string format, float2 position)
|
||||||
{
|
{
|
||||||
Timer = timer;
|
Timer = timer;
|
||||||
Header = header;
|
Format = format;
|
||||||
Position = position;
|
Position = position;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var font = Game.Renderer.Fonts["Bold"];
|
var font = Game.Renderer.Fonts["Bold"];
|
||||||
var text = "{0}: {1}".F(Header, WidgetUtils.FormatTime(Timer.TicksLeft));
|
var text = Format.F(WidgetUtils.FormatTime(Timer.TicksLeft));
|
||||||
font.DrawTextWithContrast(text, Position, Timer.TicksLeft <= 25 * 10 && Game.LocalTick % 50 < 25 ? Color.Red : Color.White, Color.Black, 1);
|
font.DrawTextWithContrast(text, Position, Timer.TicksLeft <= 25 * 10 && Game.LocalTick % 50 < 25 ? Color.Red : Color.White, Color.Black, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1502,7 +1502,7 @@ Actors:
|
|||||||
Location: 74,43
|
Location: 74,43
|
||||||
Owner: Neutral
|
Owner: Neutral
|
||||||
Actor0: apwr
|
Actor0: apwr
|
||||||
Location: 53,42
|
Location: 52,42
|
||||||
Owner: Soviets
|
Owner: Soviets
|
||||||
Actor54: proc
|
Actor54: proc
|
||||||
Location: 25,95
|
Location: 25,95
|
||||||
@@ -2659,6 +2659,12 @@ Actors:
|
|||||||
Actor835: sbag
|
Actor835: sbag
|
||||||
Location: 18,35
|
Location: 18,35
|
||||||
Owner: Soviets
|
Owner: Soviets
|
||||||
|
SovietReinforcementsEntryPoint1: waypoint
|
||||||
|
Location: 42,16
|
||||||
|
Owner: Neutral
|
||||||
|
SovietReinforcementsEntryPoint2: waypoint
|
||||||
|
Location: 24,16
|
||||||
|
Owner: Neutral
|
||||||
|
|
||||||
Smudges:
|
Smudges:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user