diff --git a/Assemblies/Contraband.dll b/Assemblies/Contraband.dll index 2c76db3..8a81941 100644 Binary files a/Assemblies/Contraband.dll and b/Assemblies/Contraband.dll differ diff --git a/Assemblies/Institution.dll b/Assemblies/Institution.dll index f20060c..59e0e96 100644 Binary files a/Assemblies/Institution.dll and b/Assemblies/Institution.dll differ diff --git a/Assemblies/InstitutionCore.dll b/Assemblies/InstitutionCore.dll index f0577be..0448473 100644 Binary files a/Assemblies/InstitutionCore.dll and b/Assemblies/InstitutionCore.dll differ diff --git a/Assemblies/InstitutionGangs.dll b/Assemblies/InstitutionGangs.dll index 76de6d0..48e6870 100644 Binary files a/Assemblies/InstitutionGangs.dll and b/Assemblies/InstitutionGangs.dll differ diff --git a/Assemblies/InstitutionJustice.dll b/Assemblies/InstitutionJustice.dll index 6af0cac..c9cf8ea 100644 Binary files a/Assemblies/InstitutionJustice.dll and b/Assemblies/InstitutionJustice.dll differ diff --git a/Assemblies/Ward.dll b/Assemblies/Ward.dll index 9ceb735..71e801f 100644 Binary files a/Assemblies/Ward.dll and b/Assemblies/Ward.dll differ diff --git a/Defs/HediffDefs/Hediffs_Corrections.xml b/Defs/HediffDefs/Hediffs_Corrections.xml new file mode 100644 index 0000000..c8cea54 --- /dev/null +++ b/Defs/HediffDefs/Hediffs_Corrections.xml @@ -0,0 +1,36 @@ + + + + + + Institution_Reforming + + This prisoner is being rehabilitated — worked with toward turning a corner. Progress decays without sustained sessions. When they have reformed enough and their security grade is low enough, they can be paroled back into the colony. + HediffWithComps + (0.55, 0.85, 0.65) + false + 1.0 + false + +
  • + -0.08 +
  • +
    + +
  • + 0 + +
  • +
  • + 0.999 + +
  • +
    +
    + +
    diff --git a/Defs/JobDefs/Jobs_Corrections.xml b/Defs/JobDefs/Jobs_Corrections.xml new file mode 100644 index 0000000..35bc74b --- /dev/null +++ b/Defs/JobDefs/Jobs_Corrections.xml @@ -0,0 +1,20 @@ + + + + + + Institution_RehabilitateJob + Contraband.JobDriver_Rehabilitate + rehabilitating TargetA. + false + + + + Institution_ParoleJob + Contraband.JobDriver_Parole + paroling TargetA. + false + + + diff --git a/Defs/PrisonerInteractionModeDefs/PrisonerInteractionModes_Justice.xml b/Defs/PrisonerInteractionModeDefs/PrisonerInteractionModes_Justice.xml new file mode 100644 index 0000000..c8b6b31 --- /dev/null +++ b/Defs/PrisonerInteractionModeDefs/PrisonerInteractionModes_Justice.xml @@ -0,0 +1,30 @@ + + + + + + Institution_Rehabilitate + + 120 + true + false + false + true + + + + Institution_Parole + + 210 + true + false + false + true + + + diff --git a/Defs/ThoughtDefs/Thoughts_Corrections.xml b/Defs/ThoughtDefs/Thoughts_Corrections.xml new file mode 100644 index 0000000..d2c04ef --- /dev/null +++ b/Defs/ThoughtDefs/Thoughts_Corrections.xml @@ -0,0 +1,46 @@ + + + + + Institution_Rehabilitated + Thought_Memory + 2 + 3 + +
  • + + Someone sat with me and talked it through. Maybe I can turn this around. + 5 +
  • +
    +
    + + + Institution_Paroled + Thought_Memory + 8 + 1 + +
  • + + They gave me a second chance and let me back in. I mean to earn it. + 12 +
  • +
    +
    + + + Institution_ReformNeglected + Thought_Memory + 3 + 4 + +
  • + + They said they would help me change, then forgot I exist. Why should I bother? + -6 +
  • +
    +
    + +
    diff --git a/Defs/WorkGiverDefs/WorkGivers_Corrections.xml b/Defs/WorkGiverDefs/WorkGivers_Corrections.xml new file mode 100644 index 0000000..31163e2 --- /dev/null +++ b/Defs/WorkGiverDefs/WorkGivers_Corrections.xml @@ -0,0 +1,36 @@ + + + + + + Institution_WardenRehabilitate + + Contraband.WorkGiver_Warden_Rehabilitate + Warden + rehabilitate + rehabilitating + 65 + +
  • Talking
  • +
  • Hearing
  • +
    +
    + + + Institution_WardenParole + + Contraband.WorkGiver_Warden_Parole + Warden + parole + paroling + 85 + +
  • Talking
  • +
    +
    + +
    diff --git a/Wiki/Home.md b/Wiki/Home.md index ccf15a3..0a4e283 100644 --- a/Wiki/Home.md +++ b/Wiki/Home.md @@ -33,9 +33,10 @@ The suite is a closed loop, and each turn of it lives in a different layer: under the perimeter, all countered by warden search — and a bent warden who smuggles for them. 6. **Gangs** *(Gangs)* — held pawns organise into contraband economies: joining by disposition, smuggling networks, rivalry, fights that book as crimes. -7. **Corrections** *(Justice)* — classification grades the danger; discipline moves a **reform** - score (harden vs. rehabilitate); a **deterrence** climate rises and falls with visible justice and - feeds back into everyone's disposition; parole releases the genuinely reformed. +7. **Corrections** *(Justice · Rehabilitation)* — a warden **rehabilitates** a prisoner: counselling + sessions move a **reform** score and raise the colony's climate of **order** (classification + re-grades as reform rises), that order feeds back into everyone's disposition, and a **parole** + alert releases the genuinely reformed back into the colony. Neglect a flagged prisoner and they harden. 8. **Treatment** *(Ward)* — the other door: a prisoner committed for **psychiatric care** rather than punished. Counselling reduces the disorder that broke them and builds a recovery track toward discharge; neglect a committed patient and they deteriorate. @@ -55,7 +56,7 @@ one off disables its systems in place without uninstalling anything. |---|---|---|---| | **Core** | *(always on — the engine)* | propensity, the criminal record, secured context, the shared **treatment engine**, the deterrence seam | [Core](core/Home.md) | | **Contraband** | Contraband | concealment & intake, improvised shivs, Prison-Architect tunnels, warden search, warden corruption | [Contraband](contraband/Home.md) | -| **Justice** | Justice | classification, deterrence feedback, discipline & reform, parole, regime (prisoner recreation) | [Justice](justice/Home.md) | +| **Justice** | Justice | classification, deterrence feedback, discipline & reform, **rehabilitation** (warden reform work + parole), regime | [Justice](justice/Home.md) | | **Justice · Policing** | Policing | colony crime on the spectrum, witnesses, a constable, the weighed arrest, prison riots, recidivism alerts | [Policing](justice/Policing.md) | | **Gangs** | Gangs | gangs as contraband economies — joining, smuggling networks, rivalry, fights-as-crime | [Gangs](gangs/Home.md) | | **Ward** | Ward | psychiatric care — treatment, recovery, discharge, ward neglect, sedation | [Ward](ward/Home.md) | diff --git a/Wiki/justice/Discipline-and-Reform.md b/Wiki/justice/Discipline-and-Reform.md index 05ec249..8fffab2 100644 --- a/Wiki/justice/Discipline-and-Reform.md +++ b/Wiki/justice/Discipline-and-Reform.md @@ -2,6 +2,9 @@ *Punishment as an action, with a self-complete payoff — and the seat of institutionalization.* +> This page is the **maths** — what a disciplinary act does to reform and order. What *drives* it in +> play (a warden's rehabilitation sessions, and neglect that hardens) is [Rehabilitation](Rehabilitation.md). + Punishment in Justice does two things at once, on two different axes: 1. **It deters the colony.** Order seen to be done raises the climate of order for everyone — diff --git a/Wiki/justice/Home.md b/Wiki/justice/Home.md index d42937a..a9abbab 100644 --- a/Wiki/justice/Home.md +++ b/Wiki/justice/Home.md @@ -45,7 +45,7 @@ happened* are fed by its siblings. It grades and gates over all of them. --- -## The five modules +## The six modules | Module | What it does | Page | |---|---|---| @@ -53,9 +53,10 @@ happened* are fed by its siblings. It grades and gates over all of them. | **Deterrence** | The colony's climate of order, moved by crime and punishment, drifting to baseline, read back into propensity. | [Deterrence](Deterrence.md) | | **Discipline & Reform** | Punishment moves the reform score — harden vs. rehabilitate. The seat of institutionalization and recidivism. | [Discipline & Reform](Discipline-and-Reform.md) | | **Parole** | Release when reform, grade, and pardon status line up. | [Parole](Parole.md) | +| **Rehabilitation** | The warden work that DRIVES the corrections arc: a rehabilitate mode + counselling sessions move reform and colony order, a parole alert + release job, and neglect that hardens. | [Rehabilitation](Rehabilitation.md) | | **Regime** | Enables the prisoner recreation (Joy) need via a Harmony postfix, idempotent with Prisoner Recreation. | [Regime](Regime.md) | -Threaded through all five is one small piece of glue, **`JusticeBootstrap`**, which at load fills the +Threaded through all six is one small piece of glue, **`JusticeBootstrap`**, which at load fills the neutral deterrence seam Core leaves open — reconnecting the feedback loop across the mod boundary without Core ever depending on Justice. See [Deterrence](Deterrence.md). diff --git a/Wiki/justice/Parole.md b/Wiki/justice/Parole.md index 3684e90..e4b7971 100644 --- a/Wiki/justice/Parole.md +++ b/Wiki/justice/Parole.md @@ -2,6 +2,10 @@ *Release, driven by what the pawn has become.* +> This page is the release **decision** (`CanRelease`). The warden work that acts on it — the +> "Ready for parole" alert and the release job that frees a parolee back into the colony — is +> [Rehabilitation](Rehabilitation.md). + Parole is the end of the arc, and it is deliberately a *decision*, not a mechanic that rebuilds the game's release flow. It asks one question — **is this pawn ready?** — and answers it from two things already on the record: the reform the sentence earned (or failed to earn), and the grade the record diff --git a/Wiki/justice/Rehabilitation.md b/Wiki/justice/Rehabilitation.md new file mode 100644 index 0000000..0f9c761 --- /dev/null +++ b/Wiki/justice/Rehabilitation.md @@ -0,0 +1,115 @@ +# Rehabilitation — the post-arrest loop, wired + +*The warden work that finally drives discipline, reform, and parole. Source in +`Source/Justice/Corrections/`.* + +Classification, discipline, deterrence, and parole always had their **maths** — a grade over the +record, a reform score punishment moves, an order climate, a release decision. What they lacked was a +**trigger**: nothing in play called them. Reform never moved, so classification never re-graded and +parole never fired; the only thing that raised the colony's order was a punishment nothing invoked. +The post-arrest half of the loop was real code with no way to run it. + +Rehabilitation is that trigger. It gives corrections the same treatment Ward gave psychiatric care — +a **prisoner interaction mode**, **warden jobs**, an **alert**, and an inspect readout — so a warden +actually reforms a prisoner over time and paroles them when they have turned a corner. + +--- + +## The two modes + +Both are non-exclusive prisoner interaction modes (the shape Prison Labor and Ward use), so they +stack with each other and with recruit / reduce-resistance. + +| Mode | What a warden does | Result | +|---|---|---| +| **Rehabilitate** | Runs counselling sessions on the prisoner | Reform rises, the reform track fills, colony order rises | +| **Parole when reformed** | Releases the prisoner **once they are eligible** | A paroled colonist, back in the colony | + +Set **Rehabilitate** alone to run the programme and parole by hand when the alert fires; set **both** +for a hands-off "reform, then release" pipeline. A prisoner flagged for parole who is *not yet* +eligible is simply not acted on — the warden waits. + +--- + +## A rehabilitation session + +A warden walks to the prisoner and counsels them for ~1250 ticks (about 20 in-game minutes), Social +being the active skill. On completion (never on interruption — the credit is a follow-on toil), one +session does three things, in `CorrectionsUtility.RunReformSession`: + +1. **Corrective discipline** — `Discipline.Punish(prisoner, harsh: false)`: reform **+0.10**, and the + punishment is recorded, which raises the colony's **order** by `+0.12`. This is the deterrence-up + half that punishment alone never triggered — visible corrective justice deters everyone else. +2. **The reform track** — `TreatmentProgram.AdvanceRecovery` advances `Institution_Reforming` on + Core's shared treatment engine, by `0.34 × cell quality × skill`. It is the visible progress bar, + and it **decays** (`−0.08/day`), so rehabilitation has to be *sustained*. +3. **A memory** — the prisoner feels counselled (a small mood lift). + +| Input | Range | Source | +|---|---|---| +| skill factor | `0.5 … 1.0` | warden's Social level | +| cell quality | `0.5 … 1.5` | `TreatmentProgram.FacilityQuality` (room impressiveness) | +| reform / session | `+0.10` | `Discipline.Punish` (fixed) | +| order / session | `+0.12` | `Justice.RecordPunishment` | + +Reform reaches the parole bar (`≥ 0.30`) in roughly **three completed sessions**, faster than a bad +cell or a poor counsellor fills the visible track — so the "Ready for parole" alert keys off the real +gate (`Parole.CanRelease`), not the bar. + +--- + +## Neglect — the teeth + +A prisoner you flag for rehabilitation and then never attend **hardens**, exactly as a ward you don't +staff does. `MapComponent_ReformNeglect` measures the days since the last real session; past **two +days** of neglect, reform falls `−0.15/day` and they resent it (a mood hit). The hardening lowers +reform *directly*, not through `Discipline.Punish` — neglect is passive prisonization, not an act of +visible justice, so unlike a session it must **not** raise the colony's order. + +Attend the prisoner and the clock resets; flag them and walk away and they slide back toward the +record that put them in. "A reform programme you don't staff is worse than none." + +--- + +## Parole — the release that stays + +When a rehabilitated prisoner clears `Parole.CanRelease` — reform `≥ 0.30`, security grade +`≤ Medium`, not already pardoned — the **Ready for parole** alert names them. A warden set to Parole +then processes the release (`CorrectionsUtility.ReleaseOnParole`): + +- marks the **pardon** on the record; +- clears the prisoner hold so a former colonist is a **free colonist again** — a parolee who *stays* + in the colony carrying their record, not vanilla's release that ejects them from the map; +- a grateful memory, and a small **+0.03** to order (a lawful release is visible justice too). + +The parolee keeps their `CriminalRecord`, so if they reoffend the [policing](Policing.md) loop catches +them again — recidivism, closing back onto the start. + +--- + +## Seeing it + +A rehabilitated prisoner's inspect pane shows the state directly (a Harmony postfix on +`Pawn.GetInspectString`, via Justice's existing Regime patch — not a contested method): + +> *Rehabilitation: reforming (40%)* · *reformed — ready for parole* · *— neglected (3d)* + +And because the colony's **order climate** otherwise has no readout at all, the same line surfaces it +when it is far enough from ordinary to matter — *Colony order: low (28%) — crime pays here* / *high +(71%) — order holds*. + +--- + +## What this closes + +With rehabilitation wired, the whole post-arrest arc runs in play: **discipline** moves reform, +**classification** re-grades as reform rises, **deterrence** climbs on visible justice (not just +falls on crime), **parole** releases the reformed, and Core's **treatment engine** carries the reform +track the same way it carries Ward's recovery. The loop closes back onto disposition — catching, +reforming, and releasing one pawn moves the climate every other pawn is judged against. + +Gated by `InstitutionSettings.justice`, like the rest of the corrections layer. + +--- + +*Part of the **Institution** suite. AI disclosure: developed with substantial assistance from Claude (Anthropic).*