Public: anyone can read this; the crew can change it.

forked from trevato/cs

Take updates from trevato/cs #375

Merged opened this in answer to

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

Merged

This merges trevato/cs `main` (82a8a65, staged at `refs/following/main`) in two commits. The merge commit (`7bd3e52`) keeps this repository's tree for every conflicted file, so its tree is byte-for-byte this branch's. The one new upstream change that fits here, #228 (fall damage), is ported onto the engine layout in its own commit so it can be reviewed alone.

shipped production is serving it deploy ae07c2d

opened this

This merges trevato/cs main (82a8a65, staged at refs/following/main) in two commits. The merge commit (7bd3e52) keeps this repository's tree for every conflicted file, so its tree is byte-for-byte this branch's. The one new upstream change that fits here, #228 (fall damage), is ported onto the engine layout in its own commit so it can be reviewed alone.

The git merge base is still #179, because earlier syncs were squashed. #367 and #371 already decided #188–#226, so only #223, #227 and #228 are new.

Per file:

  • This side won in src/client/{bots,hud,main,motion,report,weapons,world}.ts and their tests, src/db.ts and db.test.ts, src/pages/game.ts and game.test.ts, and src/rl/arena.test.ts. Upstream's text there is the pre-extraction version of work this repo already has, the same decision as #367 and #371.

- Upstream's report.ts change names a fall in the round's damage report. Here report.ts is the result poster, and there is no damage report to name it in.

  • This side won in src/client/{bodies,earshot,input,physics,plan,renderer,settings}.ts, their tests and src/readme.test.ts: they stay deleted. Their jobs live in src/engine/ (controls, renderer, physics) and in src/plan/.
  • Upstream src/client/zoom.ts and zoom.test.ts: dropped again. src/client/look.ts already does scoped sensitivity.
  • #223 (no-JS notice in the menu): not ported. This repo already covers it: Play and the room buttons are server-rendered disabled, and a <noscript> line from the game's registry entry says why. Upstream's inline <style> inside <noscript> would also break this repo's hash-pinned style CSP.
  • #227 (a bot detours to a dropped rifle): not ported. Nothing in this repo puts a gun on the floor: there are no pickups, and nothing drops a weapon. The detour would have no target, so porting it would add dead code, the same reason #367 left out #222's worthTheDetour.
  • #228 (fall damage): ported.

- Engine (src/engine/physics.ts): move now returns the speed a body met the floor at on the tick a fall ends, and 0 on every other tick. - This is a measurement, not a game rule, so the engine can report it. The list of exported names is unchanged, the three callers that ignore the result are untouched, and no Body literal changes. - Four new tests in physics.test.ts, run on both profiles: a drop reports v²=2gh once, a jump lands at the speed it left with, walking never reports a landing, and a bounce is not a landing. - GUIDE.md now says what move returns. - Game (src/client/world.ts): land charges fallDamage from movement.ts, rounded to whole points, and armour doesn't reduce it. - Only the person gets a hurt effect, recorded at their own feet. - A death to it is a feed line with the victim on both sides and cause "fall", and no kill or money goes to anyone. - FeedEntry.weapon becomes Cause = WeaponId | "fall", shown through causeName. A cause string off a room's wire that this build doesn't know is shown as itself instead of crashing the frame. - HUD (src/client/hud.ts): a hurt from straight below draws the pain flash but no arc, and the feed reads Pike Fall Pike. - Tests: new ones in world.test.ts and hud.test.ts. - One existing test changed only because the feed type got wider: in grenade.test.ts, WEAPONS[entry.weapon].name became causeName(entry.weapon). The test wasn't wrong; the old line no longer type-checks. - What players will notice: nothing on the current maps. - Every level has floors at 0, 2, 64 and 128 units, plus 384-unit walls. I checked de_forge and 200 generated seeds. - The highest floor anyone can stand on is a 128-unit crate, which lands at about 452 u/s, under the 580 u/s where damage starts. - No replay pin moved. The README says this next to the tagging paragraph.

bun run test (typecheck, then bun test) passes 1521 of 1521. The booted app answers / with a 200 in 15 ms. In the preview, the game should play exactly as before. A fall only costs health from about 210 units up, and no floor on these maps is that high.

Closes #372

🤖 Generated with Claude Code

Closes #372

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs