B8: Thrown powder kegs with line-of-sight blasts

Fire with a powder keg held now throws one (Explosives.throw): lobbed along
the look direction, it drops down anything it strikes, rests where it lands,
falls again if its support goes, and blows when its fuse runs out (3 s).

The blast (Explosives.blast) reaches blast_radius, measured to the nearest
point of each body, piece or prop:
- terrain, pieces, props and fixed solids shield what is behind them;
  players are hit if their body middle or head is in sight;
- damage falls off linearly to BLAST_EDGE_FACTOR at the edge, times tier;
- players take damage armor first, credited to the thrower, who takes
  BLAST_SELF_FACTOR of their own;
- pieces and props take structure_damage, so kegs can breach breakwaters.
Everything reached is worked out before any damage is applied.

Line of sight uses a per-blast Sight: the nearby solids once, a cheap box
pre-check per ray, and a coarse terrain check skipped above the highest
ground in reach. Four kegs blowing on one tick inside a 5x5x3 stone fort
take about 5 ms, under the 12 ms tick budget (tested).

Kegs in flight and lying lit are drawn with the item models (EntityView);
capture scenario items_kegs. A blast emits "explosion" for A7's effects and
an impact the sound director already plays as keg_blast.

The launcher and bots that throw are follow-up #83.

Closes #22

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-14 09:04:54 -05:00
co-authored by Claude Opus 5.5
parent 36d474695a
commit 238e8e4463
17 changed files with 690 additions and 7 deletions
+15
View File
@@ -255,6 +255,21 @@ ammunition and rarity. Every weapon besides the boathook takes an inventory slot
| Line Thrower | Fires a line and yanks you towards where it lands |
| Powder Keg | Thrown explosive; damages structures heavily |
**Powder kegs** (B8, [`src/sim/explosives.gd`](../src/sim/explosives.gd)) are thrown,
not fired. Fire throws one from the stack, lobbed (`THROW_LIFT`) at the keg's
`projectile_speed`. It drops down anything it strikes, rests where it lands, falls again
if what it rests on goes, and blows `fuse` seconds after the throw. The blast reaches
`blast_radius`, measured to the nearest point of each body, piece or prop:
- terrain, built pieces, props and fixed solids shield what is behind them; players
don't, and a player whose body middle or head is in sight is hit;
- damage falls off linearly from all of it at the middle to `BLAST_EDGE_FACTOR` at the
edge, times the keg's tier;
- players take `damage`, armor first, credited to the thrower, who takes
`BLAST_SELF_FACTOR` of their own;
- pieces and props take `structure_damage`, so a keg can open a breakwater and let the
sea in.
Weapons come in four quality tiers, from `WEAPON_TIERS`: Rusted, Seaworthy,
Brass-Fitted and Captain's. Better tiers hit harder and reload faster.
+5
View File
@@ -102,6 +102,11 @@ Gamepads aren't supported in this release.
and you can't fire or build. Underwater you run out of breath and start to drown.
After the last rise everyone left loses health until one remains.
**Powder kegs** are thrown with fire. One lands, lies there and blows three seconds
after the throw, hurting everyone in sight within six metres (you too, a little less)
and smashing built pieces, props and breakwaters. Cover between you and the keg
protects you.
Weapons come in four tiers: Rusted, Seaworthy, Brass-Fitted and Captain's. Bandages and
tonic restore health; tar patches and cork vests add armor, which takes damage first.