H9: Boathook swings damage players; unarmed bots brawl

- Harvest.swing traces the swing as a shot is traced (Weapons.trace, lag
  compensated). A player reached before terrain, a solid, a prop's grown
  box or a built piece takes the boathook's damage through
  Weapons.damage_player, so armor, the kill feed and stats count it. A level
  swing meets the head and takes the headshot multiplier, as a shot does.
- Unarmed bots go for an opponent in view within BOT_BRAWL_METRES (6 m) and
  swing within BOT_SWING_METRES; inside a hut they swing back without
  walking in.
- Tests: harvest +5 (hit, armor first, out of reach, wall between, player in
  front of a tree), bot brain +2 (closes in and lands hits; leaves a distant
  opponent alone).
- test_world_replication: an unarmed bot now meets the scripted player early
  on seed 2, so the test gives it full armor on landing so it lives to build;
  all assertions unchanged.

Closes #73

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-13 21:10:48 -05:00
co-authored by Claude Opus 5.5
parent 923876ed1f
commit d5c8019d11
7 changed files with 186 additions and 5 deletions
+4
View File
@@ -290,6 +290,10 @@ const BOT_AIM_WANDER_TICKS: int = 12
const BOT_BLOOM_PAUSE_DEGREES: float = 3.0
## Bots notice items lying within this distance.
const BOT_LOOT_SIGHT_METRES: float = 12.0
## A bot with no gun goes for an opponent in view this close with its boathook, in
## metres, and swings once its eye is this far from the opponent's body.
const BOT_BRAWL_METRES: float = 6.0
const BOT_SWING_METRES: float = 2.3
## The most weapons a bot carries; its other slots are for consumables.
const BOT_MAX_WEAPONS: int = 3
## Ground counts as safe from the next tide level when it stands this far above it.