diff --git a/OpenRA.Mods.RA/Missions/Allies01Script.cs b/OpenRA.Mods.RA/Missions/Allies01Script.cs index 96b921881c..082c342bdb 100644 --- a/OpenRA.Mods.RA/Missions/Allies01Script.cs +++ b/OpenRA.Mods.RA/Missions/Allies01Script.cs @@ -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; } @@ -134,20 +140,23 @@ namespace OpenRA.Mods.RA.Missions } if (objectives[ExtractEinsteinID].Status == ObjectiveStatus.InProgress) { - SendAttackWave(); - if (world.FrameNumber >= currentAttackWaveFrameNumber + 600) + if (difficulty != "Easy") { - Sound.Play("enmyapp1.aud"); - SpawnAttackWave(AttackWave); - currentAttackWave++; - currentAttackWaveFrameNumber = world.FrameNumber; - if (currentAttackWave >= EinsteinChinookAttackWave) + SendAttackWave(); + if (world.FrameNumber >= currentAttackWaveFrameNumber + 600) { - SpawnAttackWave(LastAttackWaveAddition); - } - if (currentAttackWave == EinsteinChinookAttackWave) - { - ExtractEinsteinAtLZ(); + Sound.Play("enmyapp1.aud"); + SpawnAttackWave(AttackWave); + currentAttackWave++; + currentAttackWaveFrameNumber = world.FrameNumber; + if (currentAttackWave >= EinsteinChinookAttackWave) + { + SpawnAttackWave(LastAttackWaveAddition); + } + if (currentAttackWave == EinsteinChinookAttackWave) + { + ExtractEinsteinAtLZ(); + } } } if (einsteinChinook != null) @@ -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().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(); alliesRes.TakeCash(alliesRes.Cash); alliesRes.TakeOre(alliesRes.Ore); + Game.MoveViewport(insertionLZ.Location.ToFloat2()); Media.PlayFMVFullscreen(w, "ally1.vqa", () => { diff --git a/OpenRA.Mods.RA/Missions/Allies04Script.cs b/OpenRA.Mods.RA/Missions/Allies04Script.cs index cc9623c6e5..2353654195 100644 --- a/OpenRA.Mods.RA/Missions/Allies04Script.cs +++ b/OpenRA.Mods.RA/Missions/Allies04Script.cs @@ -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() && !a.HasTrait() && !a.HasTrait() && 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() && !a.HasTrait() && !a.HasTrait() && a != lab); + } + void OnDestroyBaseTimerExpired(CountdownTimer t) { - if (!world.Actors.Any(a => a.Owner == soviets && a.IsInWorld && !a.IsDead() - && a.HasTrait() && !a.HasTrait() && !a.HasTrait() && 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); diff --git a/mods/ra/maps/allies-01/map.yaml b/mods/ra/maps/allies-01/map.yaml index fa5df278e5..31def01168 100644 --- a/mods/ra/maps/allies-01/map.yaml +++ b/mods/ra/maps/allies-01/map.yaml @@ -20,6 +20,8 @@ UseAsShellmap: False Type: Campaign +Difficulties: Easy, Normal + Players: PlayerReference@Neutral: Name: Neutral