Custom succubus tail sex interactions and modification to fertilin absorbtion

This commit is contained in:
Shabakur 2022-12-29 16:08:22 +01:00
parent 22892db8e0
commit 3cf2d44c82
17 changed files with 955 additions and 44 deletions

View file

@ -77,5 +77,8 @@ namespace RJW_Genes
public static readonly GeneDef rjw_genes_pussyhealer;
public static readonly GeneDef rjw_genes_vaginal_absorber;
public static readonly GeneDef rjw_genes_anal_absorber;
// Cosmetic
public static readonly GeneDef rjw_genes_succubus_tail;
}
}

View file

@ -50,7 +50,7 @@ namespace RJW_Genes
if (comp.props is CompProperties_SexInteractionRequirements)
{
CompProperties_SexInteractionRequirements sexpropsreq = comp.props as CompProperties_SexInteractionRequirements;
this.Sexprops = CompAbility_SexInteractionRequirements.GenerateSexProps(this.pawn, this.Partner, sexpropsreq);
this.Sexprops = CustomSexInteraction_Helper.GenerateSexProps(this.pawn, this.Partner, sexpropsreq);
}
}
this.Start();

View file

@ -20,58 +20,144 @@ namespace RJW_Genes
if (props.pawn == null || !props.hasPartner())
return;
// Exit if pawn has fertilin themself, it won't give any if it has lifeforce themself.
if (GeneUtility.HasLifeForce(props.pawn))
{
return;
}
//Summary//
//We use the positions of the pawn (dom or sub) and based on that which interactions will transfer fertilin
//By checking isreceiver we know if the succubus is the dom or the sub and if the situation is reverse we also swap the function we use
//
float absorb_factor = 0f;
if (GeneUtility.HasLifeForce(props.partner))
{
if (props.sexType == xxx.rjwSextype.Oral || props.sexType == xxx.rjwSextype.Fellatio || props.sexType == xxx.rjwSextype.Sixtynine)
Pawn succubus = props.partner;
if (!props.isRevese)
{
absorb_factor += 1f;
//Currently taking the sum of all penises, maybe I should just consider one at random
}
else if (props.sexType == xxx.rjwSextype.Vaginal && GeneUtility.HasGeneNullCheck(props.partner, GeneDefOf.rjw_genes_vaginal_absorber))
{
absorb_factor += 1f;
}
else if (props.sexType == xxx.rjwSextype.Anal && GeneUtility.HasGeneNullCheck(props.partner, GeneDefOf.rjw_genes_anal_absorber))
{
absorb_factor += 1f;
}
else if (props.sexType == xxx.rjwSextype.DoublePenetration)
{
if (GeneUtility.HasGeneNullCheck(props.partner, GeneDefOf.rjw_genes_vaginal_absorber))
if (props.isReceiver)
{
absorb_factor += 0.5f;
// Scenario Dom Succubus, normal
absorb_factor = BaseDom(props, succubus);
}
if (GeneUtility.HasGeneNullCheck(props.partner, GeneDefOf.rjw_genes_anal_absorber))
else
{
absorb_factor += 0.5f;
// Scenario Sub Succubus, normal
absorb_factor = BaseSub(props, succubus);
}
}
if (absorb_factor != 0)
{
else
{
if (props.isReceiver)
{
// Scenario Dom Succubus, Reverse
absorb_factor = BaseSub(props, succubus);
}
else
{
// Scenario Sub Succubus, Reverse
absorb_factor = BaseDom(props, succubus);
}
}
//If we remove this check fertelin is always lost, but the succubus doesn't always gain any
if (absorb_factor != 0f)
{
AbsorbFertilin(props, absorb_factor);
}
}
}
public static void AbsorbFertilin(SexProps props, float absorb_factor = 1f)
{
{
Pawn_GeneTracker genes = props.partner.genes;
Gene_LifeForce gene = genes.GetFirstGeneOfType<Gene_LifeForce>();
float multiplier = Rand.Range(0.10f, 0.40f); //Around quarter get ejected everytime pawn cums
Hediff fertelin_lost = props.pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.Fertilin_Lost);
if (fertelin_lost == null)
{
{
Hediff new_fertelin_lost = HediffMaker.MakeHediff(HediffDefOf.Fertilin_Lost, props.pawn);
props.pawn.health.AddHediff(new_fertelin_lost);
new_fertelin_lost.Severity = multiplier;
}
else
{
else
{
multiplier *= 1 - fertelin_lost.Severity;
fertelin_lost.Severity += multiplier;
}
gene.Resource.Value += CumUtility.GetTotalFluidAmount(props.partner) / 100 * absorb_factor * multiplier;
}
//Currently taking the sum of all penises, maybe I should just consider one at random
gene.Resource.Value += CumUtility.GetTotalFluidAmount(props.pawn) / 100 * absorb_factor * multiplier;
}
public static float BaseDom(SexProps props, Pawn succubus)
{
float absorb_factor = 0f;
if (props.sexType == xxx.rjwSextype.Sixtynine)
{
absorb_factor += 1f;
}
else if (props.sexType == xxx.rjwSextype.Vaginal)
{
//with insertion absorbtion or vaginal cum absorbtion
//absorb_factor += 1f;
}
else if (props.sexType == xxx.rjwSextype.DoublePenetration)
{
if (GeneUtility.HasGeneNullCheck(succubus, GeneDefOf.rjw_genes_vaginal_absorber))
{
//with insertion absorbtion?
//absorb_factor += 0.5f;
}
if (GeneUtility.HasGeneNullCheck(succubus, GeneDefOf.rjw_genes_anal_absorber))
{
//with insertion absorbtion?
//absorb_factor += 0.5f;
}
}
else if (props.sexType == xxx.rjwSextype.Scissoring)
{
//with vaginal cum absorption && vaginal absorbtion
//absorb_factor += 1f;
}
return absorb_factor;
}
public static float BaseSub(SexProps props, Pawn succubus)
{
float absorb_factor = 0f;
if (props.sexType == xxx.rjwSextype.Oral || props.sexType == xxx.rjwSextype.Fellatio || props.sexType == xxx.rjwSextype.Sixtynine)
{
absorb_factor += 1f;
}
else if (props.sexType == xxx.rjwSextype.Vaginal && GeneUtility.HasGeneNullCheck(succubus, GeneDefOf.rjw_genes_vaginal_absorber))
{
absorb_factor += 1f;
}
else if (props.sexType == xxx.rjwSextype.Anal && GeneUtility.HasGeneNullCheck(succubus, GeneDefOf.rjw_genes_anal_absorber))
{
absorb_factor += 1f;
}
else if (props.sexType == xxx.rjwSextype.DoublePenetration)
{
if (GeneUtility.HasGeneNullCheck(succubus, GeneDefOf.rjw_genes_vaginal_absorber))
{
absorb_factor += 0.5f;
}
if (GeneUtility.HasGeneNullCheck(succubus, GeneDefOf.rjw_genes_anal_absorber))
{
absorb_factor += 0.5f;
}
}
else if (props.sexType == xxx.rjwSextype.Scissoring || props.sexType == xxx.rjwSextype.Cunnilingus)
{
//with vaginal cum absorbtion
//absorb_factor += 1f;
}
return absorb_factor;
}
}
}

View file

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
namespace RJW_Genes
{
public class CompAbility_SexInteractionRequirements : AbilityComp
{
public CompProperties_SexInteractionRequirements Props
{
get
{
return (CompProperties_SexInteractionRequirements)this.props;
}
}
}
}

View file

@ -13,16 +13,8 @@ using rjw.Modules.Interactions.Implementation;
using rjw.Modules.Interactions.Defs.DefFragment;
namespace RJW_Genes
{
public class CompAbility_SexInteractionRequirements : AbilityComp
{
public CompProperties_SexInteractionRequirements Props
{
get
{
return (CompProperties_SexInteractionRequirements)this.props;
}
}
public class CustomSexInteraction_Helper
{
public static List<InteractionDef> GenerateInteractionDefList(Pawn pawn, Pawn pawn2, CompProperties_SexInteractionRequirements sexpropsreq)
{
List<InteractionTag> tags = new List<InteractionTag>();

View file

@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using rjw.Modules.Interactions;
using rjw.Modules.Interactions.Internals.Implementation;
using rjw.Modules.Interactions.Objects;
using rjw;
using rjw.Modules.Interactions.Enums;
//Modefied code based of RJW-AI code at https://gitgud.io/Ed86/rjw-ia/-/tree/master/
namespace RJW_Genes
{
[StaticConstructorOnStartup]
public class DomSuccubusTailCustomRequirementHandler : ICustomRequirementHandler
{
public string HandlerKey
{
get
{
return "DomSuccubusTailCustomRequirementHandler";
}
}
static DomSuccubusTailCustomRequirementHandler()
{
Register();
}
public static void Register()
{
InteractionRequirementService.CustomRequirementHandlers.Add(new DomSuccubusTailCustomRequirementHandler());
if (Prefs.DevMode)
{
Log.Message("DomSuccubusTailCustomRequirementHandler registered: ");
}
}
public bool FufillRequirements(InteractionWithExtension interaction, InteractionPawn dominant, InteractionPawn submissive)
{
if (GeneUtility.HasGeneNullCheck(dominant.Pawn, GeneDefOf.rjw_genes_succubus_tail))
{
return true;
}
return false;
}
//public static readonly StringListDef filter = DefDatabase<StringListDef>.GetNamed("DomSuccubusTailFilter");
}
}

View file

@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using rjw.Modules.Interactions;
using rjw.Modules.Interactions.Internals.Implementation;
using rjw.Modules.Interactions.Objects;
using rjw;
using rjw.Modules.Interactions.Enums;
//Modefied code based of RJW-AI code at https://gitgud.io/Ed86/rjw-ia/-/tree/master/
namespace RJW_Genes
{
[StaticConstructorOnStartup]
public class SubSuccubusTailCustomRequirementHandler : ICustomRequirementHandler
{
public string HandlerKey
{
get
{
return "SubSuccubusTailCustomRequirementHandler";
}
}
static SubSuccubusTailCustomRequirementHandler()
{
Register();
}
public static void Register()
{
InteractionRequirementService.CustomRequirementHandlers.Add(new SubSuccubusTailCustomRequirementHandler());
if (Prefs.DevMode)
{
Log.Message("SubSuccubusTailCustomRequirementHandler registered: ");
}
}
public bool FufillRequirements(InteractionWithExtension interaction, InteractionPawn dominant, InteractionPawn submissive)
{
if (GeneUtility.HasGeneNullCheck(submissive.Pawn, GeneDefOf.rjw_genes_succubus_tail))
{
return true;
}
return false;
}
//public static readonly StringListDef filter = DefDatabase<StringListDef>.GetNamed("SubSuccubusTailFilter");
}
}

View file

@ -116,10 +116,10 @@
<Compile Include="Genes\Genitalia\GenitaliaChanger.cs" />
<Compile Include="Genes\Life_Force\AbilityUtility.cs" />
<Compile Include="Genes\Life_Force\CompAbilityEffect_LifeForceCost.cs" />
<Compile Include="Genes\Life_Force\CompAbility_SexInteractionRequirements.cs" />
<Compile Include="Interactions\CompAbility_SexInteractionRequirements.cs" />
<Compile Include="Genes\Life_Force\CompAbilityEffect_PussyHeal.cs" />
<Compile Include="Genes\Life_Force\CompProperties_AbilityLifeForceCost.cs" />
<Compile Include="Genes\Life_Force\CompProperties_SexInteractionRequirements.cs" />
<Compile Include="Interactions\CompProperties_SexInteractionRequirements.cs" />
<Compile Include="Genes\Life_Force\CompProperties_AbilityPussyHeal.cs" />
<Compile Include="Genes\Life_Force\GeneGizmo_ResourceLifeForce.cs" />
<Compile Include="Genes\Life_Force\HediffWithComps_tank.cs" />
@ -137,7 +137,10 @@
<Compile Include="Genes\Special\Patch_OrgasmRush.cs" />
<Compile Include="HarmonyInit.cs" />
<Compile Include="HediffDefOf.cs" />
<Compile Include="Interactions\CustomSexInteraction_Helper.cs" />
<Compile Include="Interactions\GenesPartKindUsageRule.cs" />
<Compile Include="Interactions\SubSuccubusTailCustomRequirementHandler - Copy.cs" />
<Compile Include="Interactions\DomSuccubusTailCustomRequirementHandler.cs" />
<Compile Include="JobDefOf.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RJW_Genes.cs" />