split off rjw stds in separate mod for rjw 5.0+

split stds into separate xml/cs files
This commit is contained in:
Ed86 2022-05-26 14:37:23 +03:00
parent 086e66119d
commit bc8368af15
35 changed files with 2096 additions and 86 deletions

63
.gitattributes vendored Normal file
View File

@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain

340
.gitignore vendored Normal file
View File

@ -0,0 +1,340 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- Backup*.rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb

BIN
1.3/Assemblies/STD.dll Normal file

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,37 @@
<?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>
<SexAbility>0.1</SexAbility>
<Vulnerability>0.1</Vulnerability>
</statOffsets>
</li>
<li>
<minSeverity>0.5</minSeverity>
<label>noticable swelling</label>
<painOffset>0.2</painOffset>
<statOffsets>
<SexAbility>0.2</SexAbility>
<Vulnerability>0.3</Vulnerability>
</statOffsets>
</li>
<li>
<minSeverity>0.9</minSeverity>
<label>spectacular swelling</label>
<painOffset>0.3</painOffset>
<statOffsets>
<SexAbility>0.3</SexAbility>
<Vulnerability>0.5</Vulnerability>
</statOffsets>
</li>
</stages>
</HediffDef>
</Defs>

153
1.3/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,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,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>

63
1.3/Defs/STDDefs/STDs.xml Normal file
View File

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<rjw.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>
</rjw.std_def>
<rjw.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>
</rjw.std_def>
<rjw.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>
</rjw.std_def>
<rjw.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>
</rjw.std_def>
<rjw.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>
</rjw.std_def>
</Defs>

View File

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<ThoughtDef>
<defName>ItchyCrotch</defName>
<workerClass>rjw_std.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>SyphiliticThoughts</defName>
<workerClass>rjw_std.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>
<ThoughtDef>
<defName>WastingAway</defName>
<workerClass>rjw_std.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>
<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,13 @@
<?xml version="1.0" encoding="utf-8"?>
<LanguageData>
<!-- Settings -->
<std_sex>Enable STDs</std_sex>
<std_sex_desc>Enables sexually transmitted diseases.</std_sex_desc>
<std_floor>STDs from environment</std_floor>
<std_floor_desc>Pawns will catch STDs from dirty environment.</std_floor_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 advanced {3} infection.</RJW_Syphilis_Damage_Message>
</LanguageData>

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.3/Source/STD.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", "STD\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

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

81
1.3/Source/STD/STD.csproj Normal file
View File

@ -0,0 +1,81 @@
<?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>STD</RootNamespace>
<AssemblyName>STD</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.2\Assemblies\HugsLib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RJW">
<HintPath>..\..\..\..\rjw\1.3\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="STDs\std_Rash.cs" />
<Compile Include="Hediffs\Hediff_ID.cs" />
<Compile Include="std.cs" />
<Compile Include="STDBase.cs" />
<Compile Include="STDs\std_Boobitis.cs" />
<Compile Include="std_def.cs" />
<Compile Include="STDs\std_Immunodeficiency.cs" />
<Compile Include="std_spreader.cs" />
<Compile Include="STDs\std_Syphilis.cs" />
<Compile Include="std_updater.cs" />
<Compile Include="Thoughts\ThoughtWorker_ItchyCrotch.cs" />
<Compile Include="Thoughts\ThoughtWorker_SyphiliticThoughts.cs" />
<Compile Include="Thoughts\ThoughtWorker_WastingAway.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

27
1.3/Source/STD/STDBase.cs Normal file
View File

@ -0,0 +1,27 @@
using System;
using HugsLib;
using HugsLib.Settings;
using Verse;
namespace STD
{
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 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);
}
}
}

View File

@ -0,0 +1,109 @@
using Verse;
using HarmonyLib;
using System;
using rjw;
namespace STD
{
///<summary>
///boobitis increase sex need
///</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.hediff_def))
{
__result *= 3f;
}
}
catch (Exception e)
{
Log.Error(e.ToString());
}
}
}
/// <summary>
/// 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());
}
}
}
public static class std_Boobitis
{
public static void update(Pawn pawn)
{
if (pawn.health.hediffSet.HasHediff(std.boobitis.hediff_def))
UpdateBoobitis(pawn);
}
public static void UpdateBoobitis(Pawn pawn)
{
//var partBPR = Genital_Helper.get_breastsBPR(pawn);
//var Parts = Genital_Helper.get_PartsHediffList(pawn, partBPR);
//if (!Parts.NullOrEmpty())
//{
// foreach (Hediff hed in Parts)
// {
// if (!(hed is Hediff_PartBaseNatural))
// continue;
// GenderHelper.ChangeSex(pawn, () =>
// {
// hed.Severity += 0.1f;
// });
// var message = "RJW_BreastsHaveGrownFromBoobitis".Translate(pawn);
// Messages.Message(message, pawn, MessageTypeDefOf.SilentInput);
// }
//}
//var hediff = std.get_infection(pawn, std.boobitis);
//if (hediff == null
// || !(hediff.Severity >= 0.20f)
// || hediff.FullyImmune()
// || !BreastSize_Helper.TryGetBreastSize(pawn, out var oldSize, out var oldBoobs)
// || oldSize >= BreastSize_Helper.MaxSize
// || !RollFor(hediff.Severity > 0.90f ? 5f : 15f))
//{
// return;
//}
//var chest = Genital_Helper.get_breastsBPR(pawn);
//var newSize = oldSize + 1;
//var newBoobs = BreastSize_Helper.GetHediffDef(newSize);
//GenderHelper.ChangeSex(pawn, () =>
//{
// if (oldBoobs != null)
// {
// pawn.health.RemoveHediff(oldBoobs);
// }
// pawn.health.AddHediff(newBoobs, chest);
//});
//var message = "RJW_BreastsHaveGrownFromBoobitis".Translate(pawn);
//Messages.Message(message, pawn, MessageTypeDefOf.SilentInput);
}
}
}

View File

@ -0,0 +1,121 @@
using Verse;
using HarmonyLib;
using System;
using rjw;
using RimWorld;
namespace STD
{
/// <summary>
/// add some infections
/// </summary>
[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());
}
}
}
public static class std_Immunodeficiency
{
//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 = xxx.config.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,82 @@
using Verse;
using HarmonyLib;
using rjw;
using System;
using RimWorld;
namespace STD
{
///<summary>
///add aftersex thoughts about herpes, warts
///</summary>
[HarmonyPatch(typeof(AfterSexUtility), "ThinkAboutDiseases")]
[StaticConstructorOnStartup]
static class Aftersex_STDThoughtApply
{
[HarmonyPrefix]
private static void ThinkAboutDiseasesStdPatch(Pawn pawn, Pawn partner)
{
try
{
std_Rash.ThinkAboutDiseases(pawn, partner);
}
catch (Exception e)
{
Log.Error(e.ToString());
}
}
}
public static class std_Rash
{
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");
// Returns how severely affected this pawn's crotch is by rashes and warts, on a scale from 0 to 3.
public static int genital_rash_severity(Pawn p)
{
int tr = 0;
Hediff her = p.health.hediffSet.GetFirstHediffOfDef(std.herpes.hediff_def);
if (her != null && her.Severity >= 0.25f)
++tr;
Hediff war = p.health.hediffSet.GetFirstHediffOfDef(std.warts.hediff_def);
if (war != null)
tr += war.Severity < 0.40f ? 1 : 2;
return tr;
}
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,100 @@
using Verse;
using HarmonyLib;
using System;
using rjw;
using RimWorld;
namespace STD
{
/// <summary>
/// do damage to pawn health
/// </summary>
[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());
}
}
}
public static class std_Syphilis
{
public static void update(Pawn pawn)
{
if (pawn.health.hediffSet.HasHediff(std.syphilis.hediff_def))
roll_for_syphilis_damage(pawn);
}
//[SyncMethod]
public static void roll_for_syphilis_damage(Pawn p)
{
Hediff syp = p.health.hediffSet.GetFirstHediffOfDef(std.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 = std.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, std.syphilis.label).CapitalizeFirst();
Find.LetterStack.ReceiveLetter(message_title, message_text, LetterDefOf.ThreatSmall, p);
}
}
}
}
}

View File

@ -0,0 +1,19 @@
using RimWorld;
using Verse;
namespace STD
{
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,21 @@
using RimWorld;
using Verse;
namespace STD
{
public class ThoughtWorker_SyphiliticThoughts : ThoughtWorker
{
protected override ThoughtState CurrentStateInternal(Pawn p)
{
var syp = p.health.hediffSet.GetFirstHediffOfDef(std.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,16 @@
using RimWorld;
using Verse;
namespace STD
{
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,38 @@
using Verse;
using HarmonyLib;
using rjw;
using System;
namespace STD
{
///<summary>
///roll for STD with unprotected rjw sex
///</summary>
[HarmonyPatch(typeof(SexUtility), "Aftersex")]
[StaticConstructorOnStartup]
static class Aftersex_STD_Apply
{
[HarmonyPrefix]
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,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Lib.Harmony" version="2.2.1" targetFramework="net472" />
</packages>

66
1.3/Source/STD/std.cs Normal file
View File

@ -0,0 +1,66 @@
using System.Collections.Generic;
using System.Linq;
using Verse;
using rjw;
namespace STD
{
/// <summary>
/// Common functions and constants relevant to STDs.
/// </summary>
public static class std
{
//STDs
public static std_def ahiv = DefDatabase<std_def>.GetNamed("AcuteHIV");
public static std_def chiv = DefDatabase<std_def>.GetNamed("ChronicHIV");
public static std_def herpes = DefDatabase<std_def>.GetNamed("Herpes");
public static std_def warts = DefDatabase<std_def>.GetNamed("Warts");
public static std_def syphilis = DefDatabase<std_def>.GetNamed("Syphilis");
public static std_def boobitis = DefDatabase<std_def>.GetNamed("Boobitis");
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.3/Source/STD/std_def.cs Normal file
View File

@ -0,0 +1,20 @@
using System.Collections.Generic;
using Verse;
namespace STD
{
/// <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 STD
{
/// <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 (xxx.config.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; float pitch_chance;
{
if (get_severity(pitcher, sd) >= xxx.config.std_min_severity_to_pitch)
{
pitch_source = xxx.get_pawnname(pitcher);
pitch_chance = 1.0f;
}
else
{
pitch_source = "the environment";
pitch_chance = sd.environment_pitch_chance * cleanliness_factor;
if (!STDBase.std_floor)
{
pitch_chance = -9001f;
}
}
}
float pitch_rv = Rand.Value;
//if (xxx.config.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 (xxx.config.std_show_roll_to_catch)
//--Log.Message(" INFECTED!");
}
}
}
//else
//if (xxx.config.std_show_roll_to_catch)
//--Log.Message(" Still immune to " + sd.label);
}
//else
//if (xxx.config.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) ?? xxx.config.std_outdoor_cleanliness;
float exa = cle >= 0.0f ? xxx.config.std_env_pitch_cleanliness_exaggeration : xxx.config.std_env_pitch_dirtiness_exaggeration;
return Mathf.Max(0.0f, 1.0f - exa * cle);
}
// Not called anywhere?
//[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) ? 1.0f : xxx.config.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 STD
{
/// <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);
}
}
}

42
About/About.xml Normal file
View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<ModMetaData>
<name>RimJobWorld - STD</name>
<author>Ed86</author>
<url>https://gitgud.io/Ed86/rjw-std</url>
<supportedVersions>
<li>1.3</li>
</supportedVersions>
<packageId>rjw.std</packageId>
<modDependencies>
<li>
<packageId>rim.job.world</packageId>
<displayName>RJW</displayName>
<downloadUrl>https://gitgud.io/Ed86/rjw</downloadUrl>
</li>
<li>
<packageId>brrainz.harmony</packageId>
<displayName>Harmony</displayName>
<downloadUrl>https://github.com/pardeike/HarmonyRimWorld/releases/latest</downloadUrl>
<steamWorkshopUrl>steam://url/CommunityFilePage/2009463077</steamWorkshopUrl>
</li>
<li>
<packageId>UnlimitedHugs.HugsLib</packageId>
<displayName>HugsLib</displayName>
<downloadUrl>https://github.com/UnlimitedHugs/RimworldHugsLib/releases/latest</downloadUrl>
<steamWorkshopUrl>steam://url/CommunityFilePage/818773962</steamWorkshopUrl>
</li>
</modDependencies>
<loadAfter>
<li>brrainz.harmony</li>
<li>UnlimitedHugs.HugsLib</li>
<li>erdelf.HumanoidAlienRaces</li>
<li>rim.job.world</li>
</loadAfter>
<description>
<![CDATA[
Additional features to RimJobWorld:
STDs
]]>
</description>
</ModMetaData>

13
About/Manifest.xml Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
<identifier>RimJobWorld STD</identifier>
<version>1.0.0</version>
<dependencies>
<li>RimJobWorld</li>
</dependencies>
<loadAfter>
<li>RimJobWorld</li>
</loadAfter>
<manifestUri>https://gitgud.io/Ed86/rjw-std/raw/master/About/Manifest.xml</manifestUri>
<downloadUri>https://gitgud.io/Ed86/rjw-std</downloadUri>
</Manifest>

103
README.md
View File

@ -1,92 +1,23 @@
# RJW - STD
And why would you read me?
Mod git:
https://gitgud.io/Ed86/rjw-std
Discord:
https://discord.gg/CXwHhv8
## Getting started
LoversLab:
-
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Requirements:
Harmony
Hugslib
Rimjobworld (https://gitgud.io/Ed86/rjw)
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
Additional features to RimJobWorld (STDs):
## Add your files
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://gitgud.io/Ed86/rjw-std.git
git branch -M master
git push -uf origin master
```
## Integrate with your tools
- [ ] [Set up project integrations](https://gitgud.io/Ed86/rjw-std/-/settings/integrations)
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
- HIVs
- Immunodeficiency
- Syphilis
- Herpes & Warts
- Boobitis