add mine building for automated stone production

- New 3×2 building placeable only on ROCK tiles without resources (50 stone + 200 wood)
- Mine entrance at bottom-centre tile (tileX+1, tileY+1) — only passable tile
- Other 5 footprint tiles blocked via resourceTiles index (impassable ROCK)
- Nisse with mine priority > 0 walk to entrance, hide inside for MINE_WORK_MS (15 s),
  then reappear carrying MINE_STONE_YIELD (2) stone and haul to stockpile
- Up to MINE_CAPACITY (3) Nisse work simultaneously; overflow Nisse wait for a slot
- ⛏ X/3 world-space status label above building updated each frame
- Surface rock harvesting unchanged; mine buildings take precedence in pickJob
- Ghost resizes to 3×2 when mine is selected; placement validated across full footprint
- Mine added to build menu with cost and placement hint

Closes #42

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-24 19:07:04 +00:00
parent a6c2aa5309
commit 202ff435f7
6 changed files with 286 additions and 37 deletions

View File

@@ -20,8 +20,18 @@ export const BUILDING_COSTS: Record<BuildingType, Record<string, number>> = {
bed: { wood: 6 },
stockpile_zone:{ wood: 0 },
forester_hut: { wood: 50 },
mine: { stone: 50, wood: 200 },
}
/** Maximum number of Nisse that can work inside a mine simultaneously. */
export const MINE_CAPACITY = 3
/** Milliseconds a Nisse spends inside a mine per visit. */
export const MINE_WORK_MS = 15_000
/** Stone yielded per mine visit. */
export const MINE_STONE_YIELD = 2
/** Max Chebyshev radius (in tiles) that a forester hut's zone can extend. */
export const FORESTER_ZONE_RADIUS = 5