add demolish mode for buildings (Issue #50)

- New 💥 Demolish button in the action bar
- Red ghost highlights building footprint on hover
- Refund: 100% within 3 min, decays linearly to 0%
- Mine teardown unblocks passability tiles and removes status label
- Nisse inside demolished mine are rescued and reset to idle
- Floor/wall/chest tiles restored to GRASS on demolish
- Build error now shows missing resources instead of generic message
- BuildingState gains builtAt field; old saves default to 0 (no refund)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-24 20:18:49 +00:00
parent 6eeb47c720
commit fc10201469
8 changed files with 302 additions and 30 deletions

View File

@@ -61,6 +61,9 @@ export const VILLAGER_NAMES = [
'Orla','Pike','Quinn','Rook','Sera','Tull','Uma','Vex',
]
/** Milliseconds after placement during which demolishing gives a full refund (linearly decays to 0%). */
export const DEMOLISH_REFUND_MS = 180_000 // 3 minutes
export const SAVE_KEY = 'tg_save_v5'
export const AUTOSAVE_INTERVAL = 30_000