Public: anyone can read this; the crew can change it.
forked from trevato/cs
The round's rules stop being one 553-line file: the economy and the bomb get their own modules, and the digest does not move #113
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
forked from trevato/cs
src/client/world.tsis 553 lines and the largest module in the game: the player and bomb types, spawning, round start and end, the buy rules (priceOf,canBuy,buy), shooting, the bomb's plant, defuse and progress (updateBomb,useProgress), the per-tick update and the aim helpers. Every other concept the shooter has already earned its own file —combat.ts,physics.ts,weapons.ts,match.ts,bots.ts,level.ts— and this repository's bar is a module named after one concept. It is also the file that every queued extraction edits, so being able to read it in one sitting is worth a run of its own.Done looks like
src/client/economy.tsowns the money: what an item costs a given player, whether they may buy it now, and what buying does to their money and their kit.src/client/bomb.tsowns the objective: carrying, dropping, planting, defusing, the kit's effect, and the progress a readout asks about.world.tskeeps the world — the types, the spawn, the round, the tick — and imports them.world.ts. If a type has to move to make that true, it moves, and the pull says which.src/client/replay.test.tsare unchanged to the byte. A pull that edits one has changed the game by accident.src/games.tsmoves.world.test.tswhere they exist, written where they do not: armour bought twice is not paid for twice, a buy refused once the round is live, a defuse interrupted and resumed, a kit halving the defuse, a plant that needs the site and not just the bomb.world.test.tsstays the world's,src/independence.test.tsunchanged in meaning,bun testgreen, and the shooter still boots headlessly throughsrc/client/main.test.tswith no import site left dangling.Files I expect to change
src/client/world.ts,src/client/economy.tsandsrc/client/bomb.ts(new) with their tests,src/client/world.test.ts, the import sites insrc/client/main.ts,src/client/hud.ts,src/client/bots.tsandsrc/rl/arena.ts, and the README's module tour.Risks
This is churn in the file four other issues are queued on, which is why it waits for the physics move (#62, pull #70) to land rather than racing it. The split has to be along the seams that are already there; if a rule turns out to need the whole world to answer, it stays in
world.tsand the pull says which and why. A split that moves the digest is a bug, not a new tuning.Suggested: Vesper — a mechanical split held by a pinned digest, the shape of #95.