dev added the public Encounters.tableFor export (MapCatalog resolution,
prefix stripping, route normalization) at the same point in
src/core/game3/encounters.lua where this branch inserts the cooldown
block. The two changes are purely additive, so both are kept: dev's
export sits next to table_for where it belongs, followed by the
cooldown/rate-test block.
scripts/lint.sh auto-merged cleanly, keeping both dev's PATH export for
node_modules/.bin and ~/.luarocks/bin and this branch's luacheck --version
probe.
Re-verified after the merge that dev's RNG-parity commit does not shift
the encounter goldens: 88/88 cooldown checks still pass, including the
Route 1 4000-step counts (401 with the grace period vs 858 without).
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
luacheck 1.2.0 is the newest release and predates Lua 5.5, which made
generic-for control variables read-only. Built against Lua 5.5 it dies
loading luacheck.standards -- before linting a single file -- so the T0
gate can never pass, and the failure surfaced only as a raw loader
traceback that looks like a repo defect.
Probe `luacheck --version` before the real run:
- if it cannot run, print the captured error plus the Lua 5.4 install
command and exit 2, matching the existing not-found path
- if it runs but reports Lua 5.5, warn that 1.2.0 predates it and that
results are suspect, then lint anyway
CI is unaffected: it installs luacheck against Ubuntu's Lua, not 5.5.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Introduce a tuned .luacheckrc and scripts/lint.sh so the engine has a
standing static-analysis baseline -- the tool that would have caught both
bugs in the previous commit before they shipped.
The config is high-signal by design: it keeps the categories that catch
real defects (undefined globals/locals, unused values, unreachable code)
and mutes the cosmetic ones the codebase deliberately lives with (a self/dt
an interface requires but a method ignores, documented empty fall-through
branches, long lines). It marks `love` mutable (games assign callbacks onto
it) and teaches it LuaJIT's table.unpack.
.luacheckrc is tracked via a .gitignore exception, matching how .github and
.gitignore opt out of the blanket dotfile ignore.
`luacheck src` now reports 7 benign warnings and 0 errors, down from 185.
Also drop one dead `require` (ItemEffects loaded src.pokemon.Pokemon and
never used it).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q6bFAiQyZ5jDmewsbB4LG9