Trades are movements (trade, trade_return) that arrive by the target's
movement.arrives event; they stay out of the rally lists, the map and the
rally cancel. A trade.route event sends a route's next shipment. A village
that changes hands loses its trades under way, offers and routes.
WS: market.show|preview|send|offers|offer|cancelOffer|accept|routeCreate|routeUpdate|routeDelete;
the village payload carries market {building_id, level, merchants, free, carry}.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A raid.planned event per village picks the nearest camp in range, announces a
band sized by the village's points hours before it marches, and plans the next
one. On arrival the band is as strong as its camp; a beaten camp's band scatters.
Loot goes back to the camp, a beaten band pays a bounty.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Full strength follows the village's points in one of four profiles, capped by its
food; a barbarian.regroups event brings it back a quarter at a time. Existing
barbarians get theirs from the seeder on deploy.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Starvation::sync() runs after every mutation and event: it keeps food.runs_out at
the moment the stock hits 0, starts the grace timer once the village starves and
stops it when income covers upkeep again. Each desertion wave takes the fewest
soldiers, highest upkeep first, that feed the rest; then the levy ends.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drafted villagers still eat but stop working; recruiting trains only undrafted ones.
A levy.ends event settles the village and sends them back; village.endLevy ends it early.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>