Map Lich's sound moments in code

Delegated run·Oct 10, 2026  13:37·Prompted by Opus 5.5·Run by Sonnet 5.5Sonnet 5.5 xhigh
Ctrl + F
Show

Transcript

Opus 5.5·13:37:14·Oct 10, 2026Prompter

Read-only code mapping in C:\Users\a327e\Desktop\a327ex\lich-survivors (an Anchor/Lua game; game logic in port/*.lua, entry main.lua + boot.lua, the harness/frame in port/game.lua). Do NOT edit anything, do not run the game, no browser. Grep/Glob/Read only.

Context: the game is getting sounds. Every moment that should make a sound needs a call like AU.play('slot_name', { pos = <world Vector3 or {x,y,z}> }) inserted at the exact place it happens, and continuous sounds need loops (AU.loop) started/stopped at the right places. I need a precise map of those places.

The game: a floating lich in a cave defends an egg in a sun shaft from snakes with six powers (port/powers.lua drives them): FIRE (port/fire.lua), LIFT (port/lift.lua; lifts snakes, curls them into a ball, bursts them with a fist), ROCK (port/rock.lua; telekinetic rock throw, crush), LEAK (port/leak.lua + port/warp.lua; dissolve/leakage streaks), BEAM (port/beam.lua; prismatic beam from his finger, revolver-like group shots, glass petals port/petals.lua), LENS (port/lens.lua; a glass lens focusing a cutting beam). Snakes: port/snakes.lua (waves, spawning, slithering, reaching the egg, dying, coiling round the egg port/coil.lua). Gore: port/gore.lua (bursts, debris, guts, blood, floor splashes). Objects: port/items.lua (six objects: thrown from his hand, falling as rigid bodies, landing, picked up again), the model viewer port/inspect.lua (open, close, THROW button, X). The lich: port/lich.lua (hit reactions/jolts, hurt pose), port/lichmask.lua (his mask; drops at death), port/ragdoll.lua (his death fall). The intro walk-in (port/game.lua INTRO). The ending (port/game.lua seq_tick / SEQ: envelopment, silhouettes, death, snakes burst, egg knocks port/eggphys.lua: knocks, crack, breaking into pieces, pieces landing; port/silhouette.lua). The cave itself (port/cave.lua: ambient? the sun shaft, dust motes). HUD: port/hud.lua, port/ui_style.lua (hover/click on inventory slots).

For EACH sound moment, report:

  • a suggested slot name (snake_case, short, e.g. fire_cast, snake_burst, egg_knock)
  • file:line and the enclosing function where it happens (the exact line where the event becomes true, e.g. the line that sets a 'dead' flag or calls a burst)
  • whether it is one-shot or continuous (a loop: say where it starts and where it stops)
  • the variable(s) in scope at that line that hold its world position (e.g. s.x, s.z for a snake; L for the lich; EGG; a Vector3), and the Y if known (heights: the lich floats ~1.4 m, snakes on the floor ~0)
  • for group versions (3+ snakes in one cast), whether the code path differs (so the sound can differ)
  • how often it can fire (per tick? per snake? once per cast?) so I can avoid spam Also list: the camera/listener (where the world camera's position lives each frame; port/post.lua R.world_camera), the game's fixed tick function and where per-frame updates happen (port/game.lua tick / frame), and how the HUD projects a world point to the screen (game.lua draws a goal marker with Vector3:project(R.world_camera) around draw_hud — quote that snippet).

Be exhaustive about discrete events; aim for ~40-70 moments. Organize by module. Keep each entry to one or two lines. Total under ~2500 words.

Sonnet 5.5xhigh·13:37:17·Oct 10, 2026Worked for 5m 56s
Thinking13:37:17

I should start by exploring the codebase to understand its structure.

Bashls && wc -l port/*.lua main.lua boot.lua 2>/dev/null | sort -n | tail -8013:37:18Output not recorded
Input
ls && wc -l port/*.lua main.lua boot.lua 2>/dev/null | sort -n | tail -80
GrepAU\.|\bau\.play|audio13:37:18Output not recorded
Input
AU\.|\bau\.play|audio
Thinking13:37:22

There's no AU found in the game yet, so I should start exploring the codebase, beginning with game.lua since the files are large.

ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\main.lua13:37:22Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\main.lua
ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\boot.lua13:37:22Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\boot.lua
ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\game.lua13:37:22Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\game.lua
ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\game.lua13:37:22Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\game.lua
Bashls anchor | head -50; grep -n "AU\b" anchor/anchor.meta.lua | head; ls assets | ...13:37:22Output not recorded
Input
ls anchor | head -50; grep -n "AU\b" anchor/anchor.meta.lua | head; ls assets | ...
Thinking13:37:30

I should check post.lua for world_camera, then move on to powers.lua, snakes.lua, and other related files in parallel.

Grepworld_camera13:37:30Output not recorded
Input
world_camera
ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\powers.lua13:37:30Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\powers.lua
Thinking13:37:36

I'm tracking down the exact line numbers in powers.lua where each cast happens — the single targeted cast, the beam volley starts and continuations, and the ignite/fire-lick triggers during the sweep sequence.

Continuing through the remaining cast sites: fire cast triggering ignite, lens cast and cast_group variants, rock cast calls in a few different spots, and the last-resort fallback near the end of the file. Next I'll move on to checking snakes.lua.

ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\snakes.lua13:37:36Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\snakes.lua
ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\snakes.lua13:37:36Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\snakes.lua
Thinking13:37:45

I'm tracing how snakes spawn and become visible, finding the delay countdown decrements each update rather than firing a discrete event, so the actual spawn moment aligns with the wave-sending logic instead. The slithering motion itself seems to run continuously per snake rather than as a one-time trigger.

Mapping out the key snake lifecycle events now: wave sent, emergence as delay crosses zero, reaching the egg, gripping it with the coil, and finally winning/covering it. There's also burn-to-ash and sink completion logic, and I still need to check where the dying state gets set, possibly tied into gore effects — then I'll move on to looking at fire.lua.

ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\fire.lua13:37:45Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\fire.lua
ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\lift.lua13:37:45Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\lift.lua
Thinking13:37:55

I'm mapping out the lift sequence: the cast triggers group knot formation with a balling sound transitioning through rise and gather phases, positioned along the snake's spine and knot center, while rising begins with a per-snake delay and swell timing is offset before the group's activation point.

Then there's the curl closing the fist ahead of the group's activation, and the burst event — though staggered timing is baked into each snake's activation tick, all snakes actually burst simultaneously once the group timer crosses threshold.

For fire sounds: ignition starts at the snake's leading spine point, burning loops continuously until burn-out or fade, with burn completion marked separately and a sweep lick sound running throughout the sweep phase between its start and stop points. Next I'm moving into gore.lua.

ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\gore.lua13:37:55Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\gore.lua
ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\gore.lua13:37:55Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\gore.lua
Thinking13:38:04

I'm tracing the gore module's discrete events — burst, crush, and spatter — and checking which call sites trigger each, like rock crushes, beam hits, and piece landings.

Debris landings and blood splashes are too frequent to log individually, so those need throttling or sampling rather than per-event tracking. Next I need to check the actual callers of burst/crush/spatter plus the `dying` function to map out the full event chain.

ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\rock.lua13:38:04Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\rock.lua
Grepgore\.(burst|crush|spatter)|\.dying\s*=|snakes\.take|\.take\(13:38:04Output not recorded
Input
gore\.(burst|crush|spatter)|\.dying\s*=|snakes\.take|\.take\(
Thinking13:38:14

I'm mapping out the rock event lifecycle—cast and raise triggers per rock, the tear effect when a rock rips from the floor with ground-level positioning and a puff of chunks staggered slightly between rocks, and the hold phase with a continuous sparkling aura and ambient hum while the rock floats.

From there I trace the throw sequence: orbit rocks release together with staggered timing, flight produces wake puffs until the rock hits something or comes to rest, and impact triggers a crush effect at the collision point. I follow the rock through its bounce on the ground, settling into the rest phase, then sinking and disappearing, noting there's no distinct event for the snake's crush rope settling beyond timed sinking. Now I'm moving on to leak.lua and warp.lua.

ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\leak.lua13:38:14Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\leak.lua
ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\beam.lua13:38:14Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\beam.lua
Thinking13:38:23

I'm mapping out the beam events - the cast fires from the fingertip position in a staggered fan pattern, with a continuous channel loop that needs proper start/stop handling tied to the live state, and then the shot event follows after.

When a beam connects, bite registers the hit on the snake at a goal position, pierce tracks fill progress until it hits the shatter threshold where the snake bursts into streaks of spine fragments and petals, and petals.trickle adds a continuous chime effect for beamed snakes. There's also beam detachment/cutting and recoil kickback on the lich when firing.

After this I plan to work through petals.lua, lens.lua, warp.lua, items.lua, inspect.lua, lich.lua, lichmask.lua, ragdoll.lua, eggphys.lua, silhouette.lua, cave.lua, coil.lua, hud.lua, and ui_style.lua in parallel.

ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\lens.lua13:38:23Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\lens.lua
ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\petals.lua13:38:23Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\petals.lua
Thinking13:38:29

I'm tracing the lens lifecycle: it spawns high in the shaft when crystallizing, then converges once FORM ends, with the cone and patch focusing while a rising 'lens_focus' sound loops from convergence until the sweep reaches LIGHT.

Next it fires, launching a cutting-beam ribbon that persists until released or the sweep exceeds its duration, severing whatever snake it targets into two pieces at the strike point. After that the lens dissolves away and retargeting stops. I'll move on to items.lua and inspect.lua next.

ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\items.lua13:38:30Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\items.lua
Thinking13:38:36

I'm tracing the item event handlers: throwing releases orbs and sets landing position, dropping ties into the power toggle logic, and impact with the floor triggers a dust effect based on velocity. I should check body.lua to see how on_hit is actually implemented.

Also mapping out ball bounce thresholds, orb-to-orb collisions, pickup/puff effects when items are taken, and the hover loop that runs while an item is held between hold_orbs and release_orbs. I need to look at how egg collisions are handled in body.lua too.

ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\body.lua13:38:36Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\body.lua
ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\inspect.lua13:38:36Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\inspect.lua
Thinking13:38:43

I'm tracing the inspect viewer's UI sound events—open triggers from ask_remove, the 'i' key, and inventory clicks; close resets the closing state; and answer handles the throw button press.

The remaining events cover switching objects with A/D, hover highlighting on buttons, drag-start and wheel zoom, and the close-X press. Next I'll move on to examining lich.lua, lichmask.lua, and ragdoll.lua.

ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\lich.lua13:38:43Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\lich.lua
ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\mover.lua13:38:43Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\mover.lua
Thinking13:38:50

I'm tracing where lich.hit, lich.kick, and lich.curl get called from across the game logic—grip, win, spasm events, beam and item interactions. For movement, I'm thinking the lich could have a continuous hovering hum or cloth-like whoosh sound that's modulated by its speed through mover.speed().

Next I want to check lichmask.lua and ragdoll.lua for how position and animation state are tracked.

ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\lichmask.lua13:38:50Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\lichmask.lua
ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\ragdoll.lua13:38:50Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\ragdoll.lua
Thinking13:38:57

I'm thinking about detecting ragdoll body-part impacts with the ground in the collision function, using velocity at contact to trigger distinct thud sounds for pelvis, chest, and head.

I also want to find where masks drop and bounce — the mask-drop logic around M.drop and the bounce behavior where falling velocity triggers a rest state. After that I'll move on to looking at eggphys.lua and silhouette.lua.

ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\eggphys.lua13:38:57Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\eggphys.lua
Thinking13:39:06

I'm tracing the knock event handling in eggphys.lua, looking at how knock intensity and position are computed relative to the egg's world coordinates and shell surface points.

Now I'm mapping the hatch sequence: knocks begin at a scheduled offset, then crack growth kicks off with a timed glow spreading over `crack_t` seconds, followed by the actual egg-opening break that launches the cap and shards from the egg's position. I still need to figure out whether shard/piece landings generate collision events, so I'm going to check if the physics3 API exposes contact or hit callbacks.

ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\silhouette.lua13:39:06Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\silhouette.lua
Bashgrep -n "physics3_" anchor/anchor.meta.lua | head -80; grep -n "contact\|hit_eve...13:39:06Output not recorded
Input
grep -n "physics3_" anchor/anchor.meta.lua | head -80; grep -n "contact\|hit_eve...
Thinking13:39:11

I'm thinking about using collision tags 'shell' and 'ground' to detect contact, possibly through a hit-event polling function, and want to verify the exact API signatures in the documentation.

ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\anchor\anchor.meta.lua13:39:11Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\anchor\anchor.meta.lua
ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\anchor\anchor.meta.lua13:39:11Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\anchor\anchor.meta.lua
Grepsound|audio|AU\b13:39:11Output not recorded
Input
sound|audio|AU\b
Thinking13:39:18

I'm tracing where collision hit events for shell/ground would need to be enabled in eggphys.lua — noting that physics3_enable_hit isn't currently called in build_ground, even though api.tick already polls for the hit result.

Next I want to check cave.lua, coil.lua for its coiling sound, hud.lua, ui_style.lua, post.lua for the world_camera position, fx.lua, and warp.lua, starting with the key portions of cave.lua.

ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\ui_style.lua13:39:18Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\ui_style.lua
ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\hud.lua13:39:18Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\hud.lua
ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\cave.lua13:39:18Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\cave.lua
Thinking13:39:26

I'm tracing where the cave's ambient update loop lives, noting the dust mote animation, the sun shaft hum, and the subtle egg tremble effect tied to a sine-based rotation.

Then I'm checking the HUD's inventory drawing and hover/click logic for slots, plus the inspect module's pointer handling for buttons. I'm also scanning coil, hud, post, and fx for event hooks, and tracking down where power-removal and snake-related callbacks like on_coil, on_grip, on_won, and on_dissolve actually get assigned.

ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\post.lua13:39:27Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\post.lua
Grepon_coil|on_dissolve|on_grip|on_won13:39:27Output not recorded
Input
on_coil|on_dissolve|on_grip|on_won
Grepfunction |phase|touch13:39:27Output not recorded
Input
function |phase|touch
Thinking13:39:35

I'm checking fx.lua and warp.lua for minor details, then tracing how the intro sequence transitions the lich from floating/hovering to walking, and looking at how power-related events like toggle_power and throw_power handle dropping and taking items.

Then I'm verifying the END.won / END.over logic: it seems the black screen cut never actually triggers during normal gameplay since SEQ.on gets set true before END.over would run, except in the special LICH_ROOM case. I want to confirm a few more line numbers, particularly around fx.lua's chunk-landing effects for rock debris, before finalizing my citations.

ReadC:\Users\a327e\Desktop\a327ex\lich-survivors\port\hud.lua13:39:35Output not recorded
Input
C:\Users\a327e\Desktop\a327ex\lich-survivors\port\hud.lua
Greplanded|ground_y|function fx\.|chunk13:39:35Output not recorded
Input
landed|ground_y|function fx\.|chunk
Thinking13:42:22

I'm confirming a few more details: skipping the fx.lua chunk near line 158, noting the head position call for the "lich" vocal, and checking the engine's update loop timing—game ticks at 60Hz with camera placement happening after each tick and during render.

The listener position should update from the world camera's position and matrix after place_camera runs, ideally inside game.frame after the tick loop or in render right after the camera placement call. I'm also noting the fixed room camera's static eye and target coordinates, which shift during SEQ sequences toward different lerp targets near the egg.

I'm cross-checking several line numbers I plan to cite—die, snakes.burst_all, lmask.drop, ep.start, seq_tick, knocking, hatch, crack_egg—along with where the lich's fall collides with the floor via the ragdoll creation and collision lines.

Now I'm tracing the egg hatch sequence through crack_egg and the open check against the crack timer, then following the wave director logic in snakes.lua for spawn delays, emergence detection when a snake's delay crosses zero, and positioning from spawn coordinates. I'm working out the crawling and slither behavior, how a snake reaches the egg and triggers coiling, and the grip threshold check that fires the on_grip callback when the coil tightens past a certain point.

From there I'm mapping how on_grip connects to lich.hit, tracking coil phases from wrap through set and the continuous squeeze loop tied to coverage percentage, and the coverage update cycle that determines the win condition at 97%. I'm also noting the sequence triggers once the ending begins — lich getting taken, periodic spasm hits at randomized intervals, and how all these hit calls funnel through the central lich.hit function.

Now I'm tracing the later ending beats: silhouettes sweeping in over twelve seconds before the death trigger fires after a hold delay, the die() function spawning a ragdoll and bursting all coiled snakes simultaneously for a group gore effect, egg wobble knocks applying physics impulses with scaling intensity, and the camera zoom kicking in at the 2.2 second mark.

I'm also mapping out the egg's crack/hatch sequence — the glow growing over 0.8 seconds, open_egg() triggering a launch impulse and shard spawning — plus noting the HUD's goal-marker logic, which projects a 3D world point onto 2D screen coordinates using the camera, converting normalized clip space into pixel positions.

I'm tracing the camera's world direction and up vector for orientation, then looking at inventory hover/click handling — the slot detection on mouse move, how hover state only applies to "on" slots, and the click logic that triggers removal when a slot is selected.

For empty-slot clicks I'm checking whether there's a denial sound/state at the else branch. In ui_style, hover and button states are purely drawn, not computed, so the actual input logic lives in inspect.lua and game.lua. I'm also mapping out the inspect dialog's open/close/next/answer/X flow and where the 'closing' and 'active' flags get toggled.

Now I'm tracing the drag/turn pointer-down and wheel handlers alongside the accept action, then following how the intro sequence sets the walk state, goal, and arrival flag that triggers snake waves. I'm also noting where throw and kick pull their power from the mover's yaw and how drop ties into the toggle_power call.

Next I'm mapping body impact handling—the hit threshold triggering on_hit callbacks, dust effects scaled by velocity, and position tracking through substeps with a cap to avoid spam across multiple bouncing balls. I'm also tracing ball-ball collision logic requiring negative relative velocity, the "lying" rest state for balls and rigid bodies, and the pickup flow where items.near triggers power toggling and puff effects at specific positions, plus how orbs hover via hold_orbs.

Now I'm tracking how orbs stay held from creation through continuous updates until release, indexed within the ALL items array (FIRE, LIFT, ROCK, LEAK, BEAM, LENS), confirming orbs correspond to index 4. I'm also looking at the leak item's wind-streak visual effect emanating from the skull and the on/off toggle logic that controls when this whispering loop plays.

For the ripple effect, I'm checking how a pulse emits from the leak position every 1.6-2.6 seconds, and tracing the per-snake dissolve mechanic where accumulated leak value spawns flakes and smoke before the snake fully dissolves once it crosses a threshold, with speed slowing as leak accumulates. I'm also examining fire's ignition path from snake trigger through the start function, how the cast ability handles multiple targets with staggered delays and capacity limits, and the group sweep logic for fire.

Tracing the sound event flow now — cast gesture, per-snake ignite, and looping burn sound tied to burn duration constants, with a lit-fraction value driving volume intensity. Following what happens when a snake finishes burning: it transitions to burnt state, sinks, puffs ash, and eventually respawns, while the sweep lick mechanic fires repeatedly per tick to drive a continuous sweep sound.

Mapping out the sweep/aim/lower gesture phases in powers.lua and deciding sounds belong attached to fire.start rather than the gesture code itself, since ignite can fail the free-check; also starting to note where lift.cast's per-group logic picks up.

I'm working through the lift timing math: each snake rises with staggered delays, knots only form past a group threshold, and I'm computing the total elapsed times for single versus knotted groups by summing rise, hold/gather, swell, and curl stages before the burst fires per snake.

I'm noticing all snakes in a group actually burst on the same tick, so I should dedupe any per-group effects like sound using a flag so it only fires once instead of spamming per snake. I'll also note the fist-closing animation on the lich's curl and start thinking through the "unseen hand" lift force mechanic under the snakes.

For the lift, I'm tracking snake position along the spine (using a mid-index around 45% of the ring), their rise height of 1.5-2.0m, and the knot's anchor point slightly above ground level, with snakes writhing while suspended and new ones joining via a later extend group.

For the rock mechanic, I'm mapping out the cast and raise sequence with staggered timing, the tear effect that fires on the first "rip" phase tick, positioning at the origin point, then a hover/hold phase with aura puffs lasting roughly a quarter second (longer for grouped orbit throws) before transitioning to the fly phase for the throw.

Now I'm working through rock behavior after the throw: tracking thrown counts, wake puffs during flight, hit detection that crushes snake segments with multi-hit support for rocks, bounce physics on ground contact with thud effects for high-velocity impacts, resting and sinking into the ground after a few seconds, plus quick-rock variants and a fallback "set down" behavior when there's no target. I'm also noting the rope's crush twitch animation and sink timing, and the group orbit behavior where rocks circle at a fixed angular speed before being loosed together with staggered throw delays. Now moving into the beam mechanic, starting with its cast and channel setup and the per-beam shoot timing.

Then I'm detailing the beam's travel and impact sequence: it moves at a fixed velocity, bites on contact triggering burn phase and shatter effects with glow, warp streaks, gore spatter, and petal bursts, and the channel ends once all beams are spent, with recoil kicks tied to cast, bite, and shot events. I also trace the difference between single-cast beams versus the "revolver" multi-shot variant with faster speed and stronger kick, how shot position is tied to the caster's fingertip, and how non-group casts fan out multiple staggered beams up to a capacity based on power level, with an extend function adding more beams to an existing channel.

Now I'm turning to the Lens power: casting spawns a lens at a position along the shaft axis, which goes through forming, converging (cone and floor light patch tightening), then firing a sweeping ribbon effect that cuts through targets over roughly 0.87 seconds, triggering cut effects on anything in its path, before the lens dissolves and the ribbon releases; quick-cast lenses skip ahead in this timeline to fire almost immediately.

I'm also tracking lens groups and large variants, gore effects for impacts and landings, and the Lich's reactive systems — hit/kick/curl animations tied to combat events, a hurt pose that ramps up gradually while gripped and resets on death, hover movement driven by a speed-based mover with turning, and a spasm state tied to the game loop.

Moving to death handling, I'm mapping out the mask drop with its bounce physics, ragdoll collision detection for key body points like pelvis and head, and the final collapse sequence where the lich body falls with a sound cue while the mask drops alongside it.

Beyond that I'm tracking ending logic around snake group holds and silhouette timing, plus the cave ambience system including the sun shaft's geometric position relative to the egg and its radius bounds for the in_sun detection.

Tracing the egg's position comes down to the layout manifest and ground_y helper, landing around y≈0.3 for the base mound, and I'm checking whether dust motes count as discrete ambient events or can be skipped, then looking at the idle tremble animation for the egg driven by overlapping sine waves over time.

I'm noting this tremble produces intermittent "egg_shiver" bursts on rising edges, stopping once enough snakes have coiled, and cave.update exits early when physics-driven objects are present. Then I'm moving to the wave director logic — send_wave picks a pattern (ONE, PAIR, PACK, SPREAD, STREAM) and schedules a snake plan with delays and angles, firing a "wave_incoming" cue with spawn location, and snakes actually emerge once their delay counts down to zero. I'm now tracking what happens when a snake dies, starting with the burnt-sink and dying-state event triggers.

Looking closer, the "dying" branch at line 832 seems to be dead code since nothing ever sets that state besides spawn initialization and pooling. I'm also noting the fx 'done' path triggers a respawn, dissolve and burst/gore handle other death types, and snake_stuck respawns silently without any sound cue.

Now I'm checking how group-based power effects differ when three or more targets are involved — group_of in powers.lua returns different results for beam/fire effects, LIFT has its own knot-grouping, ROCK casting sets a group flag once targets hit three, and LENS has similar group logic, each tracked with its own counter.

I'm pulling up a snippet of the HUD projection code, then mapping out the per-frame update order: main.lua's update calls input handling, then frame stepping, then the tick function, followed by camera placement, while rendering calls a separate zero-delta camera placement. Within tick, I'm listing the sequence — powers, ending, sequence, lich pose, rag, post-pose, lich update, lmask, cave, snakes, fire, fx, gore...

Continuing through the tick sequence, I'm noting warp, items, and pickup updates round it out. I need to be careful that any audio calls I add stay pure side effects without touching the RNG, since replays and test harnesses run tick() many times rapidly without real time passing — I'm thinking about whether to throttle by real time or flag it as a manual mode. I'm also tracking the lich's gesture phases (start, aim, hold, lower), the ending sequence's periodic power-toggle behavior that throws items from the hand, and noting that a 'power_lost' sound should probably trigger when toggle_power turns a power off.

Now I'm cross-referencing exact line numbers across powers.lua, items.lua, and fx.lua for drop, throw, take, hold, collision, and gore effects (burst, crush, spatter, debris landing, blood splashes) to make sure my sound-trigger additions land on the right calls, and I'm double-checking whether egg-wall contact in body.lua even has a distinct on_hit path versus just floor-contact counting.

I'm noting that item-to-egg contact in body.lua returns an impact value that's currently discarded, which could be hooked for an "item_egg_clunk" sound, and similarly checking orb-avoidance and lens/rock claim logic for missing sound hooks. I'm also mapping out ambient loop lifecycle — when cave ambience starts relative to GM.create, how game_hosted_visible/stop pause or kill audio loops when the game is off-screen, and confirming that the inspect view actually halts the tick loop.

I want to check whether that inspect-mode halt means world loops like fire and orb hums should be ducked or frozen alongside the frozen simulation, and whether the "wait" intro state still lets the tick run. With roughly sixty sound moments to document and a ~2500 word budget, I need to stay compact — citing specific line references like lich.hit callers and snakes.on_grip, then tracing how the camera listener position gets updated each frame from place_camera and where exactly in the render loop the audio listener should sync to it.

The static camera eye sits roughly 15m from the action looking toward the egg/lich area, which means spatialization decisions need to consider whether the listener should track the fixed camera or the in-scene focal point instead. I'm also noting key position variables — the egg's center offset, the lich's hover height and head/fingertip accessors, and the snake's spine ring indexing for head, tail, and various midpoint rings used for lift, rock, and beam-aim calculations.

Now I'm ready to assemble the final report, organizing each sound by module with its ID, trigger slot, file:line reference, function name, one-shot versus loop behavior, and the relevant position variables.

I'm aiming for roughly 65 compact entries at about 30 words each, keeping things tight with shorthand notation for position fields. Starting with the infrastructure section: there's no audio system currently in the repo beyond the engine's raw sound_play_handle and related volume/pitch/loop/stop calls, so I'm tracing through the update loop — from main's update call down through game.frame's fixed-timestep tick accumulator, noting that the engine runs at 120Hz while game logic ticks at 60Hz, meaning some frames skip logic entirely. I'm also flagging that the harness's bulk step/until functions run many ticks without real elapsed time, so any looping sound logic needs to tolerate that, and that tick() exits early while the viewer is open.

Now I'm identifying key audio-relevant hooks: the listener should track the world camera, whose position and orientation get written once per tick in place_camera, with a static far-away room camera that eventually lerps toward the egg during the ending sequence — so the best place to update listener position is right after place_camera runs. I'm also cataloguing important world positions to anchor sounds to: the mover's hover position, lich head/fingertip helpers, the egg's position, and the snake's spine segments, plus starting to think about HUD projection for any UI-space audio cues.

Now I'm drafting individual sound-event entries with IDs (F1, F2...) for cave ambience — a looping ambient bed tied to game boot/stop, an optional shaft-hum positioned along the sun column above the egg, and a one-shot "egg shiver" triggered on rising edges of a noisy shake value that fires every several seconds until the egg goes still or gains physics. Then I move into intro-sequence events: begin/arrive triggers tied to the intro state machine anchored at the mover's position, and a looping lich-hover sound modulated by mover speed and yaw.

I'm now working through snake-related sound events: wave-send triggers keyed to wave type and spawn coordinates, snake-appear one-shots fired when a snake's spawn delay counts down to visibility (with debouncing for pack arrivals), and a looping slither sound tied to each snake's crawl state, with volume by distance to the egg and pitch scaled to speed and leak smoothing, limited to the nearest three voices. I'm also considering an optional close-range hiss triggered once a snake gets within urgent distance of the egg.

I continue mapping out coil-related events — reaching the egg, gripping, the squeeze loop whose volume ties into coverage or ending level, the win trigger at ~97% coverage, and one-shot sounds for burn/ash and dissolve deaths, each tied to specific snake positions and counted once per snake. I decide to skip the cut-done case and move on to start the fire-related sound events next.

I'm tracing fire's full lifecycle: the gesture-raise cast tied to arm-raising with timing offsets for multi-target sweeps, the ignite trigger fired from snake death after staggered delays or sweep attacks (capped at 3 snakes within 0.24s), the burn loop whose volume follows a decay curve and caps at 4 concurrent lights, and finally the group sweep phase bounded by its start and end states in the gesture system.

Moving to Lift, I'm mapping its own cast-to-rise pipeline: the initial cast gesture positioned at the snake's mid-spine, the per-snake rise animation using a staggered smoothstep easing starting from a negative delay, and for group lifts (3+ snakes) the additional knotting/balling phase that gathers snakes together before the swell and burst — tracking exact timing constants (RISE, GATHER, SWELL, STAGGER) and where each effect reads its position from.

Then I trace the lift fist-curl gesture guard that prevents duplicate curling per group, followed by the burst call shared across all snakes in a group (since burst timing depends on group time, not individual stagger), noting I should throttle duplicate burst sounds per group. Finally I move into Gore, cataloging burst, crush, spatter, and piece-landing events with their callers, position sources, and recommended throttling (e.g. capping piece-land effects to 3 per burst despite up to 18 pieces).

Now I'm cataloguing chunk landing (meat/ribs/scraps pools, sampled sparsely with a quiet splat), blood-drop splashes (flagged as too frequent, needing rate limiting), and gut landings (to skip entirely). Then I move into Rock mechanics: tearing free with staggered timing, the hold/hum loop with aura puffs until throw, the throw event treating grouped throws as one volley, the flight whoosh loop pitched by velocity, and I'm starting to trace the hit-snake callback.

I continue the rock hit-snake logic covering multi-hit and crush, then rock landing with bounce counts and thud strength, and rock resting/sinking as optional quiet states. I shift to Leak/warp effects: the whisper loop tied to lich head position and reach scale, periodic expanding ripples, and the per-snake dissolving leak accumulation tied to the earlier dissolve entry. I'm about to start cataloguing the Beam effects next.

Now I'm detailing beam casting from the fingertip with fan-based beam counts and scaling kick, the channel loop bounded by creation and nullification of the channel object, and the revolver-style beam shot used for groups with staggered volley timing and a sharper kick. I continue into beam hit/bite logic targeting the spine ring position with an initial kick, the trickle/pierce effect producing a rising chime as it ticks toward a shatter threshold, and the shatter trigger itself firing once that threshold time is reached.

Next I'm tracking lens mechanics: the lens forming high in the shaft with a crystallizing chime, scaling up for grouped casts; the focus phase converging with rising pitch as the cone contracts; the fire loop sustaining a ribbon effect for a computed duration depending on single or group sweep; the cut-snake interaction applying effects per snake within a sweep; and the dissolve stage winding down the lens.

Then I shift to items: throwing logic pulling position from hand to landing point with index-based item types (including orb release puffs), dropping logic for toggling power off, and impact detection with debounce and velocity-scaled effects per body type.

Continuing through orb collisions with ball-wake triggers, optional egg contact hooks, settling states for lying items, pickup logic auto-grabbing nearby items with position offsets, and the orb hover loop managing held orbs through creation, update, and release while a power flag is active.

Moving into inspect/HUD logic, I'm mapping slot hover detection (no state currently tracked, needs edge-detection added) and slot click behavior tied to power-on status, plus the viewer open/close flow triggered by remove requests or key presses, including the throw-vs-browse distinction and closing animation state.

Next I trace viewer navigation (A/D keys), hover detection on throw/close buttons, the click handler that sets the throw/keep result consumed by game logic, and drag/wheel interactions, followed by power toggle effects on item drop/pickup.

Then I move to the lich's hit function, tracking intensity values passed in from grip events, win state, and periodic spasm triggers scaled by difficulty level and timing intervals.

Finally I work through the ending sequence: control loss on first grip, silence buildup over twelve seconds, the death trigger that creates a ragdoll, and the body thud collision logic checking fall speed at pelvis, chest, head, and ankle points.

Continuing on, I trace the mask dropping and bouncing, the synchronized snake burst effect firing across up to eight snakes with a single mass sound, and the egg physics system starting silently before the knock sequence applies a timed impulse based on wobble delay and intensity.

Then I map out the egg's climax sequence: a slow camera zoom pushing in over seven seconds, a glowing crack spreading across the shell as a crackle loop plays, and finally the egg breaking open with a capped impulse that scatters eighteen shards plus the bottom and cap pieces, triggering the site unlock.

With no landing events currently wired up, I need to add ground-hit detection for shell pieces and poll for approach speed in the tick loop, throttling updates since there are around twenty pieces to track by position, speed, and a time interval. Given I'm already near ninety entries and a 2500-word budget, I decide to merge the hold/optional items and finalize around sixty-five compact entries, each noting slot, file location, kind, position, and rate.

I'm also working out approximate y-heights for each creature and object—snake head near ground level, lifted snake higher, knot and lich at mid-height, lens much taller at its axis, rocks held slightly above surface, beam tip near arm height, egg centered a bit above its base—plus checking the beam-casting logic in powers.lua where the group's first shot triggers the volley phase, and noting lich's kick animation on throw. Now I'm ready to write the final answer, keeping it terse with abbreviations to stay within the length budget.

Sound map for lich-survivors (read-only)

There is no AU in the repo yet. The engine has sound_play_handle, sound_handle_set_volume/pitch/looping/stop (anchor/anchor.meta.lua:199-268). All paths below are under C:\Users\a327e\Desktop\a327ex\lich-survivors\. Entry format: slot — file:line (function) — kind — position — rate.

0. Infrastructure

  • Frame loop. main.lua:26 update(dt) calls input_update(), then G.game.frame(dt) (port/game.lua:918). frame runs tick(); place_camera(DT) in a loop at a fixed DT=1/60, up to 8 per frame (game.lua:923; DT at :44).
  • Draw. main.lua:34 draw() calls game.render(dt) (game.lua:893), which calls place_camera(0) at :895.
  • Zero-tick frames. The engine runs at 120 Hz, so some frames run zero ticks.
  • Tick order (game.lua:854): GCP, inspect gate, mover.tick, powers.tick, ending_tick, seq_tick, lich.pose, rag doll, lich.update, lmask.tick, cave.update, snakes.update, fire, fx, gore, warp, items.update plus pickup (:889).
  • First tick and creation. boot.lua:59 calls GM.create; boot.lua:61 runs the first tick().
  • Inspect gate. While the viewer is open, tick returns at game.lua:857. The world is frozen, so duck or pause world loops there.
  • Harness. GAME.step and GAME['until'] (game.lua:932,973) run tick() in bulk without real time. Sounds must tolerate that.
  • Hosted. main.lua:50-53 game_hosted_visible and game_hosted_stop should pause or stop all loops.
  • Determinism. Never call rng from sound code. The two builds must stay bit-exact (CLAUDE.md).
  • Listener.
    • R.world_camera is created at post.lua:40 and exported at post.lua:215.
    • place_camera (game.lua:315) writes C.position:copy(eye) at :358, C:look_at(tgt) at :360 and C:update_matrix_world() at :361. FOV is set at :323.
    • Forward vector: R.world_camera:get_world_direction(cf) (game.lua:453).
    • The ROOM camera is static, eye (-3.6, 9.8, -10.4) looking at (0.4, 0.1, 2.4) (game.lua:62), about 15 m from the egg.
    • In the ending it lerps toward SEQ.eye/SEQ.tgt (:325-331), then in on the egg via SEQ.k2 (:332-339).
    • Best hook: right after place_camera(0) at game.lua:895, once per drawn frame.
  • Positions.
    • Lich: L = mover.p (game.lua:87, y about ground+1.28). lich.head_pos(v) and lich.fingertip(arm, v) are at lich.lua:397,387.
    • Egg: EGG = cave.egg.position (game.lua:60). It is at about x=0, z=0, y is the base, and the centre is about +0.4.
    • Snake: head is s.x, s.z, y about cave.ground_y(x,z)+0.1. s.spine[i+1] are Vector3 rings, 0 = head and 71 = tail.
    • Ring indices: lift mid=32, rock mid=29, beam aim ring=22.
  • HUD projection (game.lua:622,647-653):
local gp = Vector3.new()
...
if goal then
  gp:copy(goal):project(R.world_camera)
  if gp.z < 1 then
    local x, y = floor((gp.x*0.5 + 0.5)*R.W + 0.5), floor((0.5 - gp.y*0.5)*R.H + 0.5)

R.W/R.H are 640x360. Use the same projection for stereo pan.

1. Cave (port/cave.lua)

  • cave_amb — loop bed. Start boot.lua:59-61 (or the first tick). Stop main.lua:53. Non-spatial.
  • shaft_hum — optional loop. Sun column over EGG: point (0.11h, h, 0.05h), h about 3 (cave.lua:20). Dust (:181) has no discrete events.
  • egg_shiver — one-shot, cave.update cave.lua:334. k=max(0,sin(.9t)·sin(2.3t)-.55)·1.6·(1-still) is intermittent. Fire on its rising edge, about every 5-10 s. It stops after still=1 (first coiled snake, game.lua:261) and at ud.phys (:322). Position EGG.

2. Intro (game.lua)

  • intro_begin — game.lua:239 begin(), state='walk' at :241. :866 auto, :612 on the site's first click. Once. Position L, starting offscreen at z=-8.6.
  • intro_arrive — game.lua:868-870 (INTRO.state='done', waves released). Once. L.
  • lich_hover — loop, mover.lua:40 mover.tick. Modulate by mover.speed() (:92) and yaw_v. Start at the first tick. Stop at die() (game.lua:725). Position L.

3. Snakes (port/snakes.lua)

  • wave_send — snakes.lua:439 (nav) / :447 in send_wave (:422). Kind in ONE, PAIR, PACK, SPREAD, STREAM; n=#plan. Position is plan[1][2].x/.z (about 15 m out). One per wave, every 2-10 s. PACK, SPREAD and STREAM have n≥3, so vary the sound.
  • snake_appear — snakes.lua:819 (update): s.delay decrement reaches ≤0, so the snake becomes visible. Position s.x, s.z (14-15.8 m out). Once per snake. A PACK arrives within 0.7 s, so debounce.
  • snake_slither — per-snake loop. It runs in the free-crawl branch :840-891; free = free(s) (:487). Start at appear. Stop when free(s) goes false (take, burn, coil, pool). Position s.x, s.z. Pitch by s.speed (1.0-1.35) times (1-0.85·smoothstep(s.leak)) (:841). Cap at the nearest 3, or use a shared bus.
  • snake_reach_egg — snakes.lua:885-888 (d<1.1, api.reached++, start_coil). Once per snake. Position s.x, s.z.
  • coil_grip — snakes.lua:542 in coil_tick (head reaches the shell, was<e0 and h>=e0). on_grip is assigned at game.lua:163 and also calls lich.hit. Once per coiled snake. Position EGG+0.4y.
  • coil_squeeze — loop. Start snakes.lua:526 (coiled[#coiled+1]). Volume from snakes.coverage (:909-912, every 6 ticks) or END.level (game.lua:260). Stop in burst_all (snakes.lua:945). Position EGG.
  • coil_win — snakes.lua:913 (coverage ≥ 0.97), then game.lua:164. Once. The ending proper starts at SEQ.on (:786), at the first grip.
  • snake_dissolve — snakes.lua:894-896 (s.leak≥1.12, api.on_dissolve, leak.lua:172). Once per snake. Position s.spine[1..7].
  • snake_ash — snakes.lua:831 (s.burn.done, fire.ash). Soft, optional. Once per burn kill.

4. Gestures (port/powers.lua)

  • cast_raise — optional, powers.lua:272 start_gesture (G.phase='aim'; G.ab=FIRE, lift or beam). Arm up. Position L / lich.fingertip(G.arm). Once per cast.
    • The 'lower' phase is :608.
    • The sound fires only if the cast actually goes off at :471-494.

5. Fire (port/fire.lua)

  • fire_ignite — fire.lua:98 start(), reached only via snakes.ignite (snakes.lua:918) after its free(s) check.
    • Callers: powers.lua:63 (first target, immediate), :303 (targets 2-3, 0.12 s apart through later), :523, :575 (sweep), :736 (last resort).
    • Position spine[ignite_at+1] (fire.lua:108). One per snake, up to 3 within 0.24 s.
    • The group version (n≥3, group_of :270) uses the sweep path (:485), with one ignite per snake about 0.12-0.5 s apart.
  • fire_burn — per-burn loop. Start in start() (fire.lua:98). Volume = frac (fire.lua:189). Fade after BURN.out (3.1 s); end fire.lua:221 (4.3 s, b.done). Position is the mean of b.spine (the light, :214). At most 4 lights, so cap about 4 voices.
  • fire_sweep — group only, loop. Start powers.lua:485 (G.phase='sweep'). Stop :533 (tail done) or :526 (aborted). fire_fx.lick is called 3x per tick (:538,571). Position G.point (L + sin/cos(G.sw_a)·G.sw_d, y=G.sw_y). One loop per sweep, about 1-3 s.

6. Lift (port/lift.lua)

  • lift_cast — lift.lua:182 P.cast; last resort powers.lua:737. Once per cast. Position L / s.spine[33].
  • lift_hold — loop. Per snake, f.t runs from -delay (STAGGER 0.08). The snake rises as f.t goes above 0 (lift.lua:44) to 1.5-2.0 m. Start lift_fx :34. Stop at burst. Position s.spine[mid+1].
  • lift_knot — group only (n≥3). lift.lua:197-198 (knot_of, knots++). The balling runs from f.t≥0.32 to 1.75 (place :65-107). Position K.c (y=ground+1.9). Burst time at is 2.3+0.08(n-1) s, versus 1.4+0.08(n-1) s for the plain version.
  • lift_swell — riser, derive in f.tick (lift.lua:108) when grp.t ≥ grp.at-0.2 (:51,55). Once per group.
  • lift_fist — lift.lua:208 lich.curl(g.arm) (lich.lua:379, ignores a repeat within 0.35 s). Once per group, 0.08 s before the burst. Position fingertip.
  • lift_burst — lift.lua:114 gore.burst, per snake.
    • All snakes in a group burst on the same tick, because grp.t>=grp.at is shared. STAGGER only offsets the rise.
    • Use one group sound, guarded by a flag on grp, scaled by n.
    • Position s.spine[mid+1], or K.c for the knot.

7. Gore (port/gore.lua)

  • gore_burst — gore.lua:513. Callers: lift.lua:114 (toward = lich, pulled to him) and snakes.lua:943 via burst_all (game.lua:735, toward=nil, the ending). Position c=s.spine[mid+1].
  • gore_crush — gore.lua:680, caller rock.lua:369. Position p=s.spine[j+1], dir.
  • gore_spatter — gore.lua:717, caller beam.lua:95. Position pts.
  • gore_piece_land — gore.lua:289 (P.landed first touch). Up to 18 per burst; limit to about 3. Position hx, hz, m.position.y.
  • gore_chunk_land — gore.lua:382-384 (d.landed; wet splat if d.bleed~=0). Up to about 100 per burst; sample 1 in N or limit to 4 per burst. Position d.x, d.y, d.z.
  • Blood-drop floor splashes (:134-137, 900 particles) are too frequent; skip them.

8. Rock (port/rock.lua)

  • rock_rip — rock.lua:296 (not q.torn, tear(q) :217). One per rock, spaced k·0.12 s (quick ×0.4; group orbit k·0.03). Position q.from (floor, in front of the lich or in the orbit ring). Cap about ceil(p/1.5); up to 8 in a group.
  • rock_hold — loop. Start :301 (phase 'hold', aura puffs :299,309). Stop :319-322. Group: rock_orbit (q.orbit, ORBIT_W 2.4 rad/s) for 1.0 s+k·0.04. Position m.position.
  • rock_throw — rock.lua:320 (phase='fly'; stats.thrown++ :322 unless set_down). Position m.position, q.v. Group throws are 0.04 s apart, so treat them as one volley.
  • rock_fly — whoosh loop :325-362 (wake puffs). Stop at hit, bounce or rest. Pitch by q.v:length().
  • rock_hit — rock.lua:363-373 (hits callback, includes gore.crush). Per snake; one rock can hit several (q.hits). Position s.spine[j+1], dir.
  • rock_land — rock.lua:375-389 (m.position.y<gy, q.v.y<0). Thud strength abs(q.v.y); up to 3 bounces. Position m.position.
  • rock_sink — optional, :394 rest and :410 sink after 3 s.

9. Leak and warp (port/leak.lua, port/powers.lua)

  • leak_whisper — loop while on (leak.lua:218-227, skull streaks). Start/stop at powers.lua:758 (P.toggle) / :747. Position lich.head_pos (leak.lua:219). Volume by reach (leak.scale :175).
  • leak_ripple — leak.lua:229 ring_from(L). Every 1.6-2.6 s. Position L.x, L.z at floor level.
  • leak_snake — per-snake loop while s.leak>0 (leak.lua:190-198). Start when leak_at is set (:191). Stop when the leak decays (:211-214) or at dissolve. Position s.spine[leak_at+1].
  • item_orb_hover — see section 12.

10. Beam (port/beam.lua, port/petals.lua)

  • beam_cast — beam.lua:289 B.cast (caller powers.lua:488). Position TIP (lich.fingertip(arm) + finger direction). n=#fan=1+round((p-1)·1.3); recoil :319. Once per cast.
  • beam_channel — loop. Start where ch is created (beam.lua:315 cast, :336 shot). Stop :239-242 (ch=nil). Volume ch.kmax.
  • beam_shot — group only (n≥3, revolver). beam.lua:331 B.shot. Callers powers.lua:479 (first), :551 (rest, 0.17-0.4 s apart, quick 0.1-0.25 s), :738 (last resort). Harder kick (:343). Position TIP (b.from). The path differs from B.cast, so use a sharper, shorter sound.
  • beam_bite — beam.lua:184-185 (bite :120). Per beam, staggered STAGGER_B 0.07 s. Position goal=s.spine[b.ring+1]. The first bite in a channel also kicks (:130).
  • beam_fill — chime rising for 0.22 s. Start beam.lua:183 (pierce_fx); petals.trickle is called at :111.
  • beam_shatter — beam.lua:112 (f.t≥0.36, shatter :62; includes gore.spatter :95 and petals.burst :96). Per snake. Position the snake's mean pts.
  • beam_cut — optional, beam.lua:366 B.cut / :285 detach (hand lost; beams cut short).

11. Lens (port/lens.lua)

  • lens_form — lens.lua:175 spawn (L.on=true :193). Callers powers.lua:652 (quick), :660 (group cast_group), :674. Position pos=axis_at(h)+offset (3.8-6.0 m up in the shaft). Group lens is larger (big 1.45).
  • lens_focus — rising loop. lens.lua:314-315 (on_c: t_conv≥0 until sweep_t<0.15). Position q.spot (floor).
  • lens_fire — loop. Start lens.lua:359-360 (q.core=fx.ribbon, q.flare=1 :362; q.fired :283-285). Stop :454 (fx.release). Duration SWEEP/SPEED≈0.87 s. A group makes one long cut of path.len/5.0 s (min 0.4). Position q.spot (moves), source lp.
  • lens_cut — lens.lua:415 (snakes.take(cut_fx)). Per snake cut; a group cut has several in one sweep. Position q.spot.
  • lens_dissolve — lens.lua:430-439 (gone 0→1 over 0.45 s) until :440-441. Position lp.
  • lens_retarget_fail — lens.lua:167, silent abort. No sound.

12. Items (port/items.lua, port/body.lua; i=0 mask/FIRE, 1 hand/LIFT, 2 lodestone/ROCK, 3 orbs/LEAK, 4 gem/BEAM, 5 lens/LENS)

  • item_throw — items.lua:457 throw(i, yaw). Callers game.lua:154 (via :859-862), :776, :782. Position from (hand :479) → w.land. Kick 1.1 (orbs 0.9, via release_orbs :358).
  • item_drop — items.lua:401 drop(i). Caller game.lua:140 (toggle_power off; ending_tick :254 every 0.4 s). Lighter toss; kick 0.45.
  • item_impact — body.lua:142 on_hit(hit) → items.lua:146 (rigid, hit>0.4); balls :223,256 (v>1.2). hit is the impact speed in m/s, and it fires per substep (4 per tick). Debounce ≥0.1 s per body; scale by v. Position b.x.
  • orb_clack — items.lua:396 (collide_balls, vn<0). Position a.x. Up to 5 balls.
  • item_egg_bonk — optional. body.lua:120 contact() return value is discarded; hook there. Position egg wall.
  • item_pickup — items.lua:536 take(i). Callers game.lua:889-890 (auto, items.near), :140 (toggle_power on). Position w.g.position / b.x.x/y/z. Orbs: hold_orbs :543.
  • item_settle — optional, items.lua:569/575/602 (state→'lying').
  • orb_hover — loop. hold_orbs items.lua:259 (also called at creation, :665) → update_held :289. Stop release_orbs :358. Position L (orbit about 1 m, ORB_C 0.28 up). Five orbs.

13. Inspect viewer and HUD (inspect.lua, game.lua, ui_style.lua)

ui_style.lua only draws (slot :102, button :145, glyph_button :171), so hover and click sounds belong in the input code.

  • ui_hover_slot — game.lua:575 mouse_input. No hover state is kept; add edge detection with slot_at(mx,my) (:568) after :577. Only slots whose power is on can be hot (:631).
  • ui_click_slot — game.lua:579-583 (ask_remove :146 → inspect.open :149). Clicking an empty slot (power off) does nothing (:581); use a deny sound.
  • viewer_open — inspect.lua:126 insp.open. Callers game.lua:149, :524 (I key). S.remove distinguishes the THROW question from browsing.
  • viewer_close — inspect.lua:140 insp.close (S.closing=0; end :202). Via :517, the X button :172, answer :162.
  • viewer_next — inspect.lua:141 (A/D, game.lua:518-519).
  • viewer_hover_btn — inspect.lua:179 (S.hot changes in pointer_move; buttons THROW/close).
  • viewer_throw — inspect.lua:159 answer(yes), sets S.result 'throw' / 'keep'; consumed at game.lua:859-862.
  • viewer_drag — optional, inspect.lua:175 (drag start) and :188 (wheel).
  • power_lost — game.lua:137 toggle_power (on==false → drop, true → take). Covers the inventory slot going dark.

14. Lich (lich.lua, lichmask.lua, ragdoll.lua)

  • lich_hurt — lich.lua:371 lich.hit(a). Callers: game.lua:163 (grip, a=0.5+0.1·min(grips,6), +0.5 on the first), :164 (won, 1.7), :266 (spasm, a=END.w·(0.18+0.4·level), every 1.1-3.2 s ×(1-0.4·level)). Position lich.head_pos. Scale by a.
  • lich_hurt_pose — loop. Start at the first grip (game.lua:257; lich.hurt.w set :262). Stop die() (:827, w=0). Level END.level (:260).
  • lich_kick — lich.lua:378. Do not give it its own sound; its callers (beam, items) already have them.

15. The ending (game.lua seq_tick :771, eggphys.lua)

  • ending_begin — game.lua:786 (SEQ.on=true, snakes.hold=true). Once.
  • sil_rise — game.lua:819-820 (SEQ.sil_t0; sil.e 0→1 over 12 s). Optional riser. Whole at :822 (SEQ.e1); die() follows DIE.hold 4 s later (:823).
  • lich_die — game.lua:725 die() (SEQ.dead :726, rag doll :731). Position L (falls from about 1.3 m). Once.
  • lich_thud — ragdoll.lua:100 collide(q) (q.y<g). Fire on the first contact of each of pelvis, chest, head and ankles. Scale by q.oy-q.y before correction. Rag steps at game.lua:875.
  • mask_drop — lichmask.lua:177 M.drop (game.lua:734). Bounce lichmask.lua:191-193 (V.y<-0.7). Position M.p.
  • mass_burst — snakes.lua:939 burst_all (game.lua:735). Up to 8 gore.burst calls in one tick, so play one mass sound, n = return value. Position EGG region.
  • egg_knock — eggphys.lua:312 knock() (impulses :328-329). Started by game.lua:832 (ep.knocks, d≥1.3 s). Delays shrink 1.0 s → 0.06 s (quad_out), so use a short sample. Intensity p=knock_i/knock_n (:316). Position the shell point (px,py,pz) (:323), or EGG+0.4.
  • cam_push — optional, game.lua:848 (d≥2.2; SEQ.k2 0→1 over 7 s).
  • egg_crack — game.lua:849 (SEQ.hatch, crack_egg() :742). The crack glows for 0.8 s (uCrackGrow :835). Position EGG.
  • egg_open — game.lua:836-837 (open_egg() :761 → eggphys.lua:437 api.open; cap impulse :523, shards :525-533). Once. Position EGG. site_unlock_posts is at :838.
  • egg_piece_land — no event source exists. eggphys.lua:145-146 registers tags 'shell' and 'ground' but never calls physics3_enable_hit. Add physics3_enable_hit('shell','ground') in build_ground and poll physics3_get_hit('shell','ground') (events carry approach_speed) in api.tick (:566). The same applies to 'shell'-'shell'. Pieces are api.pieces (pc.kind 'cap' or 'shard') plus api.bottom. Limit to one per 0.05 s per body; there are about 20 pieces.
Back to Phylactery 13

Settings