feat(simulation): NPC mood state machine (#323, D-024, D-035)
8-state NPC mood FSM driven by stress, time of day, and interaction events. Adds MoodState component, derive_mood() pure function, and update_mood() Bevy system wired into NpcPlugin. Adds Focused as 9th Mood content tag (D-035 Sprint 8 amendment). Syncs CurrentMood for Layer 4 dialogue selection. 31 unit tests covering priority ordering, boundary conditions, and system integration. All random values route through SimRng (D-010 determinism). No floats. No HashMap. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// Implements D-024: 10-axis NPC model + CombatCapability component
|
||||
// Background tier state machines for schedule, mood, relationships, job
|
||||
|
||||
pub mod mood;
|
||||
pub mod relationships;
|
||||
pub mod routine;
|
||||
|
||||
@@ -24,8 +25,13 @@ impl Plugin for NpcPlugin {
|
||||
.init_resource::<routine::PreviousDayPhase>()
|
||||
.add_systems(
|
||||
Update,
|
||||
routine::check_phase_transition
|
||||
.before(crate::simulation::pathfinding::compute_paths),
|
||||
(
|
||||
routine::check_phase_transition
|
||||
.before(crate::simulation::pathfinding::compute_paths),
|
||||
mood::update_mood
|
||||
.after(routine::check_phase_transition)
|
||||
.before(crate::simulation::dialogue::process_talk_interaction),
|
||||
),
|
||||
);
|
||||
|
||||
tracing::debug!("NpcPlugin initialized");
|
||||
|
||||
Reference in New Issue
Block a user