src/game/npc.ts is 945 lines holding two things: what an NPC decides
(role behaviour, targeting, trader phases) and how it flies (brainFly,
packmates, speedFloor, the brain rate constants).
The flight half is roughly 150 lines and has a clean conceptual boundary —
decide vs act — which the rest of the codebase already draws elsewhere
(FlightDemand for the player, world-step.ts for the phases).
Note before starting: brainFly and friends are methods using this
heavily, so extraction means either free functions over an NpcShip or a named
interface for the fields they touch. The second is what worked for the combat
trainer's ExerciseVerbs, and it made the surface readable rather than just
shorter.
This would land npc.ts near 790 — still over the 400 ceiling, so it stays an
allowlist entry either way. Worth doing for the boundary, not for the number.
src/game/npc.tsis 945 lines holding two things: what an NPC decides(role behaviour, targeting, trader phases) and how it flies (
brainFly,packmates,speedFloor, the brain rate constants).The flight half is roughly 150 lines and has a clean conceptual boundary —
decide vs act — which the rest of the codebase already draws elsewhere
(
FlightDemandfor the player,world-step.tsfor the phases).Note before starting:
brainFlyand friends are methods usingthisheavily, so extraction means either free functions over an
NpcShipor a namedinterface for the fields they touch. The second is what worked for the combat
trainer's
ExerciseVerbs, and it made the surface readable rather than justshorter.
This would land
npc.tsnear 790 — still over the 400 ceiling, so it stays anallowlist entry either way. Worth doing for the boundary, not for the number.