From ada4a87efcfd9bd319727d2b93cf91b9ff2673cc Mon Sep 17 00:00:00 2001 From: Vegapnk Date: Wed, 28 Jun 2023 14:45:43 +0200 Subject: [PATCH] Added new Gene for evergrowing cock --- .../Defs/GeneDefs/GeneDefs_GenitaliaSizes.xml | 16 +++ Common/Defs/HediffDefs/Hediffs_Evergrowth.xml | 52 +++++++++ .../Gene_EvergrowingGenitalia.cs | 107 ++++++++++++++++++ Source/HediffDefOf.cs | 2 + Source/Rjw-Genes.csproj | 1 + 5 files changed, 178 insertions(+) create mode 100644 Common/Defs/HediffDefs/Hediffs_Evergrowth.xml create mode 100644 Source/Genes/GenitaliaSize/Gene_EvergrowingGenitalia.cs diff --git a/Common/Defs/GeneDefs/GeneDefs_GenitaliaSizes.xml b/Common/Defs/GeneDefs/GeneDefs_GenitaliaSizes.xml index 5c43285..6d0bb5c 100644 --- a/Common/Defs/GeneDefs/GeneDefs_GenitaliaSizes.xml +++ b/Common/Defs/GeneDefs/GeneDefs_GenitaliaSizes.xml @@ -111,4 +111,20 @@
  • AnusSize
  • + + + + + rjw_genes_evergrowth + + One of the most regretted gene-modifications in the Glitterworlds: The (primary) genitalia will continue growing forever. This affects size and fluid output. Excessive growth can also effect mental stability! (Resizing takes place at 20th Birthday) + Genes/Icons/Big_Male_Genitalia + RJW_Genes.Gene_EvergrowingGenitalia + 767 + +
  • PenisSize
  • +
  • VaginaSize
  • +
    +
    + \ No newline at end of file diff --git a/Common/Defs/HediffDefs/Hediffs_Evergrowth.xml b/Common/Defs/HediffDefs/Hediffs_Evergrowth.xml new file mode 100644 index 0000000..c2fc098 --- /dev/null +++ b/Common/Defs/HediffDefs/Hediffs_Evergrowth.xml @@ -0,0 +1,52 @@ + + + + + rjw_genes_evergrowth_sideeffect + HediffWithComps + + science has gone too far - a tool like this needs constant attention. + (1,0,0.5) + 1.0 + +
  • + -0.025 +
  • +
    + +
  • + + + 3 + +
  • +
  • + 0.5 + + + 5 + + +
  • + Consciousness + -0.05 +
  • + + +
  • + 0.9 + + + 7 + + +
  • + Consciousness + -0.1 +
  • + + +
    +
    + +
    \ No newline at end of file diff --git a/Source/Genes/GenitaliaSize/Gene_EvergrowingGenitalia.cs b/Source/Genes/GenitaliaSize/Gene_EvergrowingGenitalia.cs new file mode 100644 index 0000000..05a6803 --- /dev/null +++ b/Source/Genes/GenitaliaSize/Gene_EvergrowingGenitalia.cs @@ -0,0 +1,107 @@ +using Verse; +using Verse; +using RimWorld; +using rjw; +using System.Collections.Generic; +using System; + +namespace RJW_Genes +{ + public class Gene_EvergrowingGenitalia : RJW_Gene + { + + /// + /// The age (in years) at which the Pawns Genes will take effect, resizing their genitalia. + /// + public const int RESIZING_AGE = 20; + + //public const int GROWTH_INTERVAL = 1000; // Test value for Quick Trials + public const int GROWTH_INTERVAL = 60000; // 60k == 1 day + + public override void Tick() + { + base.Tick(); + + if (pawn.IsHashIntervalTick(GROWTH_INTERVAL) + && this.pawn.Map != null + && pawn.ageTracker.AgeBiologicalYears >= RESIZING_AGE) + { + GrowPenisses(); + GrowVaginas(); + } + } + + private void GrowPenisses() + { + 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 + 0.05f); + } else { + if (CompHediff != null) + { + CompHediff.SizeOwner += 0.015f; + if (CompHediff.SizeOwner > 3.0f) + { + // Add Mental Hediff + HandleGenitaliaSizeThoughts(pawn); + } + } + } + + // Increase Fluid + if (CompHediff != null) + CompHediff.FluidAmmount *= 1.05f; + } + } + + private void GrowVaginas() + { + List AllVaginas = Genital_Helper.get_AllPartsHediffList(pawn).FindAll(x => Genital_Helper.is_vagina(x)); + foreach (Hediff vagina in AllVaginas) + { + CompHediffBodyPart CompHediff = vagina.TryGetComp(); + if (vagina.Severity < 1.00) + { + vagina.Severity = Math.Min(1.01f, vagina.Severity + 0.05f); + } + else + { + if (CompHediff != null) + { + CompHediff.SizeOwner += 0.015f; + if (CompHediff.SizeOwner > 3.0f) + { + // Add Mental Hediff + HandleGenitaliaSizeThoughts(pawn); + } + } + } + + // Increase Fluid + if (CompHediff != null) + CompHediff.FluidAmmount *= 1.025f; + } + } + + private void HandleGenitaliaSizeThoughts(Pawn pawn) + { + Hediff hybridsThoughts = pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.rjw_genes_evergrowth_sideeffect); + + if (hybridsThoughts != null) + { + hybridsThoughts.Severity += 0.025f; + } + else + { + hybridsThoughts = HediffMaker.MakeHediff(HediffDefOf.rjw_genes_evergrowth_sideeffect, pawn); + hybridsThoughts.Severity = 0.1f; + pawn.health.AddHediff(hybridsThoughts); + } + } + + } +} \ No newline at end of file diff --git a/Source/HediffDefOf.cs b/Source/HediffDefOf.cs index 4e3b052..30e34df 100644 --- a/Source/HediffDefOf.cs +++ b/Source/HediffDefOf.cs @@ -17,6 +17,8 @@ namespace RJW_Genes public static readonly HediffDef rjw_genes_orgasm_rush_hediff; public static readonly HediffDef rjw_genes_fertilin_craving; + public static readonly HediffDef rjw_genes_evergrowth_sideeffect; + public static readonly HediffDef rjw_genes_orgasmic_mytosis_hediff; public static readonly HediffDef rjw_genes_mytosis_shock_hediff; } diff --git a/Source/Rjw-Genes.csproj b/Source/Rjw-Genes.csproj index 0ece225..c14c538 100644 --- a/Source/Rjw-Genes.csproj +++ b/Source/Rjw-Genes.csproj @@ -44,6 +44,7 @@ +