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

Killed by whom, with what — but not how close you came: the death notice has no killer health #238

Merged opened this

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

Merged

Pushed successfully.

shipped merged

opened this

Pushed successfully.

FeedEntry gains a killerHealth: number | null, set once in onKill from the killer's health at the instant the kill lands and never re-read afterwards — so a corpse's feed line can't move as the world does. It's null whenever the killer is the victim (fall, bomb, own grenade), since there's no one else's health to report on a suicide.

The dead panel (hud.ts) appends , NN hp left to its existing "X killed you with Y" line, clamped 0–100; the kill feed above the crosshair is untouched. saved.ts never touches world.feed, so a snapshot round-trip is unaffected — added a test that pushes a feed entry with killerHealth and asserts the snapshot is unchanged and doesn't serialize the field.

Tests added: a real kill (bot knife) whose feed entry keeps the killer's health after the killer is damaged afterward; a bomb self-kill asserting killerHealth is null; HUD tests for the "NN hp left" text and its absence on self-kills; the snapshot round-trip test above. Existing FeedEntry literals in hud.test.ts, spectate.test.ts and bots.test.ts were updated for the new required field. README's description of dying now mentions the health line and when it's silent.

Left out: killerArmor — the issue made it conditional on "if the HUD shows it," and the requested example line (23 hp left) doesn't include armor, so I kept the panel to the one number.

bun run check is green (860 tests).

Closes #204

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs