Commit Graph
1 Commits
Author SHA1 Message Date
claudeandClaude Opus 5.5 0013a81658 B9: Loot tables and containers
Seeded loot at every point of interest's loot markers, rolled once per match
from the "loot" stream by LootSet.plan() and placed by Simulation.place_loot().

- Each marker holds a sea chest (chance by location) or floor loot (rolls on
  the location's weapon/consumable/ammo/nothing weights). Weapons roll a tier
  from the location's tier weights and come with their ammunition; chests
  hold a weapon (best of two tier rolls), a consumable and spare ammunition.
- Interact opens the nearest closed chest in reach unless a pickup is nearer,
  and spills its contents as pickups.
- Washed-up crate props hold one roll of the crate table and spill it when
  broken by any means.
- If the rolls leave fewer POI weapons than LOOT_MIN_POI_WEAPONS (one per
  player in a full lobby), extra weapon rolls top up floor spots.
- Chest and crate state is part of state_hash(). ServerLoop places loot.

Tests: test_loot (12), including a statistics run of 1,000 loot seeds over
four generated islands that checks tier shares against the tables, that
shrines beat hamlets, and that every match has a weapon per player at POIs
and 1.25 per player counting crates.

Closes #23

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 20:16:20 -05:00