소스 검색

Invert the beam drive: resting is open, the surge drives to close

The beam now responds, but its two poses were the wrong way round in game: the
resting drive rendered as the surge and the driven end as the weapon's normal
running state. These devices carry the same inverted pose as the landing and
clamshell bridges, where the authored position-0 lane is the driven end rather
than the resting one.

beam_drive is replaced by beam_pose, which takes whether the weapon is surging
rather than which lane endpoint to send, so the mapping is stated once. Resting,
including the dark pose held after the fusion cell is deposited, is open; the
warning drives to close.
Millie 3 일 전
부모
커밋
d9466e1ff2
2개의 변경된 파일16개의 추가작업 그리고 9개의 파일을 삭제
  1. 10 6
      scripts/mission_ember/apex.lua
  2. 6 3
      tests/mission_ember_routes_test.lua

+ 10 - 6
scripts/mission_ember/apex.lua

@@ -66,8 +66,12 @@ return function(m, a, ending)
     -- `ring_device_sense` in the log carries their native position and power.
     local structure_objects = {"SPECOPS_APEX_RING_CORE_OBJECT", "SPECOPS_APEX_RING_RING_OBJECT"}
     local beam_devices = {"SPECOPS_APEX_RING_LASER_DEVICE", "SPECOPS_APEX_RING_RING_DEVICE"}
-    local function beam_drive(c, driven, snap)
-        for _, name in ipairs(beam_devices) do a.device(c, name, driven, snap) end
+    -- These carry the same inverted pose as the landing and clamshell bridges, where the
+    -- authored position-0 lane is the driven end rather than the resting one. Confirmed in game:
+    -- the resting drive rendered as the surge and the driven end as the weapon's normal state,
+    -- so resting is `open` and the surge drives to `close`.
+    local function beam_pose(c, surging, snap)
+        for _, name in ipairs(beam_devices) do a.device(c, name, not surging, snap) end
     end
     -- Firing: the beam is present and both of its devices are powered.
     local function beam(c, s, firing, snap)
@@ -79,9 +83,9 @@ return function(m, a, ending)
             lane(c, name, firing and "power_on" or "power_off", snap)
         end
         if not firing then
-            -- Installed but dark: the drive returns to its baseline with the power.
+            -- Installed but dark: the drive returns to its resting pose with the power.
             c:set_variable("ember.apex.surge", false)
-            beam_drive(c, false, snap)
+            beam_pose(c, false, snap)
         end
     end
     -- The surge is the authored drive of a firing beam, so it never removes it. If these
@@ -89,7 +93,7 @@ return function(m, a, ending)
     local function beam_surge(c, s, on)
         if s:variable("ember.apex.beam") ~= true or s:variable("ember.apex.surge") == on then return end
         c:set_variable("ember.apex.surge", on)
-        beam_drive(c, on, false)
+        beam_pose(c, on, false)
     end
     -- `REACTOR_COFFIN_INTERIOR_THERMAL_HOP_ON` and `FOUNDRY_THERMAL_DOT_HOP_ON` both reference
     -- effect resource 80C1D9E0 -- the burn already working in the Foundry. The hot-pipe and
@@ -184,7 +188,7 @@ return function(m, a, ending)
         -- its baseline here so every later surge is an animated transition, not a jump.
         beam(c, s, true, true)
         c:set_variable("ember.apex.surge", false)
-        beam_drive(c, false, true)
+        beam_pose(c, false, true)
     end
     local function start_reactor(c, s)
         if phase(s) >= 3 then return end

+ 6 - 3
tests/mission_ember_routes_test.lua

@@ -261,9 +261,11 @@ assert(vars['ember.apex.vent_step']=='warning' and timers['ember.apex.vents.1']=
 -- The weapon fires continuously through the fight; the exposure cycle must not blink it.
 -- The surge is the authored device drive of a beam that stays present and powered.
 assert(vars['ember.apex.beam']==true,'the weapon must keep firing across the cycle')
+-- Inverted pose, as on the landing and clamshell bridges: resting is open, the surge drives
+-- to close. The opposite mapping rendered the surge as the weapon's normal state.
 assert(vars['ember.apex.surge']==true,'the warning must drive the beam')
-assert(transition('SPECOPS_APEX_RING_LASER_DEVICE', true).transition=='open')
-assert(transition('SPECOPS_APEX_RING_RING_DEVICE', true).transition=='open')
+assert(transition('SPECOPS_APEX_RING_LASER_DEVICE', true).transition=='close')
+assert(transition('SPECOPS_APEX_RING_RING_DEVICE', true).transition=='close')
 assert(transition('REACTOR_CLAMSHELL_EAST_DOOR_A_DEVICE').transition=='close')
 timer('ember.apex.vents.')
 assert(timers['ember.apex.vents.1']==10000)
@@ -348,7 +350,8 @@ assert(escapeFilter=='aod_reactor_rail_top_object_filter','escape hazard must us
 -- ring objects would take the beam and its surrounding structure out of the world entirely.
 assert(vars['ember.apex.beam']==false,'the beam must stop firing after the deposit')
 assert(vars['ember.apex.surge']==false,'the drive must return to its baseline with the power')
-assert(transition('SPECOPS_APEX_RING_LASER_DEVICE', true).transition=='close')
+assert(transition('SPECOPS_APEX_RING_LASER_DEVICE', true).transition=='open',
+    'a dark weapon rests in its normal pose, not the surge')
 local poweredOff=false
 for _,row in ipairs(calls)do
     if row[1]=='transition' and row[2]=='specops_apex_ring.laser_device'