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

The knife is a 55-damage hitscan with no back to stab: a knife from behind should end it #178

Merged opened this

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

Merged

The knife now has a back. `weapons.ts` carries CS's two numbers — `damage: 55` in the front, `backstabDamage: 180` in the back — and both go through the same `armorPenetration` of 0.85, so a backstab is 153 to health (one stab through a full vest) while the front is the 47 it always was, three stabs to kill. Armour is not a second rule; it is the bullet's rule with a bigger number in front of it.

shipped merged

opened this

The knife now has a back. weapons.ts carries CS's two numbers — damage: 55 in the front, backstabDamage: 180 in the back — and both go through the same armorPenetration of 0.85, so a backstab is 153 to health (one stab through a full vest) while the front is the 47 it always was, three stabs to kill. Armour is not a second rule; it is the bullet's rule with a bigger number in front of it.

"From behind" is one pure function: fromBehind(victimYaw, victimPos, attackerPos) in weapons.ts, tested against one named threshold BACKSTAB_ARC = 61.65° either side of straight behind — CS's own dot product of 0.475 written as an angle. It is flat on the ground plane, so stabbing down from a box is no more a back than standing in front. applyHit asks it once, from the from that shoot already had, and passes computeDamage a boolean; computeDamage swaps the base damage and nothing else, so any weapon without a backstabDamage — every gun — is byte-identical whatever side it was fired from. That is asserted for all nine of them in weapons.test.ts and again through shoot with an AK in world.test.ts. Bot-stabs-person and person-stabs-bot are two tests on the same code path with no me branch; the hit marker, the pain cue, the damage ledger and the kill feed needed no new case.

What I chose not to do: bots do not know about the rule, so they will not go looking for a back — they just now kill with the knife they are holding when they are broke. scripts/measure.ts over 8 seeded matches is identical with the rule on and off (62 rounds, 73% plants, same ends), so nothing about the round shape moves. observe.ts and src/rl/arena.ts are untouched and the shipped weights still match the card.

To try it in the preview: walk up behind a bot with <kbd>3</kbd> up and stab once — they drop, the feed credits you, the hit marker fires. Face one and stab: three. bun run check is green, 727 tests; the four behavioural knife tests fail if you set backstabDamage back to 55 or drop from at the shoot call site, which I checked both ways.

🤖 Generated with Claude Code

Closes #175

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs