Skip to content

Instantly share code, notes, and snippets.

@TPJelf
Created June 24, 2024 07:32
Show Gist options
  • Save TPJelf/14acec71a095b556e6895c430a8d298b to your computer and use it in GitHub Desktop.
Save TPJelf/14acec71a095b556e6895c430a8d298b to your computer and use it in GitHub Desktop.
Faro table patch for Hospitality Casino - Rimworld
<?xml version="1.0" encoding="utf-8" ?>
<!-- Add /comps/li/compClass if there are no comps yet. -->
<!-- Add /li/compClass to /comps if exists (i.e. other mod already added the comps field first) -->
<Patch>
<Operation Class="PatchOperationFindMod">
<mods>
<li>Vanilla Factions Expanded - Settlers</li>
</mods>
<match Class="PatchOperationSequence">
<operations>
<li Class="PatchOperationConditional">
<xpath>Defs/ThingDef[defName="TableFaro"]/comps</xpath>
<nomatch Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="TableFaro"]</xpath>
<value>
<comps>
<li Class="HospitalityCasino.CompProperties_VendingMachine">
<compClass>HospitalityCasino.CompVendingMachine</compClass>
<defaultPrice>10</defaultPrice>
<noToggle>true</noToggle>
</li>
</comps>
</value>
</nomatch>
<match Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="TableFaro"]/comps</xpath>
<value>
<li Class="HospitalityCasino.CompProperties_VendingMachine">
<compClass>HospitalityCasino.CompVendingMachine</compClass>
<defaultPrice>10</defaultPrice>
<noToggle>true</noToggle>
</li>
</value>
</match>
</li>
<li Class="PatchOperationReplace">
<xpath>Defs/ThingDef[defName="TableFaro"]/building/joyKind/text()</xpath>
<value>Gamble</value>
</li>
<li Class="PatchOperationReplace">
<xpath>Defs/JoyGiverDef[defName="Play_Faro"]/joyKind/text()</xpath>
<value>Gamble</value>
</li>
<li Class="PatchOperationReplace">
<xpath>Defs/JobDef[defName="Play_Faro"]/joyKind/text()</xpath>
<value>Gamble</value>
</li>
<li Class="PatchOperationReplace">
<xpath>Defs/JobDef[defName="Play_Faro"]/driverClass/text()</xpath>
<value>HospitalityCasino.JobDriver_PlayPokerForMoney</value>
</li>
</operations>
</match>
</Operation>
</Patch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment