processing.lua 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. -- Mineral Processing: video ~05:30–10:15. Gameplay receipts, not video timestamps, advance it.
  2. return function(m, a)
  3. local P = {region = 56}
  4. local debris = {"TUMBLER_OBSTRUCTION_OBJECT"}
  5. for _, letter in ipairs({"A", "B", "C", "D", "E", "F", "G", "H", "I"}) do
  6. debris[#debris + 1] = "TUMBLER_CHAMBER_PRE_PURGE_ROCK_" .. letter .. "_OBJECT"
  7. end
  8. local waves = {"processing_wave1", "processing_wave2", "processing_wave3"}
  9. local triggers = {"PROCESSING_000_PERCENT_PLAYER_TRIGGER", "PROCESSING_015_PERCENT_PLAYER_TRIGGER",
  10. "PROCESSING_075_PERCENT_PLAYER_TRIGGER", "LINK_ENTRY_PLAYER_TRIGGER",
  11. "LINK_DIRECTIVE_TUMBLER_OBSTRUCTION_PLAYER_TRIGGER", "LINK_DIRECTIVE_CONTROL_PLAYER_TRIGGER",
  12. "LINK_CARRY_OBJECT_PLAYER_TRIGGER", "LINK_DIRECTIVE_TUMBLER_EXIT_PLAYER_TRIGGER",
  13. "DIALOG_LINK_TUMBLER_001_PLAYER_TRIGGER"}
  14. local function phase(s) return s:variable("ember.processing.phase") or 0 end
  15. local function set(c, value) c:set_variable("ember.processing.phase", value) end
  16. local function hatch(c, number, open, snap)
  17. a.device(c, "DOOR_HATCH_" .. number .. "_DEVICE", open, snap)
  18. end
  19. local carry = require("mission_ember.carry")(a, "processing", "CARRY_OBJECT", "CARRY_RECEPTACLE_INTERACT_OBJECT",
  20. function(c, s) a.cue(c, s, 13); P.guidance(c, s) end,
  21. function(c, s)
  22. if phase(s) >= 3 then return end
  23. set(c, 3)
  24. a.checkpoint(c, 56, 0x4B27745D, "processing")
  25. a.darkness(c, s, true)
  26. a.effect(c, s, "TUMBLER_DAMAGE_HOP_ON", "TUMBLER_DAMAGE_OBJECT_FILTER",
  27. {players = true, inside = a.slot(c, "TUMBLER_INTERIOR_SAFETY_TRIGGER_VOLUME")}, true)
  28. a.cue(c, s, 14)
  29. a.device(c, "TUMBLER_DOOR_DEVICE", false)
  30. a.device(c, "CONTROL_CONSOLE_SCREEN_DEVICE", true)
  31. a.device(c, "LINK_TUMBLER_WARNING_LIGHTING_STATE_DEVICE", true)
  32. a.slot(c, "PROCESSING_AUDIO_KLAXON_SEQUENCE"):play_sequence{}
  33. hatch(c, "ONE", true); hatch(c, "TWO", true)
  34. a.spawn(c, s, {waves[1]})
  35. P.guidance(c, s)
  36. end)
  37. function P.enter(c, s)
  38. if phase(s) > 0 then return end
  39. set(c, 1)
  40. a.objects(c, debris, true)
  41. a.objects(c, {"MERCURY_HOLOGRAM_OBJECT", "DEVICE_DOOR_HATCH_ONE_OBJECT", "DEVICE_DOOR_HATCH_TWO_OBJECT",
  42. "DEVICE_DOOR_HATCH_THREE_OBJECT", "DEVICE_DOOR_HATCH_FOUR_OBJECT",
  43. "CORE_WEAPON_LASER_BEAM_OBJECT_80B3C8F7"}, true)
  44. a.device(c, "LINK_ENTRY_DOOR_DEVICE", true)
  45. a.device(c, "TUMBLER_DOOR_DEVICE", true, true)
  46. a.device(c, "CONTROL_CONSOLE_SCREEN_DEVICE", false, true)
  47. a.device(c, "LINK_HOLOGRAM_LIGHTING_STATE_DEVICE", true, true)
  48. for _, n in ipairs({"ONE", "TWO", "THREE", "FOUR"}) do hatch(c, n, false, true) end
  49. for _, t in ipairs(triggers) do a.slot(c, t):fire_trigger{} end
  50. a.spawn(c, s, {"processing_entry"})
  51. a.cue(c, s, 9)
  52. P.guidance(c, s)
  53. end
  54. local function discover(c, s)
  55. if phase(s) >= 2 then return end
  56. set(c, 2)
  57. carry.start(c, s)
  58. a.cue(c, s, 10)
  59. end
  60. function P.trigger(c, s, e)
  61. if a.matches(c, e, "LINK_DIRECTIVE_TUMBLER_OBSTRUCTION_PLAYER_TRIGGER")
  62. or a.matches(c, e, "LINK_DIRECTIVE_CONTROL_PLAYER_TRIGGER")
  63. or a.matches(c, e, "LINK_CARRY_OBJECT_PLAYER_TRIGGER")
  64. or a.matches(c, e, "PROCESSING_075_PERCENT_PLAYER_TRIGGER") then discover(c, s) end
  65. if a.matches(c, e, "LINK_DIRECTIVE_CONTROL_PLAYER_TRIGGER") then a.cue(c, s, 11) end
  66. if phase(s) == 4 and a.matches(c, e, "LINK_DIRECTIVE_TUMBLER_EXIT_PLAYER_TRIGGER") then a.cue(c, s, 18) end
  67. P.guidance(c, s)
  68. end
  69. function P.cleared(c, s, name)
  70. if name == "processing_entry" then discover(c, s)
  71. elseif phase(s) == 3 and name == waves[1] then
  72. hatch(c, "THREE", true); a.spawn(c, s, {waves[2]})
  73. elseif phase(s) == 3 and name == waves[2] then
  74. hatch(c, "FOUR", true); a.spawn(c, s, {waves[3]})
  75. elseif phase(s) == 3 and name == waves[3] and a.clear(s, waves) then
  76. set(c, 4)
  77. a.device(c, "TUMBLER_CHAMBER_LEFT_DEVICE", true)
  78. a.device(c, "TUMBLER_CHAMBER_RIGHT_DEVICE", true)
  79. a.objects(c, debris, false)
  80. a.device(c, "TUMBLER_DOOR_DEVICE", true)
  81. a.device(c, "LINK_TUMBLER_WARNING_LIGHTING_STATE_DEVICE", false)
  82. a.darkness(c, s, false)
  83. a.effect(c, s, "TUMBLER_DAMAGE_HOP_ON", nil, nil, false)
  84. a.cue(c, s, 17)
  85. end
  86. P.guidance(c, s)
  87. end
  88. function P.guidance(c, s)
  89. if s:variable("ember.region") ~= 56 then return end
  90. local p = phase(s)
  91. if p == 1 then a.directive(c, s, "883C188D", "LINK_DIRECTIVE_CONTROL_INTERACT_NAV_POINT")
  92. elseif p == 2 then a.directive(c, s, s:variable("ember.carry.processing.notified") and "57050F62" or "591B1D88", carry.held(s) and "LINK_DIRECTIVE_CONTROL_INTERACT_NAV_POINT" or "LINK_CARRY_OBJECT_NAV_POINT")
  93. elseif p == 3 then a.directive(c, s, "03285502", nil)
  94. elseif p == 4 then a.directive(c, s, "65D5979D", "CINDER_DIRECTIVE_CINDER_GOTO_BUBBLE_NAV_POINT") end
  95. end
  96. function P.reset(c, s)
  97. a.effect(c, s, "TUMBLER_DAMAGE_HOP_ON", nil, nil, false)
  98. a.reset(c, waves)
  99. carry.reset(c, s)
  100. a.slot(c, "EMBER_LINK_PROCESSING_DEFEND_OBJECTIVE"):reset_objectives{}
  101. a.objects(c, debris, true)
  102. for _, n in ipairs({"ONE", "TWO", "THREE", "FOUR"}) do hatch(c, n, false, true) end
  103. a.device(c, "TUMBLER_DOOR_DEVICE", true, true)
  104. for _, n in ipairs({"TUMBLER_CHAMBER_LEFT_DEVICE", "TUMBLER_CHAMBER_RIGHT_DEVICE",
  105. "CONTROL_CONSOLE_SCREEN_DEVICE", "LINK_TUMBLER_WARNING_LIGHTING_STATE_DEVICE"}) do a.device(c, n, false, true) end
  106. set(c, 2); a.darkness(c, s, false); carry.start(c, s)
  107. c:clear_variable("ember.r.guidance"); P.guidance(c, s)
  108. end
  109. P.interaction = carry.interaction
  110. function P.object(c, s, e) carry.state(c, s, e); P.guidance(c, s) end
  111. P.timer = carry.timer
  112. function P.resume(c, s)
  113. carry.resume(c, s)
  114. if (s:variable("ember.r.furthest") or 0) <= 1 then a.darkness(c, s, phase(s) == 3) end
  115. end
  116. return P
  117. end