From bef15bd4fc0490390aabfc0b198ac21d5ea55efa Mon Sep 17 00:00:00 2001 From: Vegapnk Date: Thu, 9 Feb 2023 08:37:28 +0100 Subject: [PATCH] Added Generous Donor Cheatmode - default off --- .../Patch_SatisfyPersonal_LifeForceGain.cs | 47 ++++++++++++------- Source/Settings/RJW_Genes_Settings.cs | 8 ++++ 2 files changed, 39 insertions(+), 16 deletions(-) diff --git a/Source/Genes/Life_Force/Patches/Patch_SatisfyPersonal_LifeForceGain.cs b/Source/Genes/Life_Force/Patches/Patch_SatisfyPersonal_LifeForceGain.cs index b368c1b..74cb0bb 100644 --- a/Source/Genes/Life_Force/Patches/Patch_SatisfyPersonal_LifeForceGain.cs +++ b/Source/Genes/Life_Force/Patches/Patch_SatisfyPersonal_LifeForceGain.cs @@ -73,10 +73,19 @@ namespace RJW_Genes && !props.pawn.health.hediffSet.HasHediff(HediffDefOf.rjw_genes_succubus_drained) && !GeneUtility.IsSexualDrainer(props.pawn)) { - if (RJW_Genes_Settings.rjw_genes_detailed_debug) - ModLog.Message($"{props.pawn.Name} has been (sexually) drained by {PawnWithLifeForce.Name}"); - props.pawn.health.AddHediff(HediffDefOf.rjw_genes_succubus_drained); - GeneUtility.OffsetLifeForce(GeneUtility.GetLifeForceGene(PawnWithLifeForce), LIFEFORCE_GAINED_FROM_DRAINER_GENE); + if (GeneUtility.IsGenerousDonor(props.pawn) && RJW_Genes_Settings.rjw_genes_generous_donor_cheatmode) + { + // Cheatmode is on, do not drain but give life + GeneUtility.OffsetLifeForce(GeneUtility.GetLifeForceGene(PawnWithLifeForce), LIFEFORCE_GAINED_FROM_DRAINER_GENE); + if (RJW_Genes_Settings.rjw_genes_detailed_debug) + ModLog.Message($"{props.pawn.Name} was not (sexually) drained by {PawnWithLifeForce.Name}, because Cheatmode for Generous Donors is on"); + } else + { + if (RJW_Genes_Settings.rjw_genes_detailed_debug) + ModLog.Message($"{props.pawn.Name} has been (sexually) drained by {PawnWithLifeForce.Name}"); + props.pawn.health.AddHediff(HediffDefOf.rjw_genes_succubus_drained); + GeneUtility.OffsetLifeForce(GeneUtility.GetLifeForceGene(PawnWithLifeForce), LIFEFORCE_GAINED_FROM_DRAINER_GENE); + } } } } @@ -88,20 +97,26 @@ namespace RJW_Genes Hediff fertilin_lost = props.pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.rjw_genes_fertilin_lost); //Around quarter get ejected everytime pawn cums - float multiplier = Rand.Range(0.10f, 0.40f); - + float multiplier = Rand.Range(0.10f, 0.40f); - //Create a new ferilin_lost hediff or increase it - if (fertilin_lost == null) + if (GeneUtility.IsGenerousDonor(props.pawn) && RJW_Genes_Settings.rjw_genes_generous_donor_cheatmode) { - Hediff new_fertilin_lost = HediffMaker.MakeHediff(HediffDefOf.rjw_genes_fertilin_lost, props.pawn); - props.pawn.health.AddHediff(new_fertilin_lost); - new_fertilin_lost.Severity = multiplier; - } - else - { - multiplier *= 1 - fertilin_lost.Severity; - fertilin_lost.Severity += multiplier; + // Do nothing, Cheatmode is on + multiplier = 1; + } + else + { + //Create a new ferilin_lost hediff or increase it + if (fertilin_lost == null) + { + Hediff new_fertilin_lost = HediffMaker.MakeHediff(HediffDefOf.rjw_genes_fertilin_lost, props.pawn); + props.pawn.health.AddHediff(new_fertilin_lost); + new_fertilin_lost.Severity = multiplier; + } else + { + multiplier *= 1 - fertilin_lost.Severity; + fertilin_lost.Severity += multiplier; + } } multiplier *= absorb_percentage; diff --git a/Source/Settings/RJW_Genes_Settings.cs b/Source/Settings/RJW_Genes_Settings.cs index 0db1b15..71cf028 100644 --- a/Source/Settings/RJW_Genes_Settings.cs +++ b/Source/Settings/RJW_Genes_Settings.cs @@ -36,6 +36,9 @@ namespace RJW_Genes } + listing_Standard.Gap(5f); + listing_Standard.CheckboxLabeled("generous-donor cheatmode", ref rjw_genes_generous_donor_cheatmode, "When enabled, pawns with the 'generous donor' are not drained and not fertilin exhausted. Hence they can fuel succubi and incubi non-stop. This makes them drastically easier to keep, and you should not do it.", 0f, 1f); + listing_Standard.Gap(5f); listing_Standard.CheckboxLabeled("detailed-debug", ref rjw_genes_detailed_debug, "Adds detailed information to the log about interactions and genes.", 0f, 1f); listing_Standard.End(); @@ -46,11 +49,14 @@ namespace RJW_Genes base.ExposeData(); Scribe_Values.Look(ref RJW_Genes_Settings.rjw_genes_fertilin_from_animals_factor, "rjw_genes_fertilin_from_animals_factor", RJW_Genes_Settings.rjw_genes_fertilin_from_animals_factor, true); Scribe_Values.Look(ref RJW_Genes_Settings.rjw_genes_detailed_debug, "rjw_genes_detailed_debug", RJW_Genes_Settings.rjw_genes_detailed_debug, true); + Scribe_Values.Look(ref RJW_Genes_Settings.rjw_genes_sexdemon_visit, "rjw_genes_sexdemon_visit", RJW_Genes_Settings.rjw_genes_sexdemon_visit, true); Scribe_Values.Look(ref RJW_Genes_Settings.rjw_genes_sexdemon_join_size_matters, "rjw_genes_sexdemon_join_size_matters", RJW_Genes_Settings.rjw_genes_sexdemon_join_size_matters, true); Scribe_Values.Look(ref RJW_Genes_Settings.rjw_genes_sexdemon_visit_groups, "rjw_genes_sexdemon_groups", RJW_Genes_Settings.rjw_genes_sexdemon_visit_groups, true); Scribe_Values.Look(ref RJW_Genes_Settings.rjw_genes_sexdemon_visit_succubi, "rjw_genes_sexdemon_succubi", RJW_Genes_Settings.rjw_genes_sexdemon_visit_succubi, true); Scribe_Values.Look(ref RJW_Genes_Settings.rjw_genes_sexdemon_visit_incubi, "rjw_genes_sexdemon_incubi", RJW_Genes_Settings.rjw_genes_sexdemon_visit_incubi, true); + + Scribe_Values.Look(ref RJW_Genes_Settings.rjw_genes_generous_donor_cheatmode, "rjw_genes_generous_donor_cheatmode", RJW_Genes_Settings.rjw_genes_generous_donor_cheatmode, true); } public static bool rjw_genes_detailed_debug = false; @@ -62,5 +68,7 @@ namespace RJW_Genes public static bool rjw_genes_sexdemon_visit_groups = true; public static bool rjw_genes_sexdemon_visit_succubi = true; public static bool rjw_genes_sexdemon_visit_incubi = true; + + public static bool rjw_genes_generous_donor_cheatmode = false; } }