rimworld-blax-laws/Source/BlaxLaws/Enforcement/PunishmentWorker_Guilty.cs

25 lines
1.1 KiB
C#

using Verse;
namespace BlaxLaws
{
/// <summary>
/// Guilty for N days: pawn.guilt.Notify_Guilty(days * 60000) (Pawn_GuiltTracker.cs:46-49), which vanilla
/// saves (:40-44) and counts down (:51-61); a longer guilt already on the pawn is never shortened. The
/// guilty icon shows, the arrest of a free colonist is always accepted (Pawn.cs:4087), and executing or
/// banishing it costs the colony the mildest thoughts (ThoughtUtility.cs:27-31;
/// PawnDiedOrDownedThoughtsUtility.cs:214-232). Runs alongside; closes the case as Guilty when nothing
/// else runs for it. Design: "Warn and guilty".
/// </summary>
public class PunishmentWorker_Guilty : PunishmentWorker
{
public override void Start(LawCase c, Law law, LawStage stage)
{
if (c?.offender == null || law == null)
return;
Guilt.AtLeast(c.offender, law.DaysTicks);
if (!c.IsClosed && c.activePunishment.NullOrEmpty())
GameComponent_BlaxLaws.Instance?.CloseCase(c, CaseOutcomes.Guilty);
}
}
}