feat(simulation): character archetype, tell escalation, and news ticker (#587, #589, #591)

- Add character_archetype to StartupMessage with serde default (Detective)
- Bump PROTOCOL_VERSION to 19
- Add escalate_tells_on_activation() and expire_routine_deviations() systems
- RoutineDeviation inserted on triangle NPCs with 300-tick TTL
- Add TickerPool resource with deterministic SimRng rotation (200 ticks)
- Emit current_ticker in ObserverSnapshot when player is in bar zone
- Load ticker YAML from district content directories

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 09:13:03 +01:00
co-authored by Claude Opus 4.6
parent fc24de6128
commit 3194a6e491
16 changed files with 567 additions and 22 deletions
+12
View File
@@ -132,15 +132,25 @@ pub enum AnimationTier {
Tier2,
}
/// Duration (ticks) a storyteller-escalated RoutineDeviation persists.
/// 300 ticks = 30 game-minutes at 10 ticks/game-minute (D-031).
pub const TELL_ESCALATION_DURATION_TICKS: u64 = 300;
/// Tracks why and when an NPC's routine deviated from normal (D-064 Phase 2).
///
/// Inserted when a player action causes an NPC to break from their scheduled
/// behavior. Acts as a hook for the storyteller system and affects future
/// interactions (e.g., second-approach dialogue differences).
///
/// `expires_at_tick`: tick at which this component should be removed.
/// 0 means "never expires" (legacy default for old insertions).
#[derive(Component, Debug, Clone)]
pub struct RoutineDeviation {
pub trigger: DeviationTrigger,
pub tick: u64,
/// Tick at which this deviation expires (component removed by cleanup system).
/// Set to `tick + TELL_ESCALATION_DURATION_TICKS` for time-limited deviations.
pub expires_at_tick: u64,
}
/// What caused an NPC's routine deviation.
@@ -150,6 +160,8 @@ pub enum DeviationTrigger {
WalkAway,
/// Player delivered a confrontation (D-063).
Confrontation,
/// Storyteller activated a triangle this NPC belongs to (#589, D-024 axis 9).
TriangleEscalation,
}
// ---------------------------------------------------------------------------
+1
View File
@@ -247,6 +247,7 @@ mod tests {
NpcRoutineDeviation {
trigger: DeviationTrigger::WalkAway,
tick: 100,
expires_at_tick: 500,
}
}