Adds tools/gen_sideb.py — one data-driven builder replacing the copy-pasted gen_missionN.py pattern — and tools/smoketest.sh, which reports PASS/FAIL/DISPLAY_UNAVAILABLE instead of the process-is-alive check that has produced false passes twice now. NOT verified in-game: the display went to sleep mid-session. Static checks all pass (luac, check-yaml 0 errors, map refresh, check_assets, make) and the already-verified m03 hangs identically, confirming it is environmental. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
56 lines
1.4 KiB
Lua
56 lines
1.4 KiB
Lua
-- 04: ONBOARDING — process a quota inside the review window.
|
|
|
|
QUOTA = 3000
|
|
WINDOW = DateTime.Minutes(8)
|
|
Deadline = nil
|
|
Ticks = 0
|
|
|
|
WorldLoaded = function()
|
|
Stream = Player.GetPlayer("Player")
|
|
Party = Player.GetPlayer("Enemy")
|
|
InitObjectives(Stream)
|
|
|
|
QuotaObjective = Stream.AddPrimaryObjective("file-the-quota")
|
|
PlantObjective = Stream.AddSecondaryObjective("retire-the-plant")
|
|
Deadline = DateTime.GameTime + WINDOW
|
|
|
|
Trigger.OnKilled(LegacyPlant, function()
|
|
Stream.MarkCompletedObjective(PlantObjective)
|
|
end)
|
|
|
|
-- the legacy account eventually objects
|
|
Trigger.AfterDelay(DateTime.Minutes(3), function()
|
|
Utils.Do(Map.ActorsInWorld, function(a)
|
|
if a.Owner == Party and a.HasProperty("Hunt") then
|
|
a.Hunt()
|
|
end
|
|
end)
|
|
end)
|
|
|
|
Trigger.AfterDelay(WINDOW, function()
|
|
if not Stream.IsObjectiveCompleted(QuotaObjective) then
|
|
Stream.MarkFailedObjective(QuotaObjective)
|
|
end
|
|
end)
|
|
end
|
|
|
|
Tick = function()
|
|
Ticks = Ticks + 1
|
|
if Ticks % 25 ~= 0 or QuotaObjective == nil then
|
|
return
|
|
end
|
|
if Stream.IsObjectiveCompleted(QuotaObjective) or Stream.IsObjectiveFailed(QuotaObjective) then
|
|
return
|
|
end
|
|
|
|
if Stream.Cash + Stream.Resources >= QUOTA then
|
|
Stream.MarkCompletedObjective(QuotaObjective)
|
|
UserInterface.SetMissionText("")
|
|
return
|
|
end
|
|
|
|
local left = Deadline - DateTime.GameTime
|
|
if left < 0 then left = 0 end
|
|
UserInterface.SetMissionText("Review window " .. Utils.FormatTime(left))
|
|
end
|