Add lesson whispers, teacher catch chance, and after-bell teacher talk.

Whispering cuts lesson skill gain from BehaviorDef; a teacher in the room may interrupt into a discipline circle, and pedagogy scales the pupil's opinion of the teacher.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-20 10:35:31 +03:00
co-authored by Cursor
parent cb869e4977
commit f7d5e0c042
22 changed files with 1061 additions and 36 deletions
+39 -4
View File
@@ -261,6 +261,11 @@ internal static class PeopleDefValidator
throw new ContentLoadException($"TraitDef '{trait.DefName}' skill modifier references unknown SkillDef '{modifier.Skill}'.");
}
}
if (trait.WhisperCatchMultiplier < 0f)
{
throw new ContentLoadException($"TraitDef '{trait.DefName}' whisperCatchMultiplier cannot be negative.");
}
}
private static void ValidateNeed(NeedDef need)
@@ -574,6 +579,39 @@ internal static class PeopleDefValidator
throw new ContentLoadException(
$"BehaviorDef '{behavior.DefName}' talk circle size must be at least 2 with max ≥ min.");
}
if (behavior.LessonWhisperSkillFactor is < 0f or > 1f)
{
throw new ContentLoadException($"BehaviorDef '{behavior.DefName}' lessonWhisperSkillFactor must be 01.");
}
if (behavior.WhisperCatchChance is < 0f or > 1f)
{
throw new ContentLoadException($"BehaviorDef '{behavior.DefName}' whisperCatchChance must be 01.");
}
if (behavior.WhisperCatchMax is < 0f or > 1f)
{
throw new ContentLoadException($"BehaviorDef '{behavior.DefName}' whisperCatchMax must be 01.");
}
if (behavior.WhisperStartChance is < 0f or > 1f)
{
throw new ContentLoadException($"BehaviorDef '{behavior.DefName}' whisperStartChance must be 01.");
}
if (behavior.TalkPedagogyOpinionScale < 0f)
{
throw new ContentLoadException($"BehaviorDef '{behavior.DefName}' talkPedagogyOpinionScale cannot be negative.");
}
if (behavior.TeacherAfterLessonWeight < 0f
|| behavior.TeacherQuestionWeight < 0f
|| behavior.TeacherPraiseWeight < 0f
|| behavior.TeacherReprimandWeight < 0f)
{
throw new ContentLoadException($"BehaviorDef '{behavior.DefName}' teacher-talk weights cannot be negative.");
}
}
private static void ValidateTopic(TopicDef topic, DefCatalog catalog)
@@ -611,10 +649,7 @@ internal static class PeopleDefValidator
private static void RequireTalkTopics(DefCatalog catalog)
{
var hasTalkAction = catalog.Actions.Values.Any(action =>
!action.Abstract
&& (action.DefName.Equals(TalkActions.Chat, StringComparison.Ordinal)
|| action.DefName.Equals(TalkActions.StaffChat, StringComparison.Ordinal)
|| action.DefName.Equals(TalkActions.PhoneChat, StringComparison.Ordinal)));
!action.Abstract && TalkActions.IsTalk(action.DefName));
if (!hasTalkAction)
{
return;