Boathook swings harvest props. The client only presses fire with the boathook selected; the server casts the swing from its own copy of the player's eye and look, so range and swing rate are enforced by construction. Each hit damages the prop and gives its material (driftwood, stone or salvage iron), capped per material. - Materials: material codes and add/spend helpers; carried stock lives on SimEntity.materials and is part of the state hash. - Harvest: swing interval from the boathook's fire rate, reach from its range plus slack, nearest prop along the ray, blocked by terrain or other solids. Emits harvest and prop_destroyed events. - Simulation: per-tick events list, a shared action cooldown, and fire with selection 0 outside build mode swings. - Tuning: HARVEST_DAMAGE, HARVEST_REACH_SLACK, HARVEST_AIM_SLACK. - 12 tests: yields per kind, rate limit, reach, blocking, nearest prop, caps, destruction clearing collision, state gating and determinism on a real island. Closes #15 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 lines
20 B
Plaintext
2 lines
20 B
Plaintext
uid://b560mwnfowr3y
|