5.3 KiB
Blax Slaves
RimWorld mod (1.7) that makes slavery an everyday part of the rim. First mod under the Blax Gaming label. Needs Harmony; slaves need Ideology.
Features
- Slavers are common. The three vanilla slavers (outlander "slaver" caravan, tribal "slaver" caravan, orbital "slave ship") get commonality 2 instead of 1, and big colonies keep seeing them at half weight instead of zero. They carry more: outlander 5~9, tribal 4~7, slave ship 6~10 (vanilla 2~4). Allied outlanders and tribes send a slaver caravan on request (vanilla hides slavers from the comms console request). Every other caravan and orbital trader has a ~50% chance of 1~2 slaves, settlements stock 1~4.
Patches/BlaxSlaves_Traders.xml - Branding. "Brand" surgery for colony slaves (adults, Medicine 2, never fails). The brand remembers its owner (shown as "slave brand (Owner)"), slows suppression loss by 15%, gives the slave a -3 "branded" mood and a fresh torso burn. "Rebrand" burns your mark over another owner's.
Defs/BlaxSlaves_Brand.xml,Source/BlaxSlaves/Brand.cs - Trader slaves come branded. 35% of adult slaves in trader stock carry the trader faction's brand (orbital ships: a random faction).
- Runaways come back. A slave with your brand who escapes (slave rebellion, or a caravan whose last free member dies) is tracked. If the faction they end up with is hostile, they keep them. Otherwise, after 3~10 days (80% chance) a non-hostile faction returns them as your slave, walking in (tribal/medieval) or by drop pod.
Source/BlaxSlaves/Runaways.cs - Harming slaves doesn't upset colonists. Executing, harvesting, selling (trade or gift pod), banishing, butchering, blinding, gibbeting a slave gives free colonists no negative thoughts. Deaths only count when the colony caused them: a slave killed by raiders, animals or disease is mourned normally. Branded pawns count too unless they became free colonists. Pacifists (Kind, or incapable of violence) still mind, family still grieves, and the banish dialog shows the reduced cost.
Source/BlaxSlaves/SlaveHarm.cs - Mod settings for all the numbers and toggles.
Compat: War Crimes Expanded 2 torture and Harvest Organs Post Mortem autopsies count as slave harm when their mods are active. Hospitality visitor groups never take a runaway who is due to be returned. No Sympathy For Prisoners already removes slavery and execution precept thoughts for everyone, pacifists included. Load after [SYR] More Slaves, or every trader gets its extra 3~5 slaves on top of ours.
Not covered: eating slave meat, slave-leather apparel, slaves lost when a map closes or kidnapped by raiders (vanilla ransom handles those).
Development
The repo is the mod folder. Link it into the game with a directory junction, run from the repo root (adjust the RimWorld path):
New-Item -ItemType Junction -Path "E:\SteamLibrary\steamapps\common\RimWorld\Mods\BlaxSlaves" -Target (Get-Location).Path
Build (needs the .NET 10 SDK; output goes to 1.7/Assemblies/BlaxSlaves.dll):
dotnet build Source\BlaxSlaves\BlaxSlaves.csproj -c Release
RimWorldDir and HarmonyDir in the csproj point at the Steam install and the Harmony mod; override them with -p:RimWorldDir=... elsewhere.
RimWorld 1.7 no longer runs on Unity/Mono. It runs on .NET 10 (CoreCLR) with Ludeon's own engine ("Waylith"):
Assembly-CSharp.dllandUnityStubs.dll(Rect, Color...) sit in the install root, and targetnet10.0.- Harmony for 1.7 is the Harmony mod's
1.7/Assemblies/0Harmony.dll(3.0-rc.7, Workshop 2009463077). Reference it, don't ship it. ParameterlessPatchAll()is obsolete in Harmony 3. - In game, the Harmony mod swaps in a Waylith method-body backend (
HarmonyMod.RuntimeIL.dll). CheckPlayer.logfor[Blax Slaves] N patches appliedand Harmony'sruntime-body providerline. - Patches are applied from a
[StaticConstructorOnStartup]class, one class at a time, so one broken target can't disable the rest.
Tests
Tests/BlaxSlavesTests is a separate test mod. Tests/run-tests.ps1 builds both projects, links the test mod into the game's Mods folder for the run, and starts RimWorld headless (-headless -quicktest -blaxslavestests, no window) with its own save data folder in %TEMP%\BlaxSlavesTest, so your mod list, saves and settings stay untouched. The suite runs in a quick-test colony, saves and reloads the game, runs the persistence tests, writes BlaxSlavesTestResults.txt and quits. It takes about a minute and needs Steam running.
.\Tests\run-tests.ps1
-Compat also loads the installed mods Blax Slaves has compat code for (Hospitality, Harvest Organs Post Mortem, War Crimes Expanded 2, SYR More Slaves, Everybody Buys Slaves). Exit code 0 means all passed, 1 failures, 2 the run didn't finish (see game.log in the data folder).
Tests are public static void methods marked [BlaxTest("area: what", phase: 1)], using T for assertions and Fixtures for pawns, ticks and memories. Phase 2 runs after the save and reload; carry ThingIDs through T.Carry.
Useful 1.7 switches for manual runs: -quicktest (straight into a generated colony), -headless, -savedatafolder=<dir>, -QuitAfterBoot, -NoFileLog.
A decompiled copy of the 1.7 game code for reference lives outside the repo in ..\rimworld-src-1.7 (never commit or publish it).