Add easy mode to Allies 01 which is like the classic mission
This commit is contained in:
@@ -76,6 +76,8 @@ namespace OpenRA.Mods.RA.Missions
|
||||
const string TanyaName = "e7";
|
||||
const string SignalFlareName = "flare";
|
||||
|
||||
string difficulty;
|
||||
|
||||
void MissionFailed(string text)
|
||||
{
|
||||
if (allies.WinState != WinState.Undefined)
|
||||
@@ -122,6 +124,10 @@ namespace OpenRA.Mods.RA.Missions
|
||||
SendShips();
|
||||
objectives[FindEinsteinID].Status = ObjectiveStatus.Completed;
|
||||
objectives[ExtractEinsteinID].Status = ObjectiveStatus.InProgress;
|
||||
if (difficulty == "Easy")
|
||||
{
|
||||
ExtractEinsteinAtLZ();
|
||||
}
|
||||
OnObjectivesUpdated(true);
|
||||
currentAttackWaveFrameNumber = world.FrameNumber;
|
||||
}
|
||||
@@ -133,6 +139,8 @@ namespace OpenRA.Mods.RA.Missions
|
||||
}
|
||||
}
|
||||
if (objectives[ExtractEinsteinID].Status == ObjectiveStatus.InProgress)
|
||||
{
|
||||
if (difficulty != "Easy")
|
||||
{
|
||||
SendAttackWave();
|
||||
if (world.FrameNumber >= currentAttackWaveFrameNumber + 600)
|
||||
@@ -150,6 +158,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
ExtractEinsteinAtLZ();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (einsteinChinook != null)
|
||||
{
|
||||
if (einsteinChinook.Destroyed)
|
||||
@@ -306,8 +315,13 @@ namespace OpenRA.Mods.RA.Missions
|
||||
public void WorldLoaded(World w)
|
||||
{
|
||||
world = w;
|
||||
|
||||
difficulty = w.LobbyInfo.GlobalSettings.Difficulty;
|
||||
Game.Debug("{0} difficulty selected".F(difficulty));
|
||||
|
||||
allies = w.Players.Single(p => p.InternalName == "Allies");
|
||||
soviets = w.Players.Single(p => p.InternalName == "Soviets");
|
||||
|
||||
var actors = w.WorldActor.Trait<SpawnMapActors>().Actors;
|
||||
insertionLZ = actors["InsertionLZ"];
|
||||
extractionLZ = actors["ExtractionLZ"];
|
||||
@@ -320,9 +334,11 @@ namespace OpenRA.Mods.RA.Missions
|
||||
attackEntryPoint1 = actors["SovietAttackEntryPoint1"];
|
||||
attackEntryPoint2 = actors["SovietAttackEntryPoint2"];
|
||||
SetAlliedUnitsToDefensiveStance();
|
||||
|
||||
var alliesRes = allies.PlayerActor.Trait<PlayerResources>();
|
||||
alliesRes.TakeCash(alliesRes.Cash);
|
||||
alliesRes.TakeOre(alliesRes.Ore);
|
||||
|
||||
Game.MoveViewport(insertionLZ.Location.ToFloat2());
|
||||
Media.PlayFMVFullscreen(w, "ally1.vqa", () =>
|
||||
{
|
||||
|
||||
@@ -168,9 +168,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
OnObjectivesUpdated(true);
|
||||
MissionFailed("The remaining Allied forces in the area have been wiped out.");
|
||||
}
|
||||
else if (!world.Actors.Any(a => a.Owner == soviets && a.IsInWorld && !a.IsDead()
|
||||
&& a.HasTrait<Building>() && !a.HasTrait<Wall>() && !a.HasTrait<Allies04TrivialBuilding>() && a != lab)
|
||||
&& objectives[InfiltrateID].Status == ObjectiveStatus.Completed)
|
||||
else if (SovietBaseDestroyed() && objectives[InfiltrateID].Status == ObjectiveStatus.Completed)
|
||||
{
|
||||
objectives[DestroyID].Status = ObjectiveStatus.Completed;
|
||||
OnObjectivesUpdated(true);
|
||||
@@ -178,11 +176,15 @@ namespace OpenRA.Mods.RA.Missions
|
||||
}
|
||||
}
|
||||
|
||||
bool SovietBaseDestroyed()
|
||||
{
|
||||
return !world.Actors.Any(a => a.Owner == soviets && a.IsInWorld && !a.IsDead()
|
||||
&& a.HasTrait<Building>() && !a.HasTrait<Wall>() && !a.HasTrait<Allies04TrivialBuilding>() && a != lab);
|
||||
}
|
||||
|
||||
void OnDestroyBaseTimerExpired(CountdownTimer t)
|
||||
{
|
||||
if (!world.Actors.Any(a => a.Owner == soviets && a.IsInWorld && !a.IsDead()
|
||||
&& a.HasTrait<Building>() && !a.HasTrait<Wall>() && !a.HasTrait<Allies04TrivialBuilding>() && a != lab)
|
||||
&& objectives[InfiltrateID].Status == ObjectiveStatus.Completed)
|
||||
if (SovietBaseDestroyed() && objectives[InfiltrateID].Status == ObjectiveStatus.Completed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -407,11 +409,11 @@ namespace OpenRA.Mods.RA.Missions
|
||||
reinforcementsUnloadPoint = actors["ReinforcementsUnloadPoint"];
|
||||
patrols = new[]
|
||||
{
|
||||
new Patrol(world, new[]{ "e1", "e1", "e1", "e1", "e1" }, soviets, patrolPoints1, 0),
|
||||
new Patrol(world, new[]{ "e1", "dog.patrol", "dog.patrol" }, soviets, patrolPoints2, 3),
|
||||
new Patrol(world, new[]{ "e1", "dog.patrol", "dog.patrol" }, soviets, patrolPoints3, 0),
|
||||
new Patrol(world, new[]{ "e1", "dog.patrol", "dog.patrol" }, soviets, patrolPoints4, 0),
|
||||
new Patrol(world, new[]{ "e1", "dog.patrol", "dog.patrol" }, soviets, patrolPoints5, 0),
|
||||
new Patrol(world, new[] { "e1", "e1", "e1", "e1", "e1" }, soviets, patrolPoints1, 0),
|
||||
new Patrol(world, new[] { "e1", "dog.patrol", "dog.patrol" }, soviets, patrolPoints2, 3),
|
||||
new Patrol(world, new[] { "e1", "dog.patrol", "dog.patrol" }, soviets, patrolPoints3, 0),
|
||||
new Patrol(world, new[] { "e1", "dog.patrol", "dog.patrol" }, soviets, patrolPoints4, 0),
|
||||
new Patrol(world, new[] { "e1", "dog.patrol", "dog.patrol" }, soviets, patrolPoints5, 0),
|
||||
};
|
||||
objectives[InfiltrateID].Text = Infiltrate.F(allies1 != allies2 ? "spies" : "spy");
|
||||
OnObjectivesUpdated(false);
|
||||
|
||||
@@ -20,6 +20,8 @@ UseAsShellmap: False
|
||||
|
||||
Type: Campaign
|
||||
|
||||
Difficulties: Easy, Normal
|
||||
|
||||
Players:
|
||||
PlayerReference@Neutral:
|
||||
Name: Neutral
|
||||
|
||||
Reference in New Issue
Block a user