This commit is contained in:
Ed86 2022-06-01 12:23:51 +03:00
parent 4ead0d6aae
commit 3beb2663f2
17 changed files with 180 additions and 141 deletions

Binary file not shown.

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<rjw.std_def>
<STD.std_def>
<defName>HIV</defName>
<label>HIV</label>
<description>HIV consists of two parts: an acute and a chronic infection. Both parts follow the same course, reducing the infected pawn's blood filtration as their severity increases. The acute phase progresses rapidly but can be fought by the pawn's immune system, whereas the chronic phase progresses very slowly but can never be cured. Treatment can modestly slow the progress of the disease.</description>
@ -10,9 +10,9 @@
<catch_chance>0.05</catch_chance>
<spawn_chance>0.005</spawn_chance>
<spawn_severity>0.80</spawn_severity>
</rjw.std_def>
</STD.std_def>
<rjw.std_def>
<STD.std_def>
<defName>Herpes</defName>
<label>herpes</label>
<description>Herpes is an incurable but nonfatal disease. Affected pawns experience pain and itchiness in the affected body parts. Treatment is effective at reducing the intensity of the symptoms.</description>
@ -23,9 +23,9 @@
<appliedOnFixedBodyParts>
<li>Genitals</li>
</appliedOnFixedBodyParts>
</rjw.std_def>
</STD.std_def>
<rjw.std_def>
<STD.std_def>
<defName>Warts</defName>
<label>warts</label>
<description>Genital warts are unsightly and cause an itching/burning sensation. They are easily treated and never fatal.</description>
@ -35,9 +35,9 @@
<appliedOnFixedBodyParts>
<li>Genitals</li>
</appliedOnFixedBodyParts>
</rjw.std_def>
</STD.std_def>
<rjw.std_def>
<STD.std_def>
<defName>Syphilis</defName>
<label>syphilis</label>
<description>Syphilis is a serious disease that affects the mind. If left untreated, it leads to corrupted thoughts, mood problems, potential permanent damage to the brain, liver, and kidneys, and, ultimately, death. The good news is that it is easily defeated by proper treatment.</description>
@ -45,9 +45,9 @@
<catch_chance>0.08</catch_chance>
<environment_pitch_chance>0.03</environment_pitch_chance>
<autocure_below_severity>0.01</autocure_below_severity>
</rjw.std_def>
</STD.std_def>
<rjw.std_def>
<STD.std_def>
<defName>Boobitis</defName>
<label>boobitis</label>
<description>Boobitis is a highly contagious mechanite plague that causes permanent breast growth if left untreated. It was initialy created as a harmless glittertech "party drug" but has since mutated and spread to virtually every human colony.</description>
@ -59,5 +59,5 @@
<appliedOnFixedBodyParts>
<li>Chest</li>
</appliedOnFixedBodyParts>
</rjw.std_def>
</STD.std_def>
</Defs>

View File

@ -3,7 +3,7 @@
<Defs>
<ThoughtDef>
<defName>ItchyCrotch</defName>
<workerClass>rjw_std.ThoughtWorker_ItchyCrotch</workerClass>
<workerClass>STD.ThoughtWorker_ItchyCrotch</workerClass>
<stages>
<li>
<label>itchy crotch</label>
@ -20,7 +20,7 @@
<ThoughtDef>
<defName>SyphiliticThoughts</defName>
<workerClass>rjw_std.ThoughtWorker_SyphiliticThoughts</workerClass>
<workerClass>STD.ThoughtWorker_SyphiliticThoughts</workerClass>
<stages>
<li>
<label>syphilitic thoughts</label>
@ -37,7 +37,7 @@
<ThoughtDef>
<defName>WastingAway</defName>
<workerClass>rjw_std.ThoughtWorker_WastingAway</workerClass>
<workerClass>STD.ThoughtWorker_WastingAway</workerClass>
<stages>
<li>
<label>wasting away</label>

View File

@ -60,19 +60,23 @@
<ItemGroup>
<Compile Include="..\Properties\AssemblyInfo.cs" />
<Compile Include="harmony_add_stds.cs" />
<Compile Include="STDs\std_Rash.cs" />
<Compile Include="Hediffs\Hediff_ID.cs" />
<Compile Include="STDs\Boobitis\harmony_Boobitis.cs" />
<Compile Include="STDs\HIV\harmony_Immunodeficiency.cs" />
<Compile Include="STDs\Rash\harmony_Rash.cs" />
<Compile Include="STDs\Rash\std_Rash.cs" />
<Compile Include="STDs\HIV\Hediff_ID.cs" />
<Compile Include="std.cs" />
<Compile Include="STDBase.cs" />
<Compile Include="STDs\std_Boobitis.cs" />
<Compile Include="STDs\Boobitis\std_Boobitis.cs" />
<Compile Include="STDs\Syphilis\harmony_Syphilis.cs" />
<Compile Include="std_def.cs" />
<Compile Include="STDs\std_Immunodeficiency.cs" />
<Compile Include="STDs\HIV\std_Immunodeficiency.cs" />
<Compile Include="std_spreader.cs" />
<Compile Include="STDs\std_Syphilis.cs" />
<Compile Include="STDs\Syphilis\std_Syphilis.cs" />
<Compile Include="std_updater.cs" />
<Compile Include="Thoughts\ThoughtWorker_ItchyCrotch.cs" />
<Compile Include="Thoughts\ThoughtWorker_SyphiliticThoughts.cs" />
<Compile Include="Thoughts\ThoughtWorker_WastingAway.cs" />
<Compile Include="STDs\Rash\ThoughtWorker_ItchyCrotch.cs" />
<Compile Include="STDs\Syphilis\ThoughtWorker_SyphiliticThoughts.cs" />
<Compile Include="STDs\HIV\ThoughtWorker_WastingAway.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />

View File

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

View File

@ -5,56 +5,12 @@ using rjw;
namespace STD
{
///<summary>
///boobitis increase sex need
///</summary>
[HarmonyPatch(typeof(Need_Sex), "diseasefactor")]
[StaticConstructorOnStartup]
static class SexNeed_diseasefactorSTD_Boobitis
{
[HarmonyPostfix]
private static void diseasefactor_StdPatch(Pawn pawn, ref float __result)
{
try
{
if (pawn.health.hediffSet.HasHediff(std.boobitis.hediff_def))
{
__result *= 3f;
}
}
catch (Exception e)
{
Log.Error(e.ToString());
}
}
}
/// <summary>
/// this is probably outdated, but keep it for now atleast
/// </summary>
[HarmonyPatch(typeof(std_updater), "update")]
[StaticConstructorOnStartup]
static class std_updater_Boobitis
{
[HarmonyPostfix]
private static void updateSTD(Pawn p)
{
try
{
//std_Boobitis.update(p);
}
catch (Exception e)
{
Log.Error(e.ToString());
}
}
}
public static class std_Boobitis
{
public static std_def boobitis = DefDatabase<std_def>.GetNamed("Boobitis");
public static void update(Pawn pawn)
{
if (pawn.health.hediffSet.HasHediff(std.boobitis.hediff_def))
if (pawn.health.hediffSet.HasHediff(boobitis.hediff_def))
UpdateBoobitis(pawn);
}

View File

@ -11,7 +11,7 @@ namespace STD
{
get
{
if (!(pawn.health.hediffSet.HasHediff(std.ahiv.hediff_def) || pawn.health.hediffSet.HasHediff(std.chiv.hediff_def)))
if (!(pawn.health.hediffSet.HasHediff(std_Immunodeficiency.hiv.hediff_def)))
return base.LabelBase;
else
return "AIDS";

View File

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

View File

@ -9,26 +9,9 @@ namespace STD
/// <summary>
/// add some infections
/// </summary>
[HarmonyPatch(typeof(std_updater), "update")]
[StaticConstructorOnStartup]
static class std_updater_Immunodeficiency
{
[HarmonyPostfix]
private static void updateSTD(Pawn p)
{
try
{
std_Immunodeficiency.update(p);
}
catch (Exception e)
{
Log.Error(e.ToString());
}
}
}
public static class std_Immunodeficiency
{
public static std_def hiv = DefDatabase<std_def>.GetNamed("HIV");
//vanilla rimworld
public static readonly HediffDef immunodeficiency = DefDatabase<HediffDef>.GetNamed("Immunodeficiency");
public static bool is_wasting_away(Pawn p)

View File

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

View File

@ -6,49 +6,38 @@ using RimWorld;
namespace STD
{
///<summary>
///add aftersex thoughts about herpes, warts
///</summary>
[HarmonyPatch(typeof(AfterSexUtility), "ThinkAboutDiseases")]
[StaticConstructorOnStartup]
static class Aftersex_STDThoughtApply
{
[HarmonyPrefix]
private static void ThinkAboutDiseasesStdPatch(Pawn pawn, Pawn partner)
{
try
{
std_Rash.ThinkAboutDiseases(pawn, partner);
}
catch (Exception e)
{
Log.Error(e.ToString());
}
}
}
public static class std_Rash
{
public static std_def herpes = DefDatabase<std_def>.GetNamed("Herpes");
public static std_def warts = DefDatabase<std_def>.GetNamed("Warts");
public static readonly ThoughtDef saw_rash_1 = DefDatabase<ThoughtDef>.GetNamed("SawDiseasedPrivates1");
public static readonly ThoughtDef saw_rash_2 = DefDatabase<ThoughtDef>.GetNamed("SawDiseasedPrivates2");
public static readonly ThoughtDef saw_rash_3 = DefDatabase<ThoughtDef>.GetNamed("SawDiseasedPrivates3");
// Returns how severely affected this pawn's crotch is by rashes and warts, on a scale from 0 to 3.
/// <summary>
/// Returns how severely affected this pawn's crotch is by rashes and warts, on a scale from 0 to 3.
/// </summary>
/// <param name="p"></param>
/// <returns></returns>
public static int genital_rash_severity(Pawn p)
{
int tr = 0;
Hediff her = p.health.hediffSet.GetFirstHediffOfDef(std.herpes.hediff_def);
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.warts.hediff_def);
Hediff war = p.health.hediffSet.GetFirstHediffOfDef(std_Rash.warts.hediff_def);
if (war != null)
tr += war.Severity < 0.40f ? 1 : 2;
return tr;
}
///<summary>
///add aftersex thoughts about herpes, warts
///</summary>
public static void ThinkAboutDiseases(Pawn pawn, Pawn partner)
{
if (pawn == null)

View File

@ -7,7 +7,7 @@ namespace STD
{
protected override ThoughtState CurrentStateInternal(Pawn p)
{
var syp = p.health.hediffSet.GetFirstHediffOfDef(std.syphilis.hediff_def);
var syp = p.health.hediffSet.GetFirstHediffOfDef(std_Syphilis.syphilis.hediff_def);
if (syp != null)
{
if (syp.Severity >= 0.80f)

View File

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

View File

@ -9,36 +9,19 @@ namespace STD
/// <summary>
/// do damage to pawn health
/// </summary>
[HarmonyPatch(typeof(std_updater), "update")]
[StaticConstructorOnStartup]
static class std_updater_Syphilis
{
[HarmonyPostfix]
private static void updateSTD(Pawn p)
{
try
{
std_Syphilis.update(p);
}
catch (Exception e)
{
Log.Error(e.ToString());
}
}
}
public static class std_Syphilis
{
public static std_def syphilis = DefDatabase<std_def>.GetNamed("Syphilis");
public static void update(Pawn pawn)
{
if (pawn.health.hediffSet.HasHediff(std.syphilis.hediff_def))
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(std.syphilis.hediff_def);
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
@ -89,9 +72,9 @@ namespace STD
inj.Severity = sev;
inj.TryGetComp<HediffComp_GetsPermanent>().IsPermanent = true;
p.health.AddHediff(inj, part, null);
string message_title = std.syphilis.label + " Damage";
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, std.syphilis.label).CapitalizeFirst();
string message_text = "RJW_Syphilis_Damage_Message".Translate(xxx.get_pawnname(p), baby_pronoun, part.def.label, syphilis.label).CapitalizeFirst();
Find.LetterStack.ReceiveLetter(message_title, message_text, LetterDefOf.ThreatSmall, p);
}
}

View File

@ -10,14 +10,7 @@ namespace STD
/// </summary>
public static class std
{
//STDs
public static std_def ahiv = DefDatabase<std_def>.GetNamed("AcuteHIV");
public static std_def chiv = DefDatabase<std_def>.GetNamed("ChronicHIV");
public static std_def herpes = DefDatabase<std_def>.GetNamed("Herpes");
public static std_def warts = DefDatabase<std_def>.GetNamed("Warts");
public static std_def syphilis = DefDatabase<std_def>.GetNamed("Syphilis");
public static std_def boobitis = DefDatabase<std_def>.GetNamed("Boobitis");
//all STDs
public static List<std_def> all => DefDatabase<std_def>.AllDefsListForReading;
public static Hediff get_infection(Pawn p, std_def sd)