support for 1.4

This commit is contained in:
Ed86 2022-10-26 12:44:02 +03:00
parent d778e3a53a
commit 600cf8653d
46 changed files with 1877 additions and 1 deletions

View File

@ -40,7 +40,7 @@
<Private>False</Private>
</Reference>
<Reference Include="HugsLib">
<HintPath>..\..\..\..\..\..\..\workshop\content\294100\818773962\v1.2\Assemblies\HugsLib.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\workshop\content\294100\818773962\v1.3\Assemblies\HugsLib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RJW">

Binary file not shown.

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<DamageDef>
<defName>ViralDamage</defName>
<workerClass>DamageWorker_AddInjury</workerClass>
<label>viral damage</label>
<externalViolence>false</externalViolence>
<deathMessage>{0} has died of a disease.</deathMessage>
<hediff>VirusPerma</hediff>
<hediffSkin>VirusPerma</hediffSkin>
<hediffSolid>VirusPerma</hediffSolid>
<makesBlood>false</makesBlood>
<harmAllLayersUntilOutside>false</harmAllLayersUntilOutside>
</DamageDef>
</Defs>

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<HediffDef ParentName="MechanitesBase">
<defName>Boobitis</defName>
<label>boobitis</label>
<description>Boobitis is a highly contagious mechanite plague that causes permanent breast growth if left untreated. It was initialy created as a harmless glittertech "party drug" but has since mutated and spread to virtually every human colony.</description>
<makesSickThought>false</makesSickThought>
<stages>
<li>
<painOffset>0.1</painOffset>
<label>subtle swelling</label>
<statOffsets>
<Vulnerability>0.1</Vulnerability>
</statOffsets>
</li>
<li>
<minSeverity>0.5</minSeverity>
<label>noticable swelling</label>
<painOffset>0.2</painOffset>
<statOffsets>
<Vulnerability>0.3</Vulnerability>
</statOffsets>
</li>
<li>
<minSeverity>0.9</minSeverity>
<label>spectacular swelling</label>
<painOffset>0.3</painOffset>
<statOffsets>
<Vulnerability>0.5</Vulnerability>
</statOffsets>
</li>
</stages>
</HediffDef>
</Defs>

153
1.4/Defs/HediffsDef/HIV.xml Normal file
View File

@ -0,0 +1,153 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<HediffDef Abstract="True" ParentName="STDBase" Name="HIVBase">
<hediffClass>HediffWithComps</hediffClass>
<tendable>true</tendable>
<stages>
<li>
<minSeverity>0.000</minSeverity>
<label>detectable</label>
</li>
<li>
<minSeverity>0.100</minSeverity>
<label>minor</label>
<capMods>
<li>
<capacity>BloodFiltration</capacity>
<offset>-0.05</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.200</minSeverity>
<label>minor</label>
<capMods>
<li>
<capacity>BloodFiltration</capacity>
<offset>-0.10</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.300</minSeverity>
<label>minor</label>
<capMods>
<li>
<capacity>BloodFiltration</capacity>
<offset>-0.15</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.400</minSeverity>
<label>moderate</label>
<capMods>
<li>
<capacity>BloodFiltration</capacity>
<offset>-0.20</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.500</minSeverity>
<label>major</label>
<capMods>
<li>
<capacity>BloodFiltration</capacity>
<offset>-0.30</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.600</minSeverity>
<label>major</label>
<capMods>
<li>
<capacity>BloodFiltration</capacity>
<offset>-0.40</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.700</minSeverity>
<label>major</label>
<capMods>
<li>
<capacity>BloodFiltration</capacity>
<offset>-0.50</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.800</minSeverity>
<label>extreme</label>
<lifeThreatening>true</lifeThreatening>
<capMods>
<li>
<capacity>BloodFiltration</capacity>
<offset>-0.70</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.900</minSeverity>
<label>extreme</label>
<lifeThreatening>true</lifeThreatening>
<capMods>
<li>
<capacity>BloodFiltration</capacity>
<offset>-0.95</offset>
</li>
</capMods>
</li>
</stages>
</HediffDef>
<HediffDef ParentName="HIVBase">
<defName>AcuteHIV</defName>
<label>HIV - Acute</label>
<description>An immunodeficiency virus that spreads through sexual contact.</description>
<makesSickThought>true</makesSickThought>
<maxSeverity>1</maxSeverity>
<tendable>true</tendable>
<comps>
<li Class="HediffCompProperties_Discoverable">
<sendLetterWhenDiscovered>false</sendLetterWhenDiscovered>
</li>
<li Class="HediffCompProperties_TendDuration">
<baseTendDurationHours>24</baseTendDurationHours>
<!-- Daily -->
<severityPerDayTended>-0.022</severityPerDayTended>
</li>
<li Class="HediffCompProperties_Immunizable">
<immunityPerDayNotSick>-0.060</immunityPerDayNotSick>
<immunityPerDaySick>0.280</immunityPerDaySick>
<severityPerDayNotImmune>0.130</severityPerDayNotImmune>
<severityPerDayImmune>-0.600</severityPerDayImmune>
</li>
</comps>
</HediffDef>
<HediffDef ParentName="HIVBase">
<defName>ChronicHIV</defName>
<label>HIV - Chronic</label>
<description>An immunodeficiency virus that spreads through sexual contact.</description>
<makesSickThought>false</makesSickThought>
<minSeverity>0.001</minSeverity>
<maxSeverity>1.000</maxSeverity>
<tendable>true</tendable>
<comps>
<li Class="HediffCompProperties_Discoverable">
<sendLetterWhenDiscovered>false</sendLetterWhenDiscovered>
</li>
<li Class="HediffCompProperties_TendDuration">
<baseTendDurationHours>240</baseTendDurationHours>
<!-- Every 10 days -->
<severityPerDayTended>-0.0013</severityPerDayTended>
</li>
<li Class="HediffCompProperties_Immunizable">
<severityPerDayNotImmune>0.0048</severityPerDayNotImmune>
</li>
</comps>
</HediffDef>
</Defs>

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<HediffDef ParentName="STDBase">
<defName>Herpes</defName>
<label>Herpes</label>
<description>Genital sores that spread through sexual contact.</description>
<makesSickThought>false</makesSickThought>
<minSeverity>0.001</minSeverity>
<maxSeverity>0.650</maxSeverity>
<tendable>true</tendable>
<comps>
<li Class="HediffCompProperties_Discoverable">
<sendLetterWhenDiscovered>false</sendLetterWhenDiscovered>
</li>
<li Class="HediffCompProperties_TendDuration">
<baseTendDurationHours>240</baseTendDurationHours>
<!-- Every 10 days -->
<severityPerDayTended>-0.050</severityPerDayTended>
</li>
<li Class="HediffCompProperties_Immunizable">
<severityPerDayNotImmune>0.035</severityPerDayNotImmune>
</li>
</comps>
<stages>
<li>
<minSeverity>0.000</minSeverity>
<label>minor</label>
<painOffset>0.05</painOffset>
</li>
<li>
<minSeverity>0.250</minSeverity>
<label>moderate</label>
<painOffset>0.10</painOffset>
</li>
<li>
<minSeverity>0.500</minSeverity>
<label>major</label>
<painOffset>0.15</painOffset>
</li>
</stages>
</HediffDef>
</Defs>

View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<!-- Severity will be set to equal (1.0 - blood_filtration) in xxx.update_std_effects -->
<!-- part of HIV -->
<HediffDef>
<defName>Immunodeficiency</defName>
<hediffClass>rjwstd.Hediff_ID</hediffClass>
<defaultLabelColor>(1.0, 0.0, 0.0)</defaultLabelColor>
<label>Immunodeficiency</label>
<makesSickThought>false</makesSickThought>
<minSeverity>0.600</minSeverity>
<description>Very susceptible to disease.</description>
<initialSeverity>0.601</initialSeverity>
<tendable>false</tendable>
<stages>
<li>
<minSeverity>0.60</minSeverity>
<label>minor</label>
<restFallFactor>1.10</restFallFactor>
<capMods>
<li>
<capacity>Consciousness</capacity>
<offset>-0.05</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.75</minSeverity>
<label>major</label>
<restFallFactor>1.30</restFallFactor>
<capMods>
<li>
<capacity>Consciousness</capacity>
<offset>-0.10</offset>
</li>
<li>
<capacity>Manipulation</capacity>
<offset>-0.15</offset>
</li>
<li>
<capacity>Moving</capacity>
<offset>-0.15</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.90</minSeverity>
<label>extreme</label>
<restFallFactor>1.50</restFallFactor>
<capMods>
<li>
<capacity>Consciousness</capacity>
<offset>-0.15</offset>
</li>
<li>
<capacity>Manipulation</capacity>
<offset>-0.30</offset>
</li>
<li>
<capacity>Moving</capacity>
<offset>-0.30</offset>
</li>
</capMods>
</li>
</stages>
</HediffDef>
</Defs>

View File

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<HediffDef ParentName="STDBase">
<defName>Syphilis</defName>
<description>A bacterial infection that spreads through sexual contact.</description>
<label>Syphilis</label>
<makesSickThought>true</makesSickThought>
<initialSeverity>0.200</initialSeverity>
<minSeverity>0.000</minSeverity>
<lethalSeverity>1.000</lethalSeverity>
<tendable>true</tendable>
<comps>
<li Class="HediffCompProperties_Discoverable">
<sendLetterWhenDiscovered>false</sendLetterWhenDiscovered>
</li>
<li Class="HediffCompProperties_TendDuration">
<baseTendDurationHours>36</baseTendDurationHours>
<!-- 2 times every 3 days -->
<severityPerDayTended>-0.160</severityPerDayTended>
</li>
<li Class="HediffCompProperties_Immunizable">
<immunityPerDayNotSick>-0.045</immunityPerDayNotSick>
<immunityPerDaySick>0.060</immunityPerDaySick>
<severityPerDayNotImmune>0.080</severityPerDayNotImmune>
<severityPerDayImmune>-0.240</severityPerDayImmune>
</li>
</comps>
<stages>
<li>
<minSeverity>0.000</minSeverity>
<label>minor</label>
</li>
<li>
<minSeverity>0.360</minSeverity>
<label>moderate</label>
<capMods>
<li>
<capacity>Consciousness</capacity>
<offset>-0.05</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.600</minSeverity>
<label>major</label>
<painOffset>0.05</painOffset>
<capMods>
<li>
<capacity>Consciousness</capacity>
<offset>-0.15</offset>
</li>
<li>
<capacity>Manipulation</capacity>
<offset>-0.10</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.840</minSeverity>
<label>extreme</label>
<painOffset>0.15</painOffset>
<lifeThreatening>true</lifeThreatening>
<capMods>
<li>
<capacity>Consciousness</capacity>
<offset>-0.30</offset>
</li>
<li>
<capacity>Manipulation</capacity>
<offset>-0.20</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.888</minSeverity>
<label>extreme</label>
<painOffset>0.18</painOffset>
<lifeThreatening>true</lifeThreatening>
<capMods>
<li>
<capacity>Consciousness</capacity>
<setMax>0.50</setMax>
</li>
<li>
<capacity>Manipulation</capacity>
<offset>-0.30</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.936</minSeverity>
<label>extreme</label>
<painOffset>0.22</painOffset>
<lifeThreatening>true</lifeThreatening>
<capMods>
<li>
<capacity>Consciousness</capacity>
<setMax>0.10</setMax>
</li>
<li>
<capacity>Manipulation</capacity>
<offset>-0.40</offset>
</li>
</capMods>
</li>
</stages>
</HediffDef>
</Defs>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<HediffDef>
<defName>VirusPerma</defName>
<hediffClass>Hediff_Injury</hediffClass>
<tendable>false</tendable>
<displayWound>true</displayWound>
<chanceToCauseNoPain>1.0</chanceToCauseNoPain>
<description>Viral damage.</description>
<label>viral damage</label>
<comps>
<li Class="HediffCompProperties_GetsPermanent">
<permanentLabel>permanent viral damage</permanentLabel>
<instantlyPermanentLabel>permanent viral damage</instantlyPermanentLabel>
</li>
</comps>
<injuryProps>
<painPerSeverity>0.0</painPerSeverity>
<averagePainPerSeverityPermanent>0.0</averagePainPerSeverityPermanent>
<destroyedLabel>Destroyed by disease</destroyedLabel>
<destroyedOutLabel>Destroyed by disease</destroyedOutLabel>
</injuryProps>
</HediffDef>
</Defs>

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<HediffDef ParentName="STDBase">
<defName>Warts</defName>
<label>Warts</label>
<description>Genital warts that spread through sexual contact.</description>
<makesSickThought>false</makesSickThought>
<minSeverity>0.000</minSeverity>
<maxSeverity>0.650</maxSeverity>
<tendable>true</tendable>
<comps>
<li Class="HediffCompProperties_Discoverable">
<sendLetterWhenDiscovered>false</sendLetterWhenDiscovered>
</li>
<li Class="HediffCompProperties_TendDuration">
<baseTendDurationHours>24</baseTendDurationHours>
<!-- Everyday -->
<severityPerDayTended>-0.138</severityPerDayTended>
</li>
<li Class="HediffCompProperties_Immunizable">
<immunityPerDayNotSick>-0.090</immunityPerDayNotSick>
<immunityPerDaySick>0.165</immunityPerDaySick>
<severityPerDayNotImmune>0.225</severityPerDayNotImmune>
<severityPerDayImmune>-0.400</severityPerDayImmune>
</li>
</comps>
<stages>
<li>
<minSeverity>0.000</minSeverity>
<label>minor</label>
</li>
<li>
<minSeverity>0.400</minSeverity>
<label>major</label>
</li>
</stages>
</HediffDef>
</Defs>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<HediffDef Name="STDBase" Abstract="True">
<hediffClass>HediffWithComps</hediffClass>
<defaultLabelColor>(0.8, 0.8, 0.35)</defaultLabelColor>
<initialSeverity>0.010</initialSeverity>
</HediffDef>
</Defs>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<IncidentDef ParentName="DiseaseIncident">
<defName>Disease_Boobitis</defName>
<label>boobitis mechanites</label>
<diseaseIncident>Boobitis</diseaseIncident>
<diseasePartsToAffect>
<li>Chest</li>
</diseasePartsToAffect>
<letterLabel>Disease (boobitis mechanites)</letterLabel>
</IncidentDef>
</Defs>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<rjwstd.std_def>
<defName>Boobitis</defName>
<label>boobitis</label>
<description>Boobitis is a highly contagious mechanite plague that causes permanent breast growth if left untreated. It was initialy created as a harmless glittertech "party drug" but has since mutated and spread to virtually every human colony.</description>
<hediff_def>Boobitis</hediff_def>
<catch_chance>0.75</catch_chance>
<environment_pitch_chance>0.00</environment_pitch_chance>
<autocure_below_severity>0.00</autocure_below_severity>
<spawn_chance>0.04</spawn_chance>
<appliedOnFixedBodyParts>
<li>Chest</li>
</appliedOnFixedBodyParts>
</rjwstd.std_def>
</Defs>

14
1.4/Defs/STDDefs/HIV.xml Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<rjwstd.std_def>
<defName>HIV</defName>
<label>HIV</label>
<description>HIV consists of two parts: an acute and a chronic infection. Both parts follow the same course, reducing the infected pawn's blood filtration as their severity increases. The acute phase progresses rapidly but can be fought by the pawn's immune system, whereas the chronic phase progresses very slowly but can never be cured. Treatment can modestly slow the progress of the disease.</description>
<hediff_def>ChronicHIV</hediff_def>
<cohediff_def>AcuteHIV</cohediff_def>
<catch_chance>0.05</catch_chance>
<spawn_chance>0.005</spawn_chance>
<spawn_severity>0.80</spawn_severity>
</rjwstd.std_def>
</Defs>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<rjwstd.std_def>
<defName>Herpes</defName>
<label>herpes</label>
<description>Herpes is an incurable but nonfatal disease. Affected pawns experience pain and itchiness in the affected body parts. Treatment is effective at reducing the intensity of the symptoms.</description>
<hediff_def>Herpes</hediff_def>
<catch_chance>0.14</catch_chance>
<spawn_chance>0.04</spawn_chance>
<spawn_severity>1.00</spawn_severity>
<appliedOnFixedBodyParts>
<li>Genitals</li>
</appliedOnFixedBodyParts>
</rjwstd.std_def>
</Defs>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<rjwstd.std_def>
<defName>Syphilis</defName>
<label>syphilis</label>
<description>Syphilis is a serious disease that affects the mind. If left untreated, it leads to corrupted thoughts, mood problems, potential permanent damage to the brain, liver, and kidneys, and, ultimately, death. The good news is that it is easily defeated by proper treatment.</description>
<hediff_def>Syphilis</hediff_def>
<catch_chance>0.08</catch_chance>
<environment_pitch_chance>0.03</environment_pitch_chance>
<autocure_below_severity>0.01</autocure_below_severity>
</rjwstd.std_def>
</Defs>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<rjwstd.std_def>
<defName>Warts</defName>
<label>warts</label>
<description>Genital warts are unsightly and cause an itching/burning sensation. They are easily treated and never fatal.</description>
<hediff_def>Warts</hediff_def>
<catch_chance>0.20</catch_chance>
<environment_pitch_chance>0.07</environment_pitch_chance>
<appliedOnFixedBodyParts>
<li>Genitals</li>
</appliedOnFixedBodyParts>
</rjwstd.std_def>
</Defs>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<ThoughtDef>
<defName>WastingAway</defName>
<workerClass>rjwstd.ThoughtWorker_WastingAway</workerClass>
<stages>
<li>
<label>wasting away</label>
<description>Every day I feel weaker than the day before. I can feel my life slowly slipping away.</description>
<baseMoodEffect>-5</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
</Defs>

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<ThoughtDef>
<defName>ItchyCrotch</defName>
<workerClass>rjwstd.ThoughtWorker_ItchyCrotch</workerClass>
<stages>
<li>
<label>itchy crotch</label>
<description>I don't think anyone's looking. Lemme just...</description>
<baseMoodEffect>-3</baseMoodEffect>
</li>
<li>
<label>itchy, burning crotch</label>
<description>The worst part is: the more I scratch, the more it burns.</description>
<baseMoodEffect>-6</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>SawDiseasedPrivates1</defName>
<thoughtClass>Thought_MemorySocial</thoughtClass>
<durationDays>4.0</durationDays>
<stackLimit>3</stackLimit>
<stackedEffectMultiplier>0.4</stackedEffectMultiplier>
<stages>
<li>
<label>saw an ugly rash on {0}'s crotch</label>
<baseOpinionOffset>-9</baseOpinionOffset>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>SawDiseasedPrivates2</defName>
<thoughtClass>Thought_MemorySocial</thoughtClass>
<durationDays>6.0</durationDays>
<stackLimit>3</stackLimit>
<stackedEffectMultiplier>0.4</stackedEffectMultiplier>
<stages>
<li>
<label>saw disgusting warts on {0}'s crotch</label>
<baseOpinionOffset>-20</baseOpinionOffset>
</li>
</stages>
</ThoughtDef>
<ThoughtDef>
<defName>SawDiseasedPrivates3</defName>
<thoughtClass>Thought_MemorySocial</thoughtClass>
<durationDays>8.0</durationDays>
<stackLimit>3</stackLimit>
<stackedEffectMultiplier>0.4</stackedEffectMultiplier>
<stages>
<li>
<label>nauseated by {0}'s diseased crotch</label>
<baseOpinionOffset>-30</baseOpinionOffset>
</li>
</stages>
</ThoughtDef>
</Defs>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<ThoughtDef>
<defName>SyphiliticThoughts</defName>
<workerClass>rjwstd.ThoughtWorker_SyphiliticThoughts</workerClass>
<stages>
<li>
<label>syphilitic thoughts</label>
<description>Everyone's so stupid and everything's so annoying. Even me, I just can't think clearly.</description>
<baseMoodEffect>-8</baseMoodEffect>
</li>
<li>
<label>extreme syphilitic thoughts</label>
<description>OK, what I need is... uh... what was I doing again? Oh right this thing. This fucking thing THIS FUCKING PIECE OF SHIT. FUCKING DAMN PIECE OF GARBAGE</description>
<baseMoodEffect>-16</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
</Defs>

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<LanguageData>
<!-- Settings -->
<std_sex>STDs from sex</std_sex>
<std_sex_desc>Pawns will catch STDs from sex with infected pawn.</std_sex_desc>
<std_floor>STDs from environment</std_floor>
<std_floor_desc>Pawns will catch STDs from sex in dirty environment.</std_floor_desc>
<std_show_roll_to_catch>Show STD catch roll</std_show_roll_to_catch>
<std_show_roll_to_catch_desc>Logs the process of handing out STDs after sex for debug purposes (or for anyone who's curious)</std_show_roll_to_catch_desc>
<std_min_severity_to_pitch>Min STD severity to spread</std_min_severity_to_pitch>
<std_min_severity_to_pitch_desc>STD infections must be at least this severe to spread between pawns</std_min_severity_to_pitch_desc>
<std_env_pitch_cleanliness_exaggeration>Clean rooms spread modifier</std_env_pitch_cleanliness_exaggeration>
<std_env_pitch_cleanliness_exaggeration_desc><![CDATA[1.0f - this * RoomStatDefOf.Cleanliness.
RoomStatDefOf.Cleanliness >= 0]]></std_env_pitch_cleanliness_exaggeration_desc>
<std_env_pitch_dirtiness_exaggeration>Dirty rooms spread modifier</std_env_pitch_dirtiness_exaggeration>
<std_env_pitch_dirtiness_exaggeration_desc><![CDATA[1.0f - this * RoomStatDefOf.Cleanliness.
RoomStatDefOf.Cleanliness < 0]]></std_env_pitch_dirtiness_exaggeration_desc>
<std_outdoor_cleanliness>Outdoor Cleanliness</std_outdoor_cleanliness>
<std_outdoor_cleanliness_desc><![CDATA[Cleanliness stat for sex outdoor
RoomStatDefOf.Cleanliness = this]]></std_outdoor_cleanliness_desc>
<opp_inf_initial_immunity>Immunodeficiency spread</opp_inf_initial_immunity>
<opp_inf_initial_immunity_desc>Chance to get additional infections due to Immunodeficiency</opp_inf_initial_immunity_desc>
<pawn_spawn_with_std_mul>Pawn spawn STD multiplier</pawn_spawn_with_std_mul>
<pawn_spawn_with_std_mul_desc>Multiplier to spawn pawn with STDs (std base chance * this).</pawn_spawn_with_std_mul_desc>
<nymph_spawn_with_std_mul>Nymph spawn STD multiplier</nymph_spawn_with_std_mul>
<nymph_spawn_with_std_mul_desc>Multiplier to spawn nymphs with STDs (std base chance * this)</nymph_spawn_with_std_mul_desc>
<!-- STDs -->
<RJW_Opportunistic_Infection_Message>{0} has developed an infection due to a weakened immune system.</RJW_Opportunistic_Infection_Message>
<!--RJW_Poisoned_by_Rimming_Message>{0} has gotten food poisoning by rimming {1}</RJW_Poisoned_by_Rimming_Message-->
<RJW_Syphilis_Damage_Message>{0} has suffered permanent damage to {1} {2} due to an advancement of {3} infection.</RJW_Syphilis_Damage_Message>
<!--Breast size changes-->
<!--<RJW_BreastsHaveGrownFromBoobitis>{0} breasts have grown from boobitis.</RJW_BreastsHaveGrownFromBoobitis>-->
<RJW_BreastsHaveGrownFromBoobitis>{0} has {1} {2} grown to {3} cup from {4}.</RJW_BreastsHaveGrownFromBoobitis>
</LanguageData>

87
1.4/Source/Mod/STD.csproj Normal file
View File

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3FC2D442-19B8-4CF9-9D35-CD13B6AC7B28}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>rjwstd</RootNamespace>
<AssemblyName>RimJobWorldSTD</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\Assemblies\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\Assemblies\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony, Version=2.2.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Lib.Harmony.2.2.1\lib\net472\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="HugsLib">
<HintPath>..\..\..\..\..\..\..\workshop\content\294100\818773962\v1.4\Assemblies\HugsLib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RJW">
<HintPath>..\..\..\..\rjw\1.4\Assemblies\RJW.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Runtime.InteropServices.RuntimeInformation" />
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Properties\AssemblyInfo.cs" />
<Compile Include="harmony_add_stds.cs" />
<Compile Include="harmony_stds_generator.cs" />
<Compile Include="harmony_update_stds.cs" />
<Compile Include="STDs\Boobitis\harmony_Boobitis.cs" />
<Compile Include="STDs\HIV\harmony_Immunodeficiency.cs" />
<Compile Include="STDs\Rash\harmony_Rash.cs" />
<Compile Include="STDs\Rash\std_Rash.cs" />
<Compile Include="STDs\HIV\Hediff_ID.cs" />
<Compile Include="std.cs" />
<Compile Include="STDBase.cs" />
<Compile Include="STDs\Boobitis\std_Boobitis.cs" />
<Compile Include="STDs\Syphilis\harmony_Syphilis.cs" />
<Compile Include="std_def.cs" />
<Compile Include="STDs\HIV\std_Immunodeficiency.cs" />
<Compile Include="std_spreader.cs" />
<Compile Include="STDs\Syphilis\std_Syphilis.cs" />
<Compile Include="std_updater.cs" />
<Compile Include="STDs\Rash\ThoughtWorker_ItchyCrotch.cs" />
<Compile Include="STDs\Syphilis\ThoughtWorker_SyphiliticThoughts.cs" />
<Compile Include="STDs\HIV\ThoughtWorker_WastingAway.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

46
1.4/Source/Mod/STDBase.cs Normal file
View File

@ -0,0 +1,46 @@
using System;
using HugsLib;
using HugsLib.Settings;
using Verse;
namespace rjwstd
{
public class STDBase : ModBase
{
public override string ModIdentifier
{
get
{
return "RJW_STD";
}
}
public static SettingHandle<bool> std_sex;
public static SettingHandle<bool> std_floor;
public static SettingHandle<bool> std_show_roll_to_catch;
public static SettingHandle<float> std_min_severity_to_pitch;
public static SettingHandle<float> std_env_pitch_cleanliness_exaggeration;
public static SettingHandle<float> std_env_pitch_dirtiness_exaggeration;
public static SettingHandle<float> std_outdoor_cleanliness;
public static SettingHandle<float> opp_inf_initial_immunity;
public static SettingHandle<float> pawn_spawn_with_std_mul;
public static SettingHandle<float> nymph_spawn_with_std_mul;
public override void DefsLoaded()
{
std_sex = Settings.GetHandle("std_sex", Translator.Translate("std_sex"), Translator.Translate("std_sex_desc"), true);
std_floor = Settings.GetHandle("std_floor", Translator.Translate("std_floor"), Translator.Translate("std_floor_desc"), true);
std_show_roll_to_catch = Settings.GetHandle("std_show_roll_to_catch", Translator.Translate("std_show_roll_to_catch"), Translator.Translate("std_show_roll_to_catch_desc"), false);
std_min_severity_to_pitch = Settings.GetHandle("std_min_severity_to_pitch", Translator.Translate("std_min_severity_to_pitch"), Translator.Translate("std_min_severity_to_pitch_desc"), 0.21f);
std_env_pitch_cleanliness_exaggeration = Settings.GetHandle("std_env_pitch_cleanliness_exaggeration", Translator.Translate("std_env_pitch_cleanliness_exaggeration"), Translator.Translate("std_env_pitch_cleanliness_exaggeration_desc"), 2.0f);
std_env_pitch_dirtiness_exaggeration = Settings.GetHandle("std_env_pitch_dirtiness_exaggeration", Translator.Translate("std_env_pitch_dirtiness_exaggeration"), Translator.Translate("std_env_pitch_dirtiness_exaggeration_desc"), 0.5f);
std_outdoor_cleanliness = Settings.GetHandle("std_outdoor_cleanliness", Translator.Translate("std_outdoor_cleanliness"), Translator.Translate("std_outdoor_cleanliness_desc"), -1.0f);
opp_inf_initial_immunity = Settings.GetHandle("opp_inf_initial_immunity", Translator.Translate("opp_inf_initial_immunity"), Translator.Translate("opp_inf_initial_immunity_desc"), 0.55f);
pawn_spawn_with_std_mul = Settings.GetHandle("pawn_spawn_with_std_mul", Translator.Translate("pawn_spawn_with_std_mul"), Translator.Translate("pawn_spawn_with_std_mul_desc"), 1.0f);
nymph_spawn_with_std_mul = Settings.GetHandle("nymph_spawn_with_std_mul", Translator.Translate("nymph_spawn_with_std_mul"), Translator.Translate("nymph_spawn_with_std_mul_desc"), 3.0f);
}
}
}

View File

@ -0,0 +1,53 @@
using Verse;
using HarmonyLib;
using System;
using rjw;
namespace rjwstd
{
///<summary>
///boobitis increase sex need/make pawn horny
///</summary>
[HarmonyPatch(typeof(Need_Sex), "diseasefactor")]
[StaticConstructorOnStartup]
static class SexNeed_diseasefactorSTD_Boobitis
{
[HarmonyPostfix]
private static void diseasefactor_StdPatch(Pawn pawn, ref float __result)
{
try
{
if (pawn.health.hediffSet.HasHediff(std_Boobitis.boobitis.hediff_def))
{
__result *= 3f;
}
}
catch (Exception e)
{
Log.Error(e.ToString());
}
}
}
/// <summary>
/// boobitis increase breast size
/// this is probably outdated, but keep it for now atleast
/// </summary>
[HarmonyPatch(typeof(std_updater), "update")]
[StaticConstructorOnStartup]
static class std_updater_Boobitis
{
[HarmonyPostfix]
private static void updateSTD(Pawn p)
{
try
{
std_Boobitis.update(p);
}
catch (Exception e)
{
Log.Error(e.ToString());
}
}
}
}

View File

@ -0,0 +1,60 @@
using Verse;
using HarmonyLib;
using System;
using rjw;
using RimWorld;
namespace rjwstd
{
public static class std_Boobitis
{
public static std_def boobitis = DefDatabase<std_def>.GetNamed("Boobitis");
public static void update(Pawn pawn)
{
if (pawn.health.hediffSet.HasHediff(boobitis.hediff_def))
UpdateBoobitis(pawn);
}
public static void UpdateBoobitis(Pawn pawn)
{
var Parts = pawn.GetBreastList();
if (!Parts.NullOrEmpty())
{
foreach (Hediff hed in Parts)
{
if (!(hed is Hediff_PartBaseNatural))
continue;
var boob = pawn.health.hediffSet.GetFirstHediffOfDef(boobitis.hediff_def).Severity;
if (boob >= 1.0)
{
//re-add boob dmg someday?
continue;
}
var hedstage = hed.CurStageIndex;
//GenderHelper.ChangeSex(pawn, () =>
//{
hed.Severity += boob * 0.01f; // ~0.7 beast grow
//});
if (hedstage < hed.CurStageIndex)
{
PartSizeExtension.TryGetCupSize(hed, out float size);
var cupSize = (int)size;
var cup = PartStagesDef.GetCupSizeLabel(cupSize);
string message_title = boobitis.LabelCap;
string message_text = "RJW_BreastsHaveGrownFromBoobitis".Translate(xxx.get_pawnname(pawn), pawn.Possessive(), hed.def.label.ToLower(), cup, boobitis.LabelCap).CapitalizeFirst();
Find.LetterStack.ReceiveLetter(message_title, message_text, LetterDefOf.NeutralEvent, pawn);
//var message = "RJW_BreastsHaveGrownFromBoobitis".Translate(xxx.get_pawnname(pawn));
//Messages.Message(message, pawn, MessageTypeDefOf.SilentInput);
}
}
}
}
}
}

View File

@ -0,0 +1,21 @@
using Verse;
namespace rjwstd
{
public class Hediff_ID : Hediff
{
/// <summary>
/// rename HIVs to AIDS???
/// </summary>
public override string LabelBase
{
get
{
if (!(pawn.health.hediffSet.HasHediff(std_Immunodeficiency.hiv.hediff_def)))
return base.LabelBase;
else
return "AIDS";
}
}
}
}

View File

@ -0,0 +1,16 @@
using RimWorld;
using Verse;
namespace rjwstd
{
public class ThoughtWorker_WastingAway : ThoughtWorker
{
protected override ThoughtState CurrentStateInternal(Pawn p)
{
if (!std_Immunodeficiency.is_wasting_away(p))
return ThoughtState.Inactive;
else
return ThoughtState.ActiveAtStage(0);
}
}
}

View File

@ -0,0 +1,26 @@
using Verse;
using HarmonyLib;
using System;
using rjw;
using RimWorld;
namespace rjwstd
{
[HarmonyPatch(typeof(std_updater), "update")]
[StaticConstructorOnStartup]
static class std_updater_Immunodeficiency
{
[HarmonyPostfix]
private static void updateSTD(Pawn p)
{
try
{
std_Immunodeficiency.update(p);
}
catch (Exception e)
{
Log.Error(e.ToString());
}
}
}
}

View File

@ -0,0 +1,104 @@
using Verse;
using HarmonyLib;
using System;
using rjw;
using RimWorld;
namespace rjwstd
{
/// <summary>
/// add some infections
/// </summary>
public static class std_Immunodeficiency
{
public static std_def hiv = DefDatabase<std_def>.GetNamed("HIV");
//vanilla rimworld
public static readonly HediffDef immunodeficiency = DefDatabase<HediffDef>.GetNamed("Immunodeficiency");
public static bool is_wasting_away(Pawn p)
{
Hediff id = p.health.hediffSet.GetFirstHediffOfDef(immunodeficiency);
return id != null && id.CurStageIndex > 0;
}
public static void update(Pawn pawn)
{
if (pawn.health.hediffSet.HasHediff(immunodeficiency))
update_immunodeficiency(pawn);
}
//[SyncMethod]
public static void update_immunodeficiency(Pawn p)
{
float min_bf_for_id = 1.0f - immunodeficiency.minSeverity;
Hediff id = p.health.hediffSet.GetFirstHediffOfDef(immunodeficiency);
float bf = p.health.capacities.GetLevel(PawnCapacityDefOf.BloodFiltration);
bool has = id != null;
bool should_have = bf <= min_bf_for_id;
if (has && !should_have)
{
p.health.RemoveHediff(id);
id = null;
}
else if (!has && should_have)
{
p.health.AddHediff(immunodeficiency);
id = p.health.hediffSet.GetFirstHediffOfDef(immunodeficiency);
}
if (id == null) return;
id.Severity = 1.0f - bf;
// Roll for and apply opportunistic infections:
// Pawns will have a 90% chance for at least one infection each year at 0% filtration, and a 0%
// chance at 40% filtration, scaling linearly.
// Let x = chance infected per roll
// Then chance not infected per roll = 1 - x
// And chance not infected on any roll in one day = (1 - x) ^ (60000 / 150) = (1 - x) ^ 400
// And chance not infected on any roll in one year = (1 - x) ^ (400 * 60) = (1 - x) ^ 24000
// So 0.10 = (1 - x) ^ 24000
// log (0.10) = 24000 log (1 - x)
// x = 0.00009593644334648975435114691213 = ~96 in 1 million
// Important Note:
// this function is called from Need_Sex::NeedInterval(), where it involves a needsex_tick and a std_tick to actually trigger this update_immunodeficiency.
// j(this is not exactly the same as the value in Need_Sex, that value is 0, but here j should be 1) std_ticks per this function called, k needsex_ticks per std_tick, 150 ticks per needsex_tick, and x is the chance per 150 ticks,
// The new equation should be .1 = (1-x)^(24000/kj)
// log(.1) = (24000/kj) log(1-x), so log(1-x)= (kj/24000) log(.1), 1-x = .1^(kj/24000), x= 1-.1^(kj/24000)
// Since k=10,j=1, so kj=10, new x is 1-.1^(10/24000)=0.0009589504, let it be 959/1000000
//Rand.PopState();
//Rand.PushState(RJW_Multiplayer.PredictableSeed());
if (Rand.RangeInclusive(1, 1000000) <= 959 && Rand.Value < bf / min_bf_for_id)
{
BodyPartRecord part;
{
float rv = Rand.Value;
var parts = p.RaceProps.body.AllParts;
if (rv < 0.25f)
part = parts.Find(bpr => string.Equals(bpr.def.defName, "Jaw"));
else if (rv < 0.50f)
part = parts.Find(bpr => string.Equals(bpr.def.defName, "Lung"));
else if (rv < 0.75f)
part = parts.FindLast(bpr => string.Equals(bpr.def.defName, "Lung"));
else
part = parts.RandomElement();
}
if (part != null &&
!p.health.hediffSet.PartIsMissing(part) && !p.health.hediffSet.HasDirectlyAddedPartFor(part) &&
p.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.WoundInfection) == null && // If the pawn already has a wound infection, we can't properly set the immunity for the new one
p.health.immunity.GetImmunity(HediffDefOf.WoundInfection) <= 0.0f)
{ // Dont spawn infection if pawn already has immunity
p.health.AddHediff(HediffDefOf.WoundInfection, part);
p.health.HealthTick(); // Creates the immunity record
ImmunityRecord ir = p.health.immunity.GetImmunityRecord(HediffDefOf.WoundInfection);
if (ir != null)
ir.immunity = STDBase.opp_inf_initial_immunity;
const string message_title = "Opportunistic Infection";
string message_text = "RJW_Opportunistic_Infection_Message".Translate(xxx.get_pawnname(p)).CapitalizeFirst();
Find.LetterStack.ReceiveLetter(message_title, message_text, LetterDefOf.ThreatSmall);
}
}
}
}
}

View File

@ -0,0 +1,19 @@
using RimWorld;
using Verse;
namespace rjwstd
{
public class ThoughtWorker_ItchyCrotch : ThoughtWorker
{
protected override ThoughtState CurrentStateInternal(Pawn p)
{
int sev = std_Rash.genital_rash_severity(p);
if (sev <= 0)
return ThoughtState.Inactive;
else if (sev == 1)
return ThoughtState.ActiveAtStage(0);
else
return ThoughtState.ActiveAtStage(1);
}
}
}

View File

@ -0,0 +1,26 @@
using Verse;
using HarmonyLib;
using rjw;
using System;
using RimWorld;
namespace rjwstd
{
[HarmonyPatch(typeof(AfterSexUtility), "think_about_sex", new Type[] {typeof(Pawn), typeof(Pawn), typeof(bool), typeof(SexProps), typeof(bool)})]
[StaticConstructorOnStartup]
static class Aftersex_STDThoughtApply
{
[HarmonyPostfix]
private static void ThinkAboutDiseasesStdPatch(Pawn pawn, Pawn partner, bool isReceiving, SexProps props, bool whoring = false)
{
try
{
std_Rash.ThinkAboutDiseases(pawn, partner);
}
catch (Exception e)
{
Log.Error(e.ToString());
}
}
}
}

View File

@ -0,0 +1,71 @@
using Verse;
using HarmonyLib;
using rjw;
using System;
using RimWorld;
namespace rjwstd
{
public static class std_Rash
{
public static std_def herpes = DefDatabase<std_def>.GetNamed("Herpes");
public static std_def warts = DefDatabase<std_def>.GetNamed("Warts");
public static readonly ThoughtDef saw_rash_1 = DefDatabase<ThoughtDef>.GetNamed("SawDiseasedPrivates1");
public static readonly ThoughtDef saw_rash_2 = DefDatabase<ThoughtDef>.GetNamed("SawDiseasedPrivates2");
public static readonly ThoughtDef saw_rash_3 = DefDatabase<ThoughtDef>.GetNamed("SawDiseasedPrivates3");
/// <summary>
/// Returns how severely affected this pawn's crotch is by rashes and warts, on a scale from 0 to 3.
/// </summary>
/// <param name="p"></param>
/// <returns></returns>
public static int genital_rash_severity(Pawn p)
{
int tr = 0;
Hediff her = p.health.hediffSet.GetFirstHediffOfDef(std_Rash.herpes.hediff_def);
if (her != null && her.Severity >= 0.25f)
++tr;
Hediff war = p.health.hediffSet.GetFirstHediffOfDef(std_Rash.warts.hediff_def);
if (war != null)
tr += war.Severity < 0.40f ? 1 : 2;
return tr;
}
///<summary>
///add aftersex thoughts about herpes, warts
///</summary>
public static void ThinkAboutDiseases(Pawn pawn, Pawn partner)
{
if (pawn == null)
return;
if (partner == null)
return;
if (!(xxx.is_human(pawn) && xxx.is_human(partner)))
return;
// Dead and non-humans have no diseases (yet?).
if (partner.Dead || !xxx.is_human(partner))
return;
// check for visible diseases
// Add negative relation for visible diseases on the genitals
int pawn_rash_severity = genital_rash_severity(pawn) - genital_rash_severity(partner);
ThoughtDef pawn_thought_about_rash;
if (pawn_rash_severity == 1)
pawn_thought_about_rash = saw_rash_1;
else if (pawn_rash_severity == 2)
pawn_thought_about_rash = saw_rash_2;
else if (pawn_rash_severity >= 3)
pawn_thought_about_rash = saw_rash_3;
else
return;
Thought_Memory memory = (Thought_Memory)ThoughtMaker.MakeThought(pawn_thought_about_rash);
partner.needs.mood.thoughts.memories.TryGainMemory(memory, pawn);
}
}
}

View File

@ -0,0 +1,21 @@
using RimWorld;
using Verse;
namespace rjwstd
{
public class ThoughtWorker_SyphiliticThoughts : ThoughtWorker
{
protected override ThoughtState CurrentStateInternal(Pawn p)
{
var syp = p.health.hediffSet.GetFirstHediffOfDef(std_Syphilis.syphilis.hediff_def);
if (syp != null)
{
if (syp.Severity >= 0.80f)
return ThoughtState.ActiveAtStage(1);
else if (syp.Severity >= 0.50f)
return ThoughtState.ActiveAtStage(0);
}
return ThoughtState.Inactive;
}
}
}

View File

@ -0,0 +1,26 @@
using Verse;
using HarmonyLib;
using System;
using rjw;
using RimWorld;
namespace rjwstd
{
[HarmonyPatch(typeof(std_updater), "update")]
[StaticConstructorOnStartup]
static class std_updater_Syphilis
{
[HarmonyPostfix]
private static void updateSTD(Pawn p)
{
try
{
std_Syphilis.update(p);
}
catch (Exception e)
{
Log.Error(e.ToString());
}
}
}
}

View File

@ -0,0 +1,83 @@
using Verse;
using HarmonyLib;
using System;
using rjw;
using RimWorld;
namespace rjwstd
{
/// <summary>
/// do damage to pawn health
/// </summary>
public static class std_Syphilis
{
public static std_def syphilis = DefDatabase<std_def>.GetNamed("Syphilis");
public static void update(Pawn pawn)
{
if (pawn.health.hediffSet.HasHediff(syphilis.hediff_def))
roll_for_syphilis_damage(pawn);
}
//[SyncMethod]
public static void roll_for_syphilis_damage(Pawn p)
{
Hediff syp = p.health.hediffSet.GetFirstHediffOfDef(syphilis.hediff_def);
if (syp == null || !(syp.Severity >= 0.60f) || syp.FullyImmune()) return;
// A 30% chance per day of getting any permanent damage works out to ~891 in 1 million for each roll
// The equation is (1-x)^(60000/150)=.7
// Important Note:
// this function is called from Need_Sex::NeedInterval(), where it involves a needsex_tick and a std_tick to actually trigger this roll_for_syphilis_damage.
// j(this is not exactly the same as the value in Need_Sex, that value is 0, but here j should be 1) std_ticks per this function called, k needsex_ticks per std_tick, 150 ticks per needsex_tick, and x is the chance per 150 ticks,
// The new equation should be .7 = (1-x)^(400/kj)
// 1-x = .7^(kj/400), x =1-.7^(kj/400)
// Since k=10,j=1, so kj=10, new x is 1-.7^(10/400)=0.0088772362, let it be 888/100000
//Rand.PopState();
//Rand.PushState(RJW_Multiplayer.PredictableSeed());
if (Rand.RangeInclusive(1, 100000) <= 888)
{
BodyPartRecord part;
float sev;
var parts = p.RaceProps.body.AllParts;
float rv = Rand.Value;
if (rv < 0.10f)
{
part = parts.Find(bpr => string.Equals(bpr.def.defName, "Brain"));
sev = 1.0f;
}
else if (rv < 0.50f)
{
part = parts.Find(bpr => string.Equals(bpr.def.defName, "Liver"));
sev = Rand.RangeInclusive(1, 3);
}
else if (rv < 0.75f)
{
//LeftKidney, probably
part = parts.Find(bpr => string.Equals(bpr.def.defName, "Kidney"));
sev = Rand.RangeInclusive(1, 2);
}
else
{
//RightKidney, probably
part = parts.FindLast(bpr => string.Equals(bpr.def.defName, "Kidney"));
sev = Rand.RangeInclusive(1, 2);
}
if (part != null && !p.health.hediffSet.PartIsMissing(part) && !p.health.hediffSet.HasDirectlyAddedPartFor(part))
{
DamageDef vir_dam = DefDatabase<DamageDef>.GetNamed("ViralDamage");
HediffDef dam_def = HealthUtility.GetHediffDefFromDamage(vir_dam, p, part);
Hediff_Injury inj = (Hediff_Injury)HediffMaker.MakeHediff(dam_def, p, null);
inj.Severity = sev;
inj.TryGetComp<HediffComp_GetsPermanent>().IsPermanent = true;
p.health.AddHediff(inj, part, null);
string message_title = syphilis.label + " Damage";
string baby_pronoun = p.gender == Gender.Male ? "his" : "her";
string message_text = "RJW_Syphilis_Damage_Message".Translate(xxx.get_pawnname(p), baby_pronoun, part.def.label, syphilis.label).CapitalizeFirst();
Find.LetterStack.ReceiveLetter(message_title, message_text, LetterDefOf.ThreatSmall, p);
}
}
}
}
}

View File

@ -0,0 +1,38 @@
using Verse;
using HarmonyLib;
using rjw;
using System;
namespace rjwstd
{
///<summary>
///roll for STD with unprotected rjw sex
///</summary>
[HarmonyPatch(typeof(SexUtility), "Aftersex")]
[StaticConstructorOnStartup]
static class Aftersex_STD_Apply
{
[HarmonyPostfix]
private static void Aftersex_STD_Patch(SexProps props)
{
try
{
//TODO: add/test a roll_to_catch_from_corpse to std
if (!props.usedCondom)
if (!props.pawn.Dead && !props.partner.Dead)
{
//TODO: animal env probably always dirty, so skip, maybe add/test someday human-animal transfer
if (!(xxx.is_animal(props.pawn) || xxx.is_animal(props.partner)))
{
std_spreader.roll_to_catch(props, props.pawn, props.partner);
std_spreader.roll_to_catch(props, props.partner, props.pawn);
}
}
}
catch (Exception e)
{
Log.Error(e.ToString());
}
}
}
}

View File

@ -0,0 +1,32 @@
using Verse;
using HarmonyLib;
using rjw;
using System;
using System.Reflection;
namespace rjwstd
{
///<summary>
///roll for STD generation for pawns
///</summary>
[HarmonyPatch(typeof(PawnGenerator), "GeneratePawn", new Type[] { typeof(PawnGenerationRequest)})]
[StaticConstructorOnStartup]
static class PawnGenerator_STD_spreader
{
[HarmonyPostfix]
private static void PawnGenerator_STD_spreader_Patch(ref PawnGenerationRequest request, ref Pawn __result)
{
try
{
if (request.AllowedDevelopmentalStages == DevelopmentalStage.None ||
request.AllowedDevelopmentalStages == DevelopmentalStage.Adult)
if (__result != null)
std_spreader.generate_on(__result);
}
catch (Exception e)
{
Log.Error(e.ToString());
}
}
}
}

View File

@ -0,0 +1,35 @@
using Verse;
using HarmonyLib;
using rjw;
using System;
using System.Reflection;
namespace rjwstd
{
///<summary>
///roll for STD update every 10 sex need ticks
///</summary>
[HarmonyPatch(typeof(Need_Sex), "NeedInterval")]
[StaticConstructorOnStartup]
static class Need_Sex_STD_Update
{
[HarmonyPostfix]
private static void Need_Sex_STD_Patch(Need_Sex __instance, Pawn ___pawn)
{
try
{
if (__instance.isInvisible)
return; // no caravans
if (__instance.needsex_tick <= 0) // every 10 ticks - real tick
{
std_updater.update(___pawn);
}
}
catch (Exception e)
{
Log.Error(e.ToString());
}
}
}
}

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Lib.Harmony" version="2.2.1" targetFramework="net472" />
</packages>

59
1.4/Source/Mod/std.cs Normal file
View File

@ -0,0 +1,59 @@
using System.Collections.Generic;
using System.Linq;
using Verse;
using rjw;
namespace rjwstd
{
/// <summary>
/// Common functions and constants relevant to STDs.
/// </summary>
public static class std
{
//all STDs
public static List<std_def> all => DefDatabase<std_def>.AllDefsListForReading;
public static Hediff get_infection(Pawn p, std_def sd)
{
return p.health.hediffSet.GetFirstHediffOfDef(sd.hediff_def);
}
public static BodyPartRecord GetRelevantBodyPartRecord(Pawn pawn, std_def std)
{
if (std.appliedOnFixedBodyParts == null)
{
return null;
}
BodyPartDef target = std.appliedOnFixedBodyParts.Single();
return pawn?.RaceProps.body.GetPartsWithDef(target).Single();
//return pawn?.RaceProps.body.GetPartsWithDef(std.appliedOnFixedBodyParts.Single()).Single();
}
public static bool IsImmune(Pawn pawn)
{
// Archotech genitalia automagically purge STDs.
return pawn.health.hediffSet.HasHediff(Genital_Helper.archotech_vagina)
|| pawn.health.hediffSet.HasHediff(Genital_Helper.archotech_penis)
|| xxx.is_demon(pawn)
|| xxx.is_slime(pawn)
|| xxx.is_mechanoid(pawn);
}
public static bool PartsImmune(Pawn pawn, List<Hediff> list = null)
{
List<string> propslist;
if (!list.NullOrEmpty())
if (list.Any())
foreach (var y in list)
{
PartProps.TryGetProps(y, out propslist);
if (!propslist.NullOrEmpty())
if (propslist.Contains("STDImmune"))
{
return true;
}
}
return false;
}
}
}

20
1.4/Source/Mod/std_def.cs Normal file
View File

@ -0,0 +1,20 @@
using System.Collections.Generic;
using Verse;
namespace rjwstd
{
/// <summary>
/// Defines a disease that has a chance to spread during sex.
/// </summary>
public class std_def : Def
{
public HediffDef hediff_def;
public HediffDef cohediff_def = null;
public float catch_chance;
public float environment_pitch_chance = 0.0f;
public float spawn_chance = 0.0f;
public float spawn_severity = 0.0f;
public float autocure_below_severity = -1.0f;
public List<BodyPartDef> appliedOnFixedBodyParts = null;
}
}

View File

@ -0,0 +1,216 @@
//using Multiplayer.API;
using RimWorld;
using System.Text;
using UnityEngine;
using Verse;
using rjw;
using rjw.Modules.Interactions.Enums;
namespace rjwstd
{
/// <summary>
/// Responsible for spreading STDs (adding STD hediffs). Usually happens during sex.
/// </summary>
public static class std_spreader
{
/// <summary>
/// Check for spreading of every STD the pitcher has to the catcher.
/// Includes a small chance to spread STDs that pitcher doesn't have.
/// </summary>
//[SyncMethod]
public static void roll_to_catch(SexProps props, Pawn catcher, Pawn pitcher)
{
//immune race
if (std.IsImmune(catcher) || std.IsImmune(pitcher))
{
return;
}
//immune genitals
if (std.PartsImmune(catcher, catcher.GetGenitalsList()))
return;
//TODO: add check for sex based "genital" immunity
//if (props.pawn == catcher)
//{
// bool immune = false;
// var interaction = rjw.Modules.Interactions.Helpers.InteractionHelper.GetWithExtension(props.dictionaryKey);
// bool Reverse = interaction.HasInteractionTag(InteractionTag.Reverse);
// if (props.sexType == xxx.rjwSextype.Vaginal)
// immune = std.PartsImmune(catcher, catcher.GetGenitalsList());
// if (props.sexType == xxx.rjwSextype.Anal)
// immune =std.PartsImmune(catcher, catcher.GetAnusList());
// if (props.sexType == xxx.rjwSextype.DoublePenetration)
// immune = (std.PartsImmune(catcher, catcher.GetGenitalsList()) && std.PartsImmune(catcher, catcher.GetAnusList()));
// if (props.sexType == xxx.rjwSextype.Oral || props.sexType == xxx.rjwSextype.Fellatio || props.sexType == xxx.rjwSextype.Cunnilingus)
// std.PartsImmune(catcher, catcher.GetGenitalsList());
// if (Modules.Interactions.Helpers.PartHelper.FindParts(giver, GenitalTag.CanFertilize).Any() &&
// Modules.Interactions.Helpers.PartHelper.FindParts(reciever, GenitalTag.CanBeFertilized).Any())
// if (props.isReceiver &&
// interaction.DominantHasFamily(GenitalFamily.Vagina) &&
// interaction.SubmissiveHasTag(GenitalTag.CanPenetrate) &&
// interaction.HasInteractionTag(InteractionTag.Reverse))
// {
// if (RJWSettings.DevMode) ModLog.Message(" impregnate - by receiver");
// }
// else
// return;
// if (immune)
// return;
//}
//Rand.PopState();
//Rand.PushState(RJW_Multiplayer.PredictableSeed());
float cleanliness_factor = GetCleanlinessFactor(catcher);
foreach (std_def sd in std.all)
{
if (!catcher.health.hediffSet.HasHediff(sd.hediff_def))
{
if (catcher.health.immunity.GetImmunity(sd.hediff_def) <= 0.0f)
{
var bodyPartRecord = std.GetRelevantBodyPartRecord(catcher, sd);
var artificial = bodyPartRecord != null && catcher.health.hediffSet.HasDirectlyAddedPartFor(bodyPartRecord);
float catch_chance = GetCatchChance(catcher, sd);
float catch_rv = Rand.Value;
if (STDBase.std_show_roll_to_catch)
Log.Message(" Chance to catch " + sd.label + ": " + catch_chance.ToStringPercent() + "; rolled: " + catch_rv.ToString());
if (catch_rv < catch_chance)
{
string pitch_source = "sex";
float pitch_chance = -9001f;
{
if (STDBase.std_sex)
{
if (get_severity(pitcher, sd) >= STDBase.std_min_severity_to_pitch)
{
pitch_source = xxx.get_pawnname(pitcher);
pitch_chance = 1.0f;
}
}
if (STDBase.std_floor && pitch_chance != 1.0f)
{
pitch_source = "the environment";
pitch_chance = sd.environment_pitch_chance * cleanliness_factor;
}
}
float pitch_rv = Rand.Value;
if (STDBase.std_show_roll_to_catch)
Log.Message(" Chance to pitch (from " + pitch_source + "): " + pitch_chance.ToStringPercent() + "; rolled: " + pitch_rv.ToString());
if (pitch_rv < pitch_chance)
{
infect(catcher, sd);
show_infection_letter(catcher, sd, pitch_source, catch_chance * pitch_chance);
if (STDBase.std_show_roll_to_catch)
Log.Message(" INFECTED!");
}
}
}
else
if (STDBase.std_show_roll_to_catch)
Log.Message(" Still immune to " + sd.label);
}
else
if (STDBase.std_show_roll_to_catch)
Log.Message(" Already infected with " + sd.label);
}
}
public static float get_severity(Pawn p, std_def sd)
{
Hediff hed = std.get_infection(p, sd);
return hed?.Severity ?? 0.0f;
}
public static Hediff infect(Pawn p, std_def sd, bool include_coinfection = true)
{
Hediff existing = std.get_infection(p, sd);
if (existing != null)
{
return existing;
}
BodyPartRecord part = std.GetRelevantBodyPartRecord(p, sd);
p.health.AddHediff(sd.hediff_def, part);
if (include_coinfection && sd.cohediff_def != null)
{
p.health.AddHediff(sd.cohediff_def, part);
}
//--ModLog.Message("std::infect genitals std");
return std.get_infection(p, sd);
}
static float GetCatchChance(Pawn pawn, std_def sd)
{
var bodyPartRecord = std.GetRelevantBodyPartRecord(pawn, sd);
float artificialFactor = 1f;
if (bodyPartRecord == null && pawn.health.hediffSet.HasDirectlyAddedPartFor(Genital_Helper.get_genitalsBPR(pawn)))
{
artificialFactor = .15f;
}
else if (pawn.health.hediffSet.HasDirectlyAddedPartFor(bodyPartRecord))
{
artificialFactor = 0f;
}
return sd.catch_chance * artificialFactor;
}
public static void show_infection_letter(Pawn p, std_def sd, string source = null, float? chance = null)
{
StringBuilder info;
{
info = new StringBuilder();
info.Append(xxx.get_pawnname(p) + " has caught " + sd.label + (source != null ? " from " + source + "." : ""));
if (chance.HasValue)
info.Append(" (" + chance.Value.ToStringPercent() + " chance)");
info.AppendLine(); info.AppendLine();
info.Append(sd.description);
}
Find.LetterStack.ReceiveLetter("Infection: " + sd.label, info.ToString(), LetterDefOf.ThreatSmall, p);
}
static float GetCleanlinessFactor(Pawn catcher)
{
Room room = catcher.GetRoom();
float cle = room?.GetStat(RoomStatDefOf.Cleanliness) ?? STDBase.std_outdoor_cleanliness;
float exa = cle >= 0.0f ? STDBase.std_env_pitch_cleanliness_exaggeration : STDBase.std_env_pitch_dirtiness_exaggeration;
return Mathf.Max(0.0f, 1.0f - exa * cle);
}
//[SyncMethod]
public static void generate_on(Pawn p)
{
if (p == null) return;
//prevent error on world gen for pawns with broken bodies(no genitals)
//???
//if (p.RaceProps.body.HasPartWithTag(rjw.BodyPartTagDefOf.RJW_Fertility))
// return;
if (!xxx.is_human(p))
return;
float nymph_mul = !xxx.is_nympho(p) ? STDBase.pawn_spawn_with_std_mul : STDBase.nymph_spawn_with_std_mul;
//Rand.PopState();
//Rand.PushState(RJW_Multiplayer.PredictableSeed());
foreach (std_def sd in std.all)
if (Rand.Value < sd.spawn_chance * nymph_mul)
{
Hediff hed = infect(p, sd, false);
float sev;
{
float r = Rand.Range(sd.hediff_def.minSeverity, sd.hediff_def.maxSeverity);
sev = Mathf.Clamp(sd.spawn_severity * r, sd.hediff_def.minSeverity, sd.hediff_def.maxSeverity);
}
hed.Severity = sev;
}
}
}
}

View File

@ -0,0 +1,45 @@
//using Multiplayer.API;
using RimWorld;
using Verse;
using rjw;
namespace rjwstd
{
/// <summary>
/// Responsible for handling the periodic effects of having an STD hediff.
/// Not technically tied to the infection vector itself,
/// but some of the STD effects are weird and complicated.
/// </summary>
public static class std_updater
{
public const float UpdatesPerDay = GenDate.TicksPerDay / 150f / (float)Need_Sex.needsex_tick_timer;
public static void update(Pawn p)
{
// Check if any infections are below the autocure threshold and cure them if so
foreach (std_def sd in std.all)
{
Hediff inf = std.get_infection(p, sd);
if (inf != null && (inf.Severity < sd.autocure_below_severity || std.IsImmune(p)))
{
p.health.RemoveHediff(inf);
if (sd.cohediff_def != null)
{
Hediff coinf = p.health.hediffSet.GetFirstHediffOfDef(sd.cohediff_def);
if (coinf != null)
p.health.RemoveHediff(coinf);
}
}
}
}
/// <summary>
/// For meanDays = 1.0, will return true on average once per day. For 2.0, will return true on average once every two days.
/// </summary>
//[SyncMethod]
static bool RollFor(float meanDays)
{
return Rand.Chance(1.0f / meanDays / UpdatesPerDay);
}
}
}

View File

@ -0,0 +1,32 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("RimJobWorld STD")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RimJobWorld STD")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("c2825019-7f0b-456d-85a3-479c1a2a8805")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]

22
1.4/Source/mod.sln Normal file
View File

@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.4
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "STD", "Mod\STD.csproj", "{3FC2D442-19B8-4CF9-9D35-CD13B6AC7B28}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3FC2D442-19B8-4CF9-9D35-CD13B6AC7B28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3FC2D442-19B8-4CF9-9D35-CD13B6AC7B28}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3FC2D442-19B8-4CF9-9D35-CD13B6AC7B28}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3FC2D442-19B8-4CF9-9D35-CD13B6AC7B28}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -6,6 +6,7 @@
<url>https://gitgud.io/Ed86/rjw-std</url>
<supportedVersions>
<li>1.3</li>
<li>1.4</li>
</supportedVersions>
<packageId>rjw.std</packageId>
<modDependencies>