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 #175

shipped merged opened this has it
opened this

Make the knife a decision instead of a joke: full damage from behind, less from the front, the way CS has always paid for a flank.

src/client/weapons.ts:39 gives the knife one number — damage: 55, armorPenetration: 0.85 — and src/client/world.ts:762 treats it as a gun with 64 units of range. Nothing anywhere reads which way the victim is facing, so walking up behind someone and stabbing them is worth exactly as much as stabbing them in the face, and both take two hits at best. The game already has everything the rule needs: the victim's yaw, the attacker's position, and a damage path with armour and hitgroups in it.

Done looks like

  • [ ] A stab that lands from behind the victim does enough to kill a full-health player through armour in one, and a stab from the front does roughly what it does today. Pick the two numbers from CS's published shape, write them in weapons.ts beside the rest, and say in the pull what you chose.
  • [ ] "From behind" is one geometric test with a named threshold — the angle between the victim's facing and the direction the attacker came from — not a special case in three places. It belongs wherever the damage is computed, and it is a pure function with its own test.
  • [ ] Armour behaves the same way it does for a bullet: the knife's armorPenetration is still what decides, not a second rule.
  • [ ] It works for a bot stabbing the person and the person stabbing a bot — the same code path, no me-only branch.
  • [ ] The hit feedback already in the game says so: the hit marker, the pain sound and the kill feed need no new case, and a backstab kill is credited like any other.
  • [ ] Nothing the policy sees changes: observe.ts's 32 inputs and src/rl/arena.ts are untouched, so the shipped weights still match the card on the page.
  • [ ] Tests that fail without it: a stab at the back kills a 100/100 target in one; the same stab at the chest does not; the threshold is exercised from both sides of the angle; the bot half works too.
  • [ ] README: one clause in the weapons paragraph under What is real and what is not.

Files I expect to change: src/client/weapons.ts, src/client/combat.ts (or world.ts's shoot, whichever owns the damage), src/client/combat.test.ts, src/client/world.test.ts, README.md.

Risks: the knife shares shoot with every gun — a facing rule that leaks into the bullet path is a balance change nobody asked for, so the test that a rifle's damage is unchanged belongs in the same pull. Bots hold a knife when they are out of money and will now be able to kill with it, which is fine and worth one line in the pull if scripts/measure.ts moves.

Brief that fits: vesper.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs