Wear worn clothes on campus and replace rags at the work morning.

Condition drops from catalog hours only while the person is at school; skip through the night issues the same fresh set as a lived night so the school does not walk in in rags.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-20 03:49:11 +03:00
co-authored by Cursor
parent af90bb9f9d
commit 1ba739dd9b
20 changed files with 847 additions and 28 deletions
+53
View File
@@ -526,6 +526,18 @@ internal static class PeopleDefValidator
throw new ContentLoadException($"BehaviorDef '{behavior.DefName}' optionalApparelChance must be 01.");
}
if (behavior.ApparelWearPerHour < 0f)
{
throw new ContentLoadException($"BehaviorDef '{behavior.DefName}' apparelWearPerHour cannot be negative.");
}
if (behavior.ApparelReplaceBelow is < 0f or > 1f)
{
throw new ContentLoadException($"BehaviorDef '{behavior.DefName}' apparelReplaceBelow must be 01.");
}
ValidateConditionBands(behavior);
// A pack may invert this on purpose — lunch then pulls the class out of the lesson.
// The warning is the catch; refusing to load would make the number unmoddable.
if (behavior.LunchWeight > behavior.DutyLessonWeight)
@@ -535,6 +547,47 @@ internal static class PeopleDefValidator
}
}
private static void ValidateConditionBands(BehaviorDef behavior)
{
var bands = behavior.ApparelConditionBands;
if (bands.Count == 0)
{
throw new ContentLoadException($"BehaviorDef '{behavior.DefName}' apparelConditionBands cannot be empty.");
}
var ids = new HashSet<string>(StringComparer.Ordinal);
var sawZero = false;
foreach (var band in bands)
{
if (string.IsNullOrWhiteSpace(band.Id))
{
throw new ContentLoadException($"BehaviorDef '{behavior.DefName}' apparel condition band is missing an id.");
}
if (band.Min is < 0f or > 1f)
{
throw new ContentLoadException(
$"BehaviorDef '{behavior.DefName}' apparel condition '{band.Id}' min must be 01.");
}
if (!ids.Add(band.Id))
{
throw new ContentLoadException($"BehaviorDef '{behavior.DefName}' repeats apparel condition '{band.Id}'.");
}
if (band.Min == 0f)
{
sawZero = true;
}
}
if (!sawZero)
{
throw new ContentLoadException(
$"BehaviorDef '{behavior.DefName}' apparelConditionBands must include a min of 0 so rags have a caption.");
}
}
private static void ValidateHoliday(HolidayDef holiday)
{
if (holiday.Abstract)