From 05770a834e7886d33a2b950e973e8160b890210a Mon Sep 17 00:00:00 2001 From: Vegapnk Date: Tue, 16 Jul 2024 17:36:33 +0200 Subject: [PATCH] Start on Living CumBucket --- LoadFolders.xml | 1 + .../Defs/GeneDefs/Sexperience_GeneDefs.xml | 20 ++++++ .../HediffDefs/Sexperience_HediffDefs.xml | 71 +++++++++++++++++++ Source/GeneDefOf.cs | 1 + .../Cum/{ => Genes}/Gene_ChangeCumAmount.cs | 0 .../{ => Patches}/Patch_CumflationImmunity.cs | 0 .../{ => Patches}/Patch_LikesCumflation.cs | 0 .../Patch_LivingCumbucket_StackHediff.cs | 64 +++++++++++++++++ .../{ => Patches}/Patch_TransferNutrition.cs | 0 Source/HediffDefOf.cs | 2 + Source/Rjw-Genes.csproj | 9 +-- 11 files changed, 164 insertions(+), 4 deletions(-) create mode 100644 Mods/Sexperience/Defs/GeneDefs/Sexperience_GeneDefs.xml create mode 100644 Mods/Sexperience/Defs/HediffDefs/Sexperience_HediffDefs.xml rename Source/Genes/Cum/{ => Genes}/Gene_ChangeCumAmount.cs (100%) rename Source/Genes/Cum/{ => Patches}/Patch_CumflationImmunity.cs (100%) rename Source/Genes/Cum/{ => Patches}/Patch_LikesCumflation.cs (100%) create mode 100644 Source/Genes/Cum/Patches/Patch_LivingCumbucket_StackHediff.cs rename Source/Genes/Cum/{ => Patches}/Patch_TransferNutrition.cs (100%) diff --git a/LoadFolders.xml b/LoadFolders.xml index 8f11ba4..d3c2a27 100644 --- a/LoadFolders.xml +++ b/LoadFolders.xml @@ -16,5 +16,6 @@
  • Mods/Android
  • Mods/VE_Genetics
  • Mods/LicentiaLabs
  • +
  • Mods/Sexperience
  • \ No newline at end of file diff --git a/Mods/Sexperience/Defs/GeneDefs/Sexperience_GeneDefs.xml b/Mods/Sexperience/Defs/GeneDefs/Sexperience_GeneDefs.xml new file mode 100644 index 0000000..774a874 --- /dev/null +++ b/Mods/Sexperience/Defs/GeneDefs/Sexperience_GeneDefs.xml @@ -0,0 +1,20 @@ + + + + + rjw_genes_living_cumbucket + + rjw_genes_cum + When this Xenotype partakes in sexual activity, they store cum and produce it as an item. + Genes/Icons/Generous_Donor + 559 + + +
  • + Genes/Icons/RJW_Genes_Endogene_Background + Genes/Icons/RJW_Genes_Xenogene_Background +
  • +
    +
    + +
    \ No newline at end of file diff --git a/Mods/Sexperience/Defs/HediffDefs/Sexperience_HediffDefs.xml b/Mods/Sexperience/Defs/HediffDefs/Sexperience_HediffDefs.xml new file mode 100644 index 0000000..0a63095 --- /dev/null +++ b/Mods/Sexperience/Defs/HediffDefs/Sexperience_HediffDefs.xml @@ -0,0 +1,71 @@ + + + + rjw_genes_filled_living_cumbucket + HediffWithComps + + This pawn is a (filled) living cum bucket. Thanks to a generous donation, this pawn will slowly generate cum for pickup. + (240,200,110) + false + + false + false + +
  • + -0.5 +
  • +
    + +
  • + + + -0.1 + +
  • +
  • + + 0.4 + 0.8 + + -0.25 + + +
  • + Moving + -0.05 +
  • + + +
  • + + 0.65 + 0.75 + + -0.25 + + +
  • + Moving + -0.1 +
  • + + +
  • + + 1.1 + 0.6 + + -0.5 + + +
  • + Moving + -0.15 +
  • + + +
    +
    + + +
    diff --git a/Source/GeneDefOf.cs b/Source/GeneDefOf.cs index 7f0465f..7b0b2fc 100644 --- a/Source/GeneDefOf.cs +++ b/Source/GeneDefOf.cs @@ -83,6 +83,7 @@ namespace RJW_Genes [MayRequire("LustLicentia.RJWLabs")] public static readonly GeneDef rjw_genes_likes_cumflation; [MayRequire("LustLicentia.RJWLabs")] public static readonly GeneDef rjw_genes_cumflation_immunity; [MayRequire("LustLicentia.RJWLabs")] public static readonly GeneDef rjw_genes_generous_donor; + [MayRequire("rjw.sexperience")] public static readonly GeneDef rjw_genes_living_cumbucket; // Reproduction diff --git a/Source/Genes/Cum/Gene_ChangeCumAmount.cs b/Source/Genes/Cum/Genes/Gene_ChangeCumAmount.cs similarity index 100% rename from Source/Genes/Cum/Gene_ChangeCumAmount.cs rename to Source/Genes/Cum/Genes/Gene_ChangeCumAmount.cs diff --git a/Source/Genes/Cum/Patch_CumflationImmunity.cs b/Source/Genes/Cum/Patches/Patch_CumflationImmunity.cs similarity index 100% rename from Source/Genes/Cum/Patch_CumflationImmunity.cs rename to Source/Genes/Cum/Patches/Patch_CumflationImmunity.cs diff --git a/Source/Genes/Cum/Patch_LikesCumflation.cs b/Source/Genes/Cum/Patches/Patch_LikesCumflation.cs similarity index 100% rename from Source/Genes/Cum/Patch_LikesCumflation.cs rename to Source/Genes/Cum/Patches/Patch_LikesCumflation.cs diff --git a/Source/Genes/Cum/Patches/Patch_LivingCumbucket_StackHediff.cs b/Source/Genes/Cum/Patches/Patch_LivingCumbucket_StackHediff.cs new file mode 100644 index 0000000..030b784 --- /dev/null +++ b/Source/Genes/Cum/Patches/Patch_LivingCumbucket_StackHediff.cs @@ -0,0 +1,64 @@ +using HarmonyLib; +using rjw; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using static System.Net.Mime.MediaTypeNames; + +namespace RJW_Genes +{ + + [HarmonyPatch(typeof(SexUtility), nameof(SexUtility.SatisfyPersonal))] + public class Patch_LivingCumbucket_StackHediff + { + + /// + /// This is the amount of fluid required if the pawn has a bodysize of 1, to reach a severity in the hediff of 1. + /// The hediff can still be increased. + /// + const float fluid_amount_required_for_hediff_severity_ = 100.0f; + + public static void Postfix(SexProps props) + { + if (!ModsConfig.IsActive("rjw.sexperience")) + return; + + // ShortCuts: Exit Early if Pawn or Partner are null (can happen with Masturbation or other nieche-cases) + if (props == null || props.pawn == null || !props.hasPartner()) + return; + + Pawn pawnA = props.pawn; + Pawn pawnB = props.partner; + + if (pawnA.genes != null && pawnA.genes.HasActiveGene(GeneDefOf.rjw_genes_living_cumbucket) && CumUtility.GetTotalFluidAmount(pawnB) > 0) + { + ProcessLivingCumbucket(pawnA, CumUtility.GetTotalFluidAmount(pawnB)); + } + + if (pawnB.genes != null && pawnB.genes.HasActiveGene(GeneDefOf.rjw_genes_living_cumbucket) && CumUtility.GetTotalFluidAmount(pawnA) > 0) + { + ProcessLivingCumbucket(pawnB, CumUtility.GetTotalFluidAmount(pawnA)); + } + } + + public static void ProcessLivingCumbucket(Pawn pawn, float cumamount) + { + float bodysize = pawn.BodySize; + float result_severity_increase = cumamount / (fluid_amount_required_for_hediff_severity_ * bodysize); + ModLog.Message($"Pumping the living cumbucket {pawn} (Bodysize {bodysize}) with {cumamount} cum, resulting in severity {result_severity_increase}"); + + + Hediff hediff = pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.rjw_genes_filled_living_cumbucket); + if (hediff == null) + { + hediff = pawn.health.GetOrAddHediff(HediffDefOf.rjw_genes_filled_living_cumbucket); + hediff.Severity = 0.01f; + } + + hediff.Severity += result_severity_increase; + } + } +} diff --git a/Source/Genes/Cum/Patch_TransferNutrition.cs b/Source/Genes/Cum/Patches/Patch_TransferNutrition.cs similarity index 100% rename from Source/Genes/Cum/Patch_TransferNutrition.cs rename to Source/Genes/Cum/Patches/Patch_TransferNutrition.cs diff --git a/Source/HediffDefOf.cs b/Source/HediffDefOf.cs index 4214041..2cc03fc 100644 --- a/Source/HediffDefOf.cs +++ b/Source/HediffDefOf.cs @@ -29,5 +29,7 @@ namespace RJW_Genes public static readonly HediffDef OvaryAgitator; public static readonly HediffDef Bioscaffold; + + [MayRequire("rjw.sexperience")] public static readonly HediffDef rjw_genes_filled_living_cumbucket; } } diff --git a/Source/Rjw-Genes.csproj b/Source/Rjw-Genes.csproj index 3b8204f..41ad6da 100644 --- a/Source/Rjw-Genes.csproj +++ b/Source/Rjw-Genes.csproj @@ -82,7 +82,8 @@ - + + @@ -109,10 +110,10 @@ - - + + - +