docs: plan review fixes

This commit is contained in:
Fabian @ Blax Software 2026-12-01 19:18:40 +01:00
parent a02630972e
commit 5652d162fb
3 changed files with 254 additions and 178 deletions

View File

@ -7,7 +7,7 @@
RimWorld mod (1.7) by Blax Gaming. Lawbook, crimes and punishments. Write your colony's laws, and colonists who break them get stopped, jailed and, later, tried in court. Add "Drug binge, wake-up, planning, subdue" and when a colonist starts a wake-up binge, a warden goes for it at once and beats it down; if it reaches a drug first, that dose counts as "did it" and the did-it law applies. Add "Drug binge, did it, jail 5 days" and the one who already took some sits out five days in your prison and walks back to work. Needs Harmony. Works with any DLC combination, core only included. RimWorld mod (1.7) by Blax Gaming. Lawbook, crimes and punishments. Write your colony's laws, and colonists who break them get stopped, jailed and, later, tried in court. Add "Drug binge, wake-up, planning, subdue" and when a colonist starts a wake-up binge, a warden goes for it at once and beats it down; if it reaches a drug first, that dose counts as "did it" and the did-it law applies. Add "Drug binge, did it, jail 5 days" and the one who already took some sits out five days in your prison and walks back to work. Needs Harmony. Works with any DLC combination, core only included.
Status: design. Nothing is built yet; below is what the first release will do. What the whole mod covers and in which order: `docs/features.md`. The specs: `docs/design.md`. Status: design. Nothing is built yet; below is what the first release, the quick first version, will do. What the whole mod covers and in which order: `docs/features.md`. The specs: `docs/design.md`.
## Features ## Features
@ -31,8 +31,7 @@ The catalogue holds hundreds of acts; these are the ones the starter lawbook and
- 🗯️ **Insult.** Every insult by the one who insults; slights are their own entry. Planning for insulting sprees. - 🗯️ **Insult.** Every insult by the one who insults; slights are their own entry. Planning for insulting sprees.
- 🍖 **Ate.** Any food or drug by name, or a group: any meat (meals included), raw meat and corpses, human meat, insect meat, hard drugs. - 🍖 **Ate.** Any food or drug by name, or a group: any meat (meals included), raw meat and corpses, human meat, insect meat, hard drugs.
- 🧾 **Recorded acts, records and bills.** Cut a tree, butchered a human, harvested an organ (most need Ideology); kills, bodies stripped; made a human leather duster, any surgery. - 🧾 **Recorded acts, records and bills.** Cut a tree, butchered a human, harvested an organ (most need Ideology); kills, bodies stripped; made a human leather duster, any surgery.
- 🔪 **Violence.** Assault, harming prisoners or slaves, manslaughter and murder, plus "did it" for tantrums, berserk and rages and for the slaughterer break. Berserk and rages take a warning or guilt; subduing a pawn that fights back comes in a later step. - 💢 **Tantrums and rages.** Planning when the break starts; a warden can subdue a tantrum or a murderous rage, since those pawns don't turn on it. A berserk colonist fights back, so its case takes a warning, guilt or jail, and the jail waits until the break is over or you down it.
- 🚫 **Drugs against the policy.** Any drug the pawn's drug policy doesn't allow, outside binges and player orders.
- 🧮 **No flood.** Acts outside a break open at most one case per colonist and law a day; more acts only raise its count. - 🧮 **No flood.** Acts outside a break open at most one case per colonist and law a day; more acts only raise its count.
### Punishments ### Punishments
@ -42,13 +41,11 @@ The catalogue holds hundreds of acts; these are the ones the starter lawbook and
- 🛑 **Subdue.** A warden beats the offender down with fists to stop the break: bruises on torso and limbs, never the head or a bionic part, no lost parts, no scars, and the beating doesn't hand out the break's catharsis. No warden is pulled off a rescue, a patient or a fire, and nobody is sent while raiders are on the map. `Source/BlaxLaws/JobDriver_Subdue.cs` - 🛑 **Subdue.** A warden beats the offender down with fists to stop the break: bruises on torso and limbs, never the head or a bionic part, no lost parts, no scars, and the beating doesn't hand out the break's catharsis. No warden is pulled off a rescue, a patient or a fire, and nobody is sent while raiders are on the map. `Source/BlaxLaws/JobDriver_Subdue.cs`
- 🔒 **Jail for N days.** Arrested into a prisoner bed, kept on "Maintain only" so no prison mod recruits or enslaves your colonist, released by a warden when the time is served, back to work with its priorities intact. `Source/BlaxLaws/Enforcement.cs` - 🔒 **Jail for N days.** Arrested into a prisoner bed, kept on "Maintain only" so no prison mod recruits or enslaves your colonist, released by a warden when the time is served, back to work with its priorities intact. `Source/BlaxLaws/Enforcement.cs`
- 🔗 **Subdue, then jail.** Beaten down and carried straight to a cell before a doctor takes it to bed. - 🔗 **Subdue, then jail.** Beaten down and carried straight to a cell before a doctor takes it to bed.
- 😔 **Reprimand.** A mood penalty by severity for three days.
- 🚪 **Banish and execute.** Only after you confirm them in a dialog.
### Sentences ### Sentences
- 🛏️ **Back to its own bed.** When the sentence is served the colonist gets back its bed, grave, throne, deathrest casket, ideoligion role, its mechs' work modes and the weapon the arrest made it drop. A thing someone else claimed meanwhile stays theirs, and the letter says so. - ⏳ **Served and released.** The colonist sits out its days on "Maintain only", a warden lets it out when the time is served, and another mod's early release closes the sentence instead of fighting it.
- 🕊️ **Pardon, early release, more days.** On any jailed case, from the case log. - ⏸️ **Role holders and mechanitors wait.** An arrest would take an ideoligion role and shut a mechanitor's mechs down, so their case waits with "Arrest now" and a letter says why.
### Save and settings ### Save and settings
@ -59,21 +56,24 @@ The catalogue holds hundreds of acts; these are the ones the starter lawbook and
The whole plan, by area, with the order and the reasons: `docs/features.md`. Coming after the first release: The whole plan, by area, with the order and the reasons: `docs/features.md`. Coming after the first release:
- 🥊 **Subdue a pawn that fights back.** Berserk and rages get subdued too, by an enforcer at least as good at melee. - 🔪 **Violence, next.** Assault, harming prisoners or slaves, manslaughter and murder, plus "did it" for tantrums, berserk, rages and the slaughterer break; drugs the pawn's drug policy doesn't allow.
- 🏛️ **Court.** "Trial" as a punishment through Ideology's trial, then court sessions without any DLC: a judge, a prosecutor and spectators at a place you pick, a verdict that weighs evidence against Social skill, the sentence from your lawbook, and if you want a court that sits on its own at a set hour. Then attorneys, witnesses and a guilty plea, trials over up to three days, courtrooms and appeals. - 🛏️ **Back to its own bed.** When the sentence is served the colonist gets back its bed, grave, throne, deathrest casket, ideoligion role, its mechs' work modes and the weapon the arrest made it drop, so role holders and mechanitors no longer wait. With it: pardon, early release and more days, a reprimand, and banish or execute after you confirm.
- 🗳️ **Colony votes.** The colony elects its judge, with terms, by-elections and recalls; colonists propose and repeal laws and vote by traits, beliefs, opinion and mood, and you back or veto the result; later a jury and pardon petitions. - 🏛️ **Court.** "Trial" as a punishment through Ideology's trial, then court sessions without any DLC: a judge, a prosecutor and spectators at a place you pick, a verdict that weighs evidence against Social skill, the sentence from your lawbook, "jail, then trial" for an offender you want locked up until the verdict, and if you want a court that sits on its own at a set hour. Then attorneys, witnesses and a guilty plea, trials over up to three days, courtrooms and appeals.
- 🗳️ **Colony votes.** Colonists propose and repeal laws and vote by traits, beliefs, opinion and mood, and you back or veto the result; the colony elects its judge, with terms, by-elections and recalls; later a jury and pardon petitions.
- 📈 **Repeat offenders.** A criminal record per colonist, harsher punishments for a repeat offence, and early release on probation. - 📈 **Repeat offenders.** A criminal record per colonist, harsher punishments for a repeat offence, and early release on probation.
- 🧑‍⚖️ **Your call.** Decide a case yourself instead of a fixed punishment, talk a colonist down instead of beating it, and laws for one group only: slaves, children, a caste, or a colonist above the law.
- 📚 **Lawbook templates.** Take your lawbook to the next colony. - 📚 **Lawbook templates.** Take your lawbook to the next colony.
- 🚨 **Uprisings.** Prison breaks and slave rebellions as crimes. - 🚨 **Uprisings.** Your own convicts breaking out, and slave rebellions, as crimes.
- 🙏 **Crimes against the faith.** One law for anything a colonist's own ideoligion forbids, and apostasy (Ideology). - 🙏 **Crimes against the faith.** One law for anything the colony's ideoligion forbids, and one for leaving it (Ideology).
- 🤝 **With the other Blax mods.** Blax Castes keeps a convict's caste through any sentence, jailed slaves become slaves again, and an indenture as a sentence through Blax Slaves (both still Fabian's call). - 🥊 **Subdue a pawn that fights back.** For a berserk colonist, you pick the fighter and Laws sends it.
- 🤝 **With the other Blax mods.** Blax Castes keeps a convict's caste through any sentence, Blax Slaves' wardens calm slaves before Laws steps in, jailed slaves become slaves again, and a confinement sentence through a Blax Castes caste (the last two still Fabian's call).
## DLC support ## DLC support
Blax Laws works with any combination of DLCs, core only included, and lists none as a dependency. Every category and punishment of the first release runs on the core game; the throne, deathrest casket, role and mech parts of the release give-back switch off without their DLC. The act list shows what your game has: a DLC's breaks, drugs and recipes appear when it's active. Blax Laws works with any combination of DLCs, core only included, and lists none as a dependency. Every category and punishment of the first release runs on the core game; later, the throne, deathrest casket, role and mech parts of the release give-back switch off without their DLC. The act list shows what your game has: a DLC's breaks, drugs and recipes appear when it's active.
- **Ideology** adds slaves, who can be warned, marked guilty and subdued. An arrest takes a role holder's role; the release gives it back. - **Ideology** adds slaves, who can be warned, marked guilty and subdued. An arrest takes a role holder's role, so its case waits for "Arrest now" until the give-back returns the role at the release.
- **Biotech** adds children, who are never beaten, and mechanitors, whose mechs shut down while they sit in jail and go back to their work modes at the release. - **Biotech** adds children, who are never beaten, and mechanitors, whose mechs shut down in jail; their case waits for "Arrest now" until the give-back returns the mechs to their work modes.
- **Ideology** also records most of the game's acts (cut a tree, butchered a human); without it the recorded acts category rarely fires. - **Ideology** also records most of the game's acts (cut a tree, butchered a human); without it the recorded acts category rarely fires.
- **Royalty**, **Anomaly** and **Odyssey**: their acts appear in the list when active; Laws needs none of them. - **Royalty**, **Anomaly** and **Odyssey**: their acts appear in the list when active; Laws needs none of them.
- **A save made with a DLC** loads without it. - **A save made with a DLC** loads without it.

View File

@ -4,6 +4,16 @@ Write a lawbook and the colony enforces it. Add "Drug binge, wake-up, planning,
Status: design, no code yet. Checked against the RimWorld 1.7.5021 game code on 2026-11-30; the act catalogue (2026-12-01) was checked against the 1.7.5021 reference assemblies, which have every signature and no method bodies, so its behaviour claims are listed under "To verify" until the decompiled code confirms them. RimWorld 1.7, package id `blax.laws`. From the first release a plain unsubscribe leaves a save that loads: jailed colonists stay vanilla prisoners and the log shows 2 errors. Status: design, no code yet. Checked against the RimWorld 1.7.5021 game code on 2026-11-30; the act catalogue (2026-12-01) was checked against the 1.7.5021 reference assemblies, which have every signature and no method bodies, so its behaviour claims are listed under "To verify" until the decompiled code confirms them. RimWorld 1.7, package id `blax.laws`. From the first release a plain unsubscribe leaves a save that loads: jailed colonists stay vanilla prisoners and the log shows 2 errors.
Changes on 2026-12-01, plan review (the feature plan checked against the decompiled 1.7 code):
- First release cut back to the quick MVP Fabian asked for: the lawbook, the catalogue with its breaks and special acts, warn, guilty, subdue, jail and serving the sentence with the hold for role holders and mechanitors. Violence, slaughterers, drugs against the policy, reprimand, banish and execute, the give-back and pardon follow as the next release. The areas stay as they were; `docs/features.md` "Order" says which part ships when.
- Breaks: the line is now a state hostile to the colony (`MentalState.ForceHostileTo(Faction.OfPlayer)`, only berserk-type states in vanilla), not `IsAggro`. Tantrums, murderous and sadistic rage and slaughterers can be arrested (Verse.AI/GenAI.cs:83) and get every break punishment, Subdue included. A berserk case takes Warn, Guilty or Jail, and the jail waits until the break ends or the pawn is down. "Subdue for aggressive breaks" became "Subdue a pawn that fights back": never automatic, the player picks the fighter.
- One act, one case keeps the break case, but when the act also matches a row of its own (a murder during a murderous rage), the row with the higher severity decides.
- Violence: melee hits carry no intended target, so friendly fire is only a hit whose intended target is set and isn't the victim; a death without an attacker (bleeding out, infection) turns the victim's recent assault case into manslaughter.
- Hooks: bills are caught by a postfix on `RecordsUtility.Notify_BillDone`, not the empty, inlinable `Bill.Notify_IterationCompleted`; `CompUsable.UsedBy` files only for a pawn using the item on its own job; Ate counts a drink at a gathering spot.
- Court: our own convene window, since `Dialog_BeginLordJob` needs an installed DLC; judge and speakers stand on `ArriveToCell`, since Core's GiveSpeech duty needs a throne; courtrooms read impressiveness instead of adding a room role; custody sets guilt for the arrest and clears it at the capture; new punishment "Jail, then trial"; an acting judge from court sessions on; the repeat term reads the criminal record.
- Plan: colony votes start with the voting core and law votes, which need no court; the criminal record comes before court sessions; prison breaks cover only Laws' own convicts; jail for slaves skips indentured slaves; crimes against the faith read the colony's ideoligion and every precept comp with a bad thought, and apostasy is the `ChangedIdeo` event. New: "Applies to", talk down, decide myself, Slaves' wardens first, confinement through Castes. Indenture as a sentence moved to the ideas.
Changes on 2026-12-01, the feature plan (Fabian, 2026-12-01: plan the whole mod, chunked by what belongs together, never by time or size): Changes on 2026-12-01, the feature plan (Fabian, 2026-12-01: plan the whole mod, chunked by what belongs together, never by time or size):
- `docs/features.md` is the new plan of record for scope and order: seven areas (lawbook, crimes, enforcement and punishments, sentences, repeat offenders, court, colony votes), each with steps only where a part needs another part, a sibling feature or a decision first. This file keeps the specs. "At a glance" is a table by area, "Releases" became "Areas and steps", and day counts and totals are gone; per-feature S, M and L marks stay as information. Version numbers in the dated notes below refer to the old cut. - `docs/features.md` is the new plan of record for scope and order: seven areas (lawbook, crimes, enforcement and punishments, sentences, repeat offenders, court, colony votes), each with steps only where a part needs another part, a sibling feature or a decision first. This file keeps the specs. "At a glance" is a table by area, "Releases" became "Areas and steps", and day counts and totals are gone; per-feature S, M and L marks stay as information. Version numbers in the dated notes below refer to the old cut.
@ -16,7 +26,7 @@ Changes on 2026-12-01, the act catalogue (Fabian, 2026-11-30: the crimes he name
- A law's Action is now an entry of the act catalogue: seven categories built from the loaded defs when the game starts (mental breaks, ate, used, social interactions, recorded acts, records, bills) plus a short list of special acts that need their own hook (set a fire, displayed a corpse, started a social fight). Each category also offers group entries (any drug, hard drugs, human meat, any surgery and so on). DLC and modded defs show up with no patch, labelled with the mod they come from. - A law's Action is now an entry of the act catalogue: seven categories built from the loaded defs when the game starts (mental breaks, ate, used, social interactions, recorded acts, records, bills) plus a short list of special acts that need their own hook (set a fire, displayed a corpse, started a social fight). Each category also offers group entries (any drug, hard drugs, human meat, any surgery and so on). DLC and modded defs show up with no patch, labelled with the mod they come from.
- The six crimes are gone as a type. Their detection stays and now serves the categories; the old crimes are starter lawbook rows and links between a break and its act. - The six crimes are gone as a type. Their detection stays and now serves the categories; the old crimes are starter lawbook rows and links between a break and its act.
- "Did it" for a break comes from a link table by mental state class: a dose during a drug binge, a meal during a food binge, a fire during a fire-starting spree, a displayed corpse during a corpse obsession, an insult during an insulting spree, a jailbreak talk during a jailbreaker break. A modded break that reuses a vanilla class gets its link too. Every other break offers Planning only until a later release links it. - "Did it" for a break comes from a link table by mental state class: a dose during a drug binge, a meal during a food binge, a fire during a fire-starting spree, a displayed corpse during a corpse obsession, an insult during an insulting spree, a jailbreak talk during a jailbreaker break. A modded break that reuses a vanilla class gets its link too. Every other break offers Planning only until a later release links it.
- Aggressive breaks (berserk, murderous rage and the rest with `IsAggro`) are in the catalogue from 1.0 but offer Warn and Guilty only: subdue would walk an unarmed warden into a pawn that fights back, and vanilla refuses to arrest them. - Aggressive breaks (berserk, murderous rage and the rest with `IsAggro`) are in the catalogue from 1.0 but offer Warn and Guilty only: subdue would walk an unarmed warden into a pawn that fights back, and vanilla refuses to arrest them. (Corrected by the plan review above: vanilla refuses the arrest only for states hostile to the arrester, berserk in vanilla.)
- One act, one case: an act that is the did-it of an open break case belongs to that case; otherwise each category's most specific enabled row decides. Rows of different categories that can catch the same act get an overlap hint in the editor. - One act, one case: an act that is the did-it of an open break case belongs to that case; otherwise each category's most specific enabled row decides. Rows of different categories that can catch the same act get an overlap hint in the editor.
- New hooks: `Pawn_RecordsTracker.Increment` and `AddTo`, `HistoryEventsManager.RecordEvent`, `Notify_IterationCompleted` on the bill classes, `CompUsable.UsedBy`. Hook D (`CompDrug.PostIngested`) is dropped, since hook C sees every dose. - New hooks: `Pawn_RecordsTracker.Increment` and `AddTo`, `HistoryEventsManager.RecordEvent`, `Notify_IterationCompleted` on the bill classes, `CompUsable.UsedBy`. Hook D (`CompDrug.PostIngested`) is dropped, since hook C sees every dose.
- Plan: 1.0 takes 12 days instead of 10 (the picker and the category workers). 1.8 shrinks from 3 days to 2: food binges, jailbreakers, desertion and slaughterers are breaks in the 1.0 catalogue. The plan is 50 days. - Plan: 1.0 takes 12 days instead of 10 (the picker and the category workers). 1.8 shrinks from 3 days to 2: food binges, jailbreakers, desertion and slaughterers are breaks in the 1.0 catalogue. The plan is 50 days.
@ -48,13 +58,13 @@ What the mod covers, by area. Which area and step comes first, and why: `docs/fe
| Area | What players get | Needs | Replaces | | Area | What players get | Needs | Replaces |
|---|---|---|---| |---|---|---|---|
| Lawbook | An empty Laws tab. Add a law as Action, Stage, Severity, Punishment and Days, or press "Starter lawbook". The Action comes from a searchable catalogue built from the game's defs. A case log. Later: lawbook templates across saves | None | Rimworld Law and Order (419, 1.6 only, needs Ideology) | | Lawbook | An empty Laws tab. Add a law as Action, Stage, Severity, Punishment and Days, or press "Starter lawbook". The Action comes from a searchable catalogue built from the game's defs. A case log. Later: lawbook templates across saves, laws for one group of pawns | None (castes: Blax Castes) | Rimworld Law and Order (419, 1.6 only, needs Ideology) |
| Crimes | Every mental break, everything eaten or used, every social interaction, every recorded act and record, every bill, plus fire setting, corpse display, social fights, assault, harming prisoners or slaves, manslaughter, murder, slaughterers and drugs against the policy, DLC and modded content included. Later: prison breaks and slave rebellions, crimes against the faith | None (slaves, most recorded acts, slave rebellion, faith: Ideology) | Law and Order's crimes, its sabotage crime partly. Covers "arrest my own pawn for assault" and "reprimand my own pawn" asked on Prisoner Sentencing (1.3k) and "colonists commit small crimes and get caught" asked on RimCourt (8.8k) | | Crimes | Every mental break, everything eaten or used, every social interaction, every recorded act and record, every bill, plus fire setting, corpse display, social fights, assault, harming prisoners or slaves, manslaughter, murder, slaughterers and drugs against the policy, DLC and modded content included. Later: prison breaks by Laws' own convicts and slave rebellions, crimes against the faith | None (slaves, most recorded acts, slave rebellion, faith: Ideology) | Law and Order's crimes, its sabotage crime partly. Covers "arrest my own pawn for assault" and "reprimand my own pawn" asked on Prisoner Sentencing (1.3k) and "colonists commit small crimes and get caught" asked on RimCourt (8.8k) |
| Enforcement and punishments | Warn, guilty for N days, subdue (a capped beating that stops a break and never kills), jail, subdue then jail, reprimand, banish and execute after confirmation. Later: subdue for aggressive breaks | None (children never beaten: Biotech) | Arresting your own colonist mid-break by hand, which Arrest and Release (4.6k, no 1.7) exists for | | Enforcement and punishments | Warn, guilty for N days, subdue (a capped beating that stops a break and never kills), jail, subdue then jail, reprimand, banish and execute after confirmation. Later: talk down, decide myself, Slaves' wardens first for slaves, subdue a pawn that fights back | None (children never beaten: Biotech) | Arresting your own colonist mid-break by hand, which Arrest and Release (4.6k, no 1.7) exists for |
| Sentences | Sentences served on Maintain only and released by a warden. Release gives back the bed, grave, throne, deathrest casket, ideoligion role, mech work modes and the dropped weapon. Pardon, early release, add days. Later, with the sibling mods: Blax Castes keeps the caste, jail for slaves, indenture as a sentence | None (role: Ideology; throne: Royalty; casket, mechs: Biotech; slaves: Ideology) | Custom Guilt Duration for colonists (3.4k, no 1.7), Guilty! (302, 1.6) | | Sentences | Sentences served on Maintain only and released by a warden. Release gives back the bed, grave, throne, deathrest casket, ideoligion role, mech work modes and the dropped weapon. Pardon, early release, add days. Later, with the sibling mods: Blax Castes keeps the caste, jail for slaves, confinement through Blax Castes | None (role: Ideology; throne: Royalty; casket, mechs: Biotech; slaves: Ideology) | Custom Guilt Duration for colonists (3.4k, no 1.7), Guilty! (302, 1.6) |
| Repeat offenders | A criminal record per pawn, escalating punishments for repeat offences, probation. New, not specced | None | None; parole like Prison Expanded's (3.3k) for colonists | | Repeat offenders | A criminal record per pawn, escalating punishments for repeat offences, probation. New, not specced | None | None; parole like Prison Expanded's (3.3k) for colonists |
| Court | "Trial" as a punishment through Ideology's trial. Court sessions on the core game: an appointed judge, a prosecutor and spectators at a place you pick, a verdict that weighs evidence against Social skill, the sentence from the lawbook, a court hour, a removal button. Attorneys, witnesses and a guilty plea. Trials over 1 to 3 days, courtrooms, appeals | None (Ideology's trial: Ideology) | The vanilla trial as the only court (Ideology), Law and Order's trials | | Court | "Trial" as a punishment through Ideology's trial. Court sessions on the core game: an appointed judge, a prosecutor and spectators at a place you pick, a verdict that weighs evidence against Social skill, the sentence from the lawbook, "Jail, then trial", an acting judge, a court hour, a removal button. Attorneys, witnesses and a guilty plea. Trials over 1 to 3 days, courtrooms, appeals | None (Ideology's trial: Ideology) | The vanilla trial as the only court (Ideology), Law and Order's trials |
| Colony votes | A voting core, an elected judge with terms, by-elections and recalls (or the leader or moral guide with Ideology), law votes with back and veto, a jury and pardon petitions | None (leader as judge, precept stances: Ideology) | None; overlaps Rimocracy (6.3k), which elects leaders and votes on its decisions | | Colony votes | A voting core, law votes with back and veto, pardon petitions, an elected judge with terms, by-elections and recalls (or the leader or moral guide with Ideology), a jury | None (leader as judge, precept stances: Ideology) | None; overlaps Rimocracy (6.3k), which elects leaders and votes on its decisions |
Subscriber counts are current subscribers from the Steam Web API (GetPublishedFileDetails), read on 2026-11-30; "no 1.7" means the item has no 1.7 tag. Needs: "None" means the area runs on the core game, and a DLC in brackets marks the parts that switch off without it (see "DLC support"). Effort marks on features (S = 0.5 days, M = 2, L = 5) are information only; they decide nothing about grouping. Subscriber counts are current subscribers from the Steam Web API (GetPublishedFileDetails), read on 2026-11-30; "no 1.7" means the item has no 1.7 tag. Needs: "None" means the area runs on the core game, and a DLC in brackets marks the parts that switch off without it (see "DLC support"). Effort marks on features (S = 0.5 days, M = 2, L = 5) are information only; they decide nothing about grouping.
@ -69,21 +79,21 @@ Change if you disagree.
- Action, Option and Stage together are a row's key: the editor refuses a second row with the same three and jumps to the existing one. Option exists only for drug binges (which drug counts as "did it": any, hard, social or one chemical). When several enabled rows of one category match an act, the most specific wins: a single def over a group over the category's "any"; for binges one chemical over hard or social drugs over any drug. The starter rows plus "drug binge, wake-up, did it, jail 10 days" give a wake-up binger one case and 10 days. - Action, Option and Stage together are a row's key: the editor refuses a second row with the same three and jumps to the existing one. Option exists only for drug binges (which drug counts as "did it": any, hard, social or one chemical). When several enabled rows of one category match an act, the most specific wins: a single def over a group over the category's "any"; for binges one chemical over hard or social drugs over any drug. The starter rows plus "drug binge, wake-up, did it, jail 10 days" give a wake-up binger one case and 10 days.
- Stages: "Planning" (the break has started, nothing done yet) and "Did it". Only break entries have Planning, since the game decides the break type at the moment the break starts and never earlier. A break has "Did it" only when the link table names its act (see "Act catalogue and detection"); every other entry is "Did it" only. No guessing from mood or traits. - Stages: "Planning" (the break has started, nothing done yet) and "Did it". Only break entries have Planning, since the game decides the break type at the moment the break starts and never earlier. A break has "Did it" only when the link table names its act (see "Act catalogue and detection"); every other entry is "Did it" only. No guessing from mood or traits.
- Severity is Minor, Moderate, Serious or Grave. It sets the default days (1, 3, 5, 10), orders the case log and weighs in court. Days go from 1 to 50, so a sentence plus the release walk stays inside Blax Castes' default memory of the old caste (60 days). - Severity is Minor, Moderate, Serious or Grave. It sets the default days (1, 3, 5, 10), orders the case log and weighs in court. Days go from 1 to 50, so a sentence plus the release walk stays inside Blax Castes' default memory of the old caste (60 days).
- Core punishments: Warn, Guilty for N days, Subdue, Jail for N days, Subdue then jail. Reprimand, Banish and Execute join them in the same step (see their sections). Planning offers Warn, Subdue and Jail. A break's Did it offers all five. Every entry outside the breaks offers Warn, Guilty and Jail. Subdue acts only while the offender is still in its break; after the break a Subdue row warns and a Subdue then jail row jails. - Punishments: the first release has Warn, Guilty for N days, Subdue, Jail for N days and Subdue then jail; Reprimand, Banish and Execute come in the next release, Trial and "Jail, then trial" with the court. Which entry and stage offers which: the table in "Lawbook tab". Subdue acts only while the offender is still in its break; after the break a Subdue row warns and a Subdue then jail row jails.
- Aggressive breaks (`MentalStateDef.IsAggro`: berserk, murderous rage, sadistic rage and modded ones) offer only Warn and Guilty until "Subdue for aggressive breaks" is built. A berserk pawn fights back, so a subdue would walk an unarmed warden into a fight, and vanilla refuses to arrest a berserk pawn. Guilty still makes the vanilla capture after you down it certain and an execution justified. That step adds subdue for them with the enforcer's Melee weighed. - Breaks hostile to the colony (the live state's `ForceHostileTo(Faction.OfPlayer)` is true: berserk and berserk warcall in vanilla, Verse.AI/MentalState_Berserk.cs:12-15) offer Warn, Guilty and Jail, never Subdue: the pawn fights back, and vanilla refuses to arrest it (Verse.AI/GenAI.cs:83). Its Jail waits until the break ends or you down it, then arrests or captures it; guilt makes both certain (Verse.AI/GenAI.cs:59-66). Every other break, the aggressive ones included (tantrums, murderous and sadistic rage, slaughterer: `IsAggro` but arrestable and never aimed at the enforcer), offers the full break list. "Subdue a pawn that fights back" (Enforcement, step 3) adds a subdue for hostile breaks that the player starts.
- One case per incident. A binge is one case from its start to its end; it moves from planning to did it, and each row fires once per case. A dose count and notes ("on a table", "dug up from a grave") go into the case. - One case per incident. A binge is one case from its start to its end; it moves from planning to did it, and each row fires once per case. A dose count and notes ("on a table", "dug up from a grave") go into the case.
- One act, one case. An act that is the did-it of an open break case (a dose during the binge) belongs to that case, and no other row opens a second case for it. Outside a break each category files its own case, so "Ate: wake-up" and "Recorded acts: ingested a drug" (Ideology) both catch a dose; the editor shows an overlap hint on rows of different categories that can catch the same act. - One act, one case. An act that is the did-it of an open break case (a dose during the binge) belongs to that case, and no other row opens a second case for it. When the act also matches a row of its own (a murder during a murderous rage, a dose under "Ate: wake-up"), the case carries out the row with the higher severity, the break's row on a tie, so a "Murder: jail 10 days, Grave" row still applies to the most common colony murder. Outside a break each category files its own case, so "Ate: wake-up" and "Recorded acts: ingested a drug" (Ideology) both catch a dose; the editor shows an overlap hint on rows of different categories that can catch the same act.
- One enforcement per case. A later stage's punishment replaces an unfinished earlier one: a did-it Jail that arrives while the planning subdue still runs ends the subdue, and the same enforcer starts the arrest, or the capture if the offender is already down (Verse.AI/GenAI.cs:39-67). Warn and Guilty run alongside. - One enforcement per case. A later stage's punishment replaces an unfinished earlier one: a did-it Jail that arrives while the planning subdue still runs ends the subdue, and the same enforcer starts the arrest, or the capture if the offender is already down (Verse.AI/GenAI.cs:39-67). Warn and Guilty run alongside.
- Every act outside a break opens at most one case per offender and law per day (setting, 0 to 7 days). A further act inside that window raises the count on that case and posts no message, so a feud, a meat-eating colony of 60 or a "Records: things hauled" row doesn't flood the log or the save. - Every act outside a break opens at most one case per offender and law per day (setting, 0 to 7 days). A further act inside that window raises the count on that case and posts no message, so a feud, a meat-eating colony of 60 or a "Records: things hauled" row doesn't flood the log or the save.
- Who the laws cover: free colonists, children included, and colony slaves. Never guests, Hospitality visitors, quest lodgers, prisoners or babies. Slaves get Warn, Guilty and Subdue; jail comes with "Jail for slaves" (Sentences, step 2). - Who the laws cover: free colonists, children included, and colony slaves. Never guests, Hospitality visitors, quest lodgers, prisoners (Laws' own convicts only for a prison break, Crimes step 2) or babies. Slaves get Warn, Guilty and Subdue; jail comes with "Jail for slaves" (Sentences, step 2).
- Children (Biotech) are never beaten: Subdue on a child becomes Jail when the row has days, otherwise Warn. - Children (Biotech) are never beaten: Subdue on a child becomes Jail when the row has days, otherwise Warn.
- Player orders are exempt: an act done while drafted or on a player-forced job opens no case (setting). - Player orders are exempt: an act done while drafted or on a player-forced job opens no case (setting).
- Who enforces: the nearest awake free colonist with Warden work active who can do the job (violence for subdue, manipulation for an arrest), then anyone able. Never a slave, a child, the offender, a pawn in a break, a pawn on a player order, a pawn in a party or ritual, or a pawn on a job that must not be dropped: rescuing, carrying or tending someone, fighting a fire, manning a turret, surgery, fleeing. - Who enforces: the nearest awake free colonist with Warden work active who can do the job (violence for subdue, manipulation for an arrest), then anyone able. Never a slave, a child, the offender, a pawn in a break, a pawn on a player order, a pawn in a party or ritual, or a pawn on a job that must not be dropped: rescuing, carrying or tending someone, fighting a fire, manning a turret, surgery, fleeing.
- Laws starts the enforcer's job at once, interrupting what it does. Law enforcement is urgent; a binge's first dose comes as soon as the pawn reaches a drug, and the binge goes for the closest drug on the map (RimWorld/JobGiver_Binge.cs:17; RimWorld/JobGiver_BingeDrug.cs:83). The one exception is danger: while hostiles threaten the map, nobody is sent, the case waits and the sweep retries after the fight. - Laws starts the enforcer's job at once, interrupting what it does. Law enforcement is urgent; a binge's first dose comes as soon as the pawn reaches a drug, and the binge goes for the closest drug on the map (RimWorld/JobGiver_Binge.cs:17; RimWorld/JobGiver_BingeDrug.cs:83). The one exception is danger: while hostiles threaten the map, nobody is sent, the case waits and the sweep retries after the fight. A colonist in a berserk break counts as such a threat, so cases on its map wait until it ends or is downed.
- Subdue hits torso and limbs only, never the head or a bionic part, with capped blunt damage that leaves bruises, and stops at downed or once three hits in a row add no pain (go-juice, painkillers). The subdued pawn loses the Catharsis that ending its break would give (setting), so the beating doesn't reward the crime. - Subdue hits torso and limbs only, never the head or a bionic part, with capped blunt damage that leaves bruises, and stops at downed or once three hits in a row add no pain (go-juice, painkillers). The subdued pawn loses the Catharsis that ending its break would give (setting), so the beating doesn't reward the crime.
- Jail convicts through vanilla guilt for the sentence length, renewed right before the arrest. While it lasts the arrest of a free colonist is always accepted. Executing a guilty colonist costs the colony only the -2 "justified execution" thought (ideoligion precepts may change it) plus its family's grief; banishing it costs no colony-wide thought, though banishing it to its death still grieves its family. - Jail convicts through vanilla guilt for the sentence length, renewed right before the arrest. While it lasts the arrest of a free colonist is always accepted. Executing a guilty colonist costs the colony only the -2 "justified execution" thought (ideoligion precepts may change it) plus its family's grief; banishing it costs no colony-wide thought, though banishing it to its death still grieves its family.
- A jailed colonist is set to "Maintain only" two ticks after the capture, after any default a prison mod or Blax Castes writes, so no default recruits, enslaves or executes it. When the sentence is served Laws sets "Release" and a warden walks it out; if nobody has after a day, Laws releases it in place. - A jailed colonist is set to "Maintain only" two ticks after the capture, after any default a prison mod or Blax Castes writes, so no default recruits, enslaves or executes it. When the sentence is served Laws sets "Release" and a warden walks it out; if nobody has after a day, Laws releases it in place.
- Role holders (Ideology) and mechanitors with mechs (Biotech) aren't jailed automatically while "Release gives back what jail took" is switched off, because arrest takes the role and shuts the mechs down. The case waits with an "Arrest now" button and a letter says why. With that feature on (it ships in the same first release) both come back after the release and the hold drops. - Role holders (Ideology) and mechanitors with mechs (Biotech) aren't jailed automatically while "Release gives back what jail took" is switched off, because arrest takes the role and shuts the mechs down. The case waits with an "Arrest now" button and a letter says why. The first release ships with this hold; with the give-back on (the next release) both come back after the release and the hold drops.
- Messages for every case. Letters only when a colonist is jailed or you have to act: no prisoner bed, no enforcer, a role holder on hold. The vanilla break letter already arrives, so Laws never sends a second letter for a break. - Messages for every case. Letters only when a colonist is jailed or you have to act: no prisoner bed, no enforcer, a role holder on hold. The vanilla break letter already arrives, so Laws never sends a second letter for a break.
- "Enforce laws" switched off keeps the case log running and carries out nothing. - "Enforce laws" switched off keeps the case log running and carries out nothing.
- Laws adds no crime events and no mental breaks. It only watches what the game does anyway; Law and Order was called useless after its crime events flooded a commitment save. - Laws adds no crime events and no mental breaks. It only watches what the game does anyway; Law and Order was called useless after its crime events flooded a commitment save.
@ -112,7 +122,7 @@ All state lives in one `GameComponent_BlaxLaws`. Laws are colony policy across e
### The act catalogue is built from the game's defs, saved as names ### The act catalogue is built from the game's defs, saved as names
- Laws defines no crime list of its own. `ActCategoryDef` (our own Def type, seven of them: Break, Ate, Used, Interaction, RecordedAct, Record, Bill) names an `ActCategoryWorker` that reads the loaded defs once, after def loading, and returns the category's entries: one per def plus its group entries. `ActDef` (our own Def type) is a special act with its own hook and `ActWorker`: SetFire, DisplayedCorpse, StartedSocialFight, the violent acts and the slaughterer's kill in the first release, prison break and slave rebellion with the uprisings. `BreakLinkDef` (our own Def type) names a mental state class and the act that counts as its "did it" (see "Act catalogue and detection"). `PunishmentDef` with label, the stages and entry kinds it fits, and a `PunishmentWorker`. The first release ships them in `Defs/BlaxLaws_Categories.xml`, `BlaxLaws_Acts.xml`, `BlaxLaws_BreakLinks.xml` and `BlaxLaws_Punishments.xml`. Another mod can add a `BreakLinkDef` for its own break class with no code. - Laws defines no crime list of its own. `ActCategoryDef` (our own Def type, seven of them: Break, Ate, Used, Interaction, RecordedAct, Record, Bill) names an `ActCategoryWorker` that reads the loaded defs once, after def loading, and returns the category's entries: one per def plus its group entries. `ActDef` (our own Def type) is a special act with its own hook and `ActWorker`: SetFire, DisplayedCorpse and StartedSocialFight in the first release, the violent acts and the slaughterer's kill with "Violence" and "Slaughterers", prison break and slave rebellion with the uprisings. `BreakLinkDef` (our own Def type) names a mental state class and the act that counts as its "did it" (see "Act catalogue and detection"). `PunishmentDef` with label, the stages and entry kinds it fits, and a `PunishmentWorker`. The first release ships them in `Defs/BlaxLaws_Categories.xml`, `BlaxLaws_Acts.xml`, `BlaxLaws_BreakLinks.xml` and `BlaxLaws_Punishments.xml`. Another mod can add a `BreakLinkDef` for its own break class with no code.
- `ActCatalogue` holds the entries: key, label, icon, source mod (`def.modContentPack`, shown as "Core", the DLC's name or the mod's name), category, the stages and punishments the entry offers. It is built once per game start (a few thousand entries with a large mod list; the picker searches it, nothing else walks it) and never saved. - `ActCatalogue` holds the entries: key, label, icon, source mod (`def.modContentPack`, shown as "Core", the DLC's name or the mod's name), category, the stages and punishments the entry offers. It is built once per game start (a few thousand entries with a large mod list; the picker searches it, nothing else walks it) and never saved.
- The save names entries only as strings: the act key, resolved through the catalogue. A row whose entry is missing (a DLC drug without its DLC, a removed mod's interaction) stays in the book with its saved label and mod, shows "Needs <DLC>" or "Missing: <mod>" and isn't enforced. It works again when the mod comes back. - The save names entries only as strings: the act key, resolved through the catalogue. A row whose entry is missing (a DLC drug without its DLC, a removed mod's interaction) stays in the book with its saved label and mod, shows "Needs <DLC>" or "Missing: <mod>" and isn't enforced. It works again when the mod comes back.
- The lawbook UI reads the stage list from the entry, so an entry without a planning stage never offers one. - The lawbook UI reads the stage list from the entry, so an entry without a planning stage never offers one.
@ -131,10 +141,10 @@ All state lives in one `GameComponent_BlaxLaws`. Laws are colony policy across e
- F. `Pawn_InteractionsTracker.StartSocialFight` (RimWorld/Pawn_InteractionsTracker.cs:373): a message, two 9-argument `TryStartMentalState` calls and a tale. Special act StartedSocialFight. - F. `Pawn_InteractionsTracker.StartSocialFight` (RimWorld/Pawn_InteractionsTracker.cs:373): a message, two 9-argument `TryStartMentalState` calls and a tale. Special act StartedSocialFight.
- I. `Verb_Ignite.TryCastShot` (RimWorld/Verb_Ignite.cs:12), a protected override reached only through the virtual verb call. Special act SetFire. - I. `Verb_Ignite.TryCastShot` (RimWorld/Verb_Ignite.cs:12), a protected override reached only through the virtual verb call. Special act SetFire.
- J. `MentalState_CorpseObsession.MentalStateTick` (Verse.AI/MentalState_CorpseObsession.cs:18), a virtual override that runs only for obsessed pawns. Special act DisplayedCorpse. - J. `MentalState_CorpseObsession.MentalStateTick` (Verse.AI/MentalState_CorpseObsession.cs:18), a virtual override that runs only for obsessed pawns. Special act DisplayedCorpse.
- U. `CompUsable.UsedBy(Pawn p)`, public virtual (signature in the 1.7.5021 reference assembly). Used category. Patched on `CompUsable` and on every subclass that overrides it, found by reflection at startup, with a per-call depth guard so an override that calls base files once. - U. `CompUsable.UsedBy(Pawn p)`, public virtual, prefix and postfix (RimWorld/CompUsable.cs:161). Used category. It runs from `JobDriver_UseItem` (RimWorld/JobDriver_UseItem.cs:95-96), from `IngestionOutcomeDoer_UseThing` (RimWorld/IngestionOutcomeDoer_UseThing.cs:10) and on the patient of a doctor's `Recipe_AdministerUsableItem` (RimWorld/Recipe_AdministerUsableItem.cs:15, Core's AdministerMechSerumHealer, Defs/ThingDefs_Items/Items_Exotic.xml:102). It returns without any effect when `CanBeUsedBy` fails (RimWorld/CompUsable.cs:163-166), so the prefix stores `CanBeUsedBy(p, false, true).Accepted` in `__state` and the postfix files only when it was true and one of `p`'s own current job targets is the used thing; a patient lying in bed is never the user. Patched on `CompUsable` and on every subclass that overrides it, found by reflection at startup (in the game code only `CompUseableDatacore`, which calls base, RimWorld/CompUseableDatacore.cs:30), with a per-call depth guard so an override that calls base files once.
- H. `HistoryEventsManager.RecordEvent(HistoryEvent, bool)`. Recorded-act category; the offender is the event's `HistoryEventArgsNames.Doer` (`args.TryGetArg<Pawn>`), an event without a doer opens nothing. Most of these events are recorded only with Ideology active (see "To verify"). - H. `HistoryEventsManager.RecordEvent(HistoryEvent, bool)`. Recorded-act category; the offender is the event's `HistoryEventArgsNames.Doer` (`args.TryGetArg<Pawn>`), an event without a doer opens nothing. Most of these events are recorded only with Ideology active (see "To verify").
- R. `Pawn_RecordsTracker.Increment(RecordDef)` and `AddTo(RecordDef, float)`. Record category; the offender is the tracker's `pawn`. `Time` records are not in the catalogue: they count up on their own every 80 ticks (`RecordsTickInterval`), and if that runs through `AddTo`, the set lookup drops them. Both methods are short; if the decompiled code shows a body small enough for the JIT to inline (see "To verify"), the record category polls instead: every 250 ticks it compares the watched records of free colonists with the last values, unsaved, and loses only the player-order exemption. - R. `Pawn_RecordsTracker.Increment(RecordDef)` and `AddTo(RecordDef, float)`. Record category; the offender is the tracker's `pawn`. `Time` records are not in the catalogue: they count up on their own every 80 ticks (`RecordsTickInterval`), and if that runs through `AddTo`, the set lookup drops them. Both methods are short; if the decompiled code shows a body small enough for the JIT to inline (see "To verify"), the record category polls instead: every 250 ticks it compares the watched records of free colonists with the last values, unsaved, and loses only the player-order exemption.
- B. `Notify_IterationCompleted(Pawn billDoer, List<Thing> ingredients)` on `Bill`, `Bill_Production`, `Bill_Medical` and `Bill_Autonomous` (each declares it in the reference assembly) and on any modded subclass that overrides it, with the same depth guard as U. Bill category; the offender is `billDoer`, a bill finished without a doer (Biotech's mech gestators) opens nothing. - B. `RecordsUtility.Notify_BillDone(Pawn billDoer, List<Thing> products)` (RimWorld/RecordsUtility.cs:52), static, two nested loops, not inlinable. Bill category; the offender is `billDoer`, the recipe `billDoer.CurJob?.RecipeDef` (a null files nothing). `Toils_Recipe.FinishRecipeAndStartStoringProduct` calls it right after `bill.Notify_IterationCompleted` for every bill type, surgery and Biotech's mech gestators included, always with the pawn that finished the bill (Verse.AI/Toils_Recipe.cs:197-200), and nothing else calls `Notify_IterationCompleted`. That method itself isn't patched: `Bill`'s version is empty (RimWorld/Bill.cs:278-280) and `Bill_Medical` calls it as a non-virtual base call the JIT may inline (RimWorld/Bill_Medical.cs:129).
- Two more hooks serve the jail, not detection (see "Enforcement runs a tick later"): K on `Pawn_GuestTracker.CapturedBy` and L on `GenGuest.PrisonerRelease`. - Two more hooks serve the jail, not detection (see "Enforcement runs a tick later"): K on `Pawn_GuestTracker.CapturedBy` and L on `GenGuest.PrisonerRelease`.
- Not patched: `MentalState_CorpseObsession.Notify_CorpseHauled` (one store, :47-50), `Pawn_GuiltTracker.Notify_Guilty` (one store, RimWorld/Pawn_GuiltTracker.cs:46-49), `MentalStateHandler.ClearMentalStateDirect` and `MentalState.RecoverFromState`. A break that ends with nothing done is found by the 250-tick sweep over open planning cases instead, which needs no hook. - Not patched: `MentalState_CorpseObsession.Notify_CorpseHauled` (one store, :47-50), `Pawn_GuiltTracker.Notify_Guilty` (one store, RimWorld/Pawn_GuiltTracker.cs:46-49), `MentalStateHandler.ClearMentalStateDirect` and `MentalState.RecoverFromState`. A break that ends with nothing done is found by the 250-tick sweep over open planning cases instead, which needs no hook.
@ -143,7 +153,7 @@ All state lives in one `GameComponent_BlaxLaws`. Laws are colony policy across e
- `Enforcement` holds a queue of (case, stage) entries. The component's `GameComponentTick` drains it on the tick after a hook filled it, so nothing acts inside a status change, an ingestion or an interaction, as Castes defers its work. The "Maintain only" write waits one tick more (see "Jail for N days"). - `Enforcement` holds a queue of (case, stage) entries. The component's `GameComponentTick` drains it on the tick after a hook filled it, so nothing acts inside a status change, an ingestion or an interaction, as Castes defers its work. The "Maintain only" write waits one tick more (see "Jail for N days").
- Every 250 ticks a sweep walks the open cases only (a handful at a time): closes planning cases whose break ended, re-issues lost subdue jobs, retries arrests that waited for a bed, an enforcer or the end of a fight, and gives the old bed back when an arrest or capture job ended without a prisoner. Every 2500 ticks it checks sentences. Nothing scans all pawns. - Every 250 ticks a sweep walks the open cases only (a handful at a time): closes planning cases whose break ended, re-issues lost subdue jobs, retries arrests that waited for a bed, an enforcer or the end of a fight, and gives the old bed back when an arrest or capture job ended without a prisoner. Every 2500 ticks it checks sentences. Nothing scans all pawns.
- Enforcer pick: free colonists on the offender's map, awake, not downed, not in a mental state, not drafted, no player-forced job, no lord (parties, rituals, caravans forming), not the offender, not a child, not a slave. Also skipped: a pawn whose `CurJob.def.casualInterruptible` is false (in Core's JobDefs that covers Rescue, Capture, Arrest, TendPatient, BeatFire, ExtinguishSelf, ManTurret, DeliverToBed and LayDown), a pawn carrying a pawn (`IsCarryingPawn`, RimWorld/PawnUtility.cs:115), a pawn on Flee or FleeAndCower (Core Defs/JobDefs/Jobs_Misc.xml:510, 518) and a pawn on a `DoBill` whose recipe `IsSurgery` (Verse/RecipeDef.cs:362). Wardens (Warden work active) first, then anyone able, nearest by straight distance among those that can reach the offender. Subdue needs a pawn able to do violence, an arrest one with Manipulation. - Enforcer pick: free colonists on the offender's map, awake, not downed, not in a mental state, not drafted, no player-forced job, no lord (parties, rituals, caravans forming), not the offender, not a child, not a slave. Also skipped: a pawn whose `CurJob.def.casualInterruptible` is false (in Core's JobDefs that covers Rescue, Capture, Arrest, TendPatient, BeatFire, ExtinguishSelf, ManTurret, DeliverToBed and LayDown), a pawn carrying a pawn (`IsCarryingPawn`, RimWorld/PawnUtility.cs:115), a pawn on Flee or FleeAndCower (Core Defs/JobDefs/Jobs_Misc.xml:510, 518) and a pawn on a `DoBill` whose recipe `IsSurgery` (Verse/RecipeDef.cs:362). Wardens (Warden work active) first, then anyone able, nearest by straight distance among those that can reach the offender. Subdue needs a pawn able to do violence, an arrest one with Manipulation.
- Danger: no enforcement starts while `GenHostility.AnyHostileActiveThreatToPlayer(map)` (RimWorld/GenHostility.cs:227) is true on the offender's map or `PawnUtility.EnemiesAreNearby(offender)` (RimWorld/PawnUtility.cs:161). The case waits and the sweep retries. - Danger: no enforcement starts while `GenHostility.AnyHostileActiveThreatToPlayer(map)` (RimWorld/GenHostility.cs:227) is true on the offender's map or `PawnUtility.EnemiesAreNearby(offender)` (RimWorld/PawnUtility.cs:161). The case waits and the sweep retries. A berserk colonist is hostile to the player faction (`MentalState_Berserk.ForceHostileTo(Faction)` returns true, Verse.AI/MentalState_Berserk.cs:12-15; RimWorld/GenHostility.cs:128-133), enters the attack target cache when the break starts (Verse.AI/MentalStateHandler.cs:175) and passes `IsPotentialThreat` (RimWorld/GenHostility.cs:266-308), so it counts as danger for as long as it rages. That is wanted: a Jail row on a berserk offender waits until the break ends or the pawn is downed, and other cases on that map wait as for a raid. Only "Subdue a pawn that fights back" (Enforcement, step 3) leaves its own offender out of the check.
- Jobs start with `Pawn_JobTracker.StartJob(job, JobCondition.InterruptForced, ..., preToilReservationsCanFail: true)` with `playerForced` set. Before an Arrest or Capture, Laws checks `enforcer.CanReserve(offender)` and `CanReserve(bed)` (Verse.AI/ReservationUtility.cs:63); without that, `StartJob` would log a reservation error and end the job as Errored (Verse.AI/Pawn_JobTracker.cs:336, 373-380), for example when a doctor already reserved the downed offender. On a failed check the case waits for the sweep. Laws never queues its own job; the one job it queues is the vanilla Capture after a subdue (see "Subdue"). - Jobs start with `Pawn_JobTracker.StartJob(job, JobCondition.InterruptForced, ..., preToilReservationsCanFail: true)` with `playerForced` set. Before an Arrest or Capture, Laws checks `enforcer.CanReserve(offender)` and `CanReserve(bed)` (Verse.AI/ReservationUtility.cs:63); without that, `StartJob` would log a reservation error and end the job as Errored (Verse.AI/Pawn_JobTracker.cs:336, 373-380), for example when a doctor already reserved the downed offender. On a failed check the case waits for the sweep. Laws never queues its own job; the one job it queues is the vanilla Capture after a subdue (see "Subdue").
- Hook K, a prefix and postfix on `Pawn_GuestTracker.CapturedBy` (RimWorld/Pawn_GuestTracker.cs:561-576, 16 lines with calls, not inlinable). It returns at once unless the pawn has a case in Enforcing with an Arrest or Capture job out. The postfix records the capture tick and queues the "Maintain only" write; the case saves whether that write is done, so a save made in between still gets it after the load. For "Release gives back what jail took" the prefix notes the weapon the pawn still holds, before `SetGuestStatus` drops it (:564; :461), and for "Castes keeps the caste" it sends Castes the `blax.laws.jailed` hint. - Hook K, a prefix and postfix on `Pawn_GuestTracker.CapturedBy` (RimWorld/Pawn_GuestTracker.cs:561-576, 16 lines with calls, not inlinable). It returns at once unless the pawn has a case in Enforcing with an Arrest or Capture job out. The postfix records the capture tick and queues the "Maintain only" write; the case saves whether that write is done, so a save made in between still gets it after the load. For "Release gives back what jail took" the prefix notes the weapon the pawn still holds, before `SetGuestStatus` drops it (:564; :461), and for "Castes keeps the caste" it sends Castes the `blax.laws.jailed` hint.
- Hook L, for the give-back and for Castes, a prefix and postfix on `GenGuest.PrisonerRelease` (RimWorld/GenGuest.cs:8-21). It returns at once unless the pawn serves a Laws sentence. For "Castes keeps the caste" the prefix sends `blax.laws.released`; the postfix queues the give-back for the next tick. Castes reads a hint in its `SetGuestStatus` hook, inside these calls, and drops it at the end of the tick, so the sweep would be too late. - Hook L, for the give-back and for Castes, a prefix and postfix on `GenGuest.PrisonerRelease` (RimWorld/GenGuest.cs:8-21). It returns at once unless the pawn serves a Laws sentence. For "Castes keeps the caste" the prefix sends `blax.laws.released`; the postfix queues the give-back for the next tick. Castes reads a hint in its `SetGuestStatus` hook, inside these calls, and drops it at the end of the tick, so the sweep would be too late.
@ -184,16 +194,17 @@ Every Blax mod works with any DLC combination, core only included (rule of 2026-
| Feature | Area, step | Needs | Without it | | Feature | Area, step | Needs | Without it |
|---|---|---|---| |---|---|---|---|
| Lawbook tab, starter lawbook, case log | Lawbook 1 (first release) | None | Works | | Lawbook tab, starter lawbook, case log | Lawbook 1 | None | Works |
| Act catalogue: breaks, ate, used, interactions, records, bills, special acts | Crimes 1 (first release) | None | Works; DLC entries are simply absent | | Act catalogue: breaks, ate, used, interactions, records, bills, special acts | Crimes 1 | None | Works; DLC entries are simply absent |
| Act catalogue: recorded acts | Crimes 1 | None (most events: Ideology) | Lists the event defs; most never fire | | Act catalogue: recorded acts | Crimes 1 | None (most events: Ideology) | Lists the event defs; most never fire |
| Violent crimes, slaughterer link, drug policy crimes | Crimes 1 | None | Works | | Violent crimes, slaughterer link, drug policy crimes | Crimes 1 | None | Works |
| Warn, guilty, subdue, jail, subdue then jail | Enforcement 1 (first release) | None | Works. Slaves don't exist | | Warn, guilty, subdue, jail, subdue then jail | Enforcement 1 | None | Works. Slaves don't exist |
| Laws for slaves (warn, guilty, subdue) | Enforcement 1 | Ideology | No slaves to cover | | Laws for slaves (warn, guilty, subdue) | Enforcement 1 | Ideology | No slaves to cover |
| Children never beaten | Enforcement 1 | Biotech | No children | | Children never beaten | Enforcement 1 | Biotech | No children |
| Reprimand, banish, execute | Enforcement 1 | None | Works | | Reprimand, banish, execute | Enforcement 1 | None | Works |
| Subdue for aggressive breaks | Enforcement 2 | None | Works | | Slaves' wardens first | Enforcement 2 | Ideology, Blax Slaves | No slaves; without Slaves' feature Laws subdues slaves itself |
| Release gives back bed, grave; pardon | Sentences 1 (first release) | None | Works | | Subdue a pawn that fights back | Enforcement 3 | None | Works |
| Release gives back bed, grave; pardon | Sentences 1 | None | Works |
| Release gives back throne | Sentences 1 | Royalty | Skipped | | Release gives back throne | Sentences 1 | Royalty | Skipped |
| Release gives back deathrest casket, mech modes | Sentences 1 | Biotech | Skipped | | Release gives back deathrest casket, mech modes | Sentences 1 | Biotech | Skipped |
| Release gives back the ideoligion role | Sentences 1 | Ideology | Skipped | | Release gives back the ideoligion role | Sentences 1 | Ideology | Skipped |
@ -201,11 +212,11 @@ Every Blax mod works with any DLC combination, core only included (rule of 2026-
| Hold for mechanitors, while the give-back is off | Sentences 1 | Biotech | No mechanitors | | Hold for mechanitors, while the give-back is off | Sentences 1 | Biotech | No mechanitors |
| Jail for slaves | Sentences 2 | Ideology | No slaves | | Jail for slaves | Sentences 2 | Ideology | No slaves |
| Trial through the vanilla trial | Court 1 | Ideology | "Trial" shows disabled with "Needs Ideology" until court sessions make it core | | Trial through the vanilla trial | Court 1 | Ideology | "Trial" shows disabled with "Needs Ideology" until court sessions make it core |
| Court sessions, court hour, removal button | Court 2 | None | Works. A throne as court place needs Royalty, a lectern or ritual spot Ideology | | Court sessions, "Jail, then trial", court hour, removal button | Court 2 | None | Works. A throne as court place needs Royalty, a lectern or ritual spot Ideology |
| Attorneys, multi-day trials, courtrooms | Court 3, Court 4 | None | Works | | Attorneys, multi-day trials, courtrooms | Court 3, Court 4 | None | Works |
| Elected judge | Colony votes 1 | None | Works | | Elected judge | Colony votes 2 | None | Works |
| Leader or moral guide as judge | Colony votes 1 | Ideology | Option disabled with "Needs Ideology"; a saved choice falls back to elected | | Leader or moral guide as judge | Colony votes 2 | Ideology | Option disabled with "Needs Ideology"; a saved choice falls back to elected |
| Law votes | Colony votes 2 | None | Works without the precept term | | Law votes | Colony votes 1 | None | Works without the precept term |
| Prison break crime | Crimes 2 | None | Works | | Prison break crime | Crimes 2 | None | Works |
| Slave rebellion crime | Crimes 2 | Ideology | Row shows "Needs Ideology" | | Slave rebellion crime | Crimes 2 | Ideology | Row shows "Needs Ideology" |
@ -213,22 +224,25 @@ Every Blax mod works with any DLC combination, core only included (rule of 2026-
The specs, grouped by area as in `docs/features.md`, which gives the order and the reasons for it. An area is one player problem; its steps follow what each part needs built first, never a time box. Features marked New in `features.md` get their spec here before their step is built. The specs, grouped by area as in `docs/features.md`, which gives the order and the reasons for it. An area is one player problem; its steps follow what each part needs built first, never a time box. Features marked New in `features.md` get their spec here before their step is built.
### Lawbook, step 1: the book (first release) ### Lawbook, step 1: the book
#### Lawbook tab #### Lawbook tab
- **Players get:** A "Laws" button in the bottom bar, after Ideoligions (order 105; Ideos is 100 and Menu 500, Ideology/Defs/MainButtonDefs/MainButtons.xml:9, Core/Defs/Misc/MainButtonDefs/MainButtons.xml:131). Two tabs. "Lawbook" lists your laws as rows (spec below). "Add law" opens the act picker first (spec below), then adds the row; each other column is a dropdown that offers only what fits the chosen action and stage. Clicking a row's Action opens the picker again. "Starter lawbook" adds the suggested rows. "Cases" lists cases newest first: who, what, stage, when, punishment, status, with a button to jump to the pawn and, for cases that wait, "Arrest now". An empty book shows one line: "No laws yet. Add one or press Starter lawbook." - **Players get:** A "Laws" button in the bottom bar, after Ideoligions (order 105; Ideos is 100 and Menu 500, Ideology/Defs/MainButtonDefs/MainButtons.xml:9, Core/Defs/Misc/MainButtonDefs/MainButtons.xml:131). Two tabs. "Lawbook" lists your laws as rows (spec below). "Add law" opens the act picker first (spec below), then adds the row; each other column is a dropdown that offers only what fits the chosen action and stage. Clicking a row's Action opens the picker again. "Starter lawbook" adds the suggested rows. "Cases" lists cases newest first: who, what, stage, when, punishment, status, with a button to jump to the pawn and, for cases that wait, "Arrest now". An empty book shows one line: "No laws yet. Add one or press Starter lawbook."
- **Row spec:** - **Row spec:**
- Columns: Action (icon, category and label, with the source mod in the tooltip); Option, only for drug binges (Any, Hard, Social, then every drug's `ChemicalDef` by label, built from the ThingDefs whose `CompProperties_Drug` names a chemical); Stage; Severity; Punishment; Days, a 1 to 50 field for Guilty, Jail and Subdue then jail and "-" otherwise; On; delete. An overlap icon marks a row that can catch the same act as a row of another category; its tooltip names that row. - Columns: Action (icon, category and label, with the source mod in the tooltip); Option, only for drug binges (Any, Hard, Social, then every drug's `ChemicalDef` by label, built from the ThingDefs whose `CompProperties_Drug` names a chemical); Stage; Severity; Punishment; Days, a 1 to 50 field for Guilty, Jail, Subdue then jail, Trial and Jail then trial and "-" otherwise; On; delete. An overlap icon marks a row that can catch the same act as a row of another category; its tooltip names that row.
- A new row gets the entry's first stage, Moderate, Warn and On. - A new row gets the entry's first stage, Moderate, Warn and On.
- Punishments per entry and stage: - Punishments per entry and stage:
| Entry | Stage | Punishments | | Entry | Stage | Punishments |
|---|---|---| |---|---|---|
| A break that isn't aggressive | Planning | Warn, Subdue, Jail | | A break that isn't hostile to the colony, aggressive ones (tantrums, murderous and sadistic rage, slaughterer) included | Planning | Warn, Subdue, Jail |
| The same, with a linked act | Did it | Warn, Guilty, Subdue, Jail, Subdue then jail. Subdue acts only while the offender is still in its break; after it a Subdue row warns and Subdue then jail jails | | The same, with a linked act | Did it | Warn, Reprimand, Guilty, Subdue, Jail, Subdue then jail, Banish, Execute, Trial, Jail then trial. Subdue acts only while the offender is still in its break; after it a Subdue row warns and Subdue then jail jails |
| An aggressive break (`IsAggro`) | Planning, and Did it through the Violence links | Warn, Guilty; Subdue once "Subdue for aggressive breaks" is built | | A break hostile to the colony (berserk) | Planning | Warn, Guilty, Jail. Jail waits until the break ends or the pawn is down |
| Every entry outside the breaks: ate, used, interactions, recorded acts, records, bills, special acts | Did it | Warn, Guilty, Jail | | The same, with its Violence link | Did it | Warn, Reprimand, Guilty, Jail, Banish, Execute, Trial, Jail then trial. Jail waits as above |
| Every entry outside the breaks: ate, used, interactions, recorded acts, records, bills, special acts | Did it | Warn, Reprimand, Guilty, Jail, Banish, Execute, Trial, Jail then trial |
Each punishment shows up once its feature is built: Reprimand, Banish and Execute in the release after the first, Trial with Court step 1, "Jail, then trial" with Court step 2. A berserk state is told apart by its class in the catalogue (`MentalState_Berserk`, `MentalState_BerserkWarcall` and their subclasses, plus an XML list for modded classes), and enforcement re-checks `ForceHostileTo(Faction.OfPlayer)` on the live state, which wins over the catalogue.
- Changing Severity resets Days to the new default only while Days still equals the old default. Changing Action or Stage resets a punishment that no longer fits to Warn. - Changing Severity resets Days to the new default only while Days still equals the old default. Changing Action or Stage resets a punishment that no longer fits to Warn.
- Action, Option and Stage are the row's key. A duplicate is refused and the list jumps to the existing row. - Action, Option and Stage are the row's key. A duplicate is refused and the list jumps to the existing row.
@ -245,14 +259,14 @@ The specs, grouped by area as in `docs/features.md`, which gives the order and t
- **Overlaps:** Federation: Laws and Warrants (3823463956, 10 subs, 1.6) has the only other laws tab on the Workshop, inside its own scenario. - **Overlaps:** Federation: Laws and Warrants (3823463956, 10 subs, 1.6) has the only other laws tab on the Workshop, inside its own scenario.
- **Replaces:** Nothing alone; with the catalogue and punishments below it replaces Rimworld Law and Order (3661387691, 419 subs, last update 2026-02-15, 1.6 only, needs Ideology, five hardcoded crimes). - **Replaces:** Nothing alone; with the catalogue and punishments below it replaces Rimworld Law and Order (3661387691, 419 subs, last update 2026-02-15, 1.6 only, needs Ideology, five hardcoded crimes).
- **Effort:** M plus S for the picker. - **Effort:** M plus S for the picker.
- **Tests:** A new game has an empty book, no cases and every watch flag false. Adding an "any drug binge" row sets the Break flag and the watched set holds both binge defs; deleting it clears them. Starter lawbook adds 7 rows; pressing it again adds none. Rows keep id, act key, saved label and mod, option, stage, severity, punishment, days and the On flag through phase 2. A row whose act key doesn't resolve (written into the component by the test, once with "Core" and once with "Ideology" as its saved mod) stays, reports "Missing: Core" or "Needs Ideology" and opens no case. A save made without Laws loads with an empty component. With "Show Laws tab" off, `buttonVisible` is false at once. A second row with the same Action, Option and Stage is refused. A new row reads first stage, Moderate, Warn, On. Moderate to Serious moves untouched Days from 3 to 5 and leaves typed Days alone. Switching a Subdue row's action to "Ate: any meat" resets it to Warn. The drug option list holds WakeUp and no non-drug chemical. The picker's search for "wake" lists Wake-up under Ate and "make wake-up" under Bills; for "insult" it lists Insult under interactions and the insulting sprees under breaks. "Ate: wake-up" next to "Recorded acts: ingested a drug" shows the overlap icon on both. - **Tests:** A new game has an empty book, no cases and every watch flag false. Adding an "any drug binge" row sets the Break flag and the watched set holds both binge defs; deleting it clears them. Starter lawbook adds 7 rows; pressing it again adds none. Rows keep id, act key, saved label and mod, option, stage, severity, punishment, days and the On flag through phase 2. A row whose act key doesn't resolve (written into the component by the test, once with "Core" and once with "Ideology" as its saved mod) stays, reports "Missing: Core" or "Needs Ideology" and opens no case. A save made without Laws loads with an empty component. With "Show Laws tab" off, `buttonVisible` is false at once. A second row with the same Action, Option and Stage is refused. A new row reads first stage, Moderate, Warn, On. Moderate to Serious moves untouched Days from 3 to 5 and leaves typed Days alone. Switching a Subdue row's action to "Ate: any meat" resets it to Warn. A Planning row never offers Reprimand, Banish or Execute; a Berserk row never offers Subdue; a Tantrum row does. The drug option list holds WakeUp and no non-drug chemical. The picker's search for "wake" lists Wake-up under Ate and "make wake-up" under Bills; for "insult" it lists Insult under interactions and the insulting sprees under breaks. "Ate: wake-up" next to "Recorded acts: ingested a drug" shows the overlap icon on both.
- **Risks:** Humanoid Alien Races pawns never got Law and Order's tab; Laws has no per-pawn tab, and its offender filter is `RaceProps.Humanlike`, so alien colonists are covered. Test with HAR in `-Compat`. - **Risks:** Humanoid Alien Races pawns never got Law and Order's tab; Laws has no per-pawn tab, and its offender filter is `RaceProps.Humanlike`, so alien colonists are covered. Test with HAR in `-Compat`.
### Lawbook, step 2: templates across saves ### Lawbook, step 2: the book across saves and groups
Not specced yet: lawbook templates (see `docs/features.md`). Not specced yet: lawbook templates and "Applies to" (see `docs/features.md`). "Applies to" needs no field reserved now: a Law saved without it loads as "everyone", and keys that are unique on Action, Option and Stage stay unique with a fourth part.
### Crimes, step 1: every act the game records (first release) ### Crimes, step 1: every act the game records
#### Act catalogue and detection #### Act catalogue and detection
@ -280,7 +294,7 @@ Not specced yet: lawbook templates (see `docs/features.md`).
| `MentalState_InsultingSpree` | InsultingSpree, TargetedInsultingSpree | Insult or slight | | `MentalState_InsultingSpree` | InsultingSpree, TargetedInsultingSpree | Insult or slight |
| `MentalState_Jailbreaker` | Jailbreaker | The jailbreak talk (`SparkJailbreak` interaction) | | `MentalState_Jailbreaker` | Jailbreaker | The jailbreak talk (`SparkJailbreak` interaction) |
Tantrums, berserk, murderous and sadistic rage get their links with "Violence", slaughterers with "Slaughterers", both in the first release. Every other break, desertion (GiveUpExit) included, is Planning only. Tantrums, berserk, murderous and sadistic rage get their links with "Violence", slaughterers with "Slaughterers", both in the release after the first. Every other break, desertion (GiveUpExit) included, is Planning only.
- **How:** - **How:**
- Catalogue build. Each `ActCategoryWorker` walks its `DefDatabase` once after def loading: breaks from `DefDatabase<MentalBreakDef>` (`mentalState`), plus an include list in XML (Berserk) and an exclude list (animal and baby states: Manhunter, ManhunterPermanent, Roaming, BabyCry, BabyGiggle and their kin, to be read from the defs); ate from ThingDefs with `IsIngestible`; used from ThingDefs whose comps include a `CompProperties_Usable`; interactions from `DefDatabase<InteractionDef>`; recorded acts from `DefDatabase<HistoryEventDef>` minus the exclusion list; records from `DefDatabase<RecordDef>` with `type` Int or Float; bills from `DefDatabase<RecipeDef>`. Groups are predicates over defs, written once in code: drug groups by `ingestible.drugCategory` (None, Medical, Social, Hard), meat groups as below, "raw food" by `ingestible.preferability`, "any meal" by `IsProcessedFood`, "any surgery" by `RecipeDef.IsSurgery`, "any aggressive break" by `MentalStateDef.IsAggro`. - Catalogue build. Each `ActCategoryWorker` walks its `DefDatabase` once after def loading: breaks from `DefDatabase<MentalBreakDef>` (`mentalState`), plus an include list in XML (Berserk) and an exclude list (animal and baby states: Manhunter, ManhunterPermanent, Roaming, BabyCry, BabyGiggle and their kin, to be read from the defs); ate from ThingDefs with `IsIngestible`; used from ThingDefs whose comps include a `CompProperties_Usable`; interactions from `DefDatabase<InteractionDef>`; recorded acts from `DefDatabase<HistoryEventDef>` minus the exclusion list; records from `DefDatabase<RecordDef>` with `type` Int or Float; bills from `DefDatabase<RecipeDef>`. Groups are predicates over defs, written once in code: drug groups by `ingestible.drugCategory` (None, Medical, Social, Hard), meat groups as below, "raw food" by `ingestible.preferability`, "any meal" by `IsProcessedFood`, "any surgery" by `RecipeDef.IsSurgery`, "any aggressive break" by `MentalStateDef.IsAggro`.
@ -293,16 +307,16 @@ Not specced yet: lawbook templates (see `docs/features.md`).
- Corpse obsession. Planning: hook A on `CorpseObsession` (MentalStates_Mood.xml:399-413); `PostStart` picks the corpse (Verse.AI/MentalState_CorpseObsession.cs:41-45). Did it: hook J sees `alreadyHauledCorpse` turn true, which the job's last toil sets (RimWorld/JobDriver_HaulCorpseToPublicPlace.cs:82-95, the call at :90). 80% of drops go on a table (:64, `TryFindTableCell` :97-123); the case checks the corpse's cell for a `def.IsTable` building. "Dug up" is read from the corpse, never from the job: hook J sees the flag only after that last, instant toil, when the haul job and its grave target are gone. Hook A notes it from `corpse.ParentHolder is Building_Grave`, and hook J re-reads it for the current `__instance.corpse` on each call while `alreadyHauledCorpse` is false, since vanilla may pick another corpse (Verse.AI/MentalState_CorpseObsession.cs:26-28). Vanilla only obsesses over buried corpses (`GetClosestCorpseToDigUp` searches `ThingRequestGroup.Grave`, Verse.AI/CorpseObsessionMentalStateUtility.cs:17-21), Anomaly's unnatural corpse aside (:13), so the note is nearly always set. The flag is saved by vanilla (MentalState_CorpseObsession.cs:15), so after a load it is already true: hook J only moves a case that is open at planning, and the case's stage is saved, so the corpse is never filed twice. - Corpse obsession. Planning: hook A on `CorpseObsession` (MentalStates_Mood.xml:399-413); `PostStart` picks the corpse (Verse.AI/MentalState_CorpseObsession.cs:41-45). Did it: hook J sees `alreadyHauledCorpse` turn true, which the job's last toil sets (RimWorld/JobDriver_HaulCorpseToPublicPlace.cs:82-95, the call at :90). 80% of drops go on a table (:64, `TryFindTableCell` :97-123); the case checks the corpse's cell for a `def.IsTable` building. "Dug up" is read from the corpse, never from the job: hook J sees the flag only after that last, instant toil, when the haul job and its grave target are gone. Hook A notes it from `corpse.ParentHolder is Building_Grave`, and hook J re-reads it for the current `__instance.corpse` on each call while `alreadyHauledCorpse` is false, since vanilla may pick another corpse (Verse.AI/MentalState_CorpseObsession.cs:26-28). Vanilla only obsesses over buried corpses (`GetClosestCorpseToDigUp` searches `ThingRequestGroup.Grave`, Verse.AI/CorpseObsessionMentalStateUtility.cs:17-21), Anomaly's unnatural corpse aside (:13), so the note is nearly always set. The flag is saved by vanilla (MentalState_CorpseObsession.cs:15), so after a load it is already true: hook J only moves a case that is open at planning, and the case's stage is saved, so the corpse is never filed twice.
- Started a fight. Hook F, offender `___pawn`, the pawn whose tracker starts the fight; `otherPawn` is the provoker. It is called from `CheckSocialFightStart` (RimWorld/Pawn_InteractionsTracker.cs:355-371) on the recipient of an interaction (:217). Slaves only fight slaves and prisoners only prisoners (:402-409). The row's tooltip says who counts as the offender. - Started a fight. Hook F, offender `___pawn`, the pawn whose tracker starts the fight; `otherPawn` is the provoker. It is called from `CheckSocialFightStart` (RimWorld/Pawn_InteractionsTracker.cs:355-371) on the recipient of an interaction (:217). Slaves only fight slaves and prisoners only prisoners (:402-409). The row's tooltip says who counts as the offender.
- Interactions. Hook E: `__result` true and `intDef` in the watched set (Insult, Slight, any other). Offender `___pawn` (the initiator), victim the recipient. Insults in a spree also come through here (RimWorld/JobDriver_Insult.cs:34) and are the insulting spree's did-it. Planning for sprees: hook A on `InsultingSpree` or `TargetedInsultingSpree`. The jailbreaker's talk is the `SparkJailbreak` interaction (`InteractionDefOf.SparkJailbreak`), the did-it of `MentalState_Jailbreaker`. - Interactions. Hook E: `__result` true and `intDef` in the watched set (Insult, Slight, any other). Offender `___pawn` (the initiator), victim the recipient. Insults in a spree also come through here (RimWorld/JobDriver_Insult.cs:34) and are the insulting spree's did-it. Planning for sprees: hook A on `InsultingSpree` or `TargetedInsultingSpree`. The jailbreaker's talk is the `SparkJailbreak` interaction (`InteractionDefOf.SparkJailbreak`), the did-it of `MentalState_Jailbreaker`.
- Ate. Hook C. The prefix reads the eaten def, `FoodUtility.GetFoodKind(__instance)` (RimWorld/FoodUtility.cs:1454), `def.IsProcessedFood` and `FoodUtility.IsHumanlikeCorpseOrHumanlikeMeatOrIngredient(__instance)` (used at Verse/Thing.cs:2033) into `__state`, before the stack can be destroyed; the postfix files the case. Meat groups: "any meat" from the food kind (meals with meat included), "raw meat or corpses" from `IsMeat` or `IsCorpse` on unprocessed food, "human meat" from that last call, "insect meat" from the meat's source race. It counts only when the ingester eats on its own: its current job is Ingest with the eaten thing as target. A doctor's dose, a warden or parent feeding someone and a baby fed by others run on the feeder's job and are skipped. - Ate. Hook C. The prefix reads the eaten def, `FoodUtility.GetFoodKind(__instance)` (RimWorld/FoodUtility.cs:1454), `def.IsProcessedFood` and `FoodUtility.IsHumanlikeCorpseOrHumanlikeMeatOrIngredient(__instance)` (used at Verse/Thing.cs:2033) into `__state`, before the stack can be destroyed; the postfix files the case. Meat groups: "any meat" from the food kind (meals with meat included), "raw meat or corpses" from `IsMeat` or `IsCorpse` on unprocessed food, "human meat" from that last call, "insect meat" from the meat's source race. It counts only when the ingester eats on its own: one of the targets (A, B or C) of its own current job is the eaten thing. That covers the Ingest job (RimWorld/JobDriver_Ingest.cs:115) and a drink at a gathering spot, which `JobDriver_SocialRelax` ingests at target C under its own job def (RimWorld/JobDriver_SocialRelax.cs:75), the most common way colonists take beer and smokeleaf. A doctor's dose (RimWorld/Recipe_AdministerIngestible.cs:11, inside the doctor's bill), a warden or parent feeding someone (RimWorld/JobDriver_FoodFeedPatient.cs:78, RimWorld/JobDriver_Feed.cs:47) and a baby fed by others (RimWorld/JobDriver_BottleFeedBaby.cs:86, 103) run on the feeder's job, so the eater's own job never targets the food and they are skipped. Caravans feed off the map (RimWorld.Planet/Caravan_NeedsTracker.cs:182, 209, 245), which the offender filter drops.
- Used. Hook U, the used thing's def against the watched set. A psytrainer, neurotrainer or serum (Royalty, Biotech or Core) files on the pawn that used it. - Used. Hook U, the used thing's def against the watched set. A psytrainer, neurotrainer or serum (Royalty, Biotech or Core) files on the pawn that used it on its own job; a patient a doctor gives a healer mech serum files nothing.
- Recorded acts. Hook H: the event def against the watched set, then `args.TryGetArg<Pawn>(HistoryEventArgsNames.Doer, ...)`; an event without a doer pawn files nothing. `RecordEvent` also runs for events the player orders (an execution), so the player-order exemption reads the doer's job like every other hook. - Recorded acts. Hook H: the event def against the watched set, then `args.TryGetArg<Pawn>(HistoryEventArgsNames.Doer, ...)`; an event without a doer pawn files nothing. `RecordEvent` also runs for events the player orders (an execution), so the player-order exemption reads the doer's job like every other hook.
- Records. Hook R: the record def against the watched set; the offender is the tracker's `pawn`. A record goes up for many reasons ("things hauled" every haul), and the cooldown keeps one case a day per pawn and row. - Records. Hook R: the record def against the watched set; the offender is the tracker's `pawn`. A record goes up for many reasons ("things hauled" every haul), and the cooldown keeps one case a day per pawn and row.
- Bills. Hook B: the bill's `recipe` against the watched set, the doer as offender. Bills are standing player orders but not forced jobs, so the exemption doesn't cover them: a row on "make yayo" files on the cook who made it, which is the row's point. - Bills. Hook B: the recipe of the doer's current job against the watched set, the doer as offender. Bills are standing player orders but not forced jobs, so the exemption doesn't cover them: a row on "make yayo" files on the cook who made it, which is the row's point.
- Each category worker opens a case or moves an open break case to did it, increments the count, and queues the punishment of the most specific enabled matching row (see "Defaults I picked") once per stage. An act that is the linked did-it of an open break case goes to that case and to no other row. - Each category worker opens a case or moves an open break case to did it, increments the count, and queues the punishment of the most specific enabled matching row (see "Defaults I picked") once per stage. An act that is the linked did-it of an open break case goes to that case and opens no other case; when it also matches a row of its own, the row with the higher severity decides, the break's row on a tie (see "Defaults I picked").
- The cooldown setting applies to every act outside a break. Inside the window a further act by the same offender under the same law raises the count on that case, open or closed, and files nothing new. An insult that sparks a fight files two cases: the insult for the insulter, the fight for the one who swings. - The cooldown setting applies to every act outside a break. Inside the window a further act by the same offender under the same law raises the count on that case, open or closed, and files nothing new. An insult that sparks a fight files two cases: the insult for the insulter, the fight for the one who swings.
- **Settings:** The cooldown and "Player orders are exempt" from the settings page; per row the option. - **Settings:** The cooldown and "Player orders are exempt" from the settings page; per row the option.
- **Save and removal:** Cases save in the component. Hooks and the catalogue save nothing. - **Save and removal:** Cases save in the component. Hooks and the catalogue save nothing.
- **Overlaps:** Insult System (3783191560, 86 subs) and Grudges! (3491693870, 27.5k, 1.6, unmaintained) add social conflict; Laws only reads vanilla interactions. Pawn Rules (Continued) (3024243615, 6.7k) prevents meat eating per pawn; Laws punishes it afterwards. Snap Out! (1319782555, 636k, no 1.7) talks a pawn out of a break; it is the gentle partner of subdue. - **Overlaps:** Insult System (3783191560, 86 subs) and Grudges! (3491693870, 27.5k, 1.6, unmaintained) add social conflict; Laws only reads vanilla interactions. Pawn Rules (Continued) (3024243615, 6.7k) prevents meat eating per pawn; Laws punishes it afterwards. Snap Out! (1319782555, 636k, no 1.7) talks a pawn out of a break; Laws' "Talk down" (Enforcement, step 1, New) covers that for colonists on 1.7.
- **Replaces:** Law and Order's crimes are new events and breaks; Laws replaces the idea with vanilla's own acts. - **Replaces:** Law and Order's crimes are new events and breaks; Laws replaces the idea with vanilla's own acts.
- **Effort:** M for the categories, groups and links, S for hooks U, H, R and B, S for the catalogue tests. - **Effort:** M for the categories, groups and links, S for hooks U, H, R and B, S for the catalogue tests.
- **Tests:** - **Tests:**
@ -311,22 +325,26 @@ Not specced yet: lawbook templates (see `docs/features.md`).
- Corpse: a forced obsession on a corpse in a grave opens planning with "dug up from a grave"; driving the haul job to the end with a table in reach moves it to did it with "on a table" and keeps the note. Phase 2 after a save with the flag already true: still one did-it entry. - Corpse: a forced obsession on a corpse in a grave opens planning with "dug up from a grave"; driving the haul job to the end with a table in reach moves it to did it with "on a table" and keeps the note. Phase 2 after a save with the flag already true: still one did-it entry.
- Fight: `recipient.interactions.StartSocialFight(initiator)` files the case on the recipient, not the initiator. - Fight: `recipient.interactions.StartSocialFight(initiator)` files the case on the recipient, not the initiator.
- Insult: `TryInteractWith(target, Insult)` files on the initiator. A Slight only with the option. A second insult within a day files nothing; with the cooldown at 0 it files a second case. - Insult: `TryInteractWith(target, Insult)` files on the initiator. A Slight only with the option. A second insult within a day files nothing; with the cooldown at 0 it files a second case.
- Ate: raw meat, a simple meal with meat and human meat against the meat groups; a row on the Simple meal def catches the simple meal and not the raw meat; a drafted pawn eating opens nothing; a doctor administering a drug to a patient opens nothing for either pawn; a player-forced eat job opens nothing while the setting is on and a case when it is off. 60 colonists eating meat for a day under an "any meat, warn" law produce at most 60 cases and 60 messages. - Ate: raw meat, a simple meal with meat and human meat against the meat groups; a row on the Simple meal def catches the simple meal and not the raw meat; a drafted pawn eating opens nothing; a doctor administering a drug to a patient opens nothing for either pawn; a beer drunk on social relax files under "Ate: beer"; a player-forced eat job opens nothing while the setting is on and a case when it is off. 60 colonists eating meat for a day under an "any meat, warn" law produce at most 60 cases and 60 messages.
- Catalogue: every `MentalBreakDef`'s state, every ingestible ThingDef, every `InteractionDef`, every Int or Float `RecordDef` and every `RecipeDef` of the loaded game has an entry; no Time record and no excluded state has one. The test mod's own defs (a test drug ThingDef, a test InteractionDef, a test RecipeDef, a test mental state reusing `MentalState_FireStartingSpree`) appear with the test mod as source, and the test break offers Did it through the link. In a `-NoDlc` run no DLC entry appears and the starter lawbook still adds 7 rows. - Catalogue: every `MentalBreakDef`'s state, every ingestible ThingDef, every `InteractionDef`, every Int or Float `RecordDef` and every `RecipeDef` of the loaded game has an entry; no Time record and no excluded state has one. The test mod's own defs (a test drug ThingDef, a test InteractionDef, a test RecipeDef, a test mental state reusing `MentalState_FireStartingSpree`) appear with the test mod as source, and the test break offers Did it through the link. In a `-NoDlc` run no DLC entry appears and the starter lawbook still adds 7 rows.
- Used: `UsedBy` of a mech serum (healer) files on the user. Interactions: a forced `Chitchat` with a Chitchat row files on the initiator. Records: `pawn.records.Increment(RecordDefOf.BodiesStripped)` with a row files one case, a second increment the same day raises the count. Recorded acts: an `ExecutedPrisoner` event with a doer files on the doer, the same event without a doer files nothing (skipped without Ideology if vanilla records it only there). Bills: a finished "make simple meal" iteration files on the cook; a mech gestator bill finishing without a doer files nothing (skipped: needs Biotech). - Used: a colonist using a healer mech serum on its own job files on it; a doctor-administered healer serum files nothing for either pawn; a `UsedBy` call that `CanBeUsedBy` refuses files nothing. Interactions: a forced `Chitchat` with a Chitchat row files on the initiator. Records: `pawn.records.Increment(RecordDefOf.BodiesStripped)` with a row files one case, a second increment the same day raises the count. Recorded acts: an `ExecutedPrisoner` event with a doer files on the doer, the same event without a doer files nothing (skipped without Ideology if vanilla records it only there). Bills: a finished "make simple meal" iteration files on the cook; a surgery files on the doctor; a mech gestator bill files on the mechanitor who finishes it (skipped: needs Biotech).
- Jailbreaker: a forced Jailbreaker break opens planning, the `SparkJailbreak` interaction moves it to did it. An aggressive break row offers Warn and Guilty only. - Jailbreaker: a forced Jailbreaker break opens planning, the `SparkJailbreak` interaction moves it to did it. A Berserk row offers Warn, Guilty and Jail; a Tantrum or MurderousRage row also offers Subdue.
- Cost: 100000 calls each of `TryInteractWith`, `Increment` and `RecordEvent` with an empty book run within 2% of the same calls with the patches unapplied (test switch). - Cost: 100000 calls each of `TryInteractWith`, `Increment` and `RecordEvent` with an empty book run within 2% of the same calls with the patches unapplied (test switch).
- **Risks:** Double counting across categories (a dose is an Ate act, a recorded act and maybe a record) is accepted and shown by the overlap icon; inside a break the break case owns the act. Slights are frequent between rivals (weight 0.02, RimWorld/InteractionWorker_Slight.cs:15); the cooldown keeps the log readable. A modded break with its own state class is in the catalogue with Planning only until someone adds a `BreakLinkDef`. A mod that records acts without `Increment`, `RecordEvent` or `TryInteractWith` is invisible to Laws. The catalogue labels come from the defs; a modded def without a label shows its defName. - **Risks:** Double counting across categories (a dose is an Ate act, a recorded act and maybe a record) is accepted and shown by the overlap icon; inside a break the break case owns the act. Slights are frequent between rivals (weight 0.02, RimWorld/InteractionWorker_Slight.cs:15); the cooldown keeps the log readable. A modded break with its own state class is in the catalogue with Planning only until someone adds a `BreakLinkDef`. A mod that records acts without `Increment`, `RecordEvent` or `TryInteractWith` is invisible to Laws. The catalogue labels come from the defs; a modded def without a label shows its defName.
#### Violence #### Violence
- **Players get:** Four special acts: assault (hurt a colonist, slave or guest outside a fight), harming prisoners or slaves, manslaughter and murder. The violent breaks are in the catalogue with Planning, and Violence gives them Did it: a tantrum damaged or destroyed something, a berserk pawn or a murderous or sadistic rage hurt someone (murderous rage names its target from the start). Until "Subdue for aggressive breaks" is built, those breaks offer Warn and Guilty only. - **Players get:** Four special acts: assault (hurt a free colonist, a guest or another pawn that isn't hostile, outside a social fight), harming a prisoner or slave of the colony, manslaughter and murder. A hit that kills is murder. When the victim of an assault or harm case dies of its wounds within 2 days, by bleeding out, an infection or any other death without an attacker, that case becomes manslaughter. The violent breaks are in the catalogue with Planning, and Violence gives them Did it: a tantrum damaged or destroyed something, a berserk pawn or a murderous or sadistic rage hurt someone (murderous rage names its target from the start). A berserk case takes Warn, Guilty or Jail; tantrums and the rages take every break punishment, Subdue included (see "Defaults I picked").
- **How:** The breaks are catalogue entries already (Tantrum, TargetedTantrum, BedroomTantrum, SadisticRage, MurderousRage; MentalStates_Mood.xml:318, 352, 368, 381, 191); Violence adds `BreakLinkDef`s for `MentalState_Tantrum`, `MentalState_Berserk` and `MentalState_MurderousRage` (`MentalState_SadisticRageTantrum` is a tantrum subclass and links to harming a prisoner or slave). A postfix on `Thing.TakeDamage` (Verse/Thing.cs:1477), the funnel for all damage and hot in combat, so it reads its static flag before anything else. A prefix and postfix on `Pawn.Kill` (Verse/Pawn.cs:2096) catch deaths. Excluded: drafted instigators, damage with `instigatorGuilty` false (executions; Laws' own subdue, which also sets a scope flag), victims in an aggro state, surgery (no instigator), friendly fire (`dinfo.IntendedTarget` not the victim, Verse/DamageInfo.cs:94). Vanilla already marks such attackers guilty for a day (Verse/Pawn_HealthTracker.cs:321-329). - **How:**
- Links: the breaks are catalogue entries already (Tantrum, TargetedTantrum, BedroomTantrum, SadisticRage, MurderousRage; MentalStates_Mood.xml:318, 352, 368, 381, 191); Violence adds `BreakLinkDef`s for `MentalState_Tantrum`, `MentalState_Berserk` and `MentalState_MurderousRage` (`MentalState_SadisticRageTantrum` is a tantrum subclass and links to harming a prisoner or slave).
- Hits: a postfix on `Thing.TakeDamage` (Verse/Thing.cs:1477), the funnel for all damage and hot in combat, so it reads its static flag before anything else. The offender is `dinfo.Instigator`. During an open break case any damage the offender deals, to a pawn or a wall, is that break's did-it. Outside a break the victim's status picks the act: a prisoner of the colony or a colony slave is "harmed a prisoner or slave", any other humanlike pawn that isn't hostile is assault.
- Excluded: drafted instigators; damage with `instigatorGuilty` false (executions; Laws' own subdue, which also sets a scope flag); victims in a state hostile to the colony (a colonist hitting back at a berserker); hits while both pawns are in a social fight (that is "started a social fight"); surgery (no instigator); friendly fire. A hit counts as friendly fire only when `dinfo.IntendedTarget` is set and isn't the victim (Verse/DamageInfo.cs:94): vanilla melee builds its DamageInfo with no intended target (RimWorld/Verb_MeleeAttackDamage.cs:50-51), only bullets (RimWorld/Bullet.cs:23) and explosions (Verse/DamageWorker.cs:316) set one, so "intended target not the victim" alone would drop every punch, every blade, every berserk and every tantrum hit. Vanilla already marks undrafted attackers of player pawns guilty for a day (Verse/Pawn_HealthTracker.cs:321-329).
- Deaths: a prefix and postfix on `Pawn.Kill` (Verse/Pawn.cs:2096). With an instigator in `dinfo` that passes the filter above, the death is murder, and the killing hit files no assault besides. Most deaths after an attack carry no instigator: bleeding out or an infection reaches `Kill` through `Notify_HediffChanged`, which runs `CheckForStateChange(null, hediff)` (Verse/Pawn_HealthTracker.cs:290-294, the `Kill` at :515), and a disease's death roll calls `Kill(null, this)` (Verse/Hediff.cs:512). For such a death Laws looks for an assault or harm case of the last 2 days, open or closed, with this pawn as victim, and moves it to manslaughter like a later stage (see "One enforcement per case"). The link lives in the saved case, so it survives a load.
- **Save and removal:** Cases only. - **Save and removal:** Cases only.
- **Overlaps:** Prison mods that beat prisoners with the beater as instigator (Prisoner Realism's demoralize, Beat Your Prisoners) are caught by "harming prisoners". That is the law's point; its tooltip says so. - **Overlaps:** Prison mods that beat prisoners with the beater as instigator (Prisoner Realism's demoralize, Beat Your Prisoners) are caught by "harming prisoners". That is the law's point; its tooltip says so.
- **Replaces:** Law and Order's assault and murder crimes. - **Replaces:** Law and Order's assault and murder crimes.
- **Effort:** M, plus S for the links. - **Effort:** M, plus S for the links.
- **Tests:** One case per special act and per linked break stage; a drafted shot opens nothing; subdue damage opens nothing. - **Tests:** An undrafted colonist's punch on another colonist files assault, on a prisoner of the colony harming a prisoner. A forced berserk's melee hit on a colonist moves the berserk case to did it; a forced tantrum hitting a wall moves the tantrum case to did it. A shot that kills files murder and no assault. A stabbed colonist that bleeds out turns its assault case into manslaughter, also after a save and load in between. A murder during a murderous rage with "Murderous rage, did it: warn, Moderate" and "Murder: jail 10 days, Grave" gives one case and 10 days. An undrafted colonist's shot at a raider that hits a colonist opens nothing. A drafted shot, subdue damage and a social fight open nothing.
#### Slaughterers #### Slaughterers
@ -354,19 +372,19 @@ Needs "Pardon, early release and longer sentences" for "Add days" on a convict,
#### Prison breaks and slave rebellions #### Prison breaks and slave rebellions
- **Players get:** Two acts by pawns the laws didn't cover before: prison break (prisoners as offenders) and slave rebellion (Ideology). Which punishments a prisoner offender gets is still to be specced; `docs/features.md` proposes warn, "Add days" on a Laws sentence and a confirmed execution. - **Players get:** Two acts: prison break by Laws' own convicts and slave rebellion (Ideology). A convict who breaks out gets Warn, "Add days" on its sentence or a confirmed execution (see "Banish and execute"). Other escapees, captured raiders and enemy prisoners included, stay with the prison mods: punishing them is sentencing enemy prisoners, which Prisoner Sentencing and Prison Expanded cover.
- **How:** Postfixes on `PrisonBreakUtility.StartPrisonBreak` (RimWorld/PrisonBreakUtility.cs:214, whose out list names the escapees) and `SlaveRebellionUtility.StartSlaveRebellion` (RimWorld/SlaveRebellionUtility.cs:403). The offender filter gains prisoners of the colony for the prison break act only. - **How:** Postfixes on `PrisonBreakUtility.StartPrisonBreak` (RimWorld/PrisonBreakUtility.cs:214, whose out list names the escapees) and `SlaveRebellionUtility.StartSlaveRebellion` (RimWorld/SlaveRebellionUtility.cs:403). For the prison break act only, the offender filter gains prisoners of the colony that serve a Laws sentence or sit in Laws' custody ("Jail, then trial"); colony slaves are offenders already.
- **Save and removal:** Cases only. - **Save and removal:** Cases only.
- **Overlaps:** Blax Slaves owns rebellion; the rebellion act only records who rebelled. - **Overlaps:** Blax Slaves owns rebellion; the rebellion act only records who rebelled.
- **Replaces:** Law and Order's sabotage crime, partly. - **Replaces:** Law and Order's sabotage crime, partly.
- **Effort:** S plus S. - **Effort:** S plus S.
- **Tests:** One case per act; the slave rebellion test skips without Ideology. - **Tests:** One case per act; a captured raider in the same break opens nothing; a convict's prison break row offers Warn, Add days and Execute only; the slave rebellion test skips without Ideology.
### Crimes, step 3: crimes against the faith ### Crimes, step 3: crimes against the faith
Not specced yet: "anything my ideoligion forbids" and apostasy (see `docs/features.md`). Needs Ideology and a check of the precept code in the decompiled game. Not specced yet: "anything the colony's ideoligion forbids" and "left the colony's ideoligion" (see `docs/features.md`). Both run on hook H, so no new hook is needed. The group reads every precept comp whose `eventDef` is the recorded event and that gives the doer or those who learn of it a bad thought (`PreceptComp_SelfTookMemoryThought`, RimWorld/PreceptComp_SelfTookMemoryThought.cs:8, 16; `PreceptComp_KnowsMemoryThought`) or is a `PreceptComp_UnwillingToDo`. UnwillingToDo alone would miss meat, cannibalism and organ use, which have none (Ideology/Defs/PreceptDefs/Precepts_MeatEating.xml:25-45), and where it exists vanilla already stops the pawn's own job (RimWorld/IdeoUtility.cs:109-116). Leaving the ideoligion is the `ChangedIdeo` event, recorded while the old ideoligion is still set (RimWorld/Pawn_IdeoTracker.cs:189-192). Needs Ideology.
### Enforcement and punishments, step 1 (first release) ### Enforcement and punishments, step 1
#### Enforcement and cases #### Enforcement and cases
@ -383,6 +401,7 @@ Not specced yet: "anything my ideoligion forbids" and apostasy (see `docs/featur
- A downed offender a doctor has already reserved for a rescue: no arrest starts, no reservation error or warning is logged, and the sweep arrests it once the reservation is gone. - A downed offender a doctor has already reserved for a rescue: no arrest starts, no reservation error or warning is logged, and the sweep arrests it once the reservation is gone.
- Hand-over: the drug lies next to the binger, starter rows active. One enforcer acts, the pawn ends as a prisoner, never in a medical bed, and the case log shows one did-it outcome. - Hand-over: the drug lies next to the binger, starter rows active. One enforcer acts, the pawn ends as a prisoner, never in a medical bed, and the case log shows one did-it outcome.
- "Enforce laws" off: cases open and close, nothing is enforced. - "Enforce laws" off: cases open and close, nothing is enforced.
- A forced berserk with a Jail row: nobody is sent while it rages; once the break ends, or the test downs the pawn, it is arrested or captured. A raid still blocks every case as before.
#### Warn and guilty #### Warn and guilty
@ -411,7 +430,8 @@ Not specced yet: "anything my ideoligion forbids" and apostasy (see `docs/featur
- Blunt on a non-solid part makes a Bruise: no bleeding, pain 0.0125 per point (Core Defs/HediffDefs/Hediffs_Local_Injuries.xml:383-400). A pawn goes down when pain reaches its pain shock threshold (Verse/Pawn_HealthTracker.cs:101), 0.8 for a normal adult, so about 64 points or 11 hits. - Blunt on a non-solid part makes a Bruise: no bleeding, pain 0.0125 per point (Core Defs/HediffDefs/Hediffs_Local_Injuries.xml:383-400). A pawn goes down when pain reaches its pain shock threshold (Verse/Pawn_HealthTracker.cs:101), 0.8 for a normal adult, so about 64 points or 11 hits.
- `instigatorGuilty: false` skips vanilla's guilt for harming a player pawn (Verse/Pawn_HealthTracker.cs:321-329). Calling `TakeDamage` directly sets no `meleeThreat`, which a vanilla melee verb would (RimWorld/Verb_MeleeAttack.cs:33-37), so the target doesn't turn on the enforcer. The target does get `HarmedMe` toward the enforcer (Verse/Pawn_HealthTracker.cs:379-382). - `instigatorGuilty: false` skips vanilla's guilt for harming a player pawn (Verse/Pawn_HealthTracker.cs:321-329). Calling `TakeDamage` directly sets no `meleeThreat`, which a vanilla melee verb would (RimWorld/Verb_MeleeAttack.cs:33-37), so the target doesn't turn on the enforcer. The target does get `HarmedMe` toward the enforcer (Verse/Pawn_HealthTracker.cs:379-382).
- Going down runs `RecoverFromState` (Verse/Pawn_HealthTracker.cs:850-853), which gives the break's `moodRecoveryThought`, Catharsis for the six watched breaks (MentalStates_Mood.xml:76, 103, 413, 539), when the break was mood-caused (Verse.AI/MentalState.cs:92-95). The driver reads that thought def before the hit and, if the hit downed the pawn, removes the memory gained this tick. - Going down runs `RecoverFromState` (Verse/Pawn_HealthTracker.cs:850-853), which gives the break's `moodRecoveryThought`, Catharsis for the six watched breaks (MentalStates_Mood.xml:76, 103, 413, 539), when the break was mood-caused (Verse.AI/MentalState.cs:92-95). The driver reads that thought def before the hit and, if the hit downed the pawn, removes the memory gained this tick.
- The job ends with a message once three hits in a row haven't raised `hediffSet.PainTotal` (Verse/HediffSet.cs:57, which multiplies in pain factors at :1351-1353): go-juice, painkillers, or every reachable part at its cap. A hard ceiling of 40 hits backs that up. A "subdue then jail" row arrests instead, which works on a pawn in a non-aggro break (Verse.AI/GenAI.cs:73-103). - The job ends with a message once three hits in a row haven't raised `hediffSet.PainTotal` (Verse/HediffSet.cs:57, which multiplies in pain factors at :1351-1353): go-juice, painkillers, or every reachable part at its cap. A hard ceiling of 40 hits backs that up. A "subdue then jail" row arrests instead, which works on a pawn in any break that isn't hostile to the arrester (Verse.AI/GenAI.cs:73-103, the check at :83).
- Aggressive breaks that aren't hostile (tantrums, murderous and sadistic rage, slaughterer) can be subdued: their state targets things, a named victim, prisoners or animals, never the enforcer, and the direct `TakeDamage` gives them no melee threat to answer. The enforcer pick skips the victim a murderous rage names (`MentalState_MurderousRage.target`).
- "Subdue then jail": in the tick the hit downs the target, the driver puts vanilla `JobDefOf.Capture` to a prisoner bed at the front of the enforcer's job queue (`jobQueue.EnqueueFirst`, Verse.AI/JobQueue.cs:40) and ends its toil, so the capture is the enforcer's next job, ahead of a doctor's rescue (RimWorld/WorkGiver_RescueDowned.cs:38-60). A queued job fails its reservations silently (`fromQueue`, Verse.AI/Pawn_JobTracker.cs:336, 373-375), and a queued vanilla Capture is safe in a save. Guilt is renewed before the job is queued, as for any capture (see "Jail for N days"), since a downed colonist can be captured only while guilty (Verse.AI/GenAI.cs:39-67). - "Subdue then jail": in the tick the hit downs the target, the driver puts vanilla `JobDefOf.Capture` to a prisoner bed at the front of the enforcer's job queue (`jobQueue.EnqueueFirst`, Verse.AI/JobQueue.cs:40) and ends its toil, so the capture is the enforcer's next job, ahead of a doctor's rescue (RimWorld/WorkGiver_RescueDowned.cs:38-60). A queued job fails its reservations silently (`fromQueue`, Verse.AI/Pawn_JobTracker.cs:336, 373-375), and a queued vanilla Capture is safe in a save. Guilt is renewed before the job is queued, as for any capture (see "Jail for N days"), since a downed colonist can be captured only while guilty (Verse.AI/GenAI.cs:39-67).
- Downing drops the pawn's weapon and inventory forbidden (Verse/Pawn_HealthTracker.cs:856-859), as any downing does. - Downing drops the pawn's weapon and inventory forbidden (Verse/Pawn_HealthTracker.cs:856-859), as any downing does.
- Children (Biotech) never get this job; their row falls back as "Defaults I picked" says. - Children (Biotech) never get this job; their row falls back as "Defaults I picked" says.
@ -428,7 +448,8 @@ Not specced yet: "anything my ideoligion forbids" and apostasy (see `docs/featur
- A child offender with a subdue row is warned, and with a subdue then jail row is jailed without a beating (skipped: needs Biotech). - A child offender with a subdue row is warned, and with a subdue then jail row is jailed without a beating (skipped: needs Biotech).
- Save while the job runs: the .rws contains no "BlaxLaws_Subdue"; after the reload the enforcer runs another job and the sweep starts a new subdue within 250 ticks. Start `Vomit` with `resumeCurJobAfterwards` on the enforcer mid-subdue, then save: the .rws contains no "BlaxLaws_Subdue" and the enforcer's queue holds no subdue job. - Save while the job runs: the .rws contains no "BlaxLaws_Subdue"; after the reload the enforcer runs another job and the sweep starts a new subdue within 250 ticks. Start `Vomit` with `resumeCurJobAfterwards` on the enforcer mid-subdue, then save: the .rws contains no "BlaxLaws_Subdue" and the enforcer's queue holds no subdue job.
- A "subdue then jail" row ends with the pawn a prisoner, never in a medical bed, with a doctor free to rescue. - A "subdue then jail" row ends with the pawn a prisoner, never in a medical bed, with a doctor free to rescue.
- **Risks:** Tone: Blax Slaves cut torture and flogging as beyond vanilla's tone. Subdue is a short fistfight to stop a break, closer to vanilla's social fight than to flogging, and the description says so. An enforcer weaker than the offender still wins, since the target never strikes back; accepted for plain subdue; "Subdue for aggressive breaks" weighs Melee skill. - A forced tantrum and a forced murderous rage with subdue rows: both go down, the enforcer is never attacked and never the rage's named victim.
- **Risks:** Tone: Blax Slaves cut torture and flogging as beyond vanilla's tone. Subdue is a short fistfight to stop a break, closer to vanilla's social fight than to flogging, and the description says so. An enforcer weaker than the offender still wins, since the target never strikes back; accepted for plain subdue. A berserk pawn does strike back, with its weapon; that is why only the player can start a subdue on it ("Subdue a pawn that fights back").
#### Reprimand #### Reprimand
@ -450,19 +471,34 @@ Not specced yet: "anything my ideoligion forbids" and apostasy (see `docs/featur
- **Effort:** S. - **Effort:** S.
- **Tests:** The dialog appears and nothing happens without a click. A confirmed execution in a core-only run gives every colonist `KnowColonistExecuted` at stage 0 (-2) and nothing harsher, and the victim's spouse its grief thought. A confirmed plain banishment gives no colony-wide thought. - **Tests:** The dialog appears and nothing happens without a click. A confirmed execution in a core-only run gives every colonist `KnowColonistExecuted` at stage 0 (-2) and nothing harsher, and the victim's spouse its grief thought. A confirmed plain banishment gives no colony-wide thought.
### Enforcement and punishments, step 2: subdue a pawn that fights back Not specced yet: talk down and decide myself (see `docs/features.md`). Talk down ends a break through `MentalState.RecoverFromState`, which gives the break's catharsis (Verse.AI/MentalState.cs:92-95), so the spec decides whether "Subdued pawns lose their catharsis" covers it. Decide myself reuses the waiting case and "Arrest now".
#### Subdue for aggressive breaks ### Enforcement and punishments, step 2: with the sibling mods
- **Players get:** Subdue opens for aggressive breaks (berserk, murderous and sadistic rage, modded `IsAggro` states): only an enforcer with Melee at least the offender's goes, and when nobody qualifies a letter asks you to draft someone. #### Slaves' wardens first
- **How:** The enforcer pick (see "Enforcement runs a tick later") gains one filter for aggressive breaks: the candidate's Melee level at least the offender's. Without a candidate the case waits with a letter, and the sweep retries. Split out of the earlier "Violence" text on 2026-12-01; the details are still to be specced against the decompiled code.
- **Players get:** With Blax Slaves' "Wardens calm breakdowns" on, a slave in a non-violent break is left to Slaves' wardens: Laws files the case but sends no subdue. Its did-it rows still apply.
- **How:** `SlavesApi.CalmsBreaks`, bound by reflection at startup like the Castes calls (see "Works with the other Blax mods"), read before a subdue of a slave. Without Slaves or with the flag false, Laws subdues slaves as before.
- **Save and removal:** Nothing saved.
- **Overlaps:** Blax Slaves owns calming slaves.
- **Effort:** S.
- **Tests:** With Slaves in `-Compat` and the flag on, a slave's binge planning case with a subdue row sends nobody; with the flag off, a subdue. Skipped without Ideology or Slaves.
### Enforcement and punishments, step 3: subdue a pawn that fights back
#### Subdue a pawn that fights back
New: the outline below; the full spec comes before the step is built.
- **Players get:** For a break hostile to the colony (berserk), a "Subdue with <name>" button on the case and an alert while it waits. The case names the best candidate by Melee, the weapon it holds against the offender's, and health; pressing the button sends that pawn on the subdue job. Laws never sends anyone at a berserk pawn on its own: it hits back with its weapon at full damage while the subdue job deals capped bruises, so a Melee comparison alone would get enforcers killed in a permadeath colony.
- **How:** The button starts the subdue job like a player order. For this one case the danger rule leaves the offender out: Laws walks `map.attackTargetsCache.TargetsHostileToFaction(Faction.OfPlayer)` through `GenHostility.IsActiveThreatTo` (RimWorld/GenHostility.cs:238-258 does the same loop) and skips the offender, and skips `EnemiesAreNearby(offender)`. Any other threat still blocks. No letter: Laws adds no Letter class.
- **Save and removal:** Nothing new; the case records the subdue as before. - **Save and removal:** Nothing new; the case records the subdue as before.
- **Overlaps:** None. - **Overlaps:** None.
- **Replaces:** Drafting a fighter by hand against your own berserk colonist. - **Replaces:** Drafting a fighter by hand against your own berserk colonist.
- **Effort:** S. - **Effort:** S.
- **Tests:** An aggressive break with a subdue row sends only an enforcer whose Melee is at least the offender's; with none, one letter and no job. - **Tests:** A forced berserk with a subdue choice: nobody is sent until the button is pressed; after it, the named pawn subdues it; a raid on the map still blocks the button's job.
### Sentences, step 1: serve and come back (first release) ### Sentences, step 1: serve and come back
#### Jail for N days #### Jail for N days
@ -478,7 +514,7 @@ Not specced yet: "anything my ideoligion forbids" and apostasy (see `docs/featur
- The sentence record stores the capture tick, the release tick (capture plus the sentence) and the bed the pawn owned before the arrest job. Every 2500 ticks, a served sentence gets `SetExclusiveInteraction(Release)`. Wardens take it through `WorkGiver_Warden_ReleasePrisoner` (RimWorld/WorkGiver_Warden_ReleasePrisoner.cs:8-36), which skips downed prisoners and prisoners in a break (:15-19). `JobDriver_ReleasePrisoner` carries the pawn out and calls `GenGuest.PrisonerRelease` (Verse.AI/JobDriver_ReleasePrisoner.cs:31-37): `WasImprisoned` (-6 mood for 12 days; RimWorld/GenGuest.cs:10-13), `UnclaimAll` (:47; Pawn_Ownership.cs:286-292), and `SetGuestStatus(null)` because the home faction is the player (:55-62). Laws never patches the release job driver; Rimocracy's patch there broke every release (NullReferenceException, reported 2025-07 and 2025-08). - The sentence record stores the capture tick, the release tick (capture plus the sentence) and the bed the pawn owned before the arrest job. Every 2500 ticks, a served sentence gets `SetExclusiveInteraction(Release)`. Wardens take it through `WorkGiver_Warden_ReleasePrisoner` (RimWorld/WorkGiver_Warden_ReleasePrisoner.cs:8-36), which skips downed prisoners and prisoners in a break (:15-19). `JobDriver_ReleasePrisoner` carries the pawn out and calls `GenGuest.PrisonerRelease` (Verse.AI/JobDriver_ReleasePrisoner.cs:31-37): `WasImprisoned` (-6 mood for 12 days; RimWorld/GenGuest.cs:10-13), `UnclaimAll` (:47; Pawn_Ownership.cs:286-292), and `SetGuestStatus(null)` because the home faction is the player (:55-62). Laws never patches the release job driver; Rimocracy's patch there broke every release (NullReferenceException, reported 2025-07 and 2025-08).
- Fallback: one day after the due tick without a release, Laws calls `GenGuest.PrisonerRelease` itself. - Fallback: one day after the due tick without a release, Laws calls `GenGuest.PrisonerRelease` itself.
- Early end: once a jailed pawn is no longer `IsPrisonerOfColony` before its release tick (recruited, released by you or another mod, escaped, dead), the sentence closes with that outcome and a message. - Early end: once a jailed pawn is no longer `IsPrisonerOfColony` before its release tick (recruited, released by you or another mod, escaped, dead), the sentence closes with that outcome and a message.
- Hold: an Ideology role holder would lose its role on arrest, because `Precept_Role.ValidatePawn` refuses a player pawn that isn't a free non-slave colonist (RimWorld/Precept_Role.cs:582-585), and a mechanitor's mechs would shut down. While "Release gives back what jail took" is switched off, Laws doesn't arrest those on its own: the case waits with "Arrest now" and a letter. Guilt is set at filing anyway and renewed when "Arrest now" starts the job. - Hold: an Ideology role holder would lose its role on arrest, because `Precept_Role.ValidatePawn` refuses a player pawn that isn't a free non-slave colonist (RimWorld/Precept_Role.cs:582-585), and a mechanitor's mechs would shut down. In the first release, and later while "Release gives back what jail took" is switched off, Laws doesn't arrest those on its own: the case waits with "Arrest now" and a letter. Guilt is set at filing anyway and renewed when "Arrest now" starts the job.
- Slaves: without "Jail for slaves" Laws never jails a slave. Releasing an imprisoned slave sends it back to its old faction and off the map (RimWorld/GenGuest.cs:14-19; Pawn_GuestTracker.cs:479-482), so slave jail waits for that feature's re-enslave. A slave's jail row falls back to subdue while it is in its break, else to warn. - Slaves: without "Jail for slaves" Laws never jails a slave. Releasing an imprisoned slave sends it back to its old faction and off the map (RimWorld/GenGuest.cs:14-19; Pawn_GuestTracker.cs:479-482), so slave jail waits for that feature's re-enslave. A slave's jail row falls back to subdue while it is in its break, else to warn.
- **Settings:** "Letters for jailings" (on). Days per row. - **Settings:** "Letters for jailings" (on). Days per row.
- **Save and removal:** The sentence lives in the case. After removal a jailed colonist stays a vanilla prisoner of the colony; its guilt runs out on its own. - **Save and removal:** The sentence lives in the case. After removal a jailed colonist stays a vanilla prisoner of the colony; its guilt runs out on its own.
@ -519,7 +555,7 @@ Not specced yet: "anything my ideoligion forbids" and apostasy (see `docs/featur
### Sentences, step 2: with the sibling mods ### Sentences, step 2: with the sibling mods
Each part waits for its sibling or for Fabian's answer. Indenture as a sentence is an open question in `docs/features.md`, not specced. Each part waits for its sibling or for Fabian's answer. Confinement for N days is New in `docs/features.md`, not specced; it needs a timed caste assignment from Castes. Indenture as a sentence is an idea there.
#### Castes keeps the caste #### Castes keeps the caste
@ -535,17 +571,18 @@ Each part waits for its sibling or for Fabian's answer. Indenture as a sentence
- **Players get:** Jail rows apply to slaves. A jailed slave is a slave again when the sentence ends, and stays on the map. - **Players get:** Jail rows apply to slaves. A jailed slave is a slave again when the sentence ends, and stays on the map.
- **How:** Arresting a slave sets its old faction (RimWorld/Pawn_GuestTracker.cs:479-482); a release would send it off the map (RimWorld/GenGuest.cs:14-19). At the end Laws calls `guest.SetGuestStatus(Faction.OfPlayer, GuestStatus.Slave)` (RimWorld/Pawn_GuestTracker.cs:485-507) instead of releasing. That skips `GenGuest.TryEnslavePrisoner` (RimWorld/GenGuest.cs:127-155), so no `EnslavedPrisoner` precept event fires. A slave in a break isn't `IsColonist` (Verse/Pawn.cs:518-527), so guilt doesn't make its arrest certain; the arrester's Social decides, and a refusal is vanilla's berserk. - **How:** Arresting a slave sets its old faction (RimWorld/Pawn_GuestTracker.cs:479-482); a release would send it off the map (RimWorld/GenGuest.cs:14-19). At the end Laws calls `guest.SetGuestStatus(Faction.OfPlayer, GuestStatus.Slave)` (RimWorld/Pawn_GuestTracker.cs:485-507) instead of releasing. That skips `GenGuest.TryEnslavePrisoner` (RimWorld/GenGuest.cs:127-155), so no `EnslavedPrisoner` precept event fires. A slave in a break isn't `IsColonist` (Verse/Pawn.cs:518-527), so guilt doesn't make its arrest certain; the arrester's Social decides, and a refusal is vanilla's berserk.
- Indentured slaves: before the arrest Laws reads `SlavesApi.TermDaysLeft`. In Blax Slaves' plan an arrest ends an indentured term like any imprisonment (its open question 1), so the re-enslave at the end would leave an indentured servant a slave for life. While a term runs, Laws doesn't jail: the row falls back to subdue while the slave is in its break, else to warn, as for slaves without this feature, until Slaves offers a hint that keeps the term through a Laws sentence.
- **Needs:** Ideology; without it the option doesn't exist, since there are no slaves. - **Needs:** Ideology; without it the option doesn't exist, since there are no slaves.
- **Save and removal:** The case remembers that the prisoner was a slave. After removal a jailed slave stays a prisoner of its old faction in your prison, as vanilla's Imprison mode leaves it. - **Save and removal:** The case remembers that the prisoner was a slave. After removal a jailed slave stays a prisoner of its old faction in your prison, as vanilla's Imprison mode leaves it.
- **Overlaps:** Vanilla's Imprison slave mode does the arrest by hand; Laws adds the way back. - **Overlaps:** Vanilla's Imprison slave mode does the arrest by hand; Laws adds the way back.
- **Replaces:** Nothing. - **Replaces:** Nothing.
- **Effort:** S. - **Effort:** S.
- **Tests:** A slave jailed for 1 day is a slave of the colony again afterwards, never leaves the map, and no `EnslavedPrisoner` event was recorded. Skipped without Ideology. - **Tests:** A slave jailed for 1 day is a slave of the colony again afterwards, never leaves the map, and no `EnslavedPrisoner` event was recorded. With Slaves in `-Compat` once it ships indentured servitude, an indentured slave with a jail row is subdued or warned, never jailed. Skipped without Ideology.
- **Risks:** This writes slave status, which Blax Slaves owns. It only puts back the status the sentence took. Open decision for Fabian. - **Risks:** This writes slave status, which Blax Slaves owns. It only puts back the status the sentence took. Open decision for Fabian, together with the term hint.
### Repeat offenders ### Repeat offenders
Not specced yet: criminal record, escalation and probation (see `docs/features.md`). Needs the first release's cases. Not specced yet: the criminal record and probation (step 1), escalation (step 2) (see `docs/features.md`). Step 1 needs the first release's cases, probation also "Pardon, early release and longer sentences". The record keeps convictions after "Keep closed cases" prunes them (7 to 360 days), so the court's repeat term reads the record, never closed cases.
### Court, step 1: Ideology's trial as a punishment ### Court, step 1: Ideology's trial as a punishment
@ -565,25 +602,36 @@ Not specced yet: criminal record, escalation and probation (see `docs/features.m
- **Players get:** "Trial" works on the core game. A case with a trial row waits in the Cases tab with "Convene court" and a gizmo on the accused, or convenes itself at the court hour when you switch that on (see "Court on its own"). With Ideology, the vanilla trial still closes the case (see "Trial through Ideology's ritual"). - **Players get:** "Trial" works on the core game. A case with a trial row waits in the Cases tab with "Convene court" and a gizmo on the accused, or convenes itself at the court hour when you switch that on (see "Court on its own"). With Ideology, the vanilla trial still closes the case (see "Trial through Ideology's ritual").
- **How:** The case file gains judge, prosecutor, evidence term, session results and a short transcript of plain strings. The judge office (pawn, appointed by you) lives in the component. - **How:** The case file gains judge, prosecutor, evidence term, session results and a short transcript of plain strings. The judge office (pawn, appointed by you) lives in the component.
- **Acting judge:** when the judge is the accused, the victim, or family of either (`pawn.relations.FamilyByBlood` plus spouse and lover), or is dead, jailed, away from the map or gone, the session uses the best uninvolved candidate: a free adult colonist who isn't involved, by Social. The convene dialog names the acting judge and why. "Court on its own" skips a case that has no uninvolved candidate, and the Cases tab says why. The same rule serves elected judges (Colony votes, step 2) and appeals (Court, step 4).
- **Save and removal:** All in the component. - **Save and removal:** All in the component.
- **Overlaps:** RimCourt (3790057068, 8.8k, 1.7) is "you rule civil disputes as the lord"; Laws is "the colony tries those who break its laws". Its author called a colony vote "kind of a different mod". - **Overlaps:** RimCourt (3790057068, 8.8k, 1.7) is "you rule civil disputes as the lord"; Laws is "the colony tries those who break its laws". Its author called a colony vote "kind of a different mod".
- **Replaces:** The vanilla trial as the only court; Law and Order's trials. - **Replaces:** The vanilla trial as the only court; Law and Order's trials.
- **Effort:** M. - **Effort:** M.
- **Tests:** A trial row files a waiting case with no guilt; "Convene court" opens the dialog. - **Tests:** A trial row files a waiting case with no guilt; "Convene court" opens the dialog. A case whose appointed judge is the accused's spouse convenes with an acting judge, and the dialog names the reason.
#### Jail, then trial
- **Players get:** A punishment for did-it rows: the offender is arrested at once, as for Jail, waits in custody on Maintain only and goes to court. A conviction gives the row's days minus the days already served in custody; an acquittal releases it and closes the case. A plain Trial row arrests nobody, so a binger who already took some would keep bingeing until the court sits; this is the row for Fabian's "jail and maybe court". With Ideology, the leader's Accuse ability can also try a case in custody.
- **How:** The arrest is Jail's (see "Jail for N days"): guilt right before the Arrest or Capture job makes it certain (Verse/Pawn.cs:4085-4089; a downed free colonist can only be captured while guilty, Verse.AI/GenAI.cs:59-66), and without it the arrester's `ArrestSuccessChance` decides and a refusal is berserk (Verse/Pawn.cs:4099, 4132-4135). Hook K's postfix clears that guilt at the capture with `Notify_Guilty(0)` (RimWorld/Pawn_GuiltTracker.cs:46-49): custody is no conviction, and a guilty pawn can't be accused in the vanilla trial (RimWorld/CompAbilityEffect_StartTrial.cs:44-47). Maintain only two ticks after the capture, as for Jail. A conviction turns the custody into a sentence: release tick = capture tick plus the row's days, with the verdict's guilt. An acquittal sets Release at once. An escape closes the case as escaped, by Jail's early-end rule. Court days (Court, step 4) keep the accused in this custody between the days.
- **Save and removal:** The custody lives in the case like a sentence. After removal the pawn stays a vanilla prisoner of the colony.
- **Overlaps:** None.
- **Replaces:** Nothing.
- **Effort:** S.
- **Tests:** A did-it binge case with "Jail, then trial, 5 days": the binger is a prisoner within 2500 ticks against a Social 0 arrester, is not guilty after the capture, and its case waits for court. Convicted after 2 days in custody, it is released 3 days later; acquitted, it is released at once. With Ideology the leader can accuse it (skipped without Ideology).
#### Convene dialog #### Convene dialog
- **Players get:** The familiar ritual-style window: role slots for judge, prosecutor, accused and spectators, a place picker (party spot, any table; from Royalty a throne; from Ideology a ritual spot or lectern), and every verdict factor with the expected conviction chance. - **Players get:** The familiar ritual-style window: role slots for judge, prosecutor, accused and spectators, a place picker (party spot, any table; from Royalty a throne; from Ideology a ritual spot or lectern), and every verdict factor with the expected conviction chance.
- **How:** `Dialog_BeginLordJob` (RimWorld/Dialog_BeginLordJob.cs:10, factors at :343, label at :81) and `PawnRoleSelectionWidgetBase<CourtRole>` (RimWorld/PawnRoleSelectionWidgetBase.cs:13), which carry no precept and no DLC check; Anomaly's psychic rituals use them the same way (RimWorld/Dialog_BeginPsychicRitual.cs). A half-day spike confirms the dialog in a core-only game before the rest is built. - **How:** `Dialog_ConveneCourt : Window` of our own, with its header, the place picker, the factor list with the chance and the button row, laid out like vanilla's ritual window. It reuses only `PawnRoleSelectionWidgetBase<CourtRole>` (RimWorld/PawnRoleSelectionWidgetBase.cs:13) for the role slots; its constructor has no DLC check (:101). `Dialog_BeginLordJob` isn't used: its constructor sets the participants drawer, `closeOnClickedOutside`, `absorbInputAroundWindow` and `forcePause` only inside `if (ModLister.CheckAnyExpansion("Ritual"))` (RimWorld/Dialog_BeginLordJob.cs:134-143). That check asks which DLCs are installed, not which are active (Verse/ModLister.cs:283-286, 426-428), and logs an error when none is (:347-353), so a player who owns no DLC would get a logged error and a court dialog without its role column. A half-day spike confirms the dialog in a core-only game before the rest is built.
- **Save and removal:** The last place is stored by ThingID. - **Save and removal:** The last place is stored by ThingID.
- **Overlaps:** None. - **Overlaps:** None.
- **Replaces:** Nothing. - **Replaces:** Nothing.
- **Effort:** M. - **Effort:** M.
- **Tests:** The dialog builds in a `-NoDlc` run; the factor list sums to the chance shown. - **Tests:** The dialog builds in a `-NoDlc` run and no `ModLister.Check*` error is logged when it opens; the factor list sums to the chance shown. A `-NoDlc` run only deactivates DLCs that stay installed, so it can't trigger the install check itself; the test also asserts that `Dialog_ConveneCourt` doesn't derive from `Dialog_BeginLordJob`.
#### Court on its own #### Court on its own
- **Players get:** "Convene court on its own" (off) and "Court hour" (10). When on, a waiting case convenes at the next court hour at the last place you used, with the appointed judge and the default prosecutor, when the judge and the accused are free (not drafted, downed, in a break or in another gathering) and no hostiles threaten the map. Otherwise it tries again the next day. A message names the case; no click needed. With it off, the court sits only when you press "Convene court". - **Players get:** "Convene court on its own" (off) and "Court hour" (10). When on, a waiting case convenes at the next court hour at the last place you used, with the judge (or the acting judge, see "Cases go to trial") and the default prosecutor, when the judge and the accused are free (not drafted, downed, in a break or in another gathering) and no hostiles threaten the map. A case with no uninvolved judge waits, and the Cases tab says why. Otherwise it tries again the next day. A message names the case; no click needed. With it off, the court sits only when you press "Convene court".
- **How:** Every 2500 ticks the component compares `GenLocalDate.HourOfDay(map)` (RimWorld/GenLocalDate.cs:16) with the court hour and starts the same lord job as the dialog, one case at a time, oldest and gravest first. Court days reuse this scheduler. - **How:** Every 2500 ticks the component compares `GenLocalDate.HourOfDay(map)` (RimWorld/GenLocalDate.cs:16) with the court hour and starts the same lord job as the dialog, one case at a time, oldest and gravest first. Court days reuse this scheduler.
- **Settings:** "Convene court on its own" (off), "Court hour" (10, 0 to 23). - **Settings:** "Convene court on its own" (off), "Court hour" (10, 0 to 23).
- **Save and removal:** Settings only; the last place is already in the component. - **Save and removal:** Settings only; the last place is already in the component.
@ -595,16 +643,16 @@ Not specced yet: criminal record, escalation and probation (see `docs/features.m
#### Court session #### Court session
- **Players get:** The roles walk to the place, spectators gather, the judge and the speakers trade arguments in speech bubbles for about two in-game hours, and a letter gives the verdict and the sentence. A warden brings a jailed accused and takes it back afterwards. Danger, a drafted or downed role pawn, or a missing judge calls the session off; the case stays open. - **Players get:** The roles walk to the place, spectators gather, the judge and the speakers trade arguments in speech bubbles for about two in-game hours, and a letter gives the verdict and the sentence. A warden brings a jailed accused and takes it back afterwards. Danger, a drafted or downed role pawn, or a missing judge calls the session off; the case stays open.
- **How:** `LordJob_BlaxCourtSession : LordJob_Joinable_Gathering` (RimWorld/LordJob_Joinable_Gathering.cs:7, call-off at :40), toils after the marriage ceremony pattern (RimWorld/LordJob_Joinable_MarriageCeremony.cs:7). Core duties only: ArriveToCell and DeliverPawnToCell (Core Defs/DutyDefs/Duties_Rituals.xml:5, 55), Spectate and GiveSpeech (Core Defs/DutyDefs/Duties_Gatherings.xml:55, 139). Bubbles through `MoteMaker.MakeInteractionBubble` (RimWorld/MoteMaker.cs:181), not `TryInteractWith`, which writes a play log entry holding the InteractionDef (RimWorld/Pawn_InteractionsTracker.cs:249). One gathering at a time, as vanilla allows. - **How:** `LordJob_BlaxCourtSession : LordJob_Joinable_Gathering` (RimWorld/LordJob_Joinable_Gathering.cs:7, call-off at :40), toils after the marriage ceremony pattern (RimWorld/LordJob_Joinable_MarriageCeremony.cs:7). Core duties only: ArriveToCell for the judge and the speakers, which walks to the cell and stands there with `JobGiver_Idle` (Core Defs/DutyDefs/Duties_Rituals.xml:5-22), DeliverPawnToCell for a jailed accused (:55) and Spectate for the crowd (Core Defs/DutyDefs/Duties_Gatherings.xml:55). Core's GiveSpeech duty (:139) isn't used: its only job giver, `JobGiver_GiveSpeech`, returns no job unless the duty's focus is a `Building_Throne` assigned to the speaker (RimWorld/JobGiver_GiveSpeech.cs:19-22), so at a party spot or a table the judge and the attorneys would reach their cell, get no job and walk off to work. The lord toil's tick plays the speech bubbles through `MoteMaker.MakeInteractionBubble` (RimWorld/MoteMaker.cs:181), not `TryInteractWith`, which writes a play log entry holding the InteractionDef (RimWorld/Pawn_InteractionsTracker.cs:249), and the speech sound. Laws adds no DutyDef: a duty is saved in `mindState.duty` while a session runs, so an own one would be one more def for the removal button to clear. One gathering at a time, as vanilla allows.
- **Save and removal:** A running session is a vanilla lord with our LordJob class; see the removal button. - **Save and removal:** A running session is a vanilla lord with our LordJob class and vanilla duties; see the removal button.
- **Overlaps:** Party and ritual mods block a session while their gathering runs, and the other way round. - **Overlaps:** Party and ritual mods block a session while their gathering runs, and the other way round.
- **Replaces:** Nothing. - **Replaces:** Nothing.
- **Effort:** M. - **Effort:** M.
- **Tests:** A session from convene to verdict in a `-NoDlc` run; a drafted judge calls it off and the case stays open; a jailed accused is back in its bed afterwards. - **Tests:** A session from convene to verdict in a `-NoDlc` run at a party spot, with the judge and both speakers at their cells for the whole session; a drafted judge calls it off and the case stays open; a jailed accused is back in its bed afterwards.
#### Verdict and sentence #### Verdict and sentence
- **Players get:** Conviction chance P = 0.5 + evidence + 0.25 x (prosecutor's negotiation ability minus the accused's) + judge bias, clamped to 0.1 to 0.9. Evidence, from what the case already records: did it +0.25, each count past the first +0.05 up to +0.15, planning only (stopped before acting) 0, a repeat conviction for the same law within 60 days +0.10. Laws sees every act as it happens, so there is no "found later" term; witnesses are in the Backlog. Judge bias: -0.2 x the judge's opinion of the accused / 100. No crowd term. Convicted: the row's sentence, with guilt for at least 15 days as vanilla's trial gives (RimWorld/RitualOutcomeEffectWorker_Trial.cs:8), and "Convicted" -15 for 20 days. Acquitted: +8 for 10 days. - **Players get:** Conviction chance P = 0.5 + evidence + 0.25 x (prosecutor's negotiation ability minus the accused's) + judge bias, clamped to 0.1 to 0.9. Evidence, from what the case already records: did it +0.25, each count past the first +0.05 up to +0.15, planning only (stopped before acting) 0, a repeat conviction for the same law within 60 days +0.10, read from the criminal record (Repeat offenders, step 1), never from closed cases, which "Keep closed cases" may prune after 7 days. Laws sees every act as it happens, so there is no "found later" term; witnesses are in the Backlog. Judge bias: -0.2 x the judge's opinion of the accused / 100. No crowd term. Convicted: the row's sentence, with guilt for at least 15 days as vanilla's trial gives (RimWorld/RitualOutcomeEffectWorker_Trial.cs:8), and "Convicted" -15 for 20 days. Acquitted: +8 for 10 days.
- **How:** Negotiation ability is 0.4 plus a Social bonus, times Talking and Hearing (Core Defs/Stats/Stats_Pawns_Social.xml:5-32), the scale vanilla's trial uses. Without an attorney (see "Defence and prosecution") the accused speaks for itself. Opinion comes from `OpinionOf` (RimWorld/Pawn_RelationsTracker.cs:592). Thoughts are situational, as for Reprimand. - **How:** Negotiation ability is 0.4 plus a Social bonus, times Talking and Hearing (Core Defs/Stats/Stats_Pawns_Social.xml:5-32), the scale vanilla's trial uses. Without an attorney (see "Defence and prosecution") the accused speaks for itself. Opinion comes from `OpinionOf` (RimWorld/Pawn_RelationsTracker.cs:592). Thoughts are situational, as for Reprimand.
- **Save and removal:** Session results in the case. - **Save and removal:** Session results in the case.
- **Overlaps:** None. - **Overlaps:** None.
@ -642,25 +690,28 @@ Not specced yet: appeals (see `docs/features.md`).
#### Court days #### Court days
- **Players get:** Serious and grave cases take 2 or 3 court days, one session a day at the court hour (see "Court on its own"), with an alert when court sits. The case window shows how each day went. The verdict on the last day comes from the mean of the days. An absent attorney means the accused speaks for itself that day; a failed day is rescheduled. The accused can be held in custody until the verdict. - **Players get:** Serious and grave cases take 2 or 3 court days, one session a day at the court hour (see "Court on its own"), with an alert when court sits. The case window shows how each day went. The verdict on the last day comes from the mean of the days. An absent attorney means the accused speaks for itself that day; a failed day is rescheduled. An accused in custody ("Jail, then trial") stays there until the verdict; a free accused comes to each court day.
- **How:** Each session computes its own P with that day's attendees, plus a small swing shown as "the day went to the prosecution" or "to the defence". Custody reuses jail without guilt. - **How:** Each session computes its own P with that day's attendees, plus a small swing shown as "the day went to the prosecution" or "to the defence". Custody is the one from "Jail, then trial": guilt only for the arrest, cleared at the capture. Custody without guilt would turn accused colonists berserk at the arrest (Verse/Pawn.cs:4085-4089, 4132-4135).
- **Save and removal:** Day results in the case. - **Save and removal:** Day results in the case.
- **Overlaps:** None. - **Overlaps:** None.
- **Replaces:** Nothing. - **Replaces:** Nothing.
- **Effort:** M for days and the tally, S for absences, S for custody. - **Effort:** M for days and the tally, S for absences.
- **Tests:** A grave case runs 3 days; the verdict uses the mean; an escape during custody closes the case as escaped. - **Tests:** A grave case runs 3 days; the verdict uses the mean; an escape during custody closes the case as escaped.
#### Courtrooms #### Courtrooms
- **Players get:** A room built around the court place counts as a courtroom when it is impressive enough. A verdict given there costs the convict less mood. - **Players get:** A verdict given in an impressive room costs the convict less mood: when the room around the court place reaches the courtroom impressiveness (setting), the convict gets the milder thought. The room keeps its own role, dining room, rec room or throne room.
- **How:** A `RoomRoleDef` whose worker scores a room holding the chosen court place, after `RoomRoleWorker_ThroneRoom` (RimWorld/RoomRoleWorker_ThroneRoom.cs:17-30). Room roles are computed, never saved. - **How:** At the verdict, `room.GetStat(RoomStatDefOf.Impressiveness)` (Verse/Room.cs:823) of the room that holds the court place. No `RoomRoleDef`: a room has exactly one role, the highest score of all role workers (Verse/Room.cs:872). A courtroom role that scores higher would take over the dining room, the rec room or the throne room, which scores 10000 (RimWorld/RoomRoleWorker_ThroneRoom.cs:17-30) and which a noble's throne room requirement needs (Royalty); one that scores lower would never show.
- **Save and removal:** Nothing saved; a room loses the role with the mod. - **Settings:** "Courtroom impressiveness".
- **Save and removal:** Nothing saved and no def to remove.
- **Overlaps:** RimCourt's seat spot is a different building. - **Overlaps:** RimCourt's seat spot is a different building.
- **Replaces:** Nothing. - **Replaces:** Nothing.
- **Effort:** M, plus S tests. - **Effort:** S, plus S tests.
- **Tests:** A room with the place and high impressiveness gets the role; the convict's thought is milder there. - **Tests:** A verdict at a place in a room above the setting gives the milder thought, below it the normal one; a throne room used as court place keeps its throne room role.
### Colony votes, step 1: the voting core and the judge's office ### Colony votes, step 1: the voting core and law votes
Needs the first release only: law votes count acts through the first release's hooks in tally-only mode and use nothing from the court.
#### Voting core #### Voting core
@ -672,9 +723,25 @@ Not specced yet: appeals (see `docs/features.md`).
- **Effort:** M. - **Effort:** M.
- **Tests:** The same tally twice gives the same result; an alert click opens the tab; the .rws holds no Laws letter class. - **Tests:** The same tally twice gives the same result; an alert click opens the tab; the .rws holds no Laws letter class.
#### Colony votes on the lawbook
- **Players get:** A per-save switch, off by default. Colonists propose a law after an act that has none (25% chance, at most once per action per 10 days), petition to repeal an unpopular one (every 10 days on average) or you press "Call a vote" on any row. One vote at a time, open for 24 hours. Each voter's score adds trait stances (a pyromaniac votes against a fire law, a teetotaler for a drug law), self-interest (a trait whose only break is the targeted one), what a bystander would feel unless the voter doesn't care, Ideology precepts on the act, opinion of the offender and the proposer, and low mood. A proposal passes with more yes than no votes and at least half the voters taking a side; a tie keeps the current law. The result letter gives each voter's main reason ("Bob: no (pyromaniac)"). You can back or veto the result; the overruled side gets a small mood penalty. You can always edit the lawbook directly.
- **How:** The voting core plus the score terms. An act without a law is invisible to the hooks (its flag is false and the hook returns at once), so while votes are on every category's flag is set in tally-only mode: the hooks count acts per catalogue entry in an unsaved tally and open no case, and a proposal rolls from that tally. Records stay out of the tally ("things hauled" would only produce noise); they come up through petitions and "Call a vote". The violent crimes are the exception, since their `Thing.TakeDamage` hook is hot in combat; they come up only through petitions and "Call a vote". Self-interest reads `TraitDegreeData.randomMentalState` and `theOnlyAllowedMentalBreaks` (RimWorld/TraitDegreeData.cs:35, 63), so modded traits count with no patch. Bystander immunity through `ThoughtUtility.ThoughtNullified` (RimWorld/ThoughtUtility.cs:305). The stance data lives in `ActStanceDef` XML keyed by act key (traits, bystander thought, history events with `MayRequire="Ludeon.RimWorld.Ideology"`), written for the common entries; an entry without one gets stances only from opinion and mood. The save format doesn't change. Precept comps are read directly, not through `Ideo.MemberWillingToDo`, which rolls a random chance inside (RimWorld/Ideo.cs:881).
- **Save and removal:** Proposals and open votes in the component.
- **Overlaps:** Rimocracy (2159080853, 6.3k) votes on leadership decisions; Laws votes only on lawbook rows and the judge.
- **Replaces:** Nothing.
- **Effort:** S plus S proposals, M scores and reasons, S plus S vote flow, S tests.
- **Tests:** A pyromaniac votes no on a fire law; a teetotaler yes on a drug law; a cannibal no on a cannibalism law; a friend of the offender no, a rival yes; 2 of 6 voters taking a side fails on quorum; overrule thoughts reach only the overruled side; with 60 voters opening and closing a vote stays under a millisecond budget. With votes on and an empty book, a forced fire-starting spree counts in the tally, opens no case and can raise a fire-law proposal; with votes off the fire flag stays false.
Not specced yet: pardon petitions (see `docs/features.md`). They need the voting core and "Pardon, early release and longer sentences", nothing from the court.
### Colony votes, step 2: the judge's office
Needs court sessions (Court, step 2), whose acting-judge rule the elected judge uses.
#### Judge election #### Judge election
- **Players get:** The judge holds office for 60 days. An election runs when the term ends, when the judge dies, leaves, is jailed or convicted, or when you press "Hold election". Each voter picks the candidate with the highest opinion plus 3 x Social level, +15 for itself; ties go to higher Social. You can confirm the winner or appoint someone else, which gives the overruled voters a small mood penalty. A recall vote comes up when the colony's mean opinion of the judge drops below -10. A judge who is the accused, the victim or family of the accused hands the case to an acting judge. - **Players get:** The judge holds office for 60 days. An election runs when the term ends, when the judge dies, leaves, is jailed or convicted, or when you press "Hold election". Each voter picks the candidate with the highest opinion plus 3 x Social level, +15 for itself; ties go to higher Social. You can confirm the winner or appoint someone else, which gives the overruled voters a small mood penalty. A recall vote comes up when the colony's mean opinion of the judge drops below -10. A judge involved in a case hands it to an acting judge by the rule in "Cases go to trial"; a by-election fills a vacancy, and the acting judge sits until it is decided.
- **How:** Opinion from `OpinionOf` (RimWorld/Pawn_RelationsTracker.cs:592), once per voter and candidate per election: 3600 lookups at 60 pawns, once per term. - **How:** Opinion from `OpinionOf` (RimWorld/Pawn_RelationsTracker.cs:592), once per voter and candidate per election: 3600 lookups at 60 pawns, once per term.
- **Settings:** "Judge: appointed (default), elected, ideoligion leader, moral guide". - **Settings:** "Judge: appointed (default), elected, ideoligion leader, moral guide".
- **Save and removal:** Office and term in the component. - **Save and removal:** Office and term in the component.
@ -690,21 +757,9 @@ Not specced yet: appeals (see `docs/features.md`).
- **Effort:** S. - **Effort:** S.
- **Tests:** With Ideology the leader presides; in a `-NoDlc` run the saved choice reads as elected. - **Tests:** With Ideology the leader presides; in a `-NoDlc` run the saved choice reads as elected.
### Colony votes, step 2: law votes ### Colony votes, step 3: the jury
#### Colony votes on the lawbook Not specced yet: the jury (see `docs/features.md`). Needs court sessions and the voting core.
- **Players get:** A per-save switch, off by default. Colonists propose a law after an act that has none (25% chance, at most once per action per 10 days), petition to repeal an unpopular one (every 10 days on average) or you press "Call a vote" on any row. One vote at a time, open for 24 hours. Each voter's score adds trait stances (a pyromaniac votes against a fire law, a teetotaler for a drug law), self-interest (a trait whose only break is the targeted one), what a bystander would feel unless the voter doesn't care, Ideology precepts on the act, opinion of the offender and the proposer, and low mood. A proposal passes with more yes than no votes and at least half the voters taking a side; a tie keeps the current law. The result letter gives each voter's main reason ("Bob: no (pyromaniac)"). You can back or veto the result; the overruled side gets a small mood penalty. You can always edit the lawbook directly.
- **How:** The voting core plus the score terms. An act without a law is invisible to the hooks (its flag is false and the hook returns at once), so while votes are on every category's flag is set in tally-only mode: the hooks count acts per catalogue entry in an unsaved tally and open no case, and a proposal rolls from that tally. Records stay out of the tally ("things hauled" would only produce noise); they come up through petitions and "Call a vote". The violent crimes are the exception, since their `Thing.TakeDamage` hook is hot in combat; they come up only through petitions and "Call a vote". Self-interest reads `TraitDegreeData.randomMentalState` and `theOnlyAllowedMentalBreaks` (RimWorld/TraitDegreeData.cs:35, 63), so modded traits count with no patch. Bystander immunity through `ThoughtUtility.ThoughtNullified` (RimWorld/ThoughtUtility.cs:305). The stance data lives in `ActStanceDef` XML keyed by act key (traits, bystander thought, history events with `MayRequire="Ludeon.RimWorld.Ideology"`), written for the common entries; an entry without one gets stances only from opinion and mood. The save format doesn't change. Precept comps are read directly, not through `Ideo.MemberWillingToDo`, which rolls a random chance inside (RimWorld/Ideo.cs:881).
- **Save and removal:** Proposals and open votes in the component.
- **Overlaps:** Rimocracy (2159080853, 6.3k) votes on leadership decisions; Laws votes only on lawbook rows and the judge.
- **Replaces:** Nothing.
- **Effort:** S plus S proposals, M scores and reasons, S plus S vote flow, S tests.
- **Tests:** A pyromaniac votes no on a fire law; a teetotaler yes on a drug law; a cannibal no on a cannibalism law; a friend of the offender no, a rival yes; 2 of 6 voters taking a side fails on quorum; overrule thoughts reach only the overruled side; with 60 voters opening and closing a vote stays under a millisecond budget. With votes on and an empty book, a forced fire-starting spree counts in the tally, opens no case and can raise a fire-law proposal; with votes off the fire flag stays false.
### Colony votes, step 3: jury and petitions
Not specced yet: the jury and pardon petitions (see `docs/features.md`).
### Headless tests ### Headless tests
@ -715,9 +770,13 @@ Not specced yet: the jury and pardon petitions (see `docs/features.md`).
- **Fixtures:** Colonist, ColonySlave (Ideology), Child (Biotech), Prisoner, `Tick`, `QuietStoryteller`, `SnapshotSettings` from Castes; new: `PrisonerBed(cell)`, `Drug(def, cell)`, `Table(cell)`, `Corpse(cell)`, `ForceBreak(pawn, def, chemical)`, `LawRow(actKey, option, stage, severity, punishment, days)`. The test mod ships its own defs for the catalogue tests: a drug ThingDef, an InteractionDef, a RecipeDef and a MentalStateDef plus MentalBreakDef that reuse `MentalState_FireStartingSpree`. - **Fixtures:** Colonist, ColonySlave (Ideology), Child (Biotech), Prisoner, `Tick`, `QuietStoryteller`, `SnapshotSettings` from Castes; new: `PrisonerBed(cell)`, `Drug(def, cell)`, `Table(cell)`, `Corpse(cell)`, `ForceBreak(pawn, def, chemical)`, `LawRow(actKey, option, stage, severity, punishment, days)`. The test mod ships its own defs for the catalogue tests: a drug ThingDef, an InteractionDef, a RecipeDef and a MentalStateDef plus MentalBreakDef that reuse `MentalState_FireStartingSpree`.
- **Compat runs:** `-Compat` adds Prison Labor, Prisoner Realism, Custom Prisoner Interactions, Hospitality, Vanilla Social Interactions Expanded, Humanoid Alien Races if installed (Law and Order's tab never showed for its pawns), Blax Castes, Blax Slaves, Blax Zones and Blax Defaults. Package ids are read from each installed About.xml and recorded in Compat.cs with their source, as Castes does. Prisoner Sentencing and Prison Expanded aren't installed; their early release is simulated with a direct `GenGuest.PrisonerRelease`. The catalogue tests run there too: the compat mods' defs must appear under their mod names. - **Compat runs:** `-Compat` adds Prison Labor, Prisoner Realism, Custom Prisoner Interactions, Hospitality, Vanilla Social Interactions Expanded, Humanoid Alien Races if installed (Law and Order's tab never showed for its pawns), Blax Castes, Blax Slaves, Blax Zones and Blax Defaults. Package ids are read from each installed About.xml and recorded in Compat.cs with their source, as Castes does. Prisoner Sentencing and Prison Expanded aren't installed; their early release is simulated with a direct `GenGuest.PrisonerRelease`. The catalogue tests run there too: the compat mods' defs must appear under their mod names.
- **Performance:** 60 colonists and the starter lawbook, 2500 ticks with and without Laws, median of three runs: Laws adds under 2%. The same with a "Records: things hauled" row and an "Ate: any meal" row, the two busiest hooks. - **Performance:** 60 colonists and the starter lawbook, 2500 ticks with and without Laws, median of three runs: Laws adds under 2%. The same with a "Records: things hauled" row and an "Ate: any meal" row, the two busiest hooks.
- **Combat:** a combat run with 20 colonists against raiders: `TakeDamage` (Violence) adds under 1% with the violence laws off. - **Phase 2:** phase 3 still expects exactly 2 errors. All 8 DLC combinations.
- **Effort:** S plus S for the harness copy, the compat and performance runs, plus S for the scaffold (csproj, startup, LawsLog, Compat, DlcSupport, the Tools copy, the art with a "scale" badge).
#### The release after the first
- **Combat:** with Violence, a combat run with 20 colonists against raiders: `TakeDamage` adds under 1% with the violence laws off. Effort S.
- **Phase 2:** also covers the give-back snapshots of "Release gives back what jail took"; phase 3 still expects exactly 2 errors. All 8 DLC combinations. - **Phase 2:** also covers the give-back snapshots of "Release gives back what jail took"; phase 3 still expects exactly 2 errors. All 8 DLC combinations.
- **Effort:** S plus S for the harness copy, the compat and performance runs, plus S for the scaffold (csproj, startup, LawsLog, Compat, DlcSupport, the Tools copy, the art with a "scale" badge), plus S for the combat run.
#### Court, step 1 #### Court, step 1
@ -740,19 +799,21 @@ Not specced yet: the jury and pardon petitions (see `docs/features.md`).
- Zones: sleeping spots, beds by zone, every friendly drop location and per-cell work rules (work rule areas); it never changes a pawn's work priorities or allowed area. - Zones: sleeping spots, beds by zone, every friendly drop location and per-cell work rules (work rule areas); it never changes a pawn's work priorities or allowed area.
- Slaves: slave status (except the status Laws gives back to a slave it jailed), trade, prices, suppression, rebellion, slave medicine and the slave economy. - Slaves: slave status (except the status Laws gives back to a slave it jailed), trade, prices, suppression, rebellion, slave medicine and the slave economy.
- Defaults: starting settings of vanilla stockpiles and growing zones, storage buildings, production bills, workbenches, buildings, animals and mechs, and what the game forbids when pawns go down, die or are stripped. It writes when something is made or joins, and through its opt-in forbid rules when a pawn goes down, dies or is stripped. It keeps nothing in the save. - Defaults: starting settings of vanilla stockpiles and growing zones, storage buildings, production bills, workbenches, buildings, animals and mechs, and what the game forbids when pawns go down, die or are stripped. It writes when something is made or joins, and through its opt-in forbid rules when a pawn goes down, dies or is stripped. It keeps nothing in the save.
- Laws: the colony's lawbook (which acts are crimes, at which stage, how severe and how they are punished), cases, sentences, trials, judges, attorneys and law votes. It acts through vanilla arrest, capture, release and guilt plus its own non-lethal subdue job. For the colonists it jailed, and only for them, it writes the prisoner interaction mode (Maintain only after the arrest, Release when the sentence ends) and gives back what the sentence took: bed, grave, throne, deathrest casket, ideoligion role, mech work modes and the weapon the arrest dropped. Only if Fabian agrees, it puts a slave it jailed back into slavery. It never sets policies, work priorities, allowed areas, zones or suppression. It keeps its state in one GameComponent. - Laws: the colony's lawbook (which acts are crimes, at which stage, how severe and how they are punished), cases, sentences, trials, judges, attorneys and law votes. It acts through vanilla arrest, capture, release and guilt plus its own non-lethal subdue job, and talks colonists out of a break (Slaves' wardens calm slaves). For the colonists it jailed, and only for them, it writes the prisoner interaction mode (Maintain only after the arrest, Release when the sentence ends) and gives back what the sentence took: bed, grave, throne, deathrest casket, ideoligion role, mech work modes and the weapon the arrest dropped. Only if Fabian agrees, it puts a slave it jailed back into slavery. It never sets policies, work priorities, allowed areas, zones or suppression. It keeps its state in one GameComponent.
### Blax Castes ### Blax Castes
- An arrest is vanilla `CapturedBy`, so Castes 1.0 already moves the jailed colonist to the new-prisoner row and a release within `formerCasteDays` (60) back to its old caste. Laws' 50-day limit on days keeps every sentence, the fallback day included, inside that window; "Add days" stops at 50 days in total until the API version 2 hint keeps the record. Once Castes' join API (API version 2) ships, an arrest without the hint lands in the captured row (Castes' new `CapturedBy` scope); Laws' "Castes keeps the caste" hints it. - An arrest is vanilla `CapturedBy`, so Castes 1.0 already moves the jailed colonist to the new-prisoner row and a release within `formerCasteDays` (60) back to its old caste. Laws' 50-day limit on days keeps every sentence, the fallback day included, inside that window; "Add days" stops at 50 days in total until the API version 2 hint keeps the record. Once Castes' join API (API version 2) ships, an arrest without the hint lands in the captured row (Castes' new `CapturedBy` scope); Laws' "Castes keeps the caste" hints it.
- The one write into Castes' area: the Maintain only and Release modes for pawns Laws jailed, in every version of both mods. With Castes' join API (API version 2), Laws' "Castes keeps the caste" sends `blax.laws.jailed` from hook K and `blax.laws.released` from hook L through `HintJoinReason`; Castes' prisoner caste then sets no mode on the hinted pawn, and Laws still writes Maintain only two ticks after the capture. - The one write into Castes' area: the Maintain only and Release modes for pawns Laws jailed, in every version of both mods. With Castes' join API (API version 2), Laws' "Castes keeps the caste" sends `blax.laws.jailed` from hook K and `blax.laws.released` from hook L through `HintJoinReason`; Castes' prisoner caste then sets no mode on the hinted pawn, and Laws still writes Maintain only two ticks after the capture.
- Laws never writes a policy, a schedule, medical care or a work priority. Jail keeps priorities because prisoners have no disabled work types; the `-Compat` run checks that Prison Labor doesn't change them. - Laws never writes a policy, a schedule, medical care or a work priority. Jail keeps priorities because prisoners have no disabled work types; the `-Compat` run checks that Prison Labor doesn't change them.
- "Confinement for N days" (Sentences, step 2, New) would ask Castes to put a convict into a caste the player picks for sentences and back through `blax.laws.released`. That needs a timed caste assignment in Castes' join API, which Castes doesn't plan yet (`docs/features.md`, open question 2).
- Castes' read-only API (version 1) lists Laws' caste checks as waiting on it: that is "Applies to" (Lawbook, step 2), which reads `CastesApi.CasteIdOf`.
### Blax Slaves ### Blax Slaves
- Slaves are offenders like colonists, with warn, guilty and subdue from the first release. Rebellion stays Slaves'; the slave rebellion act (Crimes, step 2) only records it. - Slaves are offenders like colonists, with warn, guilty and subdue from the first release. Rebellion stays Slaves'; the slave rebellion act (Crimes, step 2) only records it.
- Slaves' "Wardens calm breakdowns" calms slaves out of non-violent breaks. When a SlavesApi member says that feature is on, Laws doesn't subdue slaves and lets Slaves' wardens talk them down. - Slaves' "Wardens calm breakdowns" calms slaves out of non-violent breaks. When a SlavesApi member says that feature is on, Laws doesn't subdue slaves and lets Slaves' wardens talk them down.
- "Jail for slaves" puts a jailed slave back into slavery at the end, without vanilla's enslave event. It restores the status the sentence took; it's still a write to slave status, so it ships only if Fabian agrees. - "Jail for slaves" puts a jailed slave back into slavery at the end, without vanilla's enslave event. It restores the status the sentence took; it's still a write to slave status, so it ships only if Fabian agrees. It never jails a slave while `SlavesApi.TermDaysLeft` says an indentured term runs, since Slaves ends the term at an arrest, until Slaves offers a hint that keeps the term through a Laws sentence.
- Suppression is never touched. A re-enslaved slave starts with the suppression vanilla gives a new slave. - Suppression is never touched. A re-enslaved slave starts with the suppression vanilla gives a new slave.
### Blax Zones ### Blax Zones
@ -775,8 +836,9 @@ Not specced yet: the jury and pardon petitions (see `docs/features.md`).
- Castes `docs/design.md`: the join reason table gains `blax.laws.jailed` (new-prisoner row, never the captured row, no prisoner mode, former-caste record kept beyond `formerCasteDays`) and `blax.laws.released` (previous caste whatever its age). Castes' default prisoner interaction skips pawns with the `blax.laws.jailed` hint. - Castes `docs/design.md`: the join reason table gains `blax.laws.jailed` (new-prisoner row, never the captured row, no prisoner mode, former-caste record kept beyond `formerCasteDays`) and `blax.laws.released` (previous caste whatever its age). Castes' default prisoner interaction skips pawns with the `blax.laws.jailed` hint.
- Slaves `docs/roadmap.md`: `SlavesApi` gains a bool `CalmsBreaks` with "Wardens calm breakdowns", which Laws reads to stand its subdue down for slaves. The Cut line on flogging gets a note that Laws' subdue is a capped fistfight to end a break, not a punishment system for slaves. - Slaves `docs/roadmap.md`: `SlavesApi` gains a bool `CalmsBreaks` with "Wardens calm breakdowns", which Laws reads to stand its subdue down for slaves. The Cut line on flogging gets a note that Laws' subdue is a capped fistfight to end a break, not a punishment system for slaves.
- Zones `docs/design.md`: "Works with the other Blax mods" notes that Laws' arrests use prisoner zone beds like any prisoner bed. - Zones `docs/design.md`: "Works with the other Blax mods" notes that Laws' arrests use prisoner zone beds like any prisoner bed.
- Defaults `docs/design.md`: the Blax mods section notes that Laws' subdue downs a pawn through `MakeDowned`, so the colony forbid rule decides about that weapon, and that from Laws' first release the weapon an arrest drops is allowed again at the release. - Defaults `docs/design.md`: the Blax mods section notes that Laws' subdue downs a pawn through `MakeDowned`, so the colony forbid rule decides about that weapon, and that from the Laws release that brings the give-back the weapon an arrest drops is allowed again at the release.
- Slaves `docs/roadmap.md`, only if Fabian says yes to indenture as a sentence (see `docs/features.md`): `SlavesApi` gains a call that starts an indenture for a convict with a term, and Slaves' indentured servitude names Laws as a source. - Slaves `docs/roadmap.md` and `docs/features.md` (open question 1): an indentured term keeps running through a Laws sentence when Laws hints the arrest (for example a `SlavesApi` call naming the pawn before the arrest); until that exists, Laws doesn't jail indentured slaves. Asked together with Laws' open question 1.
- Castes `docs/features.md`, only if Fabian says yes to confinement (Laws' open question 2): the join API gains a timed caste assignment for Laws' convicts, ended by `blax.laws.released`.
## To verify against the decompiled code ## To verify against the decompiled code
@ -784,9 +846,7 @@ The act catalogue was checked on 2026-12-01 against the 1.7.5021 reference assem
- `Pawn_RecordsTracker.Increment` and `AddTo`: body size (inlining risk, else the record category polls), whether time records go through `AddTo`. - `Pawn_RecordsTracker.Increment` and `AddTo`: body size (inlining risk, else the record category polls), whether time records go through `AddTo`.
- `HistoryEventsManager.RecordEvent`: which events Core records without Ideology, which carry `HistoryEventArgsNames.Doer`, and the list of faction-level events to exclude. - `HistoryEventsManager.RecordEvent`: which events Core records without Ideology, which carry `HistoryEventArgsNames.Doer`, and the list of faction-level events to exclude.
- `Notify_IterationCompleted` on `Bill`, `Bill_Production`, `Bill_Medical` and `Bill_Autonomous`: which call base (the depth guard), that a surgery's completion passes through `Bill_Medical`, and that an autonomous bill has no doer. - The self-eating check in hook C: that the eaten thing is still one of the ingester's own job targets when `Toils_Ingest` finalizes, also after a carried stack was split off. Checked by the plan review: the bill hook, `CompUsable.UsedBy` and the feeding and social relax paths (see hooks B, U and C).
- `CompUsable.UsedBy`: the overrides in Core and the DLCs, and that every use path calls it.
- The self-eating check in hook C: when `Toils_Ingest` finalizes, the ingester's own job is Ingest with the food as target, and a doctor, warden, parent or caravan feeding runs on another pawn's job or none.
- The break include and exclude lists: which states `MentalBreakDef`s name, and which animal and baby states to leave out. - The break include and exclude lists: which states `MentalBreakDef`s name, and which animal and baby states to leave out.
- The jailbreaker's talk goes through `TryInteractWith` (an earlier draft patched `InteractionWorker_SparkJailbreak.Interacted` directly). - The jailbreaker's talk goes through `TryInteractWith` (an earlier draft patched `InteractionWorker_SparkJailbreak.Interacted` directly).
- The insect meat group: how insect meat is told apart (the meat's source race flesh type is the likely field). - The insect meat group: how insect meat is told apart (the meat's source race flesh type is the likely field).
@ -809,6 +869,7 @@ Promoted to `docs/features.md` on 2026-12-01 as New features: lawbook templates;
- A Castes right "may serve in court". - A Castes right "may serve in court".
- Votes on punishments ("beating is cruel"); campaigning through vanilla deep talks; Royalty vote weight. - Votes on punishments ("beating is cruel"); campaigning through vanilla deep talks; Royalty vote weight.
- Confessions and interrogation, next to Prisoner Interrogation Ritual (3696342867, 1.3k). - Confessions and interrogation, next to Prisoner Interrogation Ritual (3696342867, 1.3k).
- Indenture as a sentence through Blax Slaves' indentured servitude (an idea in `docs/features.md` since the plan review): a slave loses Warden, Hunting, Art and Research for good and any ideoligion role, so it needs a give-back plan and a SlavesApi call first.
## Cut ## Cut
@ -817,6 +878,10 @@ Promoted to `docs/features.md` on 2026-12-01 as New features: lawbook templates;
- Vanilla's `AteMeat` event for the meat law: Ideology only and blind to meals (Verse/Thing.cs:2055-2064). - Vanilla's `AteMeat` event for the meat law: Ideology only and blind to meals (Verse/Thing.cs:2055-2064).
- The vanilla Ideology trial as the court: leader-only judge who also prosecutes, no defender, the leader's 10-day ability cooldown, a verdict driven by crowd size, Ideology only. Laws listens to it instead (see "Trial through Ideology's ritual"). - The vanilla Ideology trial as the court: leader-only judge who also prosecutes, no defender, the leader's 10-day ability cooldown, a verdict driven by crowd size, Ideology only. Laws listens to it instead (see "Trial through Ideology's ritual").
- A hidden ritual precept to get the ritual dialog for free: it would sit in every ideoligion in the save (RimWorld/Ideo.cs:617-624) and log errors per ideo after removal. - A hidden ritual precept to get the ritual dialog for free: it would sit in every ideoligion in the save (RimWorld/Ideo.cs:617-624) and log errors per ideo after removal.
- `Dialog_BeginLordJob` as the convene dialog: it builds its role column only when a DLC is installed (RimWorld/Dialog_BeginLordJob.cs:134-143) and logs an error otherwise.
- Core's GiveSpeech duty for court speakers: it gives a job only to a speaker on its own throne (RimWorld/JobGiver_GiveSpeech.cs:19-22).
- A courtroom `RoomRoleDef`: a room has one role (Verse/Room.cs:872), so it would replace the dining room, rec room or throne room.
- Patching `Bill.Notify_IterationCompleted`: empty and called as a base call the JIT may inline (RimWorld/Bill.cs:278-280, RimWorld/Bill_Medical.cs:129); hook B uses `RecordsUtility.Notify_BillDone`.
- Votes or court days as IncidentDefs, GameConditions or quests, a custom Letter class or LetterDef, memory ThoughtDefs, HediffDefs for punishments, our own InteractionDefs: each leaves our defs in vanilla save lists. - Votes or court days as IncidentDefs, GameConditions or quests, a custom Letter class or LetterDef, memory ThoughtDefs, HediffDefs for punishments, our own InteractionDefs: each leaves our defs in vanilla save lists.
- A "Law enforcement" work type: WorkTypeDefs sit in a `DefMap` saved by index, so adding or removing the mod shifts other mods' values. - A "Law enforcement" work type: WorkTypeDefs sit in a `DefMap` saved by index, so adding or removing the mod shifts other mods' values.
- Subdue with vanilla melee (`AttackMelee` or the social fight job): the weapon or fists hit the head, the undrafted enforcer turns guilty and the target fights back. - Subdue with vanilla melee (`AttackMelee` or the social fight job): the weapon or fists hit the head, the undrafted enforcer turns guilty and the target fights back.

View File

@ -2,33 +2,34 @@
Write the colony's lawbook from every act the game knows, and the colony enforces it: a warden stops a binge before the first dose, a murderer sits out its sentence and walks back to its own bed and role, and a colonist who keeps doing it gets more each time. Grave cases go to a court with a judge the colony elects, attorneys who argue with Social, witnesses and a jury, and the colony votes on the laws themselves. Laws only watches what the game already does: no new crime events, no new mental breaks. Write the colony's lawbook from every act the game knows, and the colony enforces it: a warden stops a binge before the first dose, a murderer sits out its sentence and walks back to its own bed and role, and a colonist who keeps doing it gets more each time. Grave cases go to a court with a judge the colony elects, attorneys who argue with Social, witnesses and a jury, and the colony votes on the laws themselves. Laws only watches what the game already does: no new crime events, no new mental breaks.
Status: design only, nothing built. Planned 2026-12-01. This file is the plan of record for what the mod covers and in which order the parts come. `docs/design.md` holds the spec of every designed feature. Status: design only, nothing built. Planned 2026-12-01 and reviewed against the decompiled game the same day. This file is the plan of record for what the mod covers and in which order the parts come. `docs/design.md` holds the spec of every designed feature.
## How this plan is cut ## How this plan is cut
- An area is one player problem together with the system that solves it. No area is cut to fit a time box or a release size. - An area is one player problem together with the system that solves it. No area is cut to fit a time box or a release size.
- An area has steps only where a part needs another part built first, a sibling mod's feature or a decision from Fabian. Each step is usable on its own. - An area has steps only where a part needs another part built first, a sibling mod's feature or a decision from Fabian. Each step is usable on its own.
- Which parts ship first is decided in "Order", not by the areas: a release can take part of a step.
- Status per feature: **Designed** (spec in `design.md`, linked), **New** (added by this plan; its spec is written before its step is built), **Idea** (waits for player demand). - Status per feature: **Designed** (spec in `design.md`, linked), **New** (added by this plan; its spec is written before its step is built), **Idea** (waits for player demand).
- Every feature works with any DLC combination (a DLC part switches off and says "Needs <DLC>"), has its own toggle, keeps the save loadable after a plain unsubscribe, stays inside vanilla's tone (no torture, no flogging) and needs no new art unless it says so. - Every feature works with any DLC combination (a DLC part switches off and says "Needs <DLC>"), has its own toggle, keeps the save loadable after a plain unsubscribe, stays inside vanilla's tone (no torture, no flogging) and needs no new art unless it says so.
## Scope ## Scope
Laws covers which acts are crimes, how they are seen, how the colony stops and punishes them, sentences and what comes back after them, repeat offenders, trials, the judge and votes on the laws. It covers free colonists and colony slaves; prisoners only for a prison break. Laws covers which acts are crimes, how they are seen, how the colony stops and punishes them, sentences and what comes back after them, repeat offenders, trials, the judge and votes on the laws. It covers free colonists and colony slaves; prisoners only when they are Laws' own convicts and break out.
It leaves to the sibling mods: It leaves to the sibling mods:
- Blax Castes: policies, schedules, work priorities, allowed areas and prisoner interaction defaults. Laws writes only Maintain only and Release, and only on colonists it jailed. - Blax Castes: policies, schedules, work priorities, allowed areas and prisoner interaction defaults. Laws writes only Maintain only and Release, and only on colonists it jailed. A confinement sentence would ask Castes for a timed caste (open question 2).
- Blax Slaves: slave status, suppression, rebellion and the slave economy. Laws records a rebellion as an act and, if Fabian agrees, gives back the slave status a sentence took. - Blax Slaves: slave status, suppression, rebellion and the slave economy. Laws records a rebellion as an act, leaves slaves in a non-violent break to Slaves' wardens while "Wardens calm breakdowns" is on (`SlavesApi.CalmsBreaks`), and, if Fabian agrees, gives back the slave status a sentence took.
- Blax Zones: beds by zone, drop spots and work rule areas. Arrests use any prisoner bed, zone beds included. - Blax Zones: beds by zone, drop spots and work rule areas. Arrests use any prisoner bed, zone beds included.
- Blax Defaults: what stays forbidden when pawns go down, die or are stripped. Laws only allows again the weapon its own arrest dropped. - Blax Defaults: what stays forbidden when pawns go down, die or are stripped. Laws only allows again the weapon its own arrest dropped.
Sentencing guests and enemy prisoners stays with Prisoner Sentencing and Prison Expanded. Sentencing guests and enemy prisoners, and punishing them when they break out, stays with Prisoner Sentencing and Prison Expanded.
## 1. Lawbook ## 1. Lawbook
Players want to say what is forbidden without a fixed crime list, and to see every case. Players want to say what is forbidden without a fixed crime list, and to see every case.
Step 1, the book (first release): Step 1, the book:
- **Laws tab.** Rows of Action, Stage, Severity, Punishment and Days; each dropdown offers only what fits the action. Designed: [Lawbook tab](design.md#lawbook-tab). - **Laws tab.** Rows of Action, Stage, Severity, Punishment and Days; each dropdown offers only what fits the action. Designed: [Lawbook tab](design.md#lawbook-tab).
- **Act picker.** A searchable tree like a tailoring bill's filter, built from the loaded defs, each entry labelled with its mod. Designed: [Lawbook tab](design.md#lawbook-tab). - **Act picker.** A searchable tree like a tailoring bill's filter, built from the loaded defs, each entry labelled with its mod. Designed: [Lawbook tab](design.md#lawbook-tab).
@ -36,9 +37,10 @@ Step 1, the book (first release):
- **Case log.** Who, what, stage, punishment and status, newest first, with "Arrest now" for cases that wait. Designed: [Lawbook tab](design.md#lawbook-tab). - **Case log.** Who, what, stage, punishment and status, newest first, with "Arrest now" for cases that wait. Designed: [Lawbook tab](design.md#lawbook-tab).
- **Missing entries wait.** A row whose DLC or mod is gone shows "Needs <DLC>" or "Missing: <mod>" and works again when it returns. Designed. - **Missing entries wait.** A row whose DLC or mod is gone shows "Needs <DLC>" or "Missing: <mod>" and works again when it returns. Designed.
Step 2, lawbook templates (after Repeat offenders, so the file format holds the escalation column): Step 2, the book across saves and groups (needs step 1; castes need Castes' read-only API):
- **Lawbook templates.** Save the book to a file and load it in another colony, with Blax Defaults' write, read-back and backup rules. New, from the Backlog. Demand: the same wish for policies and settings carried Export Agency (16.3k) and Save My Settings (3.8k), which Castes' templates answer. - **Lawbook templates.** Save the book to a file and load it in another colony, with Blax Defaults' write, read-back and backup rules. The file carries a version number, so a column added later (escalation, "Applies to") loads into an older template with its default. New, from the Backlog. Demand: the same wish for policies and settings carried Export Agency (16.3k) and Save My Settings (3.8k), which Castes' templates answer.
- **Applies to.** A row names whom it covers: everyone (default), free colonists, slaves, children, or a caste through `CastesApi.CasteIdOf`; a per-pawn exemption list ("above the law") sits in the component. On the same act a narrower group wins over a wider one. Rows saved before this step load as "everyone" and keep their keys unique, so no saved book changes. New. Demand: Castes' read-only API (version 1) already lists Laws' caste checks as waiting on it.
Ideas: rows that tick several entries, like a bill's ingredient filter; a per-row "player orders count too" switch. Ideas: rows that tick several entries, like a bill's ingredient filter; a per-row "player orders count too" switch.
@ -46,27 +48,25 @@ Ideas: rows that tick several entries, like a bill's ingredient filter; a per-ro
Any act the game knows can be a crime, DLC and modded content included, and the colony sees it the moment it happens. Any act the game knows can be a crime, DLC and modded content included, and the colony sees it the moment it happens.
Step 1, every act the game records (first release): Step 1, every act the game records:
- **Seven categories.** Mental breaks, ate, used, social interactions, recorded acts, records and bills, each with group entries (any drug, hard drugs, human meat, any surgery). Designed: [Act catalogue and detection](design.md#act-catalogue-and-detection). - **Seven categories.** Mental breaks, ate, used, social interactions, recorded acts, records and bills, each with group entries (any drug, hard drugs, human meat, any surgery). Designed: [Act catalogue and detection](design.md#act-catalogue-and-detection).
- **Special acts.** Set a fire, displayed a corpse, started a social fight. Designed: same section. - **Special acts.** Set a fire, displayed a corpse, started a social fight. Designed: same section.
- **Planning and did it for breaks.** A link table gives drug and food binges, fire-starting sprees, corpse obsession, insulting sprees and the jailbreaker their "did it". Designed: same section. - **Planning and did it for breaks.** A link table gives drug and food binges, fire-starting sprees, corpse obsession, insulting sprees and the jailbreaker their "did it". Designed: same section.
- **Violence.** Assault, harming prisoners or slaves, manslaughter and murder, plus "did it" for tantrums, berserk, murderous and sadistic rage. Designed: [Violence](design.md#violence). It joins the first release: a lawbook without assault and murder misses the crimes players name first. - **Violence.** Assault, harming prisoners or slaves, manslaughter and murder, plus "did it" for tantrums, berserk, murderous and sadistic rage. A hit that kills is murder; an assault victim who dies of its wounds later turns that case into manslaughter. Designed: [Violence](design.md#violence).
- **Slaughterers.** The slaughterer break's "did it" is the animal it killed. Designed: [Slaughterers](design.md#slaughterers). - **Slaughterers.** The slaughterer break's "did it" is the animal it killed. Designed: [Slaughterers](design.md#slaughterers).
- **Drugs against the policy.** An Ate group entry for a drug the pawn's policy doesn't allow; Laws reads the policy Castes or the player set. Designed: [Drugs against the policy](design.md#drugs-against-the-policy). - **Drugs against the policy.** An Ate group entry for a drug the pawn's policy doesn't allow; Laws reads the policy Castes or the player set. Designed: [Drugs against the policy](design.md#drugs-against-the-policy).
- **No flood.** Acts outside a break open at most one case per offender and law a day. Designed. - **No flood.** Acts outside a break open at most one case per offender and law a day. Designed.
Step 2, uprisings (needs Sentences step 1, and for rebel slaves Fabian's answer on jail for slaves): Step 2, uprisings (needs "Add days" from Sentences step 1, and for rebel slaves Fabian's answer on jail for slaves):
- **Prison break.** Prisoners become offenders for this one act. Designed: [Prison breaks and slave rebellions](design.md#prison-breaks-and-slave-rebellions). The spec still has to say which punishments a prisoner gets; the proposal is warn, "Add days" on a Laws sentence and a confirmed execution. - **Prison break.** Laws' own convicts who break out are offenders for this one act; they get a warning, "Add days" or a confirmed execution. Other escapees stay with the prison mods. Designed: [Prison breaks and slave rebellions](design.md#prison-breaks-and-slave-rebellions).
- **Slave rebellion.** Records who rebelled; the rebellion itself stays Slaves'. Designed: same section. Needs Ideology. - **Slave rebellion.** Records who rebelled; the rebellion itself stays Slaves'. Designed: same section. Needs Ideology.
Step 3, crimes against the faith (New; spec and a check of the precept code in the decompiled game first): Step 3, crimes against the faith (New; needs only step 1's recorded acts, and its spec first):
- **Anything my ideoligion forbids.** One group entry that matches any recorded act the offender's own ideoligion forbids, read from its precepts (`PreceptComp_UnwillingToDo.eventDef`), so a vegetarian colony needs one row instead of one per meat. New, from the Backlog. Needs Ideology. Demand: Rimworld Law and Order (419, 1.6 only) built its crimes on Ideology; vanilla answers a broken precept with mood alone. - **Anything the colony's ideoligion forbids.** One group entry under recorded acts: an act whose history event a precept of the colony's primary ideoligion answers with a bad thought for the doer or for those who learn of it (`PreceptComp_SelfTookMemoryThought`, `PreceptComp_KnowsMemoryThought`) or with `PreceptComp_UnwillingToDo`. An option switches to the offender's own ideoligion. Laws caches the events per ideoligion and rebuilds the set when an ideoligion changes. Vanilla records meat eating as an event only for raw meat (Verse/Thing.cs:2055-2064); meals with meat reach the precepts through `FoodUtility.AddThoughtsFromIdeo` (RimWorld/FoodUtility.cs:968) and no event, so a vegetarian colony uses "Ate: any meat", which reads the food itself. New, from the Backlog. Needs Ideology. Demand: Rimworld Law and Order (419, 1.6 only) built its crimes on Ideology; vanilla answers a broken precept with mood alone.
- **Apostasy.** A colonist who leaves the colony's main ideoligion (`Pawn_IdeoTracker.SetIdeo`). New, from the Backlog. Needs Ideology. - **Left the colony's ideoligion.** A group entry on the `ChangedIdeo` event, which `Pawn_IdeoTracker.SetIdeo` records with the pawn as doer while the old ideoligion is still set (RimWorld/Pawn_IdeoTracker.cs:189-192), so hook H sees it and no new hook is needed. New, from the Backlog. Needs Ideology.
The two hooks above exist in the 1.7.5021 reference assemblies (a compile probe found both); what they do at runtime is not checked.
Ideas: an "attempted" stage (needs the hot `StartJob` hook), crimes on caravans, theft during a break, used buildings and any job as a category, freeing a held entity (Anomaly). Ideas: an "attempted" stage (needs the hot `StartJob` hook), crimes on caravans, theft during a break, used buildings and any job as a category, freeing a held entity (Anomaly).
@ -74,47 +74,56 @@ Ideas: an "attempted" stage (needs the hot `StartJob` hook), crimes on caravans,
When a law is broken the colony acts at once, safely, and the punishment fits the act. When a law is broken the colony acts at once, safely, and the punishment fits the act.
Step 1 (first release): Step 1:
- **Enforcement.** One enforcer per case, wardens first; nobody is pulled off a rescue, a tending, a fire, a turret or a surgery, and nobody is sent while hostiles threaten the map. Waiting cases retry by themselves. Designed: [Enforcement and cases](design.md#enforcement-and-cases). - **Enforcement.** One enforcer per case, wardens first; nobody is pulled off a rescue, a tending, a fire, a turret or a surgery, and nobody is sent while hostiles threaten the map, a berserk colonist included. Waiting cases retry by themselves. Designed: [Enforcement and cases](design.md#enforcement-and-cases).
- **Warn and guilty.** A record and a message, or vanilla guilt for N days: certain arrest, a mild execution thought, no colony-wide banishment thought. Designed: [Warn and guilty](design.md#warn-and-guilty). - **Warn and guilty.** A record and a message, or vanilla guilt for N days: certain arrest, a mild execution thought, no colony-wide banishment thought. Designed: [Warn and guilty](design.md#warn-and-guilty).
- **Subdue.** A capped fistfight that ends a break: torso and limbs only, never a bionic part, no catharsis for the offender, children never. Designed: [Subdue](design.md#subdue). - **Subdue.** A capped fistfight that ends a break that isn't hostile to the colony, tantrums and murderous or sadistic rage included: torso and limbs only, never a bionic part, no catharsis for the offender, children never. Designed: [Subdue](design.md#subdue).
- **Jail and subdue then jail.** The arrest; serving the sentence is area 4. Designed: [Jail for N days](design.md#jail-for-n-days), [Subdue](design.md#subdue). - **Jail and subdue then jail.** The arrest; on a berserk pawn the jail waits until the break ends or you down it. Serving the sentence is area 4. Designed: [Jail for N days](design.md#jail-for-n-days), [Subdue](design.md#subdue).
- **Reprimand.** -4 to -16 mood by severity for 3 days. Designed: [Reprimand](design.md#reprimand). - **Reprimand.** -4 to -16 mood by severity for 3 days. Designed: [Reprimand](design.md#reprimand).
- **Banish and execute.** Always confirmed in a dialog, never automatic. Designed: [Banish and execute](design.md#banish-and-execute). - **Banish and execute.** Always confirmed in a dialog, never automatic. Designed: [Banish and execute](design.md#banish-and-execute).
- **Talk down.** A planning punishment for breaks that aren't hostile: the enforcer walks over, and a Social roll against the offender's mood ends the break through `RecoverFromState`, with the catharsis setting applied. The spec decides what a failed try leads to. Laws owns calming colonists; Slaves' wardens calm slaves. New. Demand: Snap Out! (1319782555, 636k, no 1.7) talks pawns out of breaks and has no 1.7 build.
- **Decide myself.** A punishment that leaves the case waiting in the Cases tab with Warn, Guilty N days, Jail N days and Pardon buttons and an alert while it waits; any open or warned case also gets a "Sentence" button. New. Demand: Prisoner Sentencing (1.3k) and RimCourt (8.8k) are built on the player choosing per case.
Step 2, subdue a pawn that fights back (needs step 1's subdue proven in play): Step 2, with the sibling mods (needs Slaves' "Wardens calm breakdowns"):
- **Subdue for aggressive breaks.** Only an enforcer with Melee at least the offender's goes; when nobody qualifies, a letter asks you to draft someone. Designed: [Subdue for aggressive breaks](design.md#subdue-for-aggressive-breaks). - **Slaves' wardens first.** While `SlavesApi.CalmsBreaks` is true, Laws doesn't subdue a slave in a non-violent break and leaves it to Slaves' wardens. Designed: [Subdue](design.md#subdue), "Works with the other Blax mods".
Step 3, subdue a pawn that fights back (needs step 1's subdue proven in play):
- **Subdue with a fighter you pick.** For a break hostile to the colony (berserk), never automatic: the case shows the best candidate by Melee, weapon and health, and "Subdue with <name>" sends that pawn. The danger rule leaves this one offender out. New: [Subdue a pawn that fights back](design.md#subdue-a-pawn-that-fights-back) holds the outline.
## 4. Sentences ## 4. Sentences
A sentence ends and the colonist comes back whole. Jail must not cost a long colony its bedrooms, roles and mechs. A sentence ends and the colonist comes back whole. Jail must not cost a long colony its bedrooms, roles and mechs.
Step 1, serve and come back (first release): Step 1, serve and come back:
- **Serving the sentence.** Maintain only, so no prison mod recruits or enslaves the convict; a warden releases it when the time is served, with a fallback; another mod's early release closes the sentence instead of fighting it. Designed: [Jail for N days](design.md#jail-for-n-days). - **Serving the sentence.** Maintain only, so no prison mod recruits or enslaves the convict; a warden releases it when the time is served, with a fallback; another mod's early release closes the sentence instead of fighting it. Until the give-back ships, role holders and mechanitors wait with "Arrest now", because the arrest takes the role and shuts the mechs down. Designed: [Jail for N days](design.md#jail-for-n-days).
- **Release gives back what jail took.** Bed, grave, throne, deathrest casket, ideoligion role, mech work modes and the weapon the arrest dropped. With it, role holders and mechanitors need no hold. Designed: [Release gives back what jail took](design.md#release-gives-back-what-jail-took). It joins the first release: a jail that takes the bedroom and the role for good is half a feature. - **Release gives back what jail took.** Bed, grave, throne, deathrest casket, ideoligion role, mech work modes and the weapon the arrest dropped. With it, role holders and mechanitors need no hold. Designed: [Release gives back what jail took](design.md#release-gives-back-what-jail-took).
- **Pardon, early release, add days.** Designed: [Pardon, early release and longer sentences](design.md#pardon-early-release-and-longer-sentences). - **Pardon, early release, add days.** Designed: [Pardon, early release and longer sentences](design.md#pardon-early-release-and-longer-sentences).
Step 2, with the sibling mods (each part waits for its sibling or Fabian's answer): Step 2, with the sibling mods (each part waits for its sibling or Fabian's answer):
- **Castes keeps the caste.** A convict returns to its own caste whatever the sentence length. Designed: [Castes keeps the caste](design.md#castes-keeps-the-caste). Needs Castes' join API (API version 2). - **Castes keeps the caste.** A convict returns to its own caste whatever the sentence length. Designed: [Castes keeps the caste](design.md#castes-keeps-the-caste). Needs Castes' join API (API version 2).
- **Jail for slaves.** A jailed slave is a slave again when the sentence ends. Designed: [Jail for slaves](design.md#jail-for-slaves). Needs Ideology and Fabian's yes, since it writes slave status. - **Jail for slaves.** A jailed slave is a slave again when the sentence ends. While an indentured term runs (`SlavesApi.TermDaysLeft`), Laws doesn't jail and falls back to subdue or warn, until Slaves offers a hint that keeps the term through a Laws sentence. Designed: [Jail for slaves](design.md#jail-for-slaves). Needs Ideology and Fabian's yes (open question 1).
- **Indenture as a sentence.** Serve N days as an indentured servant through Blax Slaves' indentured servitude. New, open question below. Needs Ideology, Slaves' indentured servitude and a SlavesApi call. Demand: players of Indentured Servitude asked to tie it to the guilty verdict (its comment page 2878184888, seen in search results; Steam rate-limited the page itself). - **Confinement for N days.** Laws asks Castes to put the convict into a caste the player picks for sentences, with that caste's allowed area and work priorities, and the `blax.laws.released` reason returns it to its old caste. No bed, role or mech is lost. New. Needs Castes' join API plus a timed caste assignment Castes doesn't offer yet (open question 2).
Idea: a life sentence until pardoned, as Prisoner Sentencing offers for prisoners. Ideas: a life sentence until pardoned, as Prisoner Sentencing offers for prisoners. Indenture as a sentence through Blax Slaves' indentured servitude, once that exists and a player asks: a slave has Warden, Hunting, Art and Research disabled and their priorities zeroed for good (Core Defs/WorkTypeDefs/WorkTypes.xml:85, 140, 280, 355; RimWorld/Pawn_WorkSettings.cs:195-205) and loses any ideoligion role (RimWorld/Precept_Role.cs:582-585), so it needs a plan for who gives those back, and a SlavesApi call to start a term.
## 5. Repeat offenders ## 5. Repeat offenders
Closed cases are pruned after 60 days and every offence is judged as the first, so a colonist who binges every season gets five days each time. New in this plan as a whole. Closed cases are pruned after the "Keep closed cases" setting (60 days by default) and every offence is judged as the first, so a colonist who binges every season gets five days each time. New in this plan as a whole.
One step (needs the first release's cases): Step 1, the record (needs the first release's cases; probation also Sentences' early release):
- **Criminal record.** Convictions per pawn and law, kept after old cases are pruned, shown in the Cases tab and on the pawn. New. The court's repeat-conviction term reads it once it exists. - **Criminal record.** Convictions per pawn and law, kept after old cases are pruned, shown in the Cases tab and on the pawn. New. The court's repeat-conviction term reads only the record, so the record comes before court sessions.
- **Escalation.** A row names what a repeat offence within N days gets: first a warning, then 5 days, then 10. New. No player request found; it brings the court's repeat rule to colonies that never convene a court.
- **Probation.** Release early on probation; a new case during probation brings back the remaining days. New. Demand: Prison Expanded (3.3k, 1.7) offers parole for prisoners, and nothing offers it for colonists. - **Probation.** Release early on probation; a new case during probation brings back the remaining days. New. Demand: Prison Expanded (3.3k, 1.7) offers parole for prisoners, and nothing offers it for colonists.
Step 2, escalation (needs the record):
- **Escalation.** A row names what a repeat offence within N days gets: first a warning, then 5 days, then 10. New. No player request found; it brings the court's repeat rule to colonies that never convene a court.
## 6. Court ## 6. Court
Grave cases get a trial instead of an automatic sentence, on the core game, with real roles. Grave cases get a trial instead of an automatic sentence, on the core game, with real roles.
@ -125,7 +134,8 @@ Step 1, Ideology's trial as a punishment:
Step 2, court sessions on the core game: Step 2, court sessions on the core game:
- **Court sessions.** Cases wait for trial, a ritual-style convene dialog with roles, place and the conviction chance, a session with speeches and a verdict letter, a verdict from evidence, Social skill and the judge's bias, and the sentence from the lawbook. The judge is appointed. Designed: [Cases go to trial](design.md#cases-go-to-trial) through [Verdict and sentence](design.md#verdict-and-sentence). - **Court sessions.** Cases wait for trial, a convene dialog of our own with roles, place and the conviction chance, a session with speeches and a verdict letter, a verdict from evidence, Social skill and the judge's bias, and the sentence from the lawbook. The judge is appointed; when the judge is the accused, the victim or family of either, or is dead, jailed or away, the best uninvolved colonist acts as judge and the dialog says why. Designed: [Cases go to trial](design.md#cases-go-to-trial) through [Verdict and sentence](design.md#verdict-and-sentence).
- **Jail, then trial.** The offender is arrested at once as for Jail, held on Maintain only and sent to court; a conviction gives the row's days minus the days served, an acquittal releases it. This is "jail and maybe court" for a binger who already took some. Designed: [Jail, then trial](design.md#jail-then-trial).
- **Court on its own.** Waiting cases convene at the court hour without a click (off by default). Designed: [Court on its own](design.md#court-on-its-own). - **Court on its own.** Waiting cases convene at the court hour without a click (off by default). Designed: [Court on its own](design.md#court-on-its-own).
- **Remove Blax Laws from a game.** A button that ends sessions and offers to release Laws' convicts, since a running session can't survive a plain unsubscribe. Designed: [Remove Blax Laws from a game](design.md#remove-blax-laws-from-a-game). - **Remove Blax Laws from a game.** A button that ends sessions and offers to release Laws' convicts, since a running session can't survive a plain unsubscribe. Designed: [Remove Blax Laws from a game](design.md#remove-blax-laws-from-a-game).
@ -137,52 +147,53 @@ Step 3, the people of a trial (needs sessions):
Step 4, long trials (needs sessions): Step 4, long trials (needs sessions):
- **Court days.** Serious and grave cases over 2 or 3 days, with custody between them. Designed: [Court days](design.md#court-days). - **Court days.** Serious and grave cases over 2 or 3 days; an accused in custody from "Jail, then trial" stays there between the days. Designed: [Court days](design.md#court-days).
- **Courtrooms.** An impressive room around the court place softens the verdict. Designed: [Courtrooms](design.md#courtrooms). - **Courtrooms.** An impressive room around the court place softens the verdict; no room role is added. Designed: [Courtrooms](design.md#courtrooms).
- **Appeals.** A convict appeals once and is retried before another judge. New, from the Backlog. Demand: Rimworld Law and Order has no appeal at all. - **Appeals.** A convict appeals once and is retried before another judge, picked by step 2's acting-judge rule. New, from the Backlog. Demand: Rimworld Law and Order has no appeal at all.
Ideas: a titled noble presides (Royalty), trial by duel (Ideology), a judge's bench (needs art and a removal story), trials for guests and enemy prisoners, a RimCourt bridge with its pillory and lash, confessions and interrogation. Ideas: a titled noble presides (Royalty), trial by duel (Ideology), a judge's bench (needs art and a removal story), trials for guests and enemy prisoners, a RimCourt bridge with its pillory and lash, confessions and interrogation.
## 7. Colony votes ## 7. Colony votes
The colony has a say in who judges and in what the law is. All votes share one voting core. The colony has a say in what the law is and who judges. All votes share one voting core.
Step 1, the voting core and the judge's office (needs court sessions): Step 1, the voting core and law votes (needs the first release; pardon petitions also Pardon):
- **Voting core.** Who votes, a ballot tab, a tally letter, an alert while a vote is open, "Aye" and "Nay" over the voters. Designed: [Voting core](design.md#voting-core). - **Voting core.** Who votes, a ballot tab, a tally letter, an alert while a vote is open, "Aye" and "Nay" over the voters. Designed: [Voting core](design.md#voting-core).
- **Elected judge.** A 60-day term, by-elections, recalls and an acting judge when the judge is involved in the case. Designed: [Judge election](design.md#judge-election). - **Law votes.** Colonists propose and repeal laws and vote by traits, beliefs, opinion and mood; you back or veto the result. Designed: [Colony votes on the lawbook](design.md#colony-votes-on-the-lawbook).
- **Pardon petitions.** A convict's friends petition and the colony votes on a pardon. New, from the Backlog.
Step 2, the judge's office (needs court sessions):
- **Elected judge.** A 60-day term, by-elections and recalls; a judge involved in a case hands it over by Court step 2's acting-judge rule. Designed: [Judge election](design.md#judge-election).
- **Leader or moral guide as judge.** Designed: [Ideoligion leader as judge](design.md#ideoligion-leader-as-judge). Needs Ideology. - **Leader or moral guide as judge.** Designed: [Ideoligion leader as judge](design.md#ideoligion-leader-as-judge). Needs Ideology.
Step 2, law votes: Step 3, the jury (needs court sessions and the voting core):
- **Law votes.** Colonists propose and repeal laws and vote by traits, beliefs, opinion and mood; you back or veto the result. Designed: [Colony votes on the lawbook](design.md#colony-votes-on-the-lawbook).
Step 3, jury and petitions (needs court sessions and the voting core):
- **Jury.** The spectators vote the verdict through the voting core instead of the formula alone. New, from the Backlog. Demand: the older Jury Trial mod built a court with jury seats but no vote (seen in search results). - **Jury.** The spectators vote the verdict through the voting core instead of the formula alone. New, from the Backlog. Demand: the older Jury Trial mod built a court with jury seats but no vote (seen in search results).
- **Pardon petitions.** A convict's friends petition and the colony votes on a pardon. New, from the Backlog.
Ideas: votes on punishments ("beating is cruel"), campaigning through vanilla deep talks, Royalty vote weight, a Castes right "may serve in court" (needs a CastesApi addition). Ideas: votes on punishments ("beating is cruel"), campaigning through vanilla deep talks, Royalty vote weight, a Castes right "may serve in court" (needs a CastesApi addition).
## Order ## Order
1. First release, the core loop: Lawbook step 1, Crimes step 1, Enforcement step 1 and Sentences step 1. None of them is useful alone: a book without enforcement does nothing, and a jail without the give-back takes bedrooms and roles for good. 1. First release, the smallest loop that stops a break and jails the one who did it: Lawbook step 1; from Crimes step 1 the seven categories with their groups, the special acts, the break links and no flood; from Enforcement step 1 enforcement, warn and guilty, subdue, jail and subdue then jail; from Sentences step 1 serving the sentence, with role holders and mechanitors held for "Arrest now". Fabian asked for a quick MVP, and none of these works without the others: a book without enforcement does nothing.
2. Enforcement step 2. Berserk and rages are the breaks players fear most, and the fight needs the plain subdue proven first. 2. The other designed parts of the step 1s: Violence first, with its combat performance run, then slaughterers and drugs against the policy, reprimand, banish and execute, the give-back (which drops the hold) and pardon, early release and add days.
3. Court, steps 1 to 4. The court is what Fabian asked for after the lawbook; step 1 gives Ideology players a trial at once, and each later step needs the one before. 3. The criminal record (Repeat offenders step 1), then Court steps 1 and 2. The court is what Fabian asked for after the lawbook; step 1 gives Ideology players a trial at once, step 2 brings "Jail, then trial" for his binge example, and the court's repeat term reads the record.
4. Colony votes, steps 1 to 3. They need court sessions; law votes and the jury reuse the voting core. 4. Attorneys (Court step 3), law votes with the voting core (Colony votes step 1) and the elected judge (Colony votes step 2). Fabian asked for each; law votes need no court, the judge needs sessions.
5. Repeat offenders, then Lawbook step 2, so the template file holds the escalation column. 5. Court days and courtrooms (Court step 4).
6. As soon as they are unblocked: Crimes step 2 (prison break once Sentences step 1 exists, rebel slaves after Fabian's answer), Sentences step 2 (Castes' join API, Fabian's answers, Slaves' indentured servitude) and Crimes step 3 (after its spec and the precept check). 6. As soon as the sibling or the answer is there: "Castes keeps the caste" with Castes' join API (it lifts the 50-day cap), "Slaves' wardens first" with Slaves' "Wardens calm breakdowns", jail for slaves after Fabian's answer.
7. After that, the parts nobody asked for yet, each once its spec is written: decide myself, talk down, probation and escalation, lawbook templates and "Applies to", witnesses, the guilty plea, appeals, the jury, pardon petitions, uprisings, crimes against the faith, confinement, and subdue a pawn that fights back.
## Left out ## Left out
- New crime events or extra mental breaks: Laws only watches. - New crime events or extra mental breaks: Laws only watches.
- Torture and flogging, fines (colonists own no silver), work bans and a law-enforcement work type. - Torture and flogging, fines (colonists own no silver), work bans and a law-enforcement work type.
- House arrest and community service: allowed areas and work priorities are Castes'. - House arrest and community service as Laws' own systems: allowed areas and work priorities are Castes', so "Confinement" (Sentences step 2) asks Castes instead.
- Anything that puts our defs into vanilla save lists: incidents, letters, hediffs or memory thoughts for votes, court days or punishments. - Anything that puts our defs into vanilla save lists: incidents, letters, hediffs or memory thoughts for votes, court days or punishments.
Reasons for these and the rest: `design.md`, "Cut". Reasons for these and the rest: `design.md`, "Cut".
## Open questions for Fabian ## Open questions for Fabian
1. Jail for slaves writes slave status back at the end of the sentence. Recommendation: yes, it only restores what the sentence took, and Blax Slaves' line in the shared ownership list already names the exception. 1. Jail for slaves writes slave status back at the end of the sentence, and skips a slave serving an indentured term until Blax Slaves adds a hint that keeps the term through a Laws sentence. Recommendation: yes to both. It only restores what the sentence took; without the hint, an arrest ends the term (Slaves' own open question 1) and a short sentence would leave an indentured servant a slave for life, so the hint goes into Slaves' plan with that question.
2. Indenture as a sentence through Blax Slaves. Recommendation: yes, once Slaves' indentured servitude exists, with Slaves owning the status and the term and Laws only handing over the convict and the days. 2. Confinement as a sentence needs a new Castes call, a timed caste assignment. Recommendation: yes, built after Castes' join API; if Castes declines, house arrest stays left out.