From 600cf8653d724f0af157093fafb9546900e790e8 Mon Sep 17 00:00:00 2001 From: Ed86 Date: Wed, 26 Oct 2022 12:44:02 +0300 Subject: [PATCH] support for 1.4 --- 1.3/Source/Mod/STD.csproj | 2 +- 1.4/Assemblies/RimJobWorldSTD.dll | Bin 0 -> 23552 bytes 1.4/Defs/DamageDefs/HIV_Damage_Viral.xml | 15 ++ 1.4/Defs/HediffsDef/Boobitis.xml | 34 +++ 1.4/Defs/HediffsDef/HIV.xml | 153 +++++++++++++ 1.4/Defs/HediffsDef/Herpes.xml | 42 ++++ 1.4/Defs/HediffsDef/Immunodeficiency.xml | 67 ++++++ 1.4/Defs/HediffsDef/Syphilis.xml | 108 +++++++++ 1.4/Defs/HediffsDef/VirusPerma.xml | 24 ++ 1.4/Defs/HediffsDef/Warts.xml | 38 +++ 1.4/Defs/HediffsDef/_STD base.xml | 8 + 1.4/Defs/IncidentDef/Boobitis.xml | 13 ++ 1.4/Defs/STDDefs/Boobitis.xml | 17 ++ 1.4/Defs/STDDefs/HIV.xml | 14 ++ 1.4/Defs/STDDefs/Herpes.xml | 16 ++ 1.4/Defs/STDDefs/Syphilis.xml | 13 ++ 1.4/Defs/STDDefs/Warts.xml | 15 ++ 1.4/Defs/ThoughtDefs/HIV.xml | 15 ++ 1.4/Defs/ThoughtDefs/Rash.xml | 62 +++++ 1.4/Defs/ThoughtDefs/Syphilis.xml | 20 ++ 1.4/Languages/English/Keyed/STD.xml | 39 ++++ 1.4/Source/Mod/STD.csproj | 87 +++++++ 1.4/Source/Mod/STDBase.cs | 46 ++++ .../Mod/STDs/Boobitis/harmony_Boobitis.cs | 53 +++++ 1.4/Source/Mod/STDs/Boobitis/std_Boobitis.cs | 60 +++++ 1.4/Source/Mod/STDs/HIV/Hediff_ID.cs | 21 ++ .../Mod/STDs/HIV/ThoughtWorker_WastingAway.cs | 16 ++ .../Mod/STDs/HIV/harmony_Immunodeficiency.cs | 26 +++ .../Mod/STDs/HIV/std_Immunodeficiency.cs | 104 +++++++++ .../STDs/Rash/ThoughtWorker_ItchyCrotch.cs | 19 ++ 1.4/Source/Mod/STDs/Rash/harmony_Rash.cs | 26 +++ 1.4/Source/Mod/STDs/Rash/std_Rash.cs | 71 ++++++ .../ThoughtWorker_SyphiliticThoughts.cs | 21 ++ .../Mod/STDs/Syphilis/harmony_Syphilis.cs | 26 +++ 1.4/Source/Mod/STDs/Syphilis/std_Syphilis.cs | 83 +++++++ 1.4/Source/Mod/harmony_add_stds.cs | 38 +++ 1.4/Source/Mod/harmony_stds_generator.cs | 32 +++ 1.4/Source/Mod/harmony_update_stds.cs | 35 +++ 1.4/Source/Mod/packages.config | 4 + 1.4/Source/Mod/std.cs | 59 +++++ 1.4/Source/Mod/std_def.cs | 20 ++ 1.4/Source/Mod/std_spreader.cs | 216 ++++++++++++++++++ 1.4/Source/Mod/std_updater.cs | 45 ++++ 1.4/Source/Properties/AssemblyInfo.cs | 32 +++ 1.4/Source/mod.sln | 22 ++ About/About.xml | 1 + 46 files changed, 1877 insertions(+), 1 deletion(-) create mode 100644 1.4/Assemblies/RimJobWorldSTD.dll create mode 100644 1.4/Defs/DamageDefs/HIV_Damage_Viral.xml create mode 100644 1.4/Defs/HediffsDef/Boobitis.xml create mode 100644 1.4/Defs/HediffsDef/HIV.xml create mode 100644 1.4/Defs/HediffsDef/Herpes.xml create mode 100644 1.4/Defs/HediffsDef/Immunodeficiency.xml create mode 100644 1.4/Defs/HediffsDef/Syphilis.xml create mode 100644 1.4/Defs/HediffsDef/VirusPerma.xml create mode 100644 1.4/Defs/HediffsDef/Warts.xml create mode 100644 1.4/Defs/HediffsDef/_STD base.xml create mode 100644 1.4/Defs/IncidentDef/Boobitis.xml create mode 100644 1.4/Defs/STDDefs/Boobitis.xml create mode 100644 1.4/Defs/STDDefs/HIV.xml create mode 100644 1.4/Defs/STDDefs/Herpes.xml create mode 100644 1.4/Defs/STDDefs/Syphilis.xml create mode 100644 1.4/Defs/STDDefs/Warts.xml create mode 100644 1.4/Defs/ThoughtDefs/HIV.xml create mode 100644 1.4/Defs/ThoughtDefs/Rash.xml create mode 100644 1.4/Defs/ThoughtDefs/Syphilis.xml create mode 100644 1.4/Languages/English/Keyed/STD.xml create mode 100644 1.4/Source/Mod/STD.csproj create mode 100644 1.4/Source/Mod/STDBase.cs create mode 100644 1.4/Source/Mod/STDs/Boobitis/harmony_Boobitis.cs create mode 100644 1.4/Source/Mod/STDs/Boobitis/std_Boobitis.cs create mode 100644 1.4/Source/Mod/STDs/HIV/Hediff_ID.cs create mode 100644 1.4/Source/Mod/STDs/HIV/ThoughtWorker_WastingAway.cs create mode 100644 1.4/Source/Mod/STDs/HIV/harmony_Immunodeficiency.cs create mode 100644 1.4/Source/Mod/STDs/HIV/std_Immunodeficiency.cs create mode 100644 1.4/Source/Mod/STDs/Rash/ThoughtWorker_ItchyCrotch.cs create mode 100644 1.4/Source/Mod/STDs/Rash/harmony_Rash.cs create mode 100644 1.4/Source/Mod/STDs/Rash/std_Rash.cs create mode 100644 1.4/Source/Mod/STDs/Syphilis/ThoughtWorker_SyphiliticThoughts.cs create mode 100644 1.4/Source/Mod/STDs/Syphilis/harmony_Syphilis.cs create mode 100644 1.4/Source/Mod/STDs/Syphilis/std_Syphilis.cs create mode 100644 1.4/Source/Mod/harmony_add_stds.cs create mode 100644 1.4/Source/Mod/harmony_stds_generator.cs create mode 100644 1.4/Source/Mod/harmony_update_stds.cs create mode 100644 1.4/Source/Mod/packages.config create mode 100644 1.4/Source/Mod/std.cs create mode 100644 1.4/Source/Mod/std_def.cs create mode 100644 1.4/Source/Mod/std_spreader.cs create mode 100644 1.4/Source/Mod/std_updater.cs create mode 100644 1.4/Source/Properties/AssemblyInfo.cs create mode 100644 1.4/Source/mod.sln diff --git a/1.3/Source/Mod/STD.csproj b/1.3/Source/Mod/STD.csproj index bd4fa8a..b25432f 100644 --- a/1.3/Source/Mod/STD.csproj +++ b/1.3/Source/Mod/STD.csproj @@ -40,7 +40,7 @@ False - ..\..\..\..\..\..\..\workshop\content\294100\818773962\v1.2\Assemblies\HugsLib.dll + ..\..\..\..\..\..\..\workshop\content\294100\818773962\v1.3\Assemblies\HugsLib.dll False diff --git a/1.4/Assemblies/RimJobWorldSTD.dll b/1.4/Assemblies/RimJobWorldSTD.dll new file mode 100644 index 0000000000000000000000000000000000000000..7593a988d325078ed668a699be6286a13f682599 GIT binary patch literal 23552 zcmeHvdvsh^b@#rHx%1FyG&7PVD~^+~6USrg5y@{kj$e`;EBF;lv17+D8ELMhiAQtg zJ2SS08)XE9kkSysBdtSIl90BzC4~e62@oI!0{IA~e6(~?XciRc*R*8?R_P-xINxvY zbFXG(Cy*>)t^U!m=iIaR*?XUT_St8jeb2q4JxAV21`(O~zVs5&P` z=_h0KvG7-yJg)8j>XPA!d?_{MI^%A3GBuhl7M*fx#7?=DVk%!u4eT3AO*%QdyRk8H zxhH!64x-(fK`ZI-sNdUnX=$oK>meEj#!}cvU0hT6R`Df@OI=rbGr}Vy`Wyh@`D4&c zw=pUIuU$QmQTW^hx%;?MCHf#6;{4D3L{Z?<$B8aJzwH;nDWXtadkFBZI=H)RpDF`> z`~V8H$yhzT0m&x?^}5}X%Z3r%s;KZp9mKcpvlY|T?b-zggsdywk1xwQf^XetE7A5k zP^#}?yW+#T=@g**Hxj*V9g!y3*Iq2@G3Z@j1AhV%Pd5`qTF+?_tFx$|ZUNvdK+zS~ zPq+F2nme@ChG6Gz&@)N8t&T(hMG_5lrb$;cia&h`&pc2p%wrZ5GKM8zNS7po0>D zmBhMy1-fA13DR56X^4RV7CIOq(V!ffbRVJ!qEln4QXX#}RtYCmV9i{@}53?%FXq~5V2 zn7#};lri60)Hn_2j+|b`#T8sEM-kE;_+|u)rx|PII_Sk87gn8WORqpnl@07R)nGQ8 zi-|`&R$QdYD!DsqFe~IbHJEh)q1f#zT!Uh_(;eWgn?@{Re=^v&F%+z&u%7M&(9jWb z&p=>92L)Fy)ze+T(aMX`-MFgxfIDzJ#(dO78s1V#fhy8LmeN7R1Grv-jME4o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Gwb zr6+k^4s1L+RJOB|c<0E?y3=U{t%@@w`?YjChitG4!tCZ^PQeJQMA7mGx zI*9vV7jpRS+JQif`I75OB@cS{gM?ZSwQw%;uk+XJ@ytJ;3&%yYdYcH-$=YMv=%Gz9i18Ct>ZPsH- z&Pe1e7Q_dDnZy}6pIse7>0%^&0^*&QLl^$7oNs}Hkb~#R;PLr;sT(x@7k^I+H=&wX zickGr=*DLoHSJ!$Kh;||dgikm{_Mo>Dm2;+8RH^>Eir|0@(9!k42gB-<5KulM2c2H zqgD9FpOuhOFGtN7pYrori;MTMaaQMj_KNQNygqowSa*Ny3@Ho0+A(aEIpF6YeBM@p z{qfXrPRcL0{Ti|TeE#!i;C%aU5T0!q6`#aSVpa>VS_+;#f9B5T^KI}OxlXCS8T>Id PCBKm_{#WS#Tnqev2;L`8 literal 0 HcmV?d00001 diff --git a/1.4/Defs/DamageDefs/HIV_Damage_Viral.xml b/1.4/Defs/DamageDefs/HIV_Damage_Viral.xml new file mode 100644 index 0000000..1601fac --- /dev/null +++ b/1.4/Defs/DamageDefs/HIV_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.4/Defs/HediffsDef/Boobitis.xml b/1.4/Defs/HediffsDef/Boobitis.xml new file mode 100644 index 0000000..23178e3 --- /dev/null +++ b/1.4/Defs/HediffsDef/Boobitis.xml @@ -0,0 +1,34 @@ + + + + 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.5 + + 0.2 + + 0.3 + +
  • +
  • + 0.9 + + 0.3 + + 0.5 + +
  • +
    +
    +
    \ No newline at end of file diff --git a/1.4/Defs/HediffsDef/HIV.xml b/1.4/Defs/HediffsDef/HIV.xml new file mode 100644 index 0000000..624010c --- /dev/null +++ b/1.4/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.4/Defs/HediffsDef/Herpes.xml b/1.4/Defs/HediffsDef/Herpes.xml new file mode 100644 index 0000000..67d9c5c --- /dev/null +++ b/1.4/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.4/Defs/HediffsDef/Immunodeficiency.xml b/1.4/Defs/HediffsDef/Immunodeficiency.xml new file mode 100644 index 0000000..d1bea52 --- /dev/null +++ b/1.4/Defs/HediffsDef/Immunodeficiency.xml @@ -0,0 +1,67 @@ + + + + + + Immunodeficiency + rjwstd.Hediff_ID + (1.0, 0.0, 0.0) + + false + 0.600 + Very susceptible to disease. + 0.601 + false + +
  • + 0.60 + + 1.10 + +
  • + Consciousness + -0.05 +
  • + + +
  • + 0.75 + + 1.30 + +
  • + Consciousness + -0.10 +
  • +
  • + Manipulation + -0.15 +
  • +
  • + Moving + -0.15 +
  • + + +
  • + 0.90 + + 1.50 + +
  • + Consciousness + -0.15 +
  • +
  • + Manipulation + -0.30 +
  • +
  • + Moving + -0.30 +
  • + + +
    +
    +
    \ No newline at end of file diff --git a/1.4/Defs/HediffsDef/Syphilis.xml b/1.4/Defs/HediffsDef/Syphilis.xml new file mode 100644 index 0000000..f2403fb --- /dev/null +++ b/1.4/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.4/Defs/HediffsDef/VirusPerma.xml b/1.4/Defs/HediffsDef/VirusPerma.xml new file mode 100644 index 0000000..68eb6a0 --- /dev/null +++ b/1.4/Defs/HediffsDef/VirusPerma.xml @@ -0,0 +1,24 @@ + + + + VirusPerma + Hediff_Injury + false + true + 1.0 + Viral damage. + + +
  • + permanent viral damage + permanent viral damage +
  • +
    + + 0.0 + 0.0 + Destroyed by disease + Destroyed by disease + +
    +
    \ No newline at end of file diff --git a/1.4/Defs/HediffsDef/Warts.xml b/1.4/Defs/HediffsDef/Warts.xml new file mode 100644 index 0000000..63fe8b6 --- /dev/null +++ b/1.4/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.4/Defs/HediffsDef/_STD base.xml b/1.4/Defs/HediffsDef/_STD base.xml new file mode 100644 index 0000000..42dd45f --- /dev/null +++ b/1.4/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.4/Defs/IncidentDef/Boobitis.xml b/1.4/Defs/IncidentDef/Boobitis.xml new file mode 100644 index 0000000..cf9e706 --- /dev/null +++ b/1.4/Defs/IncidentDef/Boobitis.xml @@ -0,0 +1,13 @@ + + + + + Disease_Boobitis + + Boobitis + +
  • Chest
  • +
    + Disease (boobitis mechanites) +
    +
    diff --git a/1.4/Defs/STDDefs/Boobitis.xml b/1.4/Defs/STDDefs/Boobitis.xml new file mode 100644 index 0000000..c8c1bfb --- /dev/null +++ b/1.4/Defs/STDDefs/Boobitis.xml @@ -0,0 +1,17 @@ + + + + + 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.4/Defs/STDDefs/HIV.xml b/1.4/Defs/STDDefs/HIV.xml new file mode 100644 index 0000000..70c2380 --- /dev/null +++ b/1.4/Defs/STDDefs/HIV.xml @@ -0,0 +1,14 @@ + + + + + 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 + + \ No newline at end of file diff --git a/1.4/Defs/STDDefs/Herpes.xml b/1.4/Defs/STDDefs/Herpes.xml new file mode 100644 index 0000000..1066d0f --- /dev/null +++ b/1.4/Defs/STDDefs/Herpes.xml @@ -0,0 +1,16 @@ + + + + + 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
  • +
    +
    +
    \ No newline at end of file diff --git a/1.4/Defs/STDDefs/Syphilis.xml b/1.4/Defs/STDDefs/Syphilis.xml new file mode 100644 index 0000000..5474a00 --- /dev/null +++ b/1.4/Defs/STDDefs/Syphilis.xml @@ -0,0 +1,13 @@ + + + + + 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 + + \ No newline at end of file diff --git a/1.4/Defs/STDDefs/Warts.xml b/1.4/Defs/STDDefs/Warts.xml new file mode 100644 index 0000000..5d11727 --- /dev/null +++ b/1.4/Defs/STDDefs/Warts.xml @@ -0,0 +1,15 @@ + + + + + Warts + + Genital warts are unsightly and cause an itching/burning sensation. They are easily treated and never fatal. + Warts + 0.20 + 0.07 + +
  • Genitals
  • +
    +
    +
    \ No newline at end of file diff --git a/1.4/Defs/ThoughtDefs/HIV.xml b/1.4/Defs/ThoughtDefs/HIV.xml new file mode 100644 index 0000000..44e30c6 --- /dev/null +++ b/1.4/Defs/ThoughtDefs/HIV.xml @@ -0,0 +1,15 @@ + + + + + WastingAway + rjwstd.ThoughtWorker_WastingAway + +
  • + + Every day I feel weaker than the day before. I can feel my life slowly slipping away. + -5 +
  • +
    +
    +
    diff --git a/1.4/Defs/ThoughtDefs/Rash.xml b/1.4/Defs/ThoughtDefs/Rash.xml new file mode 100644 index 0000000..f594510 --- /dev/null +++ b/1.4/Defs/ThoughtDefs/Rash.xml @@ -0,0 +1,62 @@ + + + + + ItchyCrotch + rjwstd.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 +
  • +
    +
    + + + 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.4/Defs/ThoughtDefs/Syphilis.xml b/1.4/Defs/ThoughtDefs/Syphilis.xml new file mode 100644 index 0000000..0b7869d --- /dev/null +++ b/1.4/Defs/ThoughtDefs/Syphilis.xml @@ -0,0 +1,20 @@ + + + + + SyphiliticThoughts + rjwstd.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 +
  • +
    +
    +
    diff --git a/1.4/Languages/English/Keyed/STD.xml b/1.4/Languages/English/Keyed/STD.xml new file mode 100644 index 0000000..26ccf7c --- /dev/null +++ b/1.4/Languages/English/Keyed/STD.xml @@ -0,0 +1,39 @@ + + + + STDs from sex + Pawns will catch STDs from sex with infected pawn. + STDs from environment + Pawns will catch STDs from sex in dirty environment. + Show STD catch roll + Logs the process of handing out STDs after sex for debug purposes (or for anyone who's curious) + + Min STD severity to spread + STD infections must be at least this severe to spread between pawns + + Clean rooms spread modifier + = 0]]> + Dirty rooms spread modifier + + Outdoor Cleanliness + + Immunodeficiency spread + Chance to get additional infections due to Immunodeficiency + + Pawn spawn STD multiplier + Multiplier to spawn pawn with STDs (std base chance * this). + Nymph spawn STD multiplier + Multiplier to spawn nymphs with STDs (std base chance * this) + + + {0} has developed an infection due to a weakened immune system. + + {0} has suffered permanent damage to {1} {2} due to an advancement of {3} infection. + + + + {0} has {1} {2} grown to {3} cup from {4}. + \ No newline at end of file diff --git a/1.4/Source/Mod/STD.csproj b/1.4/Source/Mod/STD.csproj new file mode 100644 index 0000000..5d6cbdb --- /dev/null +++ b/1.4/Source/Mod/STD.csproj @@ -0,0 +1,87 @@ + + + + + Debug + AnyCPU + {3FC2D442-19B8-4CF9-9D35-CD13B6AC7B28} + Library + rjwstd + RimJobWorldSTD + 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.4\Assemblies\HugsLib.dll + False + + + ..\..\..\..\rjw\1.4\Assemblies\RJW.dll + False + + + + + ..\..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/1.4/Source/Mod/STDBase.cs b/1.4/Source/Mod/STDBase.cs new file mode 100644 index 0000000..d4f7995 --- /dev/null +++ b/1.4/Source/Mod/STDBase.cs @@ -0,0 +1,46 @@ +using System; +using HugsLib; +using HugsLib.Settings; +using Verse; + +namespace rjwstd +{ + public class STDBase : ModBase + { + public override string ModIdentifier + { + get + { + return "RJW_STD"; + } + } + + public static SettingHandle std_sex; + public static SettingHandle std_floor; + public static SettingHandle std_show_roll_to_catch; + public static SettingHandle std_min_severity_to_pitch; + public static SettingHandle std_env_pitch_cleanliness_exaggeration; + public static SettingHandle std_env_pitch_dirtiness_exaggeration; + public static SettingHandle std_outdoor_cleanliness; + public static SettingHandle opp_inf_initial_immunity; + public static SettingHandle pawn_spawn_with_std_mul; + public static SettingHandle nymph_spawn_with_std_mul; + + public override void DefsLoaded() + { + std_sex = Settings.GetHandle("std_sex", Translator.Translate("std_sex"), Translator.Translate("std_sex_desc"), true); + std_floor = Settings.GetHandle("std_floor", Translator.Translate("std_floor"), Translator.Translate("std_floor_desc"), true); + + std_show_roll_to_catch = Settings.GetHandle("std_show_roll_to_catch", Translator.Translate("std_show_roll_to_catch"), Translator.Translate("std_show_roll_to_catch_desc"), false); + std_min_severity_to_pitch = Settings.GetHandle("std_min_severity_to_pitch", Translator.Translate("std_min_severity_to_pitch"), Translator.Translate("std_min_severity_to_pitch_desc"), 0.21f); + + std_env_pitch_cleanliness_exaggeration = Settings.GetHandle("std_env_pitch_cleanliness_exaggeration", Translator.Translate("std_env_pitch_cleanliness_exaggeration"), Translator.Translate("std_env_pitch_cleanliness_exaggeration_desc"), 2.0f); + std_env_pitch_dirtiness_exaggeration = Settings.GetHandle("std_env_pitch_dirtiness_exaggeration", Translator.Translate("std_env_pitch_dirtiness_exaggeration"), Translator.Translate("std_env_pitch_dirtiness_exaggeration_desc"), 0.5f); + std_outdoor_cleanliness = Settings.GetHandle("std_outdoor_cleanliness", Translator.Translate("std_outdoor_cleanliness"), Translator.Translate("std_outdoor_cleanliness_desc"), -1.0f); + + opp_inf_initial_immunity = Settings.GetHandle("opp_inf_initial_immunity", Translator.Translate("opp_inf_initial_immunity"), Translator.Translate("opp_inf_initial_immunity_desc"), 0.55f); + pawn_spawn_with_std_mul = Settings.GetHandle("pawn_spawn_with_std_mul", Translator.Translate("pawn_spawn_with_std_mul"), Translator.Translate("pawn_spawn_with_std_mul_desc"), 1.0f); + nymph_spawn_with_std_mul = Settings.GetHandle("nymph_spawn_with_std_mul", Translator.Translate("nymph_spawn_with_std_mul"), Translator.Translate("nymph_spawn_with_std_mul_desc"), 3.0f); + } + } +} diff --git a/1.4/Source/Mod/STDs/Boobitis/harmony_Boobitis.cs b/1.4/Source/Mod/STDs/Boobitis/harmony_Boobitis.cs new file mode 100644 index 0000000..3770409 --- /dev/null +++ b/1.4/Source/Mod/STDs/Boobitis/harmony_Boobitis.cs @@ -0,0 +1,53 @@ +using Verse; +using HarmonyLib; +using System; +using rjw; + +namespace rjwstd +{ + /// + ///boobitis increase sex need/make pawn horny + /// + [HarmonyPatch(typeof(Need_Sex), "diseasefactor")] + [StaticConstructorOnStartup] + static class SexNeed_diseasefactorSTD_Boobitis + { + [HarmonyPostfix] + private static void diseasefactor_StdPatch(Pawn pawn, ref float __result) + { + try + { + if (pawn.health.hediffSet.HasHediff(std_Boobitis.boobitis.hediff_def)) + { + __result *= 3f; + } + } + catch (Exception e) + { + Log.Error(e.ToString()); + } + } + } + + /// + /// boobitis increase breast size + /// 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()); + } + } + } +} diff --git a/1.4/Source/Mod/STDs/Boobitis/std_Boobitis.cs b/1.4/Source/Mod/STDs/Boobitis/std_Boobitis.cs new file mode 100644 index 0000000..c2dbe28 --- /dev/null +++ b/1.4/Source/Mod/STDs/Boobitis/std_Boobitis.cs @@ -0,0 +1,60 @@ +using Verse; +using HarmonyLib; +using System; +using rjw; +using RimWorld; + +namespace rjwstd +{ + public static class std_Boobitis + { + public static std_def boobitis = DefDatabase.GetNamed("Boobitis"); + public static void update(Pawn pawn) + { + if (pawn.health.hediffSet.HasHediff(boobitis.hediff_def)) + UpdateBoobitis(pawn); + + } + + public static void UpdateBoobitis(Pawn pawn) + { + var Parts = pawn.GetBreastList(); + + if (!Parts.NullOrEmpty()) + { + foreach (Hediff hed in Parts) + { + if (!(hed is Hediff_PartBaseNatural)) + continue; + + var boob = pawn.health.hediffSet.GetFirstHediffOfDef(boobitis.hediff_def).Severity; + if (boob >= 1.0) + { + //re-add boob dmg someday? + continue; + } + + var hedstage = hed.CurStageIndex; + //GenderHelper.ChangeSex(pawn, () => + //{ + hed.Severity += boob * 0.01f; // ~0.7 beast grow + //}); + + if (hedstage < hed.CurStageIndex) + { + PartSizeExtension.TryGetCupSize(hed, out float size); + var cupSize = (int)size; + var cup = PartStagesDef.GetCupSizeLabel(cupSize); + + string message_title = boobitis.LabelCap; + string message_text = "RJW_BreastsHaveGrownFromBoobitis".Translate(xxx.get_pawnname(pawn), pawn.Possessive(), hed.def.label.ToLower(), cup, boobitis.LabelCap).CapitalizeFirst(); + Find.LetterStack.ReceiveLetter(message_title, message_text, LetterDefOf.NeutralEvent, pawn); + + //var message = "RJW_BreastsHaveGrownFromBoobitis".Translate(xxx.get_pawnname(pawn)); + //Messages.Message(message, pawn, MessageTypeDefOf.SilentInput); + } + } + } + } + } +} diff --git a/1.4/Source/Mod/STDs/HIV/Hediff_ID.cs b/1.4/Source/Mod/STDs/HIV/Hediff_ID.cs new file mode 100644 index 0000000..6be4e45 --- /dev/null +++ b/1.4/Source/Mod/STDs/HIV/Hediff_ID.cs @@ -0,0 +1,21 @@ +using Verse; + +namespace rjwstd +{ + public class Hediff_ID : Hediff + { + /// + /// rename HIVs to AIDS??? + /// + public override string LabelBase + { + get + { + if (!(pawn.health.hediffSet.HasHediff(std_Immunodeficiency.hiv.hediff_def))) + return base.LabelBase; + else + return "AIDS"; + } + } + } +} \ No newline at end of file diff --git a/1.4/Source/Mod/STDs/HIV/ThoughtWorker_WastingAway.cs b/1.4/Source/Mod/STDs/HIV/ThoughtWorker_WastingAway.cs new file mode 100644 index 0000000..22b3030 --- /dev/null +++ b/1.4/Source/Mod/STDs/HIV/ThoughtWorker_WastingAway.cs @@ -0,0 +1,16 @@ +using RimWorld; +using Verse; + +namespace rjwstd +{ + public class ThoughtWorker_WastingAway : ThoughtWorker + { + protected override ThoughtState CurrentStateInternal(Pawn p) + { + if (!std_Immunodeficiency.is_wasting_away(p)) + return ThoughtState.Inactive; + else + return ThoughtState.ActiveAtStage(0); + } + } +} \ No newline at end of file diff --git a/1.4/Source/Mod/STDs/HIV/harmony_Immunodeficiency.cs b/1.4/Source/Mod/STDs/HIV/harmony_Immunodeficiency.cs new file mode 100644 index 0000000..60c3227 --- /dev/null +++ b/1.4/Source/Mod/STDs/HIV/harmony_Immunodeficiency.cs @@ -0,0 +1,26 @@ +using Verse; +using HarmonyLib; +using System; +using rjw; +using RimWorld; + +namespace rjwstd +{ + [HarmonyPatch(typeof(std_updater), "update")] + [StaticConstructorOnStartup] + static class std_updater_Immunodeficiency + { + [HarmonyPostfix] + private static void updateSTD(Pawn p) + { + try + { + std_Immunodeficiency.update(p); + } + catch (Exception e) + { + Log.Error(e.ToString()); + } + } + } +} diff --git a/1.4/Source/Mod/STDs/HIV/std_Immunodeficiency.cs b/1.4/Source/Mod/STDs/HIV/std_Immunodeficiency.cs new file mode 100644 index 0000000..8490944 --- /dev/null +++ b/1.4/Source/Mod/STDs/HIV/std_Immunodeficiency.cs @@ -0,0 +1,104 @@ +using Verse; +using HarmonyLib; +using System; +using rjw; +using RimWorld; + +namespace rjwstd +{ + /// + /// add some infections + /// + public static class std_Immunodeficiency + { + public static std_def hiv = DefDatabase.GetNamed("HIV"); + //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 = STDBase.opp_inf_initial_immunity; + const string message_title = "Opportunistic Infection"; + string message_text = "RJW_Opportunistic_Infection_Message".Translate(xxx.get_pawnname(p)).CapitalizeFirst(); + Find.LetterStack.ReceiveLetter(message_title, message_text, LetterDefOf.ThreatSmall); + } + } + } + } +} diff --git a/1.4/Source/Mod/STDs/Rash/ThoughtWorker_ItchyCrotch.cs b/1.4/Source/Mod/STDs/Rash/ThoughtWorker_ItchyCrotch.cs new file mode 100644 index 0000000..ba4d86e --- /dev/null +++ b/1.4/Source/Mod/STDs/Rash/ThoughtWorker_ItchyCrotch.cs @@ -0,0 +1,19 @@ +using RimWorld; +using Verse; + +namespace rjwstd +{ + public class ThoughtWorker_ItchyCrotch : ThoughtWorker + { + protected override ThoughtState CurrentStateInternal(Pawn p) + { + int sev = std_Rash.genital_rash_severity(p); + if (sev <= 0) + return ThoughtState.Inactive; + else if (sev == 1) + return ThoughtState.ActiveAtStage(0); + else + return ThoughtState.ActiveAtStage(1); + } + } +} \ No newline at end of file diff --git a/1.4/Source/Mod/STDs/Rash/harmony_Rash.cs b/1.4/Source/Mod/STDs/Rash/harmony_Rash.cs new file mode 100644 index 0000000..d8fc15f --- /dev/null +++ b/1.4/Source/Mod/STDs/Rash/harmony_Rash.cs @@ -0,0 +1,26 @@ +using Verse; +using HarmonyLib; +using rjw; +using System; +using RimWorld; + +namespace rjwstd +{ + [HarmonyPatch(typeof(AfterSexUtility), "think_about_sex", new Type[] {typeof(Pawn), typeof(Pawn), typeof(bool), typeof(SexProps), typeof(bool)})] + [StaticConstructorOnStartup] + static class Aftersex_STDThoughtApply + { + [HarmonyPostfix] + private static void ThinkAboutDiseasesStdPatch(Pawn pawn, Pawn partner, bool isReceiving, SexProps props, bool whoring = false) + { + try + { + std_Rash.ThinkAboutDiseases(pawn, partner); + } + catch (Exception e) + { + Log.Error(e.ToString()); + } + } + } +} diff --git a/1.4/Source/Mod/STDs/Rash/std_Rash.cs b/1.4/Source/Mod/STDs/Rash/std_Rash.cs new file mode 100644 index 0000000..a22c3d6 --- /dev/null +++ b/1.4/Source/Mod/STDs/Rash/std_Rash.cs @@ -0,0 +1,71 @@ +using Verse; +using HarmonyLib; +using rjw; +using System; +using RimWorld; + +namespace rjwstd +{ + public static class std_Rash + { + public static std_def herpes = DefDatabase.GetNamed("Herpes"); + public static std_def warts = DefDatabase.GetNamed("Warts"); + + 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_Rash.herpes.hediff_def); + if (her != null && her.Severity >= 0.25f) + ++tr; + + Hediff war = p.health.hediffSet.GetFirstHediffOfDef(std_Rash.warts.hediff_def); + if (war != null) + tr += war.Severity < 0.40f ? 1 : 2; + + return tr; + } + + /// + ///add aftersex thoughts about herpes, warts + /// + 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.4/Source/Mod/STDs/Syphilis/ThoughtWorker_SyphiliticThoughts.cs b/1.4/Source/Mod/STDs/Syphilis/ThoughtWorker_SyphiliticThoughts.cs new file mode 100644 index 0000000..1a25d88 --- /dev/null +++ b/1.4/Source/Mod/STDs/Syphilis/ThoughtWorker_SyphiliticThoughts.cs @@ -0,0 +1,21 @@ +using RimWorld; +using Verse; + +namespace rjwstd +{ + public class ThoughtWorker_SyphiliticThoughts : ThoughtWorker + { + protected override ThoughtState CurrentStateInternal(Pawn p) + { + var syp = p.health.hediffSet.GetFirstHediffOfDef(std_Syphilis.syphilis.hediff_def); + if (syp != null) + { + if (syp.Severity >= 0.80f) + return ThoughtState.ActiveAtStage(1); + else if (syp.Severity >= 0.50f) + return ThoughtState.ActiveAtStage(0); + } + return ThoughtState.Inactive; + } + } +} \ No newline at end of file diff --git a/1.4/Source/Mod/STDs/Syphilis/harmony_Syphilis.cs b/1.4/Source/Mod/STDs/Syphilis/harmony_Syphilis.cs new file mode 100644 index 0000000..c007386 --- /dev/null +++ b/1.4/Source/Mod/STDs/Syphilis/harmony_Syphilis.cs @@ -0,0 +1,26 @@ +using Verse; +using HarmonyLib; +using System; +using rjw; +using RimWorld; + +namespace rjwstd +{ + [HarmonyPatch(typeof(std_updater), "update")] + [StaticConstructorOnStartup] + static class std_updater_Syphilis + { + [HarmonyPostfix] + private static void updateSTD(Pawn p) + { + try + { + std_Syphilis.update(p); + } + catch (Exception e) + { + Log.Error(e.ToString()); + } + } + } +} diff --git a/1.4/Source/Mod/STDs/Syphilis/std_Syphilis.cs b/1.4/Source/Mod/STDs/Syphilis/std_Syphilis.cs new file mode 100644 index 0000000..80febc8 --- /dev/null +++ b/1.4/Source/Mod/STDs/Syphilis/std_Syphilis.cs @@ -0,0 +1,83 @@ +using Verse; +using HarmonyLib; +using System; +using rjw; +using RimWorld; + +namespace rjwstd +{ + /// + /// do damage to pawn health + /// + public static class std_Syphilis + { + public static std_def syphilis = DefDatabase.GetNamed("Syphilis"); + public static void update(Pawn pawn) + { + if (pawn.health.hediffSet.HasHediff(syphilis.hediff_def)) + roll_for_syphilis_damage(pawn); + } + + //[SyncMethod] + public static void roll_for_syphilis_damage(Pawn p) + { + Hediff syp = p.health.hediffSet.GetFirstHediffOfDef(syphilis.hediff_def); + if (syp == null || !(syp.Severity >= 0.60f) || syp.FullyImmune()) return; + + // A 30% chance per day of getting any permanent damage works out to ~891 in 1 million for each roll + // The equation is (1-x)^(60000/150)=.7 + // Important Note: + // this function is called from Need_Sex::NeedInterval(), where it involves a needsex_tick and a std_tick to actually trigger this roll_for_syphilis_damage. + // j(this is not exactly the same as the value in Need_Sex, that value is 0, but here j should be 1) std_ticks per this function called, k needsex_ticks per std_tick, 150 ticks per needsex_tick, and x is the chance per 150 ticks, + // The new equation should be .7 = (1-x)^(400/kj) + // 1-x = .7^(kj/400), x =1-.7^(kj/400) + // Since k=10,j=1, so kj=10, new x is 1-.7^(10/400)=0.0088772362, let it be 888/100000 + //Rand.PopState(); + //Rand.PushState(RJW_Multiplayer.PredictableSeed()); + if (Rand.RangeInclusive(1, 100000) <= 888) + { + BodyPartRecord part; + float sev; + var parts = p.RaceProps.body.AllParts; + + float rv = Rand.Value; + if (rv < 0.10f) + { + part = parts.Find(bpr => string.Equals(bpr.def.defName, "Brain")); + sev = 1.0f; + } + else if (rv < 0.50f) + { + part = parts.Find(bpr => string.Equals(bpr.def.defName, "Liver")); + sev = Rand.RangeInclusive(1, 3); + } + else if (rv < 0.75f) + { + //LeftKidney, probably + part = parts.Find(bpr => string.Equals(bpr.def.defName, "Kidney")); + sev = Rand.RangeInclusive(1, 2); + } + else + { + //RightKidney, probably + part = parts.FindLast(bpr => string.Equals(bpr.def.defName, "Kidney")); + sev = Rand.RangeInclusive(1, 2); + } + + if (part != null && !p.health.hediffSet.PartIsMissing(part) && !p.health.hediffSet.HasDirectlyAddedPartFor(part)) + { + DamageDef vir_dam = DefDatabase.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 = syphilis.label + " Damage"; + string baby_pronoun = p.gender == Gender.Male ? "his" : "her"; + string message_text = "RJW_Syphilis_Damage_Message".Translate(xxx.get_pawnname(p), baby_pronoun, part.def.label, syphilis.label).CapitalizeFirst(); + Find.LetterStack.ReceiveLetter(message_title, message_text, LetterDefOf.ThreatSmall, p); + } + } + } + } +} diff --git a/1.4/Source/Mod/harmony_add_stds.cs b/1.4/Source/Mod/harmony_add_stds.cs new file mode 100644 index 0000000..c6796f1 --- /dev/null +++ b/1.4/Source/Mod/harmony_add_stds.cs @@ -0,0 +1,38 @@ +using Verse; +using HarmonyLib; +using rjw; +using System; + +namespace rjwstd +{ + /// + ///roll for STD with unprotected rjw sex + /// + [HarmonyPatch(typeof(SexUtility), "Aftersex")] + [StaticConstructorOnStartup] + static class Aftersex_STD_Apply + { + [HarmonyPostfix] + private static void Aftersex_STD_Patch(SexProps props) + { + try + { + //TODO: add/test a roll_to_catch_from_corpse to std + if (!props.usedCondom) + if (!props.pawn.Dead && !props.partner.Dead) + { + //TODO: animal env probably always dirty, so skip, maybe add/test someday human-animal transfer + if (!(xxx.is_animal(props.pawn) || xxx.is_animal(props.partner))) + { + std_spreader.roll_to_catch(props, props.pawn, props.partner); + std_spreader.roll_to_catch(props, props.partner, props.pawn); + } + } + } + catch (Exception e) + { + Log.Error(e.ToString()); + } + } + } +} diff --git a/1.4/Source/Mod/harmony_stds_generator.cs b/1.4/Source/Mod/harmony_stds_generator.cs new file mode 100644 index 0000000..04004b7 --- /dev/null +++ b/1.4/Source/Mod/harmony_stds_generator.cs @@ -0,0 +1,32 @@ +using Verse; +using HarmonyLib; +using rjw; +using System; +using System.Reflection; + +namespace rjwstd +{ + /// + ///roll for STD generation for pawns + /// + [HarmonyPatch(typeof(PawnGenerator), "GeneratePawn", new Type[] { typeof(PawnGenerationRequest)})] + [StaticConstructorOnStartup] + static class PawnGenerator_STD_spreader + { + [HarmonyPostfix] + private static void PawnGenerator_STD_spreader_Patch(ref PawnGenerationRequest request, ref Pawn __result) + { + try + { + if (request.AllowedDevelopmentalStages == DevelopmentalStage.None || + request.AllowedDevelopmentalStages == DevelopmentalStage.Adult) + if (__result != null) + std_spreader.generate_on(__result); + } + catch (Exception e) + { + Log.Error(e.ToString()); + } + } + } +} diff --git a/1.4/Source/Mod/harmony_update_stds.cs b/1.4/Source/Mod/harmony_update_stds.cs new file mode 100644 index 0000000..6a56419 --- /dev/null +++ b/1.4/Source/Mod/harmony_update_stds.cs @@ -0,0 +1,35 @@ +using Verse; +using HarmonyLib; +using rjw; +using System; +using System.Reflection; + +namespace rjwstd +{ + /// + ///roll for STD update every 10 sex need ticks + /// + [HarmonyPatch(typeof(Need_Sex), "NeedInterval")] + [StaticConstructorOnStartup] + static class Need_Sex_STD_Update + { + [HarmonyPostfix] + private static void Need_Sex_STD_Patch(Need_Sex __instance, Pawn ___pawn) + { + try + { + if (__instance.isInvisible) + return; // no caravans + + if (__instance.needsex_tick <= 0) // every 10 ticks - real tick + { + std_updater.update(___pawn); + } + } + catch (Exception e) + { + Log.Error(e.ToString()); + } + } + } +} diff --git a/1.4/Source/Mod/packages.config b/1.4/Source/Mod/packages.config new file mode 100644 index 0000000..4b23a8c --- /dev/null +++ b/1.4/Source/Mod/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/1.4/Source/Mod/std.cs b/1.4/Source/Mod/std.cs new file mode 100644 index 0000000..c1d4fdc --- /dev/null +++ b/1.4/Source/Mod/std.cs @@ -0,0 +1,59 @@ +using System.Collections.Generic; +using System.Linq; +using Verse; +using rjw; + +namespace rjwstd +{ + /// + /// Common functions and constants relevant to STDs. + /// + public static class std + { + //all STDs + 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.4/Source/Mod/std_def.cs b/1.4/Source/Mod/std_def.cs new file mode 100644 index 0000000..9347ee8 --- /dev/null +++ b/1.4/Source/Mod/std_def.cs @@ -0,0 +1,20 @@ +using System.Collections.Generic; +using Verse; + +namespace rjwstd +{ + /// + /// 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.4/Source/Mod/std_spreader.cs b/1.4/Source/Mod/std_spreader.cs new file mode 100644 index 0000000..71f41bf --- /dev/null +++ b/1.4/Source/Mod/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 rjwstd +{ + /// + /// 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 (STDBase.std_show_roll_to_catch) + Log.Message(" Chance to catch " + sd.label + ": " + catch_chance.ToStringPercent() + "; rolled: " + catch_rv.ToString()); + if (catch_rv < catch_chance) + { + string pitch_source = "sex"; + float pitch_chance = -9001f; + { + if (STDBase.std_sex) + { + if (get_severity(pitcher, sd) >= STDBase.std_min_severity_to_pitch) + { + pitch_source = xxx.get_pawnname(pitcher); + pitch_chance = 1.0f; + } + } + if (STDBase.std_floor && pitch_chance != 1.0f) + { + pitch_source = "the environment"; + pitch_chance = sd.environment_pitch_chance * cleanliness_factor; + } + } + float pitch_rv = Rand.Value; + + if (STDBase.std_show_roll_to_catch) + Log.Message(" Chance to pitch (from " + pitch_source + "): " + pitch_chance.ToStringPercent() + "; rolled: " + pitch_rv.ToString()); + if (pitch_rv < pitch_chance) + { + infect(catcher, sd); + show_infection_letter(catcher, sd, pitch_source, catch_chance * pitch_chance); + if (STDBase.std_show_roll_to_catch) + Log.Message(" INFECTED!"); + } + } + } + else + if (STDBase.std_show_roll_to_catch) + Log.Message(" Still immune to " + sd.label); + } + else + if (STDBase.std_show_roll_to_catch) + Log.Message(" Already infected with " + sd.label); + } + } + + public static float get_severity(Pawn p, std_def sd) + { + Hediff hed = std.get_infection(p, sd); + return hed?.Severity ?? 0.0f; + } + + public static Hediff infect(Pawn p, std_def sd, bool include_coinfection = true) + { + Hediff existing = std.get_infection(p, sd); + if (existing != null) + { + return existing; + } + + BodyPartRecord part = std.GetRelevantBodyPartRecord(p, sd); + p.health.AddHediff(sd.hediff_def, part); + if (include_coinfection && sd.cohediff_def != null) + { + p.health.AddHediff(sd.cohediff_def, part); + } + //--ModLog.Message("std::infect genitals std"); + return std.get_infection(p, sd); + } + + static float GetCatchChance(Pawn pawn, std_def sd) + { + var bodyPartRecord = std.GetRelevantBodyPartRecord(pawn, sd); + float artificialFactor = 1f; + + if (bodyPartRecord == null && pawn.health.hediffSet.HasDirectlyAddedPartFor(Genital_Helper.get_genitalsBPR(pawn))) + { + artificialFactor = .15f; + } + else if (pawn.health.hediffSet.HasDirectlyAddedPartFor(bodyPartRecord)) + { + artificialFactor = 0f; + } + + return sd.catch_chance * artificialFactor; + } + + public static void show_infection_letter(Pawn p, std_def sd, string source = null, float? chance = null) + { + StringBuilder info; + { + info = new StringBuilder(); + info.Append(xxx.get_pawnname(p) + " has caught " + sd.label + (source != null ? " from " + source + "." : "")); + if (chance.HasValue) + info.Append(" (" + chance.Value.ToStringPercent() + " chance)"); + info.AppendLine(); info.AppendLine(); + info.Append(sd.description); + } + Find.LetterStack.ReceiveLetter("Infection: " + sd.label, info.ToString(), LetterDefOf.ThreatSmall, p); + } + + static float GetCleanlinessFactor(Pawn catcher) + { + Room room = catcher.GetRoom(); + float cle = room?.GetStat(RoomStatDefOf.Cleanliness) ?? STDBase.std_outdoor_cleanliness; + float exa = cle >= 0.0f ? STDBase.std_env_pitch_cleanliness_exaggeration : STDBase.std_env_pitch_dirtiness_exaggeration; + return Mathf.Max(0.0f, 1.0f - exa * cle); + } + + //[SyncMethod] + public static void generate_on(Pawn p) + { + if (p == null) return; + //prevent error on world gen for pawns with broken bodies(no genitals) + //??? + //if (p.RaceProps.body.HasPartWithTag(rjw.BodyPartTagDefOf.RJW_Fertility)) + // return; + if (!xxx.is_human(p)) + return; + float nymph_mul = !xxx.is_nympho(p) ? STDBase.pawn_spawn_with_std_mul : STDBase.nymph_spawn_with_std_mul; + //Rand.PopState(); + //Rand.PushState(RJW_Multiplayer.PredictableSeed()); + foreach (std_def sd in std.all) + if (Rand.Value < sd.spawn_chance * nymph_mul) + { + Hediff hed = infect(p, sd, false); + float sev; + { + float r = Rand.Range(sd.hediff_def.minSeverity, sd.hediff_def.maxSeverity); + sev = Mathf.Clamp(sd.spawn_severity * r, sd.hediff_def.minSeverity, sd.hediff_def.maxSeverity); + } + hed.Severity = sev; + } + } + } +} diff --git a/1.4/Source/Mod/std_updater.cs b/1.4/Source/Mod/std_updater.cs new file mode 100644 index 0000000..aafdad4 --- /dev/null +++ b/1.4/Source/Mod/std_updater.cs @@ -0,0 +1,45 @@ +//using Multiplayer.API; +using RimWorld; +using Verse; +using rjw; + +namespace rjwstd +{ + /// + /// 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/1.4/Source/Properties/AssemblyInfo.cs b/1.4/Source/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e027d5a --- /dev/null +++ b/1.4/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.4/Source/mod.sln b/1.4/Source/mod.sln new file mode 100644 index 0000000..ddd59bc --- /dev/null +++ b/1.4/Source/mod.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", "Mod\STD.csproj", "{3FC2D442-19B8-4CF9-9D35-CD13B6AC7B28}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3FC2D442-19B8-4CF9-9D35-CD13B6AC7B28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3FC2D442-19B8-4CF9-9D35-CD13B6AC7B28}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3FC2D442-19B8-4CF9-9D35-CD13B6AC7B28}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3FC2D442-19B8-4CF9-9D35-CD13B6AC7B28}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/About/About.xml b/About/About.xml index 4fb0a97..003f84e 100644 --- a/About/About.xml +++ b/About/About.xml @@ -6,6 +6,7 @@ https://gitgud.io/Ed86/rjw-std
  • 1.3
  • +
  • 1.4
  • rjw.std