Merge pull request #7081 from Mailaender/ignore-missing-npc-objectives
Removed the need to give NPCs fake objectives to properly end the game
This commit is contained in:
@@ -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,8 +95,13 @@ LabDestroyed = function()
|
||||
end
|
||||
|
||||
RescueFailed = function()
|
||||
player.MarkFailedObjective(SurviveObjective)
|
||||
ussr.MarkCompletedObjective(DefendObjective)
|
||||
Media.PlaySpeechNotification(player, "ObjectiveNotMet")
|
||||
player.MarkFailedObjective(EinsteinSurviveObjective)
|
||||
end
|
||||
|
||||
TanyaKilledInAction = function()
|
||||
Media.PlaySpeechNotification(player, "ObjectiveNotMet")
|
||||
player.MarkFailedObjective(TanyaSurviveObjective)
|
||||
end
|
||||
|
||||
OilPumpDestroyed = function()
|
||||
@@ -124,8 +129,10 @@ HelicopterGone = function()
|
||||
Media.PlaySpeechNotification(player, "TargetRescued")
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function()
|
||||
player.MarkCompletedObjective(ExtractObjective)
|
||||
player.MarkCompletedObjective(SurviveObjective)
|
||||
ussr.MarkFailedObjective(DefendObjective)
|
||||
player.MarkCompletedObjective(EinsteinSurviveObjective)
|
||||
if not Tanya.IsDead then
|
||||
player.MarkCompletedObjective(TanyaSurviveObjective)
|
||||
end
|
||||
if not collateralDamage then
|
||||
player.MarkCompletedObjective(CivilProtectionObjective)
|
||||
end
|
||||
@@ -177,10 +184,9 @@ 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.")
|
||||
TanyaSurviveObjective = player.AddPrimaryObjective("Tanya must survive.")
|
||||
EinsteinSurviveObjective = player.AddPrimaryObjective("Einstein must survive.")
|
||||
CivilProtectionObjective = player.AddSecondaryObjective("Protect all civilians.")
|
||||
DefendObjective = ussr.AddPrimaryObjective("Kill Tanya and keep Einstein hostage.")
|
||||
|
||||
RunInitialActivities()
|
||||
end)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user