4604dc6d5a
Add ACTION_SLEEP with home-position targeting and energy restoration. Embed schedule periods (SLEEP/MEAL/WORK/DISCRETIONARY) in ActionSelectionSystem with TimeOfDay from SimulationClock. NPCs sleep at night when energy is low, eat during meal periods when hungry, and work/discretionary the rest of the cycle. Home position stored per NPC and serialized through NPCStateRecord with backward-compatible fallback. Cycle duration persisted through save/restore. Includes headless test for sleep period, work period, meal hunger, energy restoration, serialization round-trip, and home targeting without world adapter.
36 lines
1.1 KiB
GDScript
36 lines
1.1 KiB
GDScript
class_name SimulationIds
|
|
extends RefCounted
|
|
|
|
const ACTION_IDLE := &"idle"
|
|
const ACTION_DEAD := &"dead"
|
|
const ACTION_SLEEP := &"sleep"
|
|
const ACTION_GATHER_FOOD := &"gather_food"
|
|
const ACTION_GATHER_WOOD := &"gather_wood"
|
|
const ACTION_PATROL := &"patrol"
|
|
const ACTION_STUDY := &"study"
|
|
const ACTION_EAT := &"eat"
|
|
const ACTION_REST := &"rest"
|
|
const ACTION_WANDER := &"wander"
|
|
const ACTION_DEPOSIT_FOOD := &"deposit_food"
|
|
const ACTION_WITHDRAW_FOOD := &"withdraw_food"
|
|
|
|
const PROFESSION_FARMER := &"farmer"
|
|
const PROFESSION_WOODCUTTER := &"woodcutter"
|
|
const PROFESSION_GUARD := &"guard"
|
|
const PROFESSION_SCHOLAR := &"scholar"
|
|
const PROFESSION_WANDERER := &"wanderer"
|
|
|
|
const TARGET_RESOURCE := &"resource"
|
|
const TARGET_ACTIVITY := &"activity"
|
|
const TARGET_FREE := &"free"
|
|
|
|
const RESOURCE_FOOD := &"food"
|
|
const RESOURCE_WOOD := &"wood"
|
|
|
|
const STORAGE_VILLAGE_PANTRY := &"village_pantry"
|
|
|
|
const EVENT_RESOURCE_EXTRACTED := &"resource_extracted"
|
|
const EVENT_STORAGE_DEPOSITED := &"storage_deposited"
|
|
const EVENT_STORAGE_WITHDRAWN := &"storage_withdrawn"
|
|
const EVENT_ITEM_CONSUMED := &"item_consumed"
|