refactor(content): rename mood vocabulary to match voice guide (D-035 Sprint 14 amendment)
Schema and Rust Mood enum renamed for author-friendly vocabulary: fond→warm, comfortable→content, worried→anxious, concerned→frustrated. Dropped: analytical (merged into focused), conflicted (modeled as suspicious+warm collision). Added: hostile. Final 8 moods: anxious, frustrated, content, suspicious, warm, hostile, relieved, focused. Neutral = untagged. Resolves Gestalt's blocking issue on #121. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -630,13 +630,12 @@ fn topic_str(t: &Topic) -> &'static str {
|
||||
|
||||
fn mood_str(m: &Mood) -> &'static str {
|
||||
match m {
|
||||
Mood::Fond => "fond",
|
||||
Mood::Comfortable => "comfortable",
|
||||
Mood::Worried => "worried",
|
||||
Mood::Anxious => "anxious",
|
||||
Mood::Frustrated => "frustrated",
|
||||
Mood::Content => "content",
|
||||
Mood::Suspicious => "suspicious",
|
||||
Mood::Analytical => "analytical",
|
||||
Mood::Conflicted => "conflicted",
|
||||
Mood::Concerned => "concerned",
|
||||
Mood::Warm => "warm",
|
||||
Mood::Hostile => "hostile",
|
||||
Mood::Relieved => "relieved",
|
||||
Mood::Focused => "focused",
|
||||
}
|
||||
|
||||
@@ -164,19 +164,17 @@ impl FromStr for Topic {
|
||||
|
||||
/// D-028 Layer 4: Mood tag — influences weighted selection.
|
||||
///
|
||||
/// 9 v0.1 values: 8 original + Focused added Sprint 8 (D-035 amendment)
|
||||
/// for Kael dialogue at The Terminal and maintenance corridors.
|
||||
/// 8 v0.1 values aligned to voice guide vocabulary (Sprint 14 rename).
|
||||
/// Neutral mood is represented by omitting the mood tag (untagged = baseline).
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub enum Mood {
|
||||
Fond,
|
||||
Comfortable,
|
||||
Worried,
|
||||
Anxious,
|
||||
Frustrated,
|
||||
Content,
|
||||
Suspicious,
|
||||
Analytical,
|
||||
Conflicted,
|
||||
Concerned,
|
||||
Warm,
|
||||
Hostile,
|
||||
Relieved,
|
||||
/// Added Sprint 8 (D-035 amendment): Kael dialogue at Terminal/corridors.
|
||||
Focused,
|
||||
}
|
||||
|
||||
@@ -184,13 +182,12 @@ impl FromStr for Mood {
|
||||
type Err = ParseEnumError;
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
match s {
|
||||
"fond" => Ok(Self::Fond),
|
||||
"comfortable" => Ok(Self::Comfortable),
|
||||
"worried" => Ok(Self::Worried),
|
||||
"anxious" => Ok(Self::Anxious),
|
||||
"frustrated" => Ok(Self::Frustrated),
|
||||
"content" => Ok(Self::Content),
|
||||
"suspicious" => Ok(Self::Suspicious),
|
||||
"analytical" => Ok(Self::Analytical),
|
||||
"conflicted" => Ok(Self::Conflicted),
|
||||
"concerned" => Ok(Self::Concerned),
|
||||
"warm" => Ok(Self::Warm),
|
||||
"hostile" => Ok(Self::Hostile),
|
||||
"relieved" => Ok(Self::Relieved),
|
||||
"focused" => Ok(Self::Focused),
|
||||
_ => Err(ParseEnumError {
|
||||
@@ -709,15 +706,14 @@ mod tests {
|
||||
#[test]
|
||||
fn mood_parse_all_values() {
|
||||
let values = [
|
||||
"fond",
|
||||
"comfortable",
|
||||
"worried",
|
||||
"anxious",
|
||||
"frustrated",
|
||||
"content",
|
||||
"suspicious",
|
||||
"analytical",
|
||||
"conflicted",
|
||||
"concerned",
|
||||
"warm",
|
||||
"hostile",
|
||||
"relieved",
|
||||
"focused", // Sprint 8 amendment (D-035)
|
||||
"focused",
|
||||
];
|
||||
for v in values {
|
||||
assert!(v.parse::<Mood>().is_ok(), "Failed to parse mood: {}", v);
|
||||
|
||||
@@ -68,7 +68,7 @@ pub struct CurrentMood(pub Mood);
|
||||
|
||||
impl Default for CurrentMood {
|
||||
fn default() -> Self {
|
||||
Self(Mood::Comfortable)
|
||||
Self(Mood::Content)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -891,14 +891,14 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn score_mood_match_adds_three() {
|
||||
let line = make_line("moody", &[], &[Mood::Worried]);
|
||||
assert_eq!(score_line(&line, Some(Mood::Worried), &[]), 4); // 1 base + 3 mood
|
||||
let line = make_line("moody", &[], &[Mood::Anxious]);
|
||||
assert_eq!(score_line(&line, Some(Mood::Anxious), &[]), 4); // 1 base + 3 mood
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn score_mood_mismatch_stays_base() {
|
||||
let line = make_line("moody", &[], &[Mood::Worried]);
|
||||
assert_eq!(score_line(&line, Some(Mood::Fond), &[]), 1);
|
||||
let line = make_line("moody", &[], &[Mood::Anxious]);
|
||||
assert_eq!(score_line(&line, Some(Mood::Warm), &[]), 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -987,7 +987,7 @@ mod tests {
|
||||
fn select_deterministic_with_same_seed() {
|
||||
let line_a = make_line("a", &[], &[]);
|
||||
let line_b = make_line("b", &[Topic::Cargo], &[]);
|
||||
let line_c = make_line("c", &[], &[Mood::Worried]);
|
||||
let line_c = make_line("c", &[], &[Mood::Anxious]);
|
||||
let candidates = vec![&line_a, &line_b, &line_c];
|
||||
let cooldown = DialogueCooldownTracker::default();
|
||||
|
||||
@@ -1003,7 +1003,7 @@ mod tests {
|
||||
fn select_favors_higher_scored_lines() {
|
||||
// Line with matching mood gets +3, so should be selected more often
|
||||
let neutral = make_line("neutral", &[], &[]);
|
||||
let matched = make_line("matched", &[], &[Mood::Worried]);
|
||||
let matched = make_line("matched", &[], &[Mood::Anxious]);
|
||||
let candidates = vec![&neutral, &matched];
|
||||
let cooldown = DialogueCooldownTracker::default();
|
||||
|
||||
@@ -1012,7 +1012,7 @@ mod tests {
|
||||
let mut rng = rand_chacha::ChaCha20Rng::seed_from_u64(seed);
|
||||
if let Some(line) = select_dialogue_line(
|
||||
&candidates,
|
||||
Some(Mood::Worried),
|
||||
Some(Mood::Anxious),
|
||||
&[],
|
||||
&cooldown,
|
||||
0,
|
||||
@@ -1077,7 +1077,7 @@ mod tests {
|
||||
trust: TrustTier::Surface,
|
||||
situation: vec![Situation::NightShift],
|
||||
topic: vec![Topic::Routine],
|
||||
mood: vec![Mood::Comfortable],
|
||||
mood: vec![Mood::Content],
|
||||
tags: vec![],
|
||||
knowledge_grant: None,
|
||||
},
|
||||
@@ -1089,7 +1089,7 @@ mod tests {
|
||||
trust: TrustTier::Real,
|
||||
situation: vec![Situation::Investigation],
|
||||
topic: vec![Topic::Cargo, Topic::Investigation],
|
||||
mood: vec![Mood::Conflicted],
|
||||
mood: vec![Mood::Suspicious],
|
||||
tags: vec![],
|
||||
knowledge_grant: None,
|
||||
},
|
||||
@@ -1122,7 +1122,7 @@ mod tests {
|
||||
location: "the-terminal".to_string(),
|
||||
role: "dock-worker".to_string(),
|
||||
},
|
||||
CurrentMood(Mood::Comfortable),
|
||||
CurrentMood(Mood::Content),
|
||||
))
|
||||
.id();
|
||||
world.resource_mut::<EntityRegistry>().register(npc);
|
||||
@@ -1414,7 +1414,7 @@ mod tests {
|
||||
location: "the-terminal".to_string(),
|
||||
role: "dock-worker".to_string(),
|
||||
},
|
||||
CurrentMood(Mood::Comfortable),
|
||||
CurrentMood(Mood::Content),
|
||||
))
|
||||
.id();
|
||||
world.resource_mut::<EntityRegistry>().register(npc);
|
||||
|
||||
Reference in New Issue
Block a user