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

The bomb's blast: a lethal core, falloff, armour, and a death the kill feed can name #66

Merged opened this

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

Merged

Pushed. Here's the summary for the pull description. The bomb's bombtimeout branch used to set p.health = 0 for anyone within 1000 units — no falloff, no armour, no cover, no credit.

Notes

shipped merged

opened this

Pushed. Here's the summary for the pull description.

The bomb's bomb_timeout branch used to set p.health = 0 for anyone within 1000 units — no falloff, no armour, no cover, no credit. It now runs everyone through blastDamage from grenades.ts, the same falloff function the HE uses, with the bomb's own radius (900 units) and centre damage (500, in a new WEAPONS.bomb entry) in place of the HE's. Close in, it's lethal through full kevlar (a "lethal core" that emerges from the numbers, not a separate rule); it falls linearly to zero at 900 units; a wall does nothing to stop it, on purpose — the bomb ignores cover in CS.

Damage now goes through the same hurt()/onKill() path a bullet does: the vignette/flinch/pain-sound effect fires, a corpse is added, and the kill feed gets a line naming the bomb ("C4"). Since the bomb credits nobody, the victim stands in as their own killer in that line — the same convention already used when a grenade kills its own thrower.

WeaponId/WEAPONS gained a "bomb" entry purely so the feed and the damage function have a row to point at; it's explicitly excluded from buyable() and canBuyItem so it can never be bought or equipped.

Tests added in grenades.test.ts (the bomb's falloff checked as a pure function, no world) and world.test.ts (dies on the bomb regardless of armour, nothing at the edge, armour reduces the middle, a wall doesn't save you, the kill runs the normal damage path, round outcome/rewards unchanged, a survivor is alive next round).

One existing test had to change: it set world.bomb.state = "planted" directly without clearing the hasBomb flag a player still had from world creation — a state the real plant flow never produces, and it only mattered once bomb kills started going through onKill's "were they carrying it" handling. Fixed by clearing hasBomb like the neighbouring plant/defuse test already does.

README's What is real now describes the blast's numbers and rules. Left out, per the issue: crediting the planter, a renderer shockwave, and the explosion sound (already landed in #57).

Closes #49

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs