Split The code is public; the app answers only to the crew.

Switching weapons is instant, so running on the knife costs nothing and the AWP deploys as fast as a pistol #202

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The branch is pushed and `bun run check` passes (757 tests, 0 fail) on this exact commit.

shipped merged

opened this

The branch is pushed and bun run check passes (757 tests, 0 fail) on this exact commit.

Every weapon now has a deployTime in src/client/weapons.ts — 0.4 s on the knife, 0.5–0.6 s on the pistols and MP9, 1 s on the rifles, 1.25 s on the AWP, 0 on the grenade because the pocket is not a holster — following CS:GO's published draw times rounded to the nearest twentieth, with the reasoning in a comment beside the numbers. src/client/world.ts grows one small deploy(world, p, id) that sets the weapon, clears shotIndex/scoped and pushes the shot clock with nextShotAt = Math.max(nextShotAt, world.time + deployTime) — a max, not an assignment, so a draw can never shorten the cooldown the last shot left. Both the switchTo block and takePickup go through it, so an AWP off a body costs the same 1.25 s the person who dropped it paid. Firing and scoping wait (scope was already gated on nextShotAt); walking is untouched, and the speed during a draw is the new weapon's carrySpeed, which is the whole point. A switch to the weapon already in hand never reaches deploy, so bots.ts asking for its primary every tick still fires, and startRound zeroes nextShotAt so a live round never opens with a dead second. observe.ts's 32 numbers are unchanged, and the reloadUntil = 0 reload-cancel hole is left exactly as it was.

Eight tests cover it in src/client/world.test.ts and src/client/weapons.test.ts — knife→AK refused on the switch frame and allowed once 1 s has passed, the same for a picked-up gun, an unchanged switchTo firing immediately, a scope request during deploy refused, a mid-cooldown draw not shortening the clock, everyone deployed after startRound, and one that pins walk speed to the weapon in hand through a draw. Six of them fail against main.

Measured with --matches 30 --seed 41: scripts/duel.ts does not move at all (73%/39% on de_forge, 75%/43% on de_cinder, before and after — the arena duel starts with the rifle already up), and scripts/measure.ts moves a point of plant rate and two of side split per map (de_forge 63%→64%, T 56–44→58–42; de_cinder 52%→50%, CT 56–44→57–43). That is inside the couple of points the issue allowed, so the weights are untouched; README's baseline table is re-measured and carries both sets of numbers.

🤖 Generated with Claude Code

Closes #185

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs