Fail mission if impossible to land at beach

This commit is contained in:
DArcy Rush
2015-11-22 17:22:28 +00:00
parent e452f40ae1
commit c65a15bfb0

View File

@@ -103,13 +103,25 @@ SendAlliedUnits = function()
Media.PlaySpeechNotification(player, "ReinforcementsArrived")
Utils.Do(AlliedUnits, function(table)
Trigger.AfterDelay(table.delay, function()
Reinforcements.Reinforce(player, table.types, { StartEntryPoint.Location, StartMovePoint.Location }, 18)
local units = Reinforcements.Reinforce(player, table.types, { StartEntryPoint.Location, StartMovePoint.Location }, 18)
Utils.Do(units, function(unit)
if unit.Type == "e6" then
Trigger.OnKilled(unit, LandingPossible)
end
end)
end)
end)
Trigger.AfterDelay(DateTime.Seconds(1), function() InitialUnitsArrived = true end)
end
LandingPossible = function()
if not beachReached and (USSRSpen.IsDead or Engineer.IsDead) and LstProduced < 1 then
player.MarkFailedObjective(CrossRiver)
end
end
SuperTankDomeInfiltrated = function()
turkey.SetStance(player, "Ally")
turkey.SetStance(neutral, "Ally")
@@ -278,7 +290,7 @@ InitObjectives = function()
end)
EliminateSuperTanks = player.AddPrimaryObjective("Eliminate these super tanks.")
CrossRiver = player.AddPrimaryObjective("Find a way to transport your forces to the mainland.")
CrossRiver = player.AddPrimaryObjective("Secure transport to the mainland.")
FindOutpost = player.AddPrimaryObjective("Find our outpost and start repairs on it.")
RescueCivilians = player.AddSecondaryObjective("Evacuate all civilians from the hospital.")
BadGuyObj = badguy.AddPrimaryObjective("Deny the destruction of the super tanks.")
@@ -400,6 +412,8 @@ InitTriggers = function()
end
end
end)
Trigger.OnKilled(USSRSpen, LandingPossible)
end
WorldLoaded = function()