mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2026-08-22 11:43:22 +00:00
Compare commits
2 commits
26b0583786
...
c3a6d5f681
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c3a6d5f681 | ||
|
|
a9beb00a65 |
2 changed files with 147 additions and 14 deletions
|
|
@ -966,6 +966,70 @@ namespace RJW_Menstruation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Inject pawn's cum into womb
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cummer"></param>
|
||||||
|
/// <param name="volume"></param>
|
||||||
|
/// <param name="fertility"></param>
|
||||||
|
/// <param name="precum"></param>
|
||||||
|
public void CumIn(Hediff penis, float volume = -1.0f, float fertility = -1.0f, bool precum = false)
|
||||||
|
{
|
||||||
|
if(!Genital_Helper.is_penis(penis)) return;
|
||||||
|
HediffComp_SexPart comp = penis.TryGetComp<HediffComp_SexPart>();
|
||||||
|
if (volume < 0) volume = Utility.GetCumVolume(penis.pawn, penis.TryGetComp<HediffComp_SexPart>());
|
||||||
|
if (volume <= 0 || float.IsNaN(volume) || float.IsInfinity(volume))
|
||||||
|
{
|
||||||
|
if (!precum) Log.Warning($"{penis.pawn}, {penis} trying to cum inside of {Pawn} with {volume} fluid");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fertility < 0) fertility = (Genital_Helper.is_fertile_penis(penis) && !penis.pawn.SterileGenes()) ? penis.pawn.health.capacities.GetLevel(xxx.reproduction) : 0.0f;
|
||||||
|
|
||||||
|
|
||||||
|
if (!precum && Rand.Chance(PulloutChance(penis.pawn, fertility))) return;
|
||||||
|
if (Pawn.HasIUD()) fertility /= 100f;
|
||||||
|
float cumd = TotalCumPercent;
|
||||||
|
float tmp = TotalCum + volume;
|
||||||
|
if (tmp > CumCapacity)
|
||||||
|
{
|
||||||
|
float cumoutrate = 1 - (CumCapacity / tmp);
|
||||||
|
bool merged = false;
|
||||||
|
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
|
||||||
|
{
|
||||||
|
if (cum.pawn?.Equals(penis.pawn) ?? false)
|
||||||
|
{
|
||||||
|
cum.MergeWithCum(volume, fertility);
|
||||||
|
merged = true;
|
||||||
|
}
|
||||||
|
cum.DismishForce(cumoutrate);
|
||||||
|
}
|
||||||
|
if (!merged) cums.Add(new Cum(penis.pawn, volume * (1 - cumoutrate), fertility));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
bool merged = false;
|
||||||
|
if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
|
||||||
|
{
|
||||||
|
if (cum.pawn?.Equals(penis.pawn) ?? false)
|
||||||
|
{
|
||||||
|
cum.MergeWithCum(volume, fertility);
|
||||||
|
merged = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!merged) cums.Add(new Cum(penis.pawn, volume, fertility));
|
||||||
|
}
|
||||||
|
cumd = TotalCumPercent - cumd;
|
||||||
|
|
||||||
|
if (!precum)
|
||||||
|
{
|
||||||
|
Pawn.records.AddTo(VariousDefOf.AmountofCreampied, volume);
|
||||||
|
AfterCumIn(penis.pawn);
|
||||||
|
AfterFluidIn(cumd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Inject pawn's fluid into womb
|
/// Inject pawn's fluid into womb
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using RimWorld;
|
using RimWorld;
|
||||||
|
using RimWorld.Planet;
|
||||||
using rjw;
|
using rjw;
|
||||||
using rjw.Modules.Interactions;
|
using rjw.Modules.Interactions;
|
||||||
using System;
|
using System;
|
||||||
|
|
@ -29,12 +30,14 @@ namespace RJW_Menstruation
|
||||||
|
|
||||||
HediffComp_Menstruation comp = mother.GetRandomMenstruationComp(true);
|
HediffComp_Menstruation comp = mother.GetRandomMenstruationComp(true);
|
||||||
if (comp == null) return true;
|
if (comp == null) return true;
|
||||||
|
|
||||||
if (Genital_Helper.has_penis_fertile(father, pawnparts) && PregnancyHelper.CanImpregnate(father, mother, sextype))
|
if (Genital_Helper.has_penis_fertile(father, pawnparts) && PregnancyHelper.CanImpregnate(father, mother, sextype))
|
||||||
{
|
{
|
||||||
if (MenstruationUtility.UsingCondom(father, mother)) return false; // Probably unnecessary
|
if (MenstruationUtility.UsingCondom(father, mother)) return false; // Probably unnecessary
|
||||||
|
|
||||||
|
MenstruationImpregnate(father, mother, props);
|
||||||
PregnancyHelper.DoImpregnate(father, mother);
|
PregnancyHelper.DoImpregnate(father, mother);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (Genital_Helper.has_ovipositorM(father, pawnparts))
|
else if (Genital_Helper.has_ovipositorM(father, pawnparts))
|
||||||
|
|
@ -70,20 +73,88 @@ namespace RJW_Menstruation
|
||||||
{
|
{
|
||||||
SexInteraction interaction = props.interaction;
|
SexInteraction interaction = props.interaction;
|
||||||
|
|
||||||
if (!interaction.HasInteractionTag(SexInteractionTag.Fertilization))
|
foreach ((var penetrator, var orifice) in props.resolved.Penetrations)
|
||||||
return false;
|
|
||||||
|
|
||||||
if (!props.isReceiver)
|
|
||||||
{
|
{
|
||||||
return
|
if (penetrator.Owner == props.pawn && orifice.Owner == props.partner && penetrator.HasGenitalTag(GenitalTag.CanFertilize) && orifice.HasGenitalTag(GenitalTag.CanBeFertilized)) return true;
|
||||||
interaction.Extension.initiatorRequirement.genitalTags.Contains(GenitalTag.CanPenetrate) &&
|
|
||||||
interaction.Extension.recipientRequirement.genitalFamilies.Contains(GenitalFamily.Vagina);
|
|
||||||
}
|
}
|
||||||
else
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void MenstruationImpregnate(Pawn father, Pawn mother, SexProps props)
|
||||||
|
{
|
||||||
|
if (!mother.ShouldCycle()) return;
|
||||||
|
if (props.sexType == xxx.rjwSextype.Vaginal)
|
||||||
{
|
{
|
||||||
return
|
HediffComp_Menstruation comp = mother.GetRandomMenstruationComp(true);
|
||||||
interaction.Extension.initiatorRequirement.genitalFamilies.Contains(GenitalFamily.Vagina) &&
|
if (comp == null)
|
||||||
interaction.Extension.recipientRequirement.genitalTags.Contains(GenitalTag.CanPenetrate);
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (AndroidsCompatibility.IsAndroid(father) && !AndroidsCompatibility.AndroidPenisFertility(father))
|
||||||
|
{
|
||||||
|
comp.CumIn(father, father.GetCumVolume(), 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else comp.CumIn(father, father.GetCumVolume(), father.SterileGenes() ? 0.0f : father.health.capacities.GetLevel(xxx.reproduction));
|
||||||
|
}
|
||||||
|
else if (props.sexType == xxx.rjwSextype.DoublePenetration)
|
||||||
|
{
|
||||||
|
List<HediffComp_Menstruation> comps = mother.GetMenstruationComps().ToList();
|
||||||
|
List<Hediff> penises = father.GetGenitalsList().Where(h => h.def is HediffDef_SexPart && Genital_Helper.is_penis(h)).ToList();
|
||||||
|
if (comps.NullOrEmpty() || penises.NullOrEmpty())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (AndroidsCompatibility.IsAndroid(father) && !AndroidsCompatibility.AndroidPenisFertility(father))
|
||||||
|
{
|
||||||
|
List<HediffComp_Menstruation> randComps = comps.OrderByDescending(x => UnityEngine.Random.value).ToList();
|
||||||
|
List<Hediff> randPenises = penises.OrderByDescending(x => UnityEngine.Random.value).ToList();
|
||||||
|
if (comps.Count() > 1 && penises.Count() > 1)
|
||||||
|
{
|
||||||
|
randComps.ElementAt(0).CumIn(randPenises.ElementAt(0), fertility: 0);
|
||||||
|
randComps.ElementAt(1).CumIn(randPenises.ElementAt(1), fertility: 0);
|
||||||
|
}
|
||||||
|
else if (penises.Count > 1)
|
||||||
|
{
|
||||||
|
randComps.ElementAt(0).CumIn(randPenises.ElementAt(0), fertility: 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
comps.ElementAt(0).CumIn(father, father.GetCumVolume(), 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
List<HediffComp_Menstruation> dangerComps = comps.OrderByDescending(x => x.IsDangerDay).ThenBy(x => UnityEngine.Random.value).ToList();
|
||||||
|
if (RJWSettings.DevMode)
|
||||||
|
{
|
||||||
|
foreach (HediffComp_Menstruation comp in dangerComps)
|
||||||
|
{
|
||||||
|
Log.Message("MenstruationComps: " + comp.parent.Label + " , State: " + comp.GetCurStageLabel + " IsDangerDay = " + comp.IsDangerDay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<Hediff> productivePenises = penises.Where(x=>Genital_Helper.is_fertile_penis(x)).OrderByDescending(x => x.TryGetComp<HediffComp_SexPart>().FluidAmount).ToList();
|
||||||
|
if (RJWSettings.DevMode)
|
||||||
|
{
|
||||||
|
foreach (Hediff penis in productivePenises)
|
||||||
|
{
|
||||||
|
Log.Message("Penis : " + penis.Label + " , Fluid amount: " + penis.TryGetComp<HediffComp_SexPart>().FluidAmount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (comps.Count() > 1 && penises.Count() > 1)
|
||||||
|
{
|
||||||
|
dangerComps.ElementAt(0).CumIn(productivePenises.ElementAt(0));
|
||||||
|
dangerComps.ElementAt(1).CumIn(productivePenises.ElementAt(1));
|
||||||
|
}
|
||||||
|
else if (penises.Count > 1)
|
||||||
|
{
|
||||||
|
dangerComps.ElementAt(0).CumIn(productivePenises.ElementAt(0));
|
||||||
|
}
|
||||||
|
else dangerComps.ElementAt(0).CumIn(father, father.GetCumVolume(), father.SterileGenes() ? 0.0f : father.health.capacities.GetLevel(xxx.reproduction));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -104,11 +175,9 @@ namespace RJW_Menstruation
|
||||||
}
|
}
|
||||||
else if (AndroidsCompatibility.IsAndroid(father) && !AndroidsCompatibility.AndroidPenisFertility(father))
|
else if (AndroidsCompatibility.IsAndroid(father) && !AndroidsCompatibility.AndroidPenisFertility(father))
|
||||||
{
|
{
|
||||||
comp.CumIn(father, father.GetCumVolume(), 0);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else comp.CumIn(father, father.GetCumVolume(), father.SterileGenes() ? 0.0f : father.health.capacities.GetLevel(xxx.reproduction));
|
else return false;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue