Add lesson marks 2-5 from lesson quality once per slot.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-21 11:45:14 +03:00
co-authored by Cursor
parent 4c8d91c6f3
commit b359bebb41
16 changed files with 702 additions and 21 deletions
+39
View File
@@ -665,6 +665,45 @@ internal static class PeopleDefValidator
throw new ContentLoadException($"BehaviorDef '{behavior.DefName}' offenseMemoryKinds cannot contain empty ids.");
}
}
if (behavior.LessonMarkMax < 0)
{
throw new ContentLoadException($"BehaviorDef '{behavior.DefName}' lessonMarkMax cannot be negative.");
}
if (behavior.LessonMarkWhenNoTeacher is { } absent
&& absent is < 2 or > 5)
{
throw new ContentLoadException(
$"BehaviorDef '{behavior.DefName}' lessonMarkWhenNoTeacher must be 25 or null.");
}
if (behavior.LessonMarkThresholds.Count > 0)
{
if (behavior.LessonMarkThresholds.Count != 3)
{
throw new ContentLoadException(
$"BehaviorDef '{behavior.DefName}' lessonMarkThresholds must list three floors (5, 4, 3).");
}
float? previous = null;
foreach (var floor in behavior.LessonMarkThresholds)
{
if (floor is < 0f or > 1f)
{
throw new ContentLoadException(
$"BehaviorDef '{behavior.DefName}' lessonMarkThresholds must be 01.");
}
if (previous is { } prior && floor > prior)
{
throw new ContentLoadException(
$"BehaviorDef '{behavior.DefName}' lessonMarkThresholds must be descending.");
}
previous = floor;
}
}
}
private static void ValidateTopic(TopicDef topic, DefCatalog catalog)