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
+2 -2
View File
@@ -16,7 +16,7 @@ What works and is tested automatically:
- Whole matches, lobby to results, offline against bots or on a dedicated server, with up to 24 players and bots.
- The rising tide on every generated island, with flooding that follows the terrain, breakwaters that hold water back, storm surges and sudden death.
- Building walls, floors, ramps, roofs and breakwaters in driftwood, stone and salvage iron, with collapse; harvesting with the boathook; seven weapons, including a harpoon gun and a line thrower, in four tiers; healing and armor; sea chests and crates.
- Building walls, floors, ramps, roofs and breakwaters in driftwood, stone and salvage iron, with collapse; harvesting with the boathook; seven weapons, including a harpoon gun and a line thrower, and thrown powder kegs that blast through walls and breakwaters, in four tiers; healing and armor; sea chests and crates.
- Bots at three difficulties. Balance was tuned over 200 bot matches (median match 13 minutes; see [docs/BALANCE.md](docs/BALANCE.md)).
- Multiplayer with client prediction, tested with 24 network clients over two matches under simulated latency, jitter and loss; LAN discovery; list servers; joining by address.
- Menus, HUD, chart, settings with rebindable keys, generated art and synthesized sound and music.
@@ -28,7 +28,7 @@ All of this is checked headless or with **software rendering in a container**. N
- **Untested on real hardware.** No real GPU, Wayland session or hybrid-graphics machine has run it yet ([docs/PLAY.md](docs/PLAY.md#tested-configurations)).
- **Solo only.** Duos and reviving ([#30](https://gitea.eom.dev/claude/tidewall/issues/30)) aren't in this release.
- **The powder keg can be carried but not thrown** yet ([#22](https://gitea.eom.dev/claude/tidewall/issues/22)), and there are no particle effects such as muzzle flashes, tracers or splashes ([#47](https://gitea.eom.dev/claude/tidewall/issues/47)).
- **No particle effects** yet, such as muzzle flashes, tracers, splashes or a keg's blast ([#47](https://gitea.eom.dev/claude/tidewall/issues/47)); a keg's blast is heard, not seen. Bots carry powder kegs but don't throw them.
- **Bots don't build** ([#29](https://gitea.eom.dev/claude/tidewall/issues/29)), and most of them fall early in a match ([#74](https://gitea.eom.dev/claude/tidewall/issues/74)).
- **No gamepad support or tutorial** ([#53](https://gitea.eom.dev/claude/tidewall/issues/53), [#52](https://gitea.eom.dev/claude/tidewall/issues/52)). No character customization ([#43](https://gitea.eom.dev/claude/tidewall/issues/43)) or editing of placed pieces ([#18](https://gitea.eom.dev/claude/tidewall/issues/18)).
- **The Join menu only searches the LAN.** List servers work from the command line (`--browse --list=...`); in the menu, join other servers by address.