Add AI parent meetings after a class last lesson.

Class teachers rarely keep the homeroom; invited parents walk onto the map, opinions nudge, then parents leave OffCampus. No player schedule API.
This commit is contained in:
Leonid Pershin
2026-08-21 13:33:40 +03:00
parent a57e581f83
commit 3288287da9
22 changed files with 1138 additions and 18 deletions
+1
View File
@@ -15,6 +15,7 @@ internal static class EventDefValidator
EventTriggers.LessonStart,
EventTriggers.GenerationFailed,
EventTriggers.DirectorSummon,
EventTriggers.ParentMeeting,
};
private static readonly HashSet<string> Actions = new(StringComparer.Ordinal)
+1
View File
@@ -13,6 +13,7 @@ public static class EventTriggers
public const string LessonStart = "lessonStart";
public const string GenerationFailed = "generationFailed";
public const string DirectorSummon = "directorSummon";
public const string ParentMeeting = "parentMeeting";
}
public static class EventActions
+18
View File
@@ -684,6 +684,24 @@ internal static class PeopleDefValidator
$"BehaviorDef '{behavior.DefName}' directorHearingMinutes must be positive.");
}
if (behavior.ParentMeetingChance is < 0f or > 1f)
{
throw new ContentLoadException(
$"BehaviorDef '{behavior.DefName}' parentMeetingChance must be 01.");
}
if (behavior.ParentMeetingAttendanceFraction is < 0f or > 1f)
{
throw new ContentLoadException(
$"BehaviorDef '{behavior.DefName}' parentMeetingAttendanceFraction must be 01.");
}
if (behavior.ParentMeetingMinutes <= 0f)
{
throw new ContentLoadException(
$"BehaviorDef '{behavior.DefName}' parentMeetingMinutes must be positive.");
}
if (behavior.LessonMarkMax < 0)
{
throw new ContentLoadException($"BehaviorDef '{behavior.DefName}' lessonMarkMax cannot be negative.");
+19
View File
@@ -595,6 +595,25 @@ public sealed class BehaviorDef : Def
/// <summary>Opinion of the Principal after a hearing. Negative — the visit is not praise.</summary>
public int DirectorHearingOpinionShift { get; init; } = -12;
/// <summary>
/// Chance a class with a class teacher holds a parent meeting after its last lesson.
/// Low in vanilla — meetings are rare AI, not a weekly calendar.
/// </summary>
public float ParentMeetingChance { get; init; } = 0.08f;
/// <summary>
/// Independent chance each class parent is invited when a meeting starts. Not 100% attendance.
/// </summary>
public float ParentMeetingAttendanceFraction { get; init; } = 0.4f;
/// <summary>Game minutes the class teacher keeps the homeroom for the meeting.</summary>
public float ParentMeetingMinutes { get; init; } = 20f;
/// <summary>
/// Opinion shift both ways between each attending parent and the class teacher. Small and positive.
/// </summary>
public int ParentMeetingOpinionShift { get; init; } = 3;
public static IReadOnlyList<string> DefaultOffenseMemoryKinds { get; } =
[
"quarrel",