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