Remember recent quarrels, fights and reprimands on the person.

Short offense list for the pupil card and save, capped by BehaviorDef — not a discipline score.
This commit is contained in:
Leonid Pershin
2026-08-21 09:37:12 +03:00
parent 910ba4da2d
commit fdcaed0f74
22 changed files with 760 additions and 16 deletions
+13
View File
@@ -652,6 +652,19 @@ internal static class PeopleDefValidator
{
throw new ContentLoadException($"BehaviorDef '{behavior.DefName}' apologyRestoreFraction must be 01.");
}
if (behavior.OffenseMemoryMax < 0)
{
throw new ContentLoadException($"BehaviorDef '{behavior.DefName}' offenseMemoryMax cannot be negative.");
}
foreach (var kind in behavior.OffenseMemoryKinds)
{
if (string.IsNullOrWhiteSpace(kind))
{
throw new ContentLoadException($"BehaviorDef '{behavior.DefName}' offenseMemoryKinds cannot contain empty ids.");
}
}
}
private static void ValidateTopic(TopicDef topic, DefCatalog catalog)
+18
View File
@@ -566,6 +566,24 @@ public sealed class BehaviorDef : Def
/// <summary>Opinion of the victim at or above this — a third person may join the quarrel.</summary>
public int DefendOpinionMin { get; init; } = 40;
/// <summary>
/// How many recent misconduct rows a person keeps. Oldest drop first. Zero disables the list.
/// </summary>
public int OffenseMemoryMax { get; init; } = 5;
/// <summary>
/// Kind ids that may be appended (<c>quarrel</c>, <c>fight</c>, <c>reprimand</c>, …).
/// Empty falls back to <see cref="DefaultOffenseMemoryKinds"/>.
/// </summary>
public IReadOnlyList<string> OffenseMemoryKinds { get; init; } = DefaultOffenseMemoryKinds;
public static IReadOnlyList<string> DefaultOffenseMemoryKinds { get; } =
[
"quarrel",
"fight",
"reprimand",
];
public static IReadOnlyList<OpinionBand> DefaultOpinionBands { get; } =
[
new() { Min = 70, Id = "OpinionCloseFriend" },