<?xml version="1.0" encoding="UTF-8"?>
<Patch>
  <Operation Class="PatchOperationAdd">
    <success>Always</success>
    <xpath>Defs/FactionDef[defName = "OutlanderCivil"][not(disallowedMemes)]</xpath>
    <value>
      <disallowedMemes></disallowedMemes>
    </value>
  </Operation>

  <!-- Prevent civil factions from generating with rape culture -->
  <Operation Class="PatchOperationAdd">
    <xpath>Defs/FactionDef[defName = "OutlanderCivil" or defName = "TribeCivil"]/disallowedMemes</xpath>
    <value>
      <li>SCE_RapeCulture</li>
    </value>
  </Operation>

  <!-- And enable it on pirates -->
  <Operation Class="PatchOperationAdd">
    <xpath>Defs/FactionDef[defName = "Pirate"]/allowedMemes</xpath>
    <value>
      <li>SCE_RapeCulture</li>
    </value>
  </Operation>

  <!-- porn logic -->
  <Operation Class="PatchOperationFindMod">
    <mods>
      <li>Royalty</li>
    </mods>
    <match Class="PatchOperationAdd">
      <xpath>Defs/FactionDef[defName = "Empire"]/allowedMemes</xpath>
      <value>
        <li>SCE_SexCult</li>
      </value>
    </match>
</Operation>
</Patch>