-- 06: THE SHUFFLE — SIDE B finale. Ticks = 0 CorrectionIssued = false WorldLoaded = function() Stream = Player.GetPlayer("Player") Party = Player.GetPlayer("Enemy") InitObjectives(Stream) AlgorithmObjective = Stream.AddPrimaryObjective("bring-algorithm-online") StudioObjective = Stream.AddPrimaryObjective("delete-the-studio") HubObjective = Stream.AddSecondaryObjective("keep-the-hub-online") Trigger.OnKilled(TheStudio, function() Stream.MarkCompletedObjective(StudioObjective) end) Trigger.OnKilled(TheVan, function() Trigger.AfterDelay(DateTime.Seconds(2), function() local hubs = Utils.Where(Map.ActorsInWorld, function(a) return a.Owner == Stream and a.Type == "streamhub" end) if #hubs == 0 then Stream.MarkFailedObjective(HubObjective) end end) end) end Tick = function() Ticks = Ticks + 1 if Ticks % 25 ~= 0 or AlgorithmObjective == nil then return end if Stream.IsObjectiveCompleted(AlgorithmObjective) then return end local cores = Utils.Where(Map.ActorsInWorld, function(a) return a.Owner == Stream and a.Type == "algorithm" end) if #cores > 0 then Stream.MarkCompletedObjective(AlgorithmObjective) if not CorrectionIssued then CorrectionIssued = true Media.DisplayMessage(UserInterface.GetFluentMessage("they-are-coming")) Media.PlaySpeechNotification(Stream, "BaseAttack") Utils.Do(Map.ActorsInWorld, function(a) if a.Owner == Party and a.HasProperty("Hunt") then a.Hunt() end end) end end end