Add rain and snow minutes to the morning commute.

Day plans take a precomputed extra; Ai does not know precipitation.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-20 09:40:24 +03:00
co-authored by Cursor
parent fbac890be2
commit ce71a91a67
11 changed files with 189 additions and 16 deletions
@@ -522,6 +522,12 @@ internal static class PeopleDefValidator
$"BehaviorDef '{behavior.DefName}' commute slack must be a non-negative range with min ≤ max.");
}
if (behavior.CommuteRainMinutes < 0 || behavior.CommuteSnowMinutes < 0)
{
throw new ContentLoadException(
$"BehaviorDef '{behavior.DefName}' commute rain and snow minutes cannot be negative.");
}
if (behavior.DutyLessonWeight < 0f
|| behavior.DutyTravelWeight < 0f
|| behavior.NeedWeightAtZero < 0f
+9
View File
@@ -285,6 +285,15 @@ public sealed class BehaviorDef : Def
public int CommuteSlackMax { get; init; }
/// <summary>
/// Extra minutes on a rainy morning. Added to slack when the street is wet. A pack without
/// the field adds nothing so the catalog still loads.
/// </summary>
public int CommuteRainMinutes { get; init; }
/// <summary>Same as <see cref="CommuteRainMinutes"/> when the street is snow.</summary>
public int CommuteSnowMinutes { get; init; }
/// <summary>A new goal must beat the current one by this much before the person switches.</summary>
public float SwitchMargin { get; init; }