diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4ce6fdd --- /dev/null +++ b/.gitignore @@ -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 \ No newline at end of file diff --git a/1.3/Assemblies/STD.dll b/1.3/Assemblies/STD.dll new file mode 100644 index 0000000..ea07a56 Binary files /dev/null and b/1.3/Assemblies/STD.dll differ diff --git a/1.3/Defs/DamageDefs/Damage_Viral.xml b/1.3/Defs/DamageDefs/Damage_Viral.xml new file mode 100644 index 0000000..1601fac --- /dev/null +++ b/1.3/Defs/DamageDefs/Damage_Viral.xml @@ -0,0 +1,15 @@ + + + + ViralDamage + DamageWorker_AddInjury + + false + {0} has died of a disease. + VirusPerma + VirusPerma + VirusPerma + false + false + + \ No newline at end of file diff --git a/1.3/Defs/HediffsDef/Boobitis.xml b/1.3/Defs/HediffsDef/Boobitis.xml new file mode 100644 index 0000000..c4058f2 --- /dev/null +++ b/1.3/Defs/HediffsDef/Boobitis.xml @@ -0,0 +1,37 @@ + + + + Boobitis + + 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. + false + +
  • + 0.1 + + + 0.1 + 0.1 + +
  • +
  • + 0.5 + + 0.2 + + 0.2 + 0.3 + +
  • +
  • + 0.9 + + 0.3 + + 0.3 + 0.5 + +
  • +
    +
    +
    \ No newline at end of file diff --git a/1.3/Defs/HediffsDef/HIV.xml b/1.3/Defs/HediffsDef/HIV.xml new file mode 100644 index 0000000..624010c --- /dev/null +++ b/1.3/Defs/HediffsDef/HIV.xml @@ -0,0 +1,153 @@ + + + + HediffWithComps + true + +
  • + 0.000 + +
  • +
  • + 0.100 + + +
  • + BloodFiltration + -0.05 +
  • + + +
  • + 0.200 + + +
  • + BloodFiltration + -0.10 +
  • + + +
  • + 0.300 + + +
  • + BloodFiltration + -0.15 +
  • + + +
  • + 0.400 + + +
  • + BloodFiltration + -0.20 +
  • + + +
  • + 0.500 + + +
  • + BloodFiltration + -0.30 +
  • + + +
  • + 0.600 + + +
  • + BloodFiltration + -0.40 +
  • + + +
  • + 0.700 + + +
  • + BloodFiltration + -0.50 +
  • + + +
  • + 0.800 + + true + +
  • + BloodFiltration + -0.70 +
  • + + +
  • + 0.900 + + true + +
  • + BloodFiltration + -0.95 +
  • + + +
    +
    + + + AcuteHIV + + An immunodeficiency virus that spreads through sexual contact. + true + 1 + true + +
  • + false +
  • +
  • + 24 + + -0.022 +
  • +
  • + -0.060 + 0.280 + 0.130 + -0.600 +
  • +
    +
    + + + ChronicHIV + + An immunodeficiency virus that spreads through sexual contact. + false + 0.001 + 1.000 + true + +
  • + false +
  • +
  • + 240 + + -0.0013 +
  • +
  • + 0.0048 +
  • +
    +
    +
    \ No newline at end of file diff --git a/1.3/Defs/HediffsDef/Herpes.xml b/1.3/Defs/HediffsDef/Herpes.xml new file mode 100644 index 0000000..67d9c5c --- /dev/null +++ b/1.3/Defs/HediffsDef/Herpes.xml @@ -0,0 +1,42 @@ + + + + Herpes + + Genital sores that spread through sexual contact. + false + 0.001 + 0.650 + true + +
  • + false +
  • +
  • + 240 + + -0.050 +
  • +
  • + 0.035 +
  • +
    + +
  • + 0.000 + + 0.05 +
  • +
  • + 0.250 + + 0.10 +
  • +
  • + 0.500 + + 0.15 +
  • +
    +
    +
    \ No newline at end of file diff --git a/1.3/Defs/HediffsDef/Syphilis.xml b/1.3/Defs/HediffsDef/Syphilis.xml new file mode 100644 index 0000000..f2403fb --- /dev/null +++ b/1.3/Defs/HediffsDef/Syphilis.xml @@ -0,0 +1,108 @@ + + + + Syphilis + A bacterial infection that spreads through sexual contact. + + true + 0.200 + 0.000 + 1.000 + true + +
  • + false +
  • +
  • + 36 + + -0.160 +
  • +
  • + -0.045 + 0.060 + 0.080 + -0.240 +
  • +
    + +
  • + 0.000 + +
  • +
  • + 0.360 + + +
  • + Consciousness + -0.05 +
  • + + +
  • + 0.600 + + 0.05 + +
  • + Consciousness + -0.15 +
  • +
  • + Manipulation + -0.10 +
  • + + +
  • + 0.840 + + 0.15 + true + +
  • + Consciousness + -0.30 +
  • +
  • + Manipulation + -0.20 +
  • + + +
  • + 0.888 + + 0.18 + true + +
  • + Consciousness + 0.50 +
  • +
  • + Manipulation + -0.30 +
  • + + +
  • + 0.936 + + 0.22 + true + +
  • + Consciousness + 0.10 +
  • +
  • + Manipulation + -0.40 +
  • + + +
    +
    +
    \ No newline at end of file diff --git a/1.3/Defs/HediffsDef/Warts.xml b/1.3/Defs/HediffsDef/Warts.xml new file mode 100644 index 0000000..63fe8b6 --- /dev/null +++ b/1.3/Defs/HediffsDef/Warts.xml @@ -0,0 +1,38 @@ + + + + Warts + + Genital warts that spread through sexual contact. + false + 0.000 + 0.650 + true + +
  • + false +
  • +
  • + 24 + + -0.138 +
  • +
  • + -0.090 + 0.165 + 0.225 + -0.400 +
  • +
    + +
  • + 0.000 + +
  • +
  • + 0.400 + +
  • +
    +
    +
    \ No newline at end of file diff --git a/1.3/Defs/HediffsDef/_STD base.xml b/1.3/Defs/HediffsDef/_STD base.xml new file mode 100644 index 0000000..42dd45f --- /dev/null +++ b/1.3/Defs/HediffsDef/_STD base.xml @@ -0,0 +1,8 @@ + + + + HediffWithComps + (0.8, 0.8, 0.35) + 0.010 + + \ No newline at end of file diff --git a/1.3/Defs/IncidentDef/Incidents_STD.xml b/1.3/Defs/IncidentDef/Incidents_STD.xml new file mode 100644 index 0000000..cf9e706 --- /dev/null +++ b/1.3/Defs/IncidentDef/Incidents_STD.xml @@ -0,0 +1,13 @@ + + + + + Disease_Boobitis + + Boobitis + +
  • Chest
  • +
    + Disease (boobitis mechanites) +
    +
    diff --git a/1.3/Defs/STDDefs/STDs.xml b/1.3/Defs/STDDefs/STDs.xml new file mode 100644 index 0000000..c5f0923 --- /dev/null +++ b/1.3/Defs/STDDefs/STDs.xml @@ -0,0 +1,63 @@ + + + + + HIV + + 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. + ChronicHIV + AcuteHIV + 0.05 + 0.005 + 0.80 + + + + Herpes + + 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. + Herpes + 0.14 + 0.04 + 1.00 + +
  • Genitals
  • +
    +
    + + + Warts + + Genital warts are unsightly and cause an itching/burning sensation. They are easily treated and never fatal. + Warts + 0.20 + 0.07 + +
  • Genitals
  • +
    +
    + + + Syphilis + + 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. + Syphilis + 0.08 + 0.03 + 0.01 + + + + Boobitis + + 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. + Boobitis + 0.75 + 0.00 + 0.00 + 0.04 + +
  • Chest
  • +
    +
    +
    \ No newline at end of file diff --git a/1.3/Defs/ThoughtDefs/Thoughts_STD.xml b/1.3/Defs/ThoughtDefs/Thoughts_STD.xml new file mode 100644 index 0000000..fb7fd6a --- /dev/null +++ b/1.3/Defs/ThoughtDefs/Thoughts_STD.xml @@ -0,0 +1,91 @@ + + + + + ItchyCrotch + rjw_std.ThoughtWorker_ItchyCrotch + +
  • + + I don't think anyone's looking. Lemme just... + -3 +
  • +
  • + + The worst part is: the more I scratch, the more it burns. + -6 +
  • +
    +
    + + + SyphiliticThoughts + rjw_std.ThoughtWorker_SyphiliticThoughts + +
  • + + Everyone's so stupid and everything's so annoying. Even me, I just can't think clearly. + -8 +
  • +
  • + + 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 + -16 +
  • +
    +
    + + + WastingAway + rjw_std.ThoughtWorker_WastingAway + +
  • + + Every day I feel weaker than the day before. I can feel my life slowly slipping away. + -5 +
  • +
    +
    + + + SawDiseasedPrivates1 + Thought_MemorySocial + 4.0 + 3 + 0.4 + +
  • + + -9 +
  • +
    +
    + + + SawDiseasedPrivates2 + Thought_MemorySocial + 6.0 + 3 + 0.4 + +
  • + + -20 +
  • +
    +
    + + + SawDiseasedPrivates3 + Thought_MemorySocial + 8.0 + 3 + 0.4 + +
  • + + -30 +
  • +
    +
    +
    diff --git a/1.3/Languages/English/Keyed/STD.xml b/1.3/Languages/English/Keyed/STD.xml new file mode 100644 index 0000000..8e1686e --- /dev/null +++ b/1.3/Languages/English/Keyed/STD.xml @@ -0,0 +1,13 @@ + + + + Enable STDs + Enables sexually transmitted diseases. + STDs from environment + Pawns will catch STDs from dirty environment. + + + {0} has developed an infection due to a weakened immune system. + + {0} has suffered permanent damage to {1} {2} due to an advanced {3} infection. + \ No newline at end of file diff --git a/1.3/Source/Properties/AssemblyInfo.cs b/1.3/Source/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e027d5a --- /dev/null +++ b/1.3/Source/Properties/AssemblyInfo.cs @@ -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")] diff --git a/1.3/Source/STD.sln b/1.3/Source/STD.sln new file mode 100644 index 0000000..2356b0d --- /dev/null +++ b/1.3/Source/STD.sln @@ -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 diff --git a/1.3/Source/STD/Hediffs/Hediff_ID.cs b/1.3/Source/STD/Hediffs/Hediff_ID.cs new file mode 100644 index 0000000..4184bcf --- /dev/null +++ b/1.3/Source/STD/Hediffs/Hediff_ID.cs @@ -0,0 +1,21 @@ +using Verse; + +namespace STD +{ + public class Hediff_ID : Hediff + { + /// + /// rename HIVs to AIDS??? + /// + 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"; + } + } + } +} \ No newline at end of file diff --git a/1.3/Source/STD/STD.csproj b/1.3/Source/STD/STD.csproj new file mode 100644 index 0000000..cb65ae1 --- /dev/null +++ b/1.3/Source/STD/STD.csproj @@ -0,0 +1,81 @@ + + + + + Debug + AnyCPU + {3FC2D442-19B8-4CF9-9D35-CD13B6AC7B28} + Library + STD + STD + v4.7.2 + 512 + + + AnyCPU + true + full + false + ..\..\Assemblies\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + ..\..\Assemblies\ + TRACE + prompt + 4 + + + + ..\packages\Lib.Harmony.2.2.1\lib\net472\0Harmony.dll + False + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll + False + + + ..\..\..\..\..\..\..\workshop\content\294100\818773962\v1.2\Assemblies\HugsLib.dll + False + + + ..\..\..\..\rjw\1.3\Assemblies\RJW.dll + False + + + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll + False + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/1.3/Source/STD/STDBase.cs b/1.3/Source/STD/STDBase.cs new file mode 100644 index 0000000..43904c3 --- /dev/null +++ b/1.3/Source/STD/STDBase.cs @@ -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 std_sex; + public static SettingHandle 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); + } + } +} diff --git a/1.3/Source/STD/STDs/std_Boobitis.cs b/1.3/Source/STD/STDs/std_Boobitis.cs new file mode 100644 index 0000000..381e827 --- /dev/null +++ b/1.3/Source/STD/STDs/std_Boobitis.cs @@ -0,0 +1,109 @@ +using Verse; +using HarmonyLib; +using System; +using rjw; + +namespace STD +{ + /// + ///boobitis increase sex need + /// + [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()); + } + } + } + + /// + /// this is probably outdated, but keep it for now atleast + /// + [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); + } + } +} diff --git a/1.3/Source/STD/STDs/std_Immunodeficiency.cs b/1.3/Source/STD/STDs/std_Immunodeficiency.cs new file mode 100644 index 0000000..9521b13 --- /dev/null +++ b/1.3/Source/STD/STDs/std_Immunodeficiency.cs @@ -0,0 +1,121 @@ +using Verse; +using HarmonyLib; +using System; +using rjw; +using RimWorld; + +namespace STD +{ + /// + /// add some infections + /// + [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.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); + } + } + } + } +} diff --git a/1.3/Source/STD/STDs/std_Rash.cs b/1.3/Source/STD/STDs/std_Rash.cs new file mode 100644 index 0000000..3054d5d --- /dev/null +++ b/1.3/Source/STD/STDs/std_Rash.cs @@ -0,0 +1,82 @@ +using Verse; +using HarmonyLib; +using rjw; +using System; +using RimWorld; + +namespace STD +{ + /// + ///add aftersex thoughts about herpes, warts + /// + [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.GetNamed("SawDiseasedPrivates1"); + public static readonly ThoughtDef saw_rash_2 = DefDatabase.GetNamed("SawDiseasedPrivates2"); + public static readonly ThoughtDef saw_rash_3 = DefDatabase.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); + } + } +} diff --git a/1.3/Source/STD/STDs/std_Syphilis.cs b/1.3/Source/STD/STDs/std_Syphilis.cs new file mode 100644 index 0000000..c67b6af --- /dev/null +++ b/1.3/Source/STD/STDs/std_Syphilis.cs @@ -0,0 +1,100 @@ +using Verse; +using HarmonyLib; +using System; +using rjw; +using RimWorld; + +namespace STD +{ + /// + /// do damage to pawn health + /// + [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.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().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); + } + } + } + } +} diff --git a/1.3/Source/STD/Thoughts/ThoughtWorker_ItchyCrotch.cs b/1.3/Source/STD/Thoughts/ThoughtWorker_ItchyCrotch.cs new file mode 100644 index 0000000..725167d --- /dev/null +++ b/1.3/Source/STD/Thoughts/ThoughtWorker_ItchyCrotch.cs @@ -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); + } + } +} \ No newline at end of file diff --git a/1.3/Source/STD/Thoughts/ThoughtWorker_SyphiliticThoughts.cs b/1.3/Source/STD/Thoughts/ThoughtWorker_SyphiliticThoughts.cs new file mode 100644 index 0000000..72eeba0 --- /dev/null +++ b/1.3/Source/STD/Thoughts/ThoughtWorker_SyphiliticThoughts.cs @@ -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; + } + } +} \ No newline at end of file diff --git a/1.3/Source/STD/Thoughts/ThoughtWorker_WastingAway.cs b/1.3/Source/STD/Thoughts/ThoughtWorker_WastingAway.cs new file mode 100644 index 0000000..f86c4dd --- /dev/null +++ b/1.3/Source/STD/Thoughts/ThoughtWorker_WastingAway.cs @@ -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); + } + } +} \ No newline at end of file diff --git a/1.3/Source/STD/harmony_add_stds.cs b/1.3/Source/STD/harmony_add_stds.cs new file mode 100644 index 0000000..82b8b13 --- /dev/null +++ b/1.3/Source/STD/harmony_add_stds.cs @@ -0,0 +1,38 @@ +using Verse; +using HarmonyLib; +using rjw; +using System; + +namespace STD +{ + /// + ///roll for STD with unprotected rjw sex + /// + [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()); + } + } + } +} diff --git a/1.3/Source/STD/packages.config b/1.3/Source/STD/packages.config new file mode 100644 index 0000000..4b23a8c --- /dev/null +++ b/1.3/Source/STD/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/1.3/Source/STD/std.cs b/1.3/Source/STD/std.cs new file mode 100644 index 0000000..33aec02 --- /dev/null +++ b/1.3/Source/STD/std.cs @@ -0,0 +1,66 @@ +using System.Collections.Generic; +using System.Linq; +using Verse; +using rjw; + +namespace STD +{ + /// + /// Common functions and constants relevant to STDs. + /// + public static class std + { + //STDs + public static std_def ahiv = DefDatabase.GetNamed("AcuteHIV"); + public static std_def chiv = DefDatabase.GetNamed("ChronicHIV"); + public static std_def herpes = DefDatabase.GetNamed("Herpes"); + public static std_def warts = DefDatabase.GetNamed("Warts"); + public static std_def syphilis = DefDatabase.GetNamed("Syphilis"); + public static std_def boobitis = DefDatabase.GetNamed("Boobitis"); + + public static List all => DefDatabase.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 list = null) + { + List 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; + } + } +} diff --git a/1.3/Source/STD/std_def.cs b/1.3/Source/STD/std_def.cs new file mode 100644 index 0000000..e8b16f6 --- /dev/null +++ b/1.3/Source/STD/std_def.cs @@ -0,0 +1,20 @@ +using System.Collections.Generic; +using Verse; + +namespace STD +{ + /// + /// Defines a disease that has a chance to spread during sex. + /// + 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 appliedOnFixedBodyParts = null; + } +} diff --git a/1.3/Source/STD/std_spreader.cs b/1.3/Source/STD/std_spreader.cs new file mode 100644 index 0000000..92dd8b9 --- /dev/null +++ b/1.3/Source/STD/std_spreader.cs @@ -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 +{ + /// + /// Responsible for spreading STDs (adding STD hediffs). Usually happens during sex. + /// + public static class std_spreader + { + /// + /// Check for spreading of every STD the pitcher has to the catcher. + /// Includes a small chance to spread STDs that pitcher doesn't have. + /// + //[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; + } + } + } +} diff --git a/1.3/Source/STD/std_updater.cs b/1.3/Source/STD/std_updater.cs new file mode 100644 index 0000000..a575508 --- /dev/null +++ b/1.3/Source/STD/std_updater.cs @@ -0,0 +1,45 @@ +//using Multiplayer.API; +using RimWorld; +using Verse; +using rjw; + +namespace STD +{ + /// + /// 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. + /// + 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); + } + } + } + } + + /// + /// For meanDays = 1.0, will return true on average once per day. For 2.0, will return true on average once every two days. + /// + //[SyncMethod] + static bool RollFor(float meanDays) + { + return Rand.Chance(1.0f / meanDays / UpdatesPerDay); + } + } +} diff --git a/About/About.xml b/About/About.xml new file mode 100644 index 0000000..4fb0a97 --- /dev/null +++ b/About/About.xml @@ -0,0 +1,42 @@ + + + + RimJobWorld - STD + Ed86 + https://gitgud.io/Ed86/rjw-std + +
  • 1.3
  • +
    + rjw.std + +
  • + rim.job.world + RJW + https://gitgud.io/Ed86/rjw +
  • +
  • + brrainz.harmony + Harmony + https://github.com/pardeike/HarmonyRimWorld/releases/latest + steam://url/CommunityFilePage/2009463077 +
  • +
  • + UnlimitedHugs.HugsLib + HugsLib + https://github.com/UnlimitedHugs/RimworldHugsLib/releases/latest + steam://url/CommunityFilePage/818773962 +
  • +
    + +
  • brrainz.harmony
  • +
  • UnlimitedHugs.HugsLib
  • +
  • erdelf.HumanoidAlienRaces
  • +
  • rim.job.world
  • +
    + + + +
    diff --git a/About/Manifest.xml b/About/Manifest.xml new file mode 100644 index 0000000..8f852dc --- /dev/null +++ b/About/Manifest.xml @@ -0,0 +1,13 @@ + + + RimJobWorld STD + 1.0.0 + +
  • RimJobWorld
  • +
    + +
  • RimJobWorld
  • +
    + https://gitgud.io/Ed86/rjw-std/raw/master/About/Manifest.xml + https://gitgud.io/Ed86/rjw-std +
    diff --git a/README.md b/README.md index 23b8720..5c4dd94 100644 --- a/README.md +++ b/README.md @@ -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