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
This commit is contained in:
@@ -41,6 +41,7 @@ namespace OpenRA
|
|||||||
public readonly PlayerReference PlayerReference;
|
public readonly PlayerReference PlayerReference;
|
||||||
public bool IsBot;
|
public bool IsBot;
|
||||||
public int SpawnPoint;
|
public int SpawnPoint;
|
||||||
|
public bool HasObjectives = false;
|
||||||
|
|
||||||
public Shroud Shroud;
|
public Shroud Shroud;
|
||||||
public World World { get; private set; }
|
public World World { get; private set; }
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ namespace OpenRA.Mods.RA
|
|||||||
{
|
{
|
||||||
foreach (var inou in inous)
|
foreach (var inou in inous)
|
||||||
inou.OnPlayerLost(player);
|
inou.OnPlayerLost(player);
|
||||||
|
|
||||||
CheckIfGameIsOver(player);
|
CheckIfGameIsOver(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -139,7 +139,7 @@ namespace OpenRA.Mods.RA
|
|||||||
{
|
{
|
||||||
var players = player.World.Players.Where(p => !p.NonCombatant);
|
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)
|
if (gameOver)
|
||||||
Game.RunAfterDelay(info.GameOverDelay, () =>
|
Game.RunAfterDelay(info.GameOverDelay, () =>
|
||||||
{
|
{
|
||||||
@@ -181,6 +181,8 @@ namespace OpenRA.Mods.RA
|
|||||||
foreach (var p in enemies)
|
foreach (var p in enemies)
|
||||||
p.PlayerActor.Trait<MissionObjectives>().ForceDefeat(p);
|
p.PlayerActor.Trait<MissionObjectives>().ForceDefeat(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CheckIfGameIsOver(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnPlayerLost(Player player)
|
public void OnPlayerLost(Player player)
|
||||||
@@ -218,6 +220,8 @@ namespace OpenRA.Mods.RA
|
|||||||
p.World.OnPlayerWinStateChanged(p);
|
p.World.OnPlayerWinStateChanged(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CheckIfGameIsOver(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ForceDefeat(Player player)
|
public void ForceDefeat(Player player)
|
||||||
@@ -227,7 +231,7 @@ namespace OpenRA.Mods.RA
|
|||||||
MarkFailed(player, id);
|
MarkFailed(player, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public event Action<Player> ObjectiveAdded = player => { };
|
public event Action<Player> ObjectiveAdded = player => { player.HasObjectives = true; };
|
||||||
|
|
||||||
public void OnObjectiveAdded(Player player, int id) {}
|
public void OnObjectiveAdded(Player player, int id) {}
|
||||||
public void OnObjectiveCompleted(Player player, int id) {}
|
public void OnObjectiveCompleted(Player player, int id) {}
|
||||||
|
|||||||
@@ -96,7 +96,6 @@ end
|
|||||||
|
|
||||||
RescueFailed = function()
|
RescueFailed = function()
|
||||||
player.MarkFailedObjective(SurviveObjective)
|
player.MarkFailedObjective(SurviveObjective)
|
||||||
ussr.MarkCompletedObjective(DefendObjective)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
OilPumpDestroyed = function()
|
OilPumpDestroyed = function()
|
||||||
@@ -125,7 +124,6 @@ HelicopterGone = function()
|
|||||||
Trigger.AfterDelay(DateTime.Seconds(1), function()
|
Trigger.AfterDelay(DateTime.Seconds(1), function()
|
||||||
player.MarkCompletedObjective(ExtractObjective)
|
player.MarkCompletedObjective(ExtractObjective)
|
||||||
player.MarkCompletedObjective(SurviveObjective)
|
player.MarkCompletedObjective(SurviveObjective)
|
||||||
ussr.MarkFailedObjective(DefendObjective)
|
|
||||||
if not collateralDamage then
|
if not collateralDamage then
|
||||||
player.MarkCompletedObjective(CivilProtectionObjective)
|
player.MarkCompletedObjective(CivilProtectionObjective)
|
||||||
end
|
end
|
||||||
@@ -178,9 +176,7 @@ WorldLoaded = function()
|
|||||||
Media.PlayMovieFullscreen("landing.vqa", function()
|
Media.PlayMovieFullscreen("landing.vqa", function()
|
||||||
FindEinsteinObjective = player.AddPrimaryObjective("Find Einstein.")
|
FindEinsteinObjective = player.AddPrimaryObjective("Find Einstein.")
|
||||||
SurviveObjective = player.AddPrimaryObjective("Tanya and Einstein must survive.")
|
SurviveObjective = player.AddPrimaryObjective("Tanya and Einstein must survive.")
|
||||||
england.AddPrimaryObjective("Destroy the soviet base after a successful rescue.")
|
|
||||||
CivilProtectionObjective = player.AddSecondaryObjective("Protect all civilians.")
|
CivilProtectionObjective = player.AddSecondaryObjective("Protect all civilians.")
|
||||||
DefendObjective = ussr.AddPrimaryObjective("Kill Tanya and keep Einstein hostage.")
|
|
||||||
|
|
||||||
RunInitialActivities()
|
RunInitialActivities()
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -111,8 +111,6 @@ WorldLoaded = function()
|
|||||||
|
|
||||||
Media.PlayMovieFullscreen("mcv.vqa", function()
|
Media.PlayMovieFullscreen("mcv.vqa", function()
|
||||||
ConquestObjective = player.AddPrimaryObjective("Secure the area.")
|
ConquestObjective = player.AddPrimaryObjective("Secure the area.")
|
||||||
ussr.AddPrimaryObjective("Defend your base.")
|
|
||||||
ukraine.AddPrimaryObjective("Destroy the convoy.")
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlaySpeechNotification(allies, "MissionTimerInitialised") end)
|
Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlaySpeechNotification(allies, "MissionTimerInitialised") end)
|
||||||
|
|||||||
Reference in New Issue
Block a user