From e16bc064a0a76608e41d9b4111a23d7426b32366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 6 Dec 2014 20:02:16 +0100 Subject: [PATCH 1/2] fix the end game dialog not showing which objectives failed - don't mark everything as failed just because one objective did - remove fake objectives workarounds for non-playable factions --- OpenRA.Game/Player.cs | 1 + OpenRA.Mods.RA/Player/MissionObjectives.cs | 10 +++++++--- mods/ra/maps/allies-01/allies01.lua | 4 ---- mods/ra/maps/allies-02/allies02.lua | 2 -- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/OpenRA.Game/Player.cs b/OpenRA.Game/Player.cs index bb97e2b9fe..db69894c3f 100644 --- a/OpenRA.Game/Player.cs +++ b/OpenRA.Game/Player.cs @@ -41,6 +41,7 @@ namespace OpenRA public readonly PlayerReference PlayerReference; public bool IsBot; public int SpawnPoint; + public bool HasObjectives = false; public Shroud Shroud; public World World { get; private set; } diff --git a/OpenRA.Mods.RA/Player/MissionObjectives.cs b/OpenRA.Mods.RA/Player/MissionObjectives.cs index 7efee51130..df24236025 100644 --- a/OpenRA.Mods.RA/Player/MissionObjectives.cs +++ b/OpenRA.Mods.RA/Player/MissionObjectives.cs @@ -129,7 +129,7 @@ namespace OpenRA.Mods.RA { foreach (var inou in inous) inou.OnPlayerLost(player); - + CheckIfGameIsOver(player); } } @@ -139,7 +139,7 @@ namespace OpenRA.Mods.RA { var players = player.World.Players.Where(p => !p.NonCombatant); - var gameOver = players.All(p => p.WinState != WinState.Undefined); + var gameOver = players.All(p => p.WinState != WinState.Undefined || !p.HasObjectives); if (gameOver) Game.RunAfterDelay(info.GameOverDelay, () => { @@ -181,6 +181,8 @@ namespace OpenRA.Mods.RA foreach (var p in enemies) p.PlayerActor.Trait().ForceDefeat(p); } + + CheckIfGameIsOver(player); } public void OnPlayerLost(Player player) @@ -218,6 +220,8 @@ namespace OpenRA.Mods.RA p.World.OnPlayerWinStateChanged(p); } } + + CheckIfGameIsOver(player); } public void ForceDefeat(Player player) @@ -227,7 +231,7 @@ namespace OpenRA.Mods.RA MarkFailed(player, id); } - public event Action ObjectiveAdded = player => { }; + public event Action ObjectiveAdded = player => { player.HasObjectives = true; }; public void OnObjectiveAdded(Player player, int id) {} public void OnObjectiveCompleted(Player player, int id) {} diff --git a/mods/ra/maps/allies-01/allies01.lua b/mods/ra/maps/allies-01/allies01.lua index 97f7dc0fe4..825951c6e1 100644 --- a/mods/ra/maps/allies-01/allies01.lua +++ b/mods/ra/maps/allies-01/allies01.lua @@ -96,7 +96,6 @@ end RescueFailed = function() player.MarkFailedObjective(SurviveObjective) - ussr.MarkCompletedObjective(DefendObjective) end OilPumpDestroyed = function() @@ -125,7 +124,6 @@ HelicopterGone = function() Trigger.AfterDelay(DateTime.Seconds(1), function() player.MarkCompletedObjective(ExtractObjective) player.MarkCompletedObjective(SurviveObjective) - ussr.MarkFailedObjective(DefendObjective) if not collateralDamage then player.MarkCompletedObjective(CivilProtectionObjective) end @@ -178,9 +176,7 @@ WorldLoaded = function() Media.PlayMovieFullscreen("landing.vqa", function() FindEinsteinObjective = player.AddPrimaryObjective("Find Einstein.") SurviveObjective = player.AddPrimaryObjective("Tanya and Einstein must survive.") - england.AddPrimaryObjective("Destroy the soviet base after a successful rescue.") CivilProtectionObjective = player.AddSecondaryObjective("Protect all civilians.") - DefendObjective = ussr.AddPrimaryObjective("Kill Tanya and keep Einstein hostage.") RunInitialActivities() end) diff --git a/mods/ra/maps/allies-02/allies02.lua b/mods/ra/maps/allies-02/allies02.lua index e4ab2a992a..a332d67400 100644 --- a/mods/ra/maps/allies-02/allies02.lua +++ b/mods/ra/maps/allies-02/allies02.lua @@ -111,8 +111,6 @@ WorldLoaded = function() Media.PlayMovieFullscreen("mcv.vqa", function() ConquestObjective = player.AddPrimaryObjective("Secure the area.") - ussr.AddPrimaryObjective("Defend your base.") - ukraine.AddPrimaryObjective("Destroy the convoy.") end) Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlaySpeechNotification(allies, "MissionTimerInitialised") end) From d319a8f506e415db2ff60dfec95141f68e5ba09c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 6 Dec 2014 20:04:11 +0100 Subject: [PATCH 2/2] split Einstein and Tanya survival objectives for clarity fixes #7068 --- mods/ra/maps/allies-01/allies01.lua | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/mods/ra/maps/allies-01/allies01.lua b/mods/ra/maps/allies-01/allies01.lua index 825951c6e1..4f9aaac26b 100644 --- a/mods/ra/maps/allies-01/allies01.lua +++ b/mods/ra/maps/allies-01/allies01.lua @@ -12,7 +12,7 @@ SendInsertionHelicopter = function() local passengers = Reinforcements.ReinforceWithTransport(player, InsertionHelicopterType, TanyaReinforcements, InsertionPath, { InsertionEntry.Location })[2] local tanya = passengers[1] - Trigger.OnKilled(tanya, RescueFailed) + Trigger.OnKilled(tanya, TanyaKilledInAction) tanya.Stance = "HoldFire" end @@ -95,7 +95,13 @@ LabDestroyed = function() end RescueFailed = function() - player.MarkFailedObjective(SurviveObjective) + Media.PlaySpeechNotification(player, "ObjectiveNotMet") + player.MarkFailedObjective(EinsteinSurviveObjective) +end + +TanyaKilledInAction = function() + Media.PlaySpeechNotification(player, "ObjectiveNotMet") + player.MarkFailedObjective(TanyaSurviveObjective) end OilPumpDestroyed = function() @@ -123,7 +129,10 @@ HelicopterGone = function() Media.PlaySpeechNotification(player, "TargetRescued") Trigger.AfterDelay(DateTime.Seconds(1), function() player.MarkCompletedObjective(ExtractObjective) - player.MarkCompletedObjective(SurviveObjective) + player.MarkCompletedObjective(EinsteinSurviveObjective) + if not Tanya.IsDead then + player.MarkCompletedObjective(TanyaSurviveObjective) + end if not collateralDamage then player.MarkCompletedObjective(CivilProtectionObjective) end @@ -175,7 +184,8 @@ WorldLoaded = function() Media.PlayMovieFullscreen("landing.vqa", function() FindEinsteinObjective = player.AddPrimaryObjective("Find Einstein.") - SurviveObjective = player.AddPrimaryObjective("Tanya and Einstein must survive.") + TanyaSurviveObjective = player.AddPrimaryObjective("Tanya must survive.") + EinsteinSurviveObjective = player.AddPrimaryObjective("Einstein must survive.") CivilProtectionObjective = player.AddSecondaryObjective("Protect all civilians.") RunInitialActivities()