Kill the allied players if they fail the mission. Also fail the mission if the Allies2 player loses all of their buildings.
This commit is contained in:
@@ -80,6 +80,10 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
allies.WinState = WinState.Lost;
|
allies.WinState = WinState.Lost;
|
||||||
|
foreach (var actor in world.Actors.Where(a => a.IsInWorld && a.Owner == allies && !a.IsDead()))
|
||||||
|
{
|
||||||
|
actor.Kill(actor);
|
||||||
|
}
|
||||||
Game.AddChatLine(Color.Red, "Mission failed", text);
|
Game.AddChatLine(Color.Red, "Mission failed", text);
|
||||||
Sound.Play("misnlst1.aud");
|
Sound.Play("misnlst1.aud");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
{
|
{
|
||||||
static readonly string[] objectives =
|
static readonly string[] objectives =
|
||||||
{
|
{
|
||||||
"Destroy the SAM sites. Tanya and Einstein must survive.",
|
"Hold off the Soviet forces and destroy the SAM sites. Tanya and Einstein must survive.",
|
||||||
"Wait for the helicopter and extract Einstein. Tanya and Einstein must survive."
|
"Wait for the helicopter and extract Einstein. Tanya and Einstein must survive."
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -92,6 +92,10 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
{
|
{
|
||||||
reinforcementsTimer.Visible = false;
|
reinforcementsTimer.Visible = false;
|
||||||
}
|
}
|
||||||
|
foreach (var actor in world.Actors.Where(a => a.IsInWorld && (a.Owner == allies1 || a.Owner == allies2) && !a.IsDead()))
|
||||||
|
{
|
||||||
|
actor.Kill(actor);
|
||||||
|
}
|
||||||
Game.AddChatLine(Color.Red, "Mission failed", text);
|
Game.AddChatLine(Color.Red, "Mission failed", text);
|
||||||
Sound.Play("misnlst1.aud");
|
Sound.Play("misnlst1.aud");
|
||||||
}
|
}
|
||||||
@@ -129,6 +133,10 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
{
|
{
|
||||||
BuildSovietUnits();
|
BuildSovietUnits();
|
||||||
}
|
}
|
||||||
|
if (!world.Actors.Any(a => a.IsInWorld && a.HasTrait<Building>() && a.Owner == allies2))
|
||||||
|
{
|
||||||
|
MissionFailed("The Allied reinforcements have been defeated.");
|
||||||
|
}
|
||||||
if (!engineerMiss.Destroyed && engineer == null && AlliesControlMiss())
|
if (!engineerMiss.Destroyed && engineer == null && AlliesControlMiss())
|
||||||
{
|
{
|
||||||
SpawnEngineerAtMiss();
|
SpawnEngineerAtMiss();
|
||||||
@@ -265,7 +273,7 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
|
|
||||||
void SpawnEngineerAtMiss()
|
void SpawnEngineerAtMiss()
|
||||||
{
|
{
|
||||||
engineer = world.CreateActor(EngineerName, new TypeDictionary {new OwnerInit(allies1), new LocationInit(engineerMiss.Location)});
|
engineer = world.CreateActor(EngineerName, new TypeDictionary { new OwnerInit(allies1), new LocationInit(engineerMiss.Location) });
|
||||||
engineer.QueueActivity(new Move.Move(engineerMiss.Location + new CVec(5, 0)));
|
engineer.QueueActivity(new Move.Move(engineerMiss.Location + new CVec(5, 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user