Skip to content

Legacy elemental-system remnants + code-quality audit (2026-07-23)

Legacy elemental-system remnants + code-quality audit (2026-07-23)

Section titled “Legacy elemental-system remnants + code-quality audit (2026-07-23)”

Trigger: Chris asked for a one-off full adversarial workflow to find (a) general code-quality improvements and (b) leftover references to the old elemental/reactions system that no longer does anything but still appears in the game.

Method: 4 parallel finder agents (legacy-elemental remnants, broader archived-system leaks, a general code-quality sweep, and an architecture-rule-consistency check), each finding put through a 3-skeptic adversarial verify pass (survives only if fewer than 2 of 3 skeptics refute it). 22 agents, ~2.1M tokens, ~6 minutes. 6 findings, all 6 confirmed, 0 refuted.

Headline: yes — the Codex is actively lying to players about “elemental reactions”

Section titled “Headline: yes — the Codex is actively lying to players about “elemental reactions””

Two enemies’ in-game counter tips (shown automatically the first time you meet them, and browsable any time from the Enemies carousel) describe a mechanic that was archived on 2026-07-09 and hasn’t fired in live gameplay since:

  • Tank (data/bestiary.json:9): “Shoot the missiles down (they’re killable) or juke them, then chip the armor with elemental reactions.”
  • Brute (data/bestiary.json:27): “Kite it or focus it with your strongest weapon. Reactions bypass armor — lean on them.” — Brute is specifically the enemy this advice matters most for (heavy armor, deep HP pool per its own description), making this the single most load-bearing piece of wrong advice in the whole bestiary.

Verified against the real live code, not just the doc’s prose: sim/elemental_system.gd’s apply_element() — the only reachable call site from live gameplay — does nothing but set a cosmetic aura tint on the enemy (its own comment says so). The real reaction-computing code, sim/elemental.gd’s Elemental.apply() (reads bible.json’s named reactions like Superconduct/Plasma and computes a burst), is called only from tests, never from any live sim path. And nothing element-related ever bypasses armor — the only two sources of pierce_armor in damage_enemy() are the Bomber drone’s signature attack and the Scythe weapon’s crit hits, neither an “elemental reaction.” A player following either tip (stacking elements to bypass Tank/ Brute armor) gets no benefit at all.

Root cause: these two bestiary entries were written for reactions-mode (archived 2026-07-09, _archive/reactions-mode/) and never updated when Survival became the sole live ruleset.

Section titled “Smaller, related finding (not player-visible today, but a landmine)”
  • data/bible.json:782 — the catalyst mod (+50% reaction damage) is still authored "live": true, even though sim/upgrade_system.gd’s mod_eligible() correctly filters it out of every level-up offer in RULESET_SURVIVAL via CRYSTALS_DEAD_EFFECTS. Not currently player-facing (the code gate does its job), but the content file itself is misleading, and if that gate is ever refactored without someone re-checking this, a dead effect could become offerable again. Low priority.

Two unrelated code-quality findings, also confirmed

Section titled “Two unrelated code-quality findings, also confirmed”
  • Nearest-enemy targeting duplicated across 6 weapon files — sim/weapon_blaster.gd, weapon_pulse.gd, weapon_scatter.gd, weapon_beam.gd, weapon_momentum_core.gd, and weapon_wildfire.gd each carry a near-identical copy-pasted “find nearest enemy” scan (even inconsistently named — public nearest_enemy_index vs private _nearest_enemy_index for identical logic). The codebase already has a precedent for this exact kind of shared helper (sim/melee_targeting.gd), just not applied here. bh-add-content will keep propagating the copy-paste to future weapons until this is extracted.
  • 3 weapon fx_events fire into the void — chalice_cast, chronowell_deploy, and momentum_charged_fire are emitted into sim.fx_events but have zero consumers anywhere (fx/fx_manager.gd has no match arm, audio/audio_manager.gd has no SFX entry) — exactly the “invisible entity” trap docs/architecture/enemies-bosses-survival.md already documents. The actual gameplay effects work fine (rendered via ZoneRenderer / a real projectile), it’s just the one-shot cast/deploy flourish that’s silently swallowed.

Fixed (2026-07-23, same session, Chris approved)

Section titled “Fixed (2026-07-23, same session, Chris approved)”

All 6 findings actioned, each verified against the full test suite (+ determinism baseline for sim/ changes) before commit:

  • Tank + Catalyst/Brute codex text rewritten to drop the false “elemental reactions”/“bypass armor” claims (1c00fa9), along with the 3 bible.json mods’ stale "live": true flags flipped to false (that field isn’t read by any code — zero behavior change).
  • Nearest-enemy targeting extracted from 6 weapon files into sim/targeting.gd (7e76342) — pure code relocation, determinism baseline unchanged.
  • chalice_cast/chronowell_deploy/momentum_charged_fire visuals wired into fx/fx_manager.gd (45fcac1). Audio deliberately left alone — all 3 are already tracked as "silent" in audio/sound_map.json’s curated backlog (15 similar entries), not an oversight this audit should override.