From d5580ba92a7ce2adb9db06e0a2d8806eab4d5c89 Mon Sep 17 00:00:00 2001 From: Vegapnk Date: Sun, 16 Jul 2023 10:59:06 +0200 Subject: [PATCH] Added a new gene that increases penis size on oral sex --- CHANGELOG.md | 1 + Common/Defs/GeneDefs/GeneDefs_SexSpecial.xml | 20 +++++ Source/GeneDefOf.cs | 3 + .../{ => Defs}/AgeTransferExtension.cs | 0 .../Special/Defs/HormonalSalivaExtension.cs | 28 +++++++ .../Gene_Aphrodisiac_Pheromones.cs | 0 .../Special/{ => Patches}/Patch_AgeDrain.cs | 0 .../Special/Patches/Patch_HormonalSaliva.cs | 76 +++++++++++++++++++ .../{ => Patches}/Patch_OrgasmMytosis.cs | 0 .../Special/{ => Patches}/Patch_OrgasmRush.cs | 0 .../{ => Patches}/Patch_Youth_Fountain.cs | 0 Source/Rjw-Genes.csproj | 14 ++-- 12 files changed, 136 insertions(+), 6 deletions(-) rename Source/Genes/Special/{ => Defs}/AgeTransferExtension.cs (100%) create mode 100644 Source/Genes/Special/Defs/HormonalSalivaExtension.cs rename Source/Genes/Special/{ => Genes}/Gene_Aphrodisiac_Pheromones.cs (100%) rename Source/Genes/Special/{ => Patches}/Patch_AgeDrain.cs (100%) create mode 100644 Source/Genes/Special/Patches/Patch_HormonalSaliva.cs rename Source/Genes/Special/{ => Patches}/Patch_OrgasmMytosis.cs (100%) rename Source/Genes/Special/{ => Patches}/Patch_OrgasmRush.cs (100%) rename Source/Genes/Special/{ => Patches}/Patch_Youth_Fountain.cs (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5dec301..b380881 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - New Gene for Genderfluid Pawns - daily chance to change sex. Futas just change "display" and keep genitalia, other pawns switch genitalia. XML configurable times & chances. - New Drawings for the Succubi Wings & Tail, thanks to @Monti (donated via Discord) - Simple Gene that removes Sex need (called asexual, `rjw_genes_no_sex_need`) +- New Gene that grows Penisses on Oral sex. Configurable in XML. **Fixes:** diff --git a/Common/Defs/GeneDefs/GeneDefs_SexSpecial.xml b/Common/Defs/GeneDefs/GeneDefs_SexSpecial.xml index af6c34f..b98bdce 100644 --- a/Common/Defs/GeneDefs/GeneDefs_SexSpecial.xml +++ b/Common/Defs/GeneDefs/GeneDefs_SexSpecial.xml @@ -78,4 +78,24 @@ -5 + + rjw_genes_hormonal_saliva + + The saliva of this xenotype stimulates growth in penises. Regular contact will lead to noticable growth. + 2 + -1 + Genes/Icons/Big_Male_Genitalia + 6 + + +
  • + + 0.02 + 2.5 + + 1.05 +
  • +
    +
    + \ No newline at end of file diff --git a/Source/GeneDefOf.cs b/Source/GeneDefOf.cs index 559c828..c58beab 100644 --- a/Source/GeneDefOf.cs +++ b/Source/GeneDefOf.cs @@ -43,6 +43,7 @@ namespace RJW_Genes public static readonly GeneDef rjw_genes_small_breasts; public static readonly GeneDef rjw_genes_loose_anus; public static readonly GeneDef rjw_genes_tight_anus; + public static readonly GeneDef rjw_genes_evergrowth; // Gender public static readonly GeneDef rjw_genes_female_only; @@ -68,6 +69,7 @@ namespace RJW_Genes public static readonly GeneDef rjw_genes_rapist; public static readonly GeneDef rjw_genes_homosexual; public static readonly GeneDef rjw_genes_bisexual; + public static readonly GeneDef rjw_genes_no_sex_need; // Damage & Side Effects [MayRequire("LustLicentia.RJWLabs")] public static readonly GeneDef rjw_genes_elasticity; @@ -79,6 +81,7 @@ namespace RJW_Genes public static readonly GeneDef rjw_genes_sex_age_drain; public static readonly GeneDef rjw_genes_aphrodisiac_pheromones; public static readonly GeneDef rjw_genes_sexual_mytosis; + public static readonly GeneDef rjw_genes_hormonal_saliva; // LifeForce public static readonly GeneDef rjw_genes_lifeforce; diff --git a/Source/Genes/Special/AgeTransferExtension.cs b/Source/Genes/Special/Defs/AgeTransferExtension.cs similarity index 100% rename from Source/Genes/Special/AgeTransferExtension.cs rename to Source/Genes/Special/Defs/AgeTransferExtension.cs diff --git a/Source/Genes/Special/Defs/HormonalSalivaExtension.cs b/Source/Genes/Special/Defs/HormonalSalivaExtension.cs new file mode 100644 index 0000000..7c212f0 --- /dev/null +++ b/Source/Genes/Special/Defs/HormonalSalivaExtension.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; + +namespace RJW_Genes +{ + public class HormonalSalivaExtension : DefModExtension + { + /// + /// How much the genitalia will growth per interaction. + /// This is applied "flat", so if you have penis 0.5 and growthRate 0.05 it goes to 0.55, 0.60, 0.65 etc. + /// + public float sizeIncrement; + /// + /// Upper Limit for the body size - default should be 2-3 + /// + public float maxBodySize; + /// + /// How much more cum the pawn will make. + /// This is applied as multiplication, so if you have cum 20 and multiplier 1.1 you will have 22,24,27 etc. + /// This leads to exponential growth, so try to keep it kinda low. + /// + public float cumMultiplier; + } +} diff --git a/Source/Genes/Special/Gene_Aphrodisiac_Pheromones.cs b/Source/Genes/Special/Genes/Gene_Aphrodisiac_Pheromones.cs similarity index 100% rename from Source/Genes/Special/Gene_Aphrodisiac_Pheromones.cs rename to Source/Genes/Special/Genes/Gene_Aphrodisiac_Pheromones.cs diff --git a/Source/Genes/Special/Patch_AgeDrain.cs b/Source/Genes/Special/Patches/Patch_AgeDrain.cs similarity index 100% rename from Source/Genes/Special/Patch_AgeDrain.cs rename to Source/Genes/Special/Patches/Patch_AgeDrain.cs diff --git a/Source/Genes/Special/Patches/Patch_HormonalSaliva.cs b/Source/Genes/Special/Patches/Patch_HormonalSaliva.cs new file mode 100644 index 0000000..150eeec --- /dev/null +++ b/Source/Genes/Special/Patches/Patch_HormonalSaliva.cs @@ -0,0 +1,76 @@ +using HarmonyLib; +using rjw; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; + +namespace RJW_Genes +{ + [HarmonyPatch(typeof(SexUtility), "Aftersex")] + public class Patch_HormonalSaliva + { + // TODO: Reduce to 0.02 after debug. + const float SIZE_INCREMENT_FALLBACK = 0.02f; + const float MAX_BODY_SIZE_FALLBACK = 2.5f; + const float CUM_MULTIPLIER_FALLBACK = 1.05f; + + public static void Postfix(SexProps props) + { + if (props == null || props.pawn == null || props.partner == null || props.partner.IsAnimal()) + { + return; + } + + Pawn pawn = props.pawn; + Pawn partner = props.partner; + + + if (GeneUtility.HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_hormonal_saliva) && (props.sexType == xxx.rjwSextype.Oral || props.sexType == xxx.rjwSextype.Sixtynine || props.sexType == xxx.rjwSextype.Fellatio)) + { + GrowPenisses(partner); + } + + if (GeneUtility.HasGeneNullCheck(partner, GeneDefOf.rjw_genes_hormonal_saliva) && (props.sexType == xxx.rjwSextype.Oral || props.sexType == xxx.rjwSextype.Sixtynine || props.sexType == xxx.rjwSextype.Fellatio)) + { + GrowPenisses(pawn); + } + + } + + private static void GrowPenisses(Pawn pawn) + { + + HormonalSalivaExtension salivaExt = GeneDefOf.rjw_genes_hormonal_saliva.GetModExtension(); + + float size_increment = salivaExt?.sizeIncrement ?? SIZE_INCREMENT_FALLBACK; + float maximum_body_size = salivaExt?.maxBodySize ?? MAX_BODY_SIZE_FALLBACK; + float cum_multiplier = salivaExt?.cumMultiplier ?? CUM_MULTIPLIER_FALLBACK; + + + List AllPenisses = Genital_Helper.get_AllPartsHediffList(pawn).FindAll(x => Genital_Helper.is_penis(x)); + foreach (Hediff penis in AllPenisses) + { + CompHediffBodyPart CompHediff = penis.TryGetComp(); + if (penis.Severity < 1.00) + { + penis.Severity = Math.Min(1.01f, penis.Severity + size_increment); + } + else + { + if (CompHediff != null && CompHediff.SizeOwner <= maximum_body_size) + { + CompHediff.SizeOwner += size_increment; + } + } + + // Increase Fluid + if (CompHediff != null) + CompHediff.FluidAmmount *= cum_multiplier; + } + } + + } +} diff --git a/Source/Genes/Special/Patch_OrgasmMytosis.cs b/Source/Genes/Special/Patches/Patch_OrgasmMytosis.cs similarity index 100% rename from Source/Genes/Special/Patch_OrgasmMytosis.cs rename to Source/Genes/Special/Patches/Patch_OrgasmMytosis.cs diff --git a/Source/Genes/Special/Patch_OrgasmRush.cs b/Source/Genes/Special/Patches/Patch_OrgasmRush.cs similarity index 100% rename from Source/Genes/Special/Patch_OrgasmRush.cs rename to Source/Genes/Special/Patches/Patch_OrgasmRush.cs diff --git a/Source/Genes/Special/Patch_Youth_Fountain.cs b/Source/Genes/Special/Patches/Patch_Youth_Fountain.cs similarity index 100% rename from Source/Genes/Special/Patch_Youth_Fountain.cs rename to Source/Genes/Special/Patches/Patch_Youth_Fountain.cs diff --git a/Source/Rjw-Genes.csproj b/Source/Rjw-Genes.csproj index e7c8bc8..e2ecbaa 100644 --- a/Source/Rjw-Genes.csproj +++ b/Source/Rjw-Genes.csproj @@ -142,9 +142,11 @@ - - - + + + + + @@ -159,10 +161,10 @@ - + - - + +