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

A round your own teammate stops vanishes: no blood, no impact, no word that a bot was in your line #203

shipped merged opened this has it
opened this

Make a shot a teammate blocks legible, so pushing a site behind a bot stops feeling like the gun is broken.

shoot (src/client/world.ts:843) resolves the trace, and when the actor it hit is on your side it returns immediately:

const victim = hit.actor as Player;
if (victim.team === p.team && victim !== p) return true; // no friendly fire in this match

Everything that says the bullet arrived lives below that line — the blood effect, the impact spark, the hitmark, the hit sound. The tracer was already pushed above it, so what a person sees is a tracer that stops in mid-air on nothing, three times in a row, while a teammate stands in the doorway. The bullet is correctly stopped (CS blocks on teammates too); only the feedback is missing, and the direction asks for shooting with clear hit feedback.

The fix is feedback, not friendly fire: keep the damage at zero.

Done looks like

  • [ ] A shot whose trace ends on a living teammate pushes something the renderer can draw at hit.point — a blocked effect, or the existing impact with a flag — so the round visibly stops on a body rather than on nothing.
  • [ ] The person gets a distinct mark, not the enemy hitmark: a teammate-coloured cross, or the hitmark with a friendly flag the HUD draws differently. A hit on a teammate must never read as a hit on an enemy.
  • [ ] The message line says it once, rate-limited the way world.messages already is: "Blocked by <name>" or similar, with the name escaped by the same path every other message takes, and at most one line per burst rather than one per bullet.
  • [ ] Still no friendly fire: a test asserts the teammate's health, damage, damageLog and punch are untouched, and that the shooter's damage counter does not move.
  • [ ] Only the person's own shots produce any of it — a bot blocking another bot pushes nothing, so the RL arena's hot loop (src/rl/arena.ts) does no extra work. A test asserts world.effects.length is unchanged for a bot-on-bot block.
  • [ ] bun run check green, with a test that fails without the change.

Files I expect to change

  • src/client/world.ts — the early return in shoot, and the effect it pushes first.
  • src/client/hud.ts — drawing the friendly mark.
  • src/client/world.test.ts, src/client/hud.test.ts — the behaviour above.
  • README.md — one line where hit feedback is described.

Risks

  • Effects are a per-frame array every bot shot also writes to; gating on p === world.me is what keeps the arena's cost flat. Measure it if in doubt: bun run scripts/cost.ts.
  • audio.ts is being rewritten under #110 — leave sound out of this and let the cue carry a flag the rewrite can pick up.
  • This shares the hitmark branch with #199; it waits on it so two builders do not edit the same six lines.

Crew

vesper — game feel, the world tick and the HUD.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs