diff --git a/1.3/Assemblies/STD.dll b/1.3/Assemblies/STD.dll index 269d622..9086e63 100644 Binary files a/1.3/Assemblies/STD.dll and b/1.3/Assemblies/STD.dll differ diff --git a/1.3/Defs/DamageDefs/Damage_Viral.xml b/1.3/Defs/DamageDefs/HIV_Damage_Viral.xml similarity index 100% rename from 1.3/Defs/DamageDefs/Damage_Viral.xml rename to 1.3/Defs/DamageDefs/HIV_Damage_Viral.xml diff --git a/1.3/Defs/HediffsDef/Boobitis.xml b/1.3/Defs/HediffsDef/Boobitis.xml index c4058f2..23178e3 100644 --- a/1.3/Defs/HediffsDef/Boobitis.xml +++ b/1.3/Defs/HediffsDef/Boobitis.xml @@ -10,7 +10,6 @@ 0.1 - 0.1 0.1 @@ -19,7 +18,6 @@ 0.2 - 0.2 0.3 @@ -28,7 +26,6 @@ 0.3 - 0.3 0.5 diff --git a/1.3/Defs/HediffsDef/Immunodeficiency.xml b/1.3/Defs/HediffsDef/Immunodeficiency.xml new file mode 100644 index 0000000..8c07c5e --- /dev/null +++ b/1.3/Defs/HediffsDef/Immunodeficiency.xml @@ -0,0 +1,67 @@ + + + + + + Immunodeficiency + std.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.3/Defs/HediffsDef/VirusPerma.xml b/1.3/Defs/HediffsDef/VirusPerma.xml new file mode 100644 index 0000000..68eb6a0 --- /dev/null +++ b/1.3/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.3/Defs/IncidentDef/Incidents_STD.xml b/1.3/Defs/IncidentDef/Boobitis.xml similarity index 100% rename from 1.3/Defs/IncidentDef/Incidents_STD.xml rename to 1.3/Defs/IncidentDef/Boobitis.xml diff --git a/1.3/Defs/STDDefs/Boobitis.xml b/1.3/Defs/STDDefs/Boobitis.xml new file mode 100644 index 0000000..43ec6b1 --- /dev/null +++ b/1.3/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.3/Defs/STDDefs/HIV.xml b/1.3/Defs/STDDefs/HIV.xml new file mode 100644 index 0000000..58e7fb5 --- /dev/null +++ b/1.3/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.3/Defs/STDDefs/Herpes.xml b/1.3/Defs/STDDefs/Herpes.xml new file mode 100644 index 0000000..9b920f9 --- /dev/null +++ b/1.3/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.3/Defs/STDDefs/STDs.xml b/1.3/Defs/STDDefs/STDs.xml deleted file mode 100644 index 4c83d2e..0000000 --- a/1.3/Defs/STDDefs/STDs.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - 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/STDDefs/Syphilis.xml b/1.3/Defs/STDDefs/Syphilis.xml new file mode 100644 index 0000000..eb20f65 --- /dev/null +++ b/1.3/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.3/Defs/STDDefs/Warts.xml b/1.3/Defs/STDDefs/Warts.xml new file mode 100644 index 0000000..f072337 --- /dev/null +++ b/1.3/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.3/Defs/ThoughtDefs/HIV.xml b/1.3/Defs/ThoughtDefs/HIV.xml new file mode 100644 index 0000000..7a72fda --- /dev/null +++ b/1.3/Defs/ThoughtDefs/HIV.xml @@ -0,0 +1,15 @@ + + + + + WastingAway + STD.ThoughtWorker_WastingAway + +
  • + + Every day I feel weaker than the day before. I can feel my life slowly slipping away. + -5 +
  • +
    +
    +
    diff --git a/1.3/Defs/ThoughtDefs/Thoughts_STD.xml b/1.3/Defs/ThoughtDefs/Rash.xml similarity index 62% rename from 1.3/Defs/ThoughtDefs/Thoughts_STD.xml rename to 1.3/Defs/ThoughtDefs/Rash.xml index 709b7d9..46267d3 100644 --- a/1.3/Defs/ThoughtDefs/Thoughts_STD.xml +++ b/1.3/Defs/ThoughtDefs/Rash.xml @@ -1,7 +1,7 @@ - + ItchyCrotch STD.ThoughtWorker_ItchyCrotch @@ -18,35 +18,6 @@ - - SyphiliticThoughts - 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 - STD.ThoughtWorker_WastingAway - -
  • - - Every day I feel weaker than the day before. I can feel my life slowly slipping away. - -5 -
  • -
    -
    - SawDiseasedPrivates1 Thought_MemorySocial diff --git a/1.3/Defs/ThoughtDefs/Syphilis.xml b/1.3/Defs/ThoughtDefs/Syphilis.xml new file mode 100644 index 0000000..f405fc4 --- /dev/null +++ b/1.3/Defs/ThoughtDefs/Syphilis.xml @@ -0,0 +1,20 @@ + + + + + SyphiliticThoughts + 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 +
  • +
    +
    +
    diff --git a/1.3/Languages/English/Keyed/STD.xml b/1.3/Languages/English/Keyed/STD.xml index 8e1686e..26ccf7c 100644 --- a/1.3/Languages/English/Keyed/STD.xml +++ b/1.3/Languages/English/Keyed/STD.xml @@ -1,13 +1,39 @@ - Enable STDs - Enables sexually transmitted diseases. + STDs from sex + Pawns will catch STDs from sex with infected pawn. STDs from environment - Pawns will catch STDs from dirty 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 advanced {3} infection. + {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.3/Source/STD/STD.csproj b/1.3/Source/Mod/STD.csproj similarity index 97% rename from 1.3/Source/STD/STD.csproj rename to 1.3/Source/Mod/STD.csproj index 092443f..26ff271 100644 --- a/1.3/Source/STD/STD.csproj +++ b/1.3/Source/Mod/STD.csproj @@ -60,6 +60,8 @@ + + diff --git a/1.3/Source/Mod/STDBase.cs b/1.3/Source/Mod/STDBase.cs new file mode 100644 index 0000000..c7174b4 --- /dev/null +++ b/1.3/Source/Mod/STDBase.cs @@ -0,0 +1,46 @@ +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 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.3/Source/STD/STDs/Boobitis/harmony_Boobitis.cs b/1.3/Source/Mod/STDs/Boobitis/harmony_Boobitis.cs similarity index 97% rename from 1.3/Source/STD/STDs/Boobitis/harmony_Boobitis.cs rename to 1.3/Source/Mod/STDs/Boobitis/harmony_Boobitis.cs index e829822..27b0b80 100644 --- a/1.3/Source/STD/STDs/Boobitis/harmony_Boobitis.cs +++ b/1.3/Source/Mod/STDs/Boobitis/harmony_Boobitis.cs @@ -42,7 +42,7 @@ namespace STD { try { - //std_Boobitis.update(p); + std_Boobitis.update(p); } catch (Exception e) { diff --git a/1.3/Source/Mod/STDs/Boobitis/std_Boobitis.cs b/1.3/Source/Mod/STDs/Boobitis/std_Boobitis.cs new file mode 100644 index 0000000..0b8751d --- /dev/null +++ b/1.3/Source/Mod/STDs/Boobitis/std_Boobitis.cs @@ -0,0 +1,60 @@ +using Verse; +using HarmonyLib; +using System; +using rjw; +using RimWorld; + +namespace STD +{ + 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.3/Source/STD/STDs/HIV/Hediff_ID.cs b/1.3/Source/Mod/STDs/HIV/Hediff_ID.cs similarity index 100% rename from 1.3/Source/STD/STDs/HIV/Hediff_ID.cs rename to 1.3/Source/Mod/STDs/HIV/Hediff_ID.cs diff --git a/1.3/Source/STD/STDs/HIV/ThoughtWorker_WastingAway.cs b/1.3/Source/Mod/STDs/HIV/ThoughtWorker_WastingAway.cs similarity index 100% rename from 1.3/Source/STD/STDs/HIV/ThoughtWorker_WastingAway.cs rename to 1.3/Source/Mod/STDs/HIV/ThoughtWorker_WastingAway.cs diff --git a/1.3/Source/STD/STDs/HIV/harmony_Immunodeficiency.cs b/1.3/Source/Mod/STDs/HIV/harmony_Immunodeficiency.cs similarity index 100% rename from 1.3/Source/STD/STDs/HIV/harmony_Immunodeficiency.cs rename to 1.3/Source/Mod/STDs/HIV/harmony_Immunodeficiency.cs diff --git a/1.3/Source/STD/STDs/HIV/std_Immunodeficiency.cs b/1.3/Source/Mod/STDs/HIV/std_Immunodeficiency.cs similarity index 98% rename from 1.3/Source/STD/STDs/HIV/std_Immunodeficiency.cs rename to 1.3/Source/Mod/STDs/HIV/std_Immunodeficiency.cs index dfca7ff..0aa571f 100644 --- a/1.3/Source/STD/STDs/HIV/std_Immunodeficiency.cs +++ b/1.3/Source/Mod/STDs/HIV/std_Immunodeficiency.cs @@ -93,7 +93,7 @@ namespace STD 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; + 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.3/Source/STD/STDs/Rash/ThoughtWorker_ItchyCrotch.cs b/1.3/Source/Mod/STDs/Rash/ThoughtWorker_ItchyCrotch.cs similarity index 100% rename from 1.3/Source/STD/STDs/Rash/ThoughtWorker_ItchyCrotch.cs rename to 1.3/Source/Mod/STDs/Rash/ThoughtWorker_ItchyCrotch.cs diff --git a/1.3/Source/STD/STDs/Rash/harmony_Rash.cs b/1.3/Source/Mod/STDs/Rash/harmony_Rash.cs similarity index 96% rename from 1.3/Source/STD/STDs/Rash/harmony_Rash.cs rename to 1.3/Source/Mod/STDs/Rash/harmony_Rash.cs index 43575ef..01ef13f 100644 --- a/1.3/Source/STD/STDs/Rash/harmony_Rash.cs +++ b/1.3/Source/Mod/STDs/Rash/harmony_Rash.cs @@ -10,7 +10,7 @@ namespace STD [StaticConstructorOnStartup] static class Aftersex_STDThoughtApply { - [HarmonyPrefix] + [HarmonyPostfix] private static void ThinkAboutDiseasesStdPatch(Pawn pawn, Pawn partner, bool isReceiving, SexProps props, bool whoring = false) { try diff --git a/1.3/Source/STD/STDs/Rash/std_Rash.cs b/1.3/Source/Mod/STDs/Rash/std_Rash.cs similarity index 100% rename from 1.3/Source/STD/STDs/Rash/std_Rash.cs rename to 1.3/Source/Mod/STDs/Rash/std_Rash.cs diff --git a/1.3/Source/STD/STDs/Syphilis/ThoughtWorker_SyphiliticThoughts.cs b/1.3/Source/Mod/STDs/Syphilis/ThoughtWorker_SyphiliticThoughts.cs similarity index 100% rename from 1.3/Source/STD/STDs/Syphilis/ThoughtWorker_SyphiliticThoughts.cs rename to 1.3/Source/Mod/STDs/Syphilis/ThoughtWorker_SyphiliticThoughts.cs diff --git a/1.3/Source/STD/STDs/Syphilis/harmony_Syphilis.cs b/1.3/Source/Mod/STDs/Syphilis/harmony_Syphilis.cs similarity index 100% rename from 1.3/Source/STD/STDs/Syphilis/harmony_Syphilis.cs rename to 1.3/Source/Mod/STDs/Syphilis/harmony_Syphilis.cs diff --git a/1.3/Source/STD/STDs/Syphilis/std_Syphilis.cs b/1.3/Source/Mod/STDs/Syphilis/std_Syphilis.cs similarity index 100% rename from 1.3/Source/STD/STDs/Syphilis/std_Syphilis.cs rename to 1.3/Source/Mod/STDs/Syphilis/std_Syphilis.cs diff --git a/1.3/Source/STD/harmony_add_stds.cs b/1.3/Source/Mod/harmony_add_stds.cs similarity index 97% rename from 1.3/Source/STD/harmony_add_stds.cs rename to 1.3/Source/Mod/harmony_add_stds.cs index 82b8b13..b51d996 100644 --- a/1.3/Source/STD/harmony_add_stds.cs +++ b/1.3/Source/Mod/harmony_add_stds.cs @@ -12,7 +12,7 @@ namespace STD [StaticConstructorOnStartup] static class Aftersex_STD_Apply { - [HarmonyPrefix] + [HarmonyPostfix] private static void Aftersex_STD_Patch(SexProps props) { try diff --git a/1.3/Source/Mod/harmony_stds_generator.cs b/1.3/Source/Mod/harmony_stds_generator.cs new file mode 100644 index 0000000..601db33 --- /dev/null +++ b/1.3/Source/Mod/harmony_stds_generator.cs @@ -0,0 +1,31 @@ +using Verse; +using HarmonyLib; +using rjw; +using System; +using System.Reflection; + +namespace STD +{ + /// + ///roll for STD update every 10 sex need ticks + /// + [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.Newborn) + if (__result != null) + std_spreader.generate_on(__result); + } + catch (Exception e) + { + Log.Error(e.ToString()); + } + } + } +} diff --git a/1.3/Source/Mod/harmony_update_stds.cs b/1.3/Source/Mod/harmony_update_stds.cs new file mode 100644 index 0000000..9dfa62b --- /dev/null +++ b/1.3/Source/Mod/harmony_update_stds.cs @@ -0,0 +1,35 @@ +using Verse; +using HarmonyLib; +using rjw; +using System; +using System.Reflection; + +namespace STD +{ + /// + ///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.3/Source/STD/packages.config b/1.3/Source/Mod/packages.config similarity index 100% rename from 1.3/Source/STD/packages.config rename to 1.3/Source/Mod/packages.config diff --git a/1.3/Source/STD/std.cs b/1.3/Source/Mod/std.cs similarity index 100% rename from 1.3/Source/STD/std.cs rename to 1.3/Source/Mod/std.cs diff --git a/1.3/Source/STD/std_def.cs b/1.3/Source/Mod/std_def.cs similarity index 100% rename from 1.3/Source/STD/std_def.cs rename to 1.3/Source/Mod/std_def.cs diff --git a/1.3/Source/STD/std_spreader.cs b/1.3/Source/Mod/std_spreader.cs similarity index 80% rename from 1.3/Source/STD/std_spreader.cs rename to 1.3/Source/Mod/std_spreader.cs index 92dd8b9..398ea20 100644 --- a/1.3/Source/STD/std_spreader.cs +++ b/1.3/Source/Mod/std_spreader.cs @@ -80,47 +80,47 @@ namespace STD 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 (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; float pitch_chance; + string pitch_source = "sex"; + float pitch_chance = -9001f; { - if (get_severity(pitcher, sd) >= xxx.config.std_min_severity_to_pitch) - { - pitch_source = xxx.get_pawnname(pitcher); - pitch_chance = 1.0f; + 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; + } } - else + if (STDBase.std_floor && pitch_chance != 1.0f) { 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 (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 (xxx.config.std_show_roll_to_catch) - //--Log.Message(" INFECTED!"); + if (STDBase.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 (STDBase.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); + else + if (STDBase.std_show_roll_to_catch) + Log.Message(" Already infected with " + sd.label); } } @@ -182,22 +182,22 @@ namespace STD 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; + 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); } - // 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 (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; + 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) diff --git a/1.3/Source/STD/std_updater.cs b/1.3/Source/Mod/std_updater.cs similarity index 100% rename from 1.3/Source/STD/std_updater.cs rename to 1.3/Source/Mod/std_updater.cs diff --git a/1.3/Source/STD/STDBase.cs b/1.3/Source/STD/STDBase.cs deleted file mode 100644 index 43904c3..0000000 --- a/1.3/Source/STD/STDBase.cs +++ /dev/null @@ -1,27 +0,0 @@ -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/Boobitis/std_Boobitis.cs b/1.3/Source/STD/STDs/Boobitis/std_Boobitis.cs deleted file mode 100644 index ac76046..0000000 --- a/1.3/Source/STD/STDs/Boobitis/std_Boobitis.cs +++ /dev/null @@ -1,65 +0,0 @@ -using Verse; -using HarmonyLib; -using System; -using rjw; - -namespace STD -{ - 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 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.sln b/1.3/Source/mod.sln similarity index 93% rename from 1.3/Source/STD.sln rename to 1.3/Source/mod.sln index 2356b0d..ddd59bc 100644 --- a/1.3/Source/STD.sln +++ b/1.3/Source/mod.sln @@ -3,7 +3,7 @@ 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}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "STD", "Mod\STD.csproj", "{3FC2D442-19B8-4CF9-9D35-CD13B6AC7B28}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/README.md b/README.md index 1bf6ab0..364adcd 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,10 @@ LoversLab: Requirements: Harmony Hugslib -Rimjobworld (https://gitgud.io/Ed86/rjw) +Rimjobworld 5.0+ (https://gitgud.io/Ed86/rjw) + +Additional features to RimJobWorld (STDs): -Additional features to RimJobWorld: -(STDs): - HIVs - Immunodeficiency - Syphilis