Försterkreislauf: Setzlinge beim Fällen, Försterhaus, Förster-Job

- Gefällter Baum → 1–2 tree_seed im Stockpile (zufällig)
- Neues Gebäude forester_hut (50 wood): Log-Hütten-Grafik, Klick öffnet Info-Panel
- Zonenmarkierung: Edit-Zone-Tool, Radius 5 Tiles, halbtransparente Overlay-Anzeige
- Neuer JobType 'forester': Nisse pflanzen Setzlinge auf markierten Zonen-Tiles
- Chop-Priorisierung: Zonen-Bäume werden vor natürlichen Bäumen gefällt
- Nisse-Panel & Info-Panel zeigen forester-Priorität-Button

Closes #25

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-23 13:07:36 +00:00
parent b024cf36fb
commit 969a82949e
9 changed files with 629 additions and 39 deletions

View File

@@ -32,18 +32,19 @@ export const PLANTABLE_TILES = new Set<TileType>([TileType.GRASS, TileType.DARK_
export type ItemId = 'wood' | 'stone' | 'wheat_seed' | 'carrot_seed' | 'wheat' | 'carrot' | 'tree_seed'
export type BuildingType = 'floor' | 'wall' | 'chest' | 'bed' | 'stockpile_zone'
export type BuildingType = 'floor' | 'wall' | 'chest' | 'bed' | 'stockpile_zone' | 'forester_hut'
export type CropKind = 'wheat' | 'carrot'
export type JobType = 'chop' | 'mine' | 'farm'
export type JobType = 'chop' | 'mine' | 'farm' | 'forester'
export type AIState = 'idle' | 'walking' | 'working' | 'sleeping'
export interface JobPriorities {
chop: number // 0 = disabled, 1 = highest, 4 = lowest
chop: number // 0 = disabled, 1 = highest, 4 = lowest
mine: number
farm: number
forester: number // plant tree seedlings in forester zones
}
export interface VillagerJob {
@@ -112,6 +113,16 @@ export interface TreeSeedlingState {
underlyingTile: TileType
}
/**
* The set of tiles assigned to one forester hut's planting zone.
* Tiles are stored as "tileX,tileY" key strings.
*/
export interface ForesterZoneState {
buildingId: string
/** Tile keys "tileX,tileY" that the player has marked for planting. */
tiles: string[]
}
export interface WorldState {
seed: number
tiles: number[]
@@ -127,6 +138,8 @@ export interface WorldState {
* Value is remaining milliseconds until the tile reverts to GRASS.
*/
tileRecovery: Record<string, number>
/** Forester zone definitions, keyed by forester_hut building ID. */
foresterZones: Record<string, ForesterZoneState>
}
export interface GameStateData {
@@ -156,3 +169,4 @@ export type GameAction =
| { type: 'REMOVE_TREE_SEEDLING'; seedlingId: string }
| { type: 'SPAWN_RESOURCE'; resource: ResourceNodeState }
| { type: 'TILE_RECOVERY_START'; tileX: number; tileY: number }
| { type: 'FORESTER_ZONE_UPDATE'; buildingId: string; tiles: string[] }