mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Compare commits
No commits in common. "190173d87dee5d8a4e92227972a8447205bcee16" and "398f1b7066f2ac534cd4497a53612575814a23a5" have entirely different histories.
190173d87d
...
398f1b7066
5 changed files with 45 additions and 17 deletions
Binary file not shown.
|
@ -1528,7 +1528,7 @@ namespace RJW_Menstruation
|
||||||
if (curStageHrs >= currentIntervalHours)
|
if (curStageHrs >= currentIntervalHours)
|
||||||
{
|
{
|
||||||
Hediff hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_MenstrualCramp);
|
Hediff hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_MenstrualCramp);
|
||||||
if (hediff != null && !Pawn.GetMenstruationComps().Any(comp => comp != this && comp.curStage == Stage.Bleeding)) Pawn.health.RemoveHediff(hediff);
|
if (hediff != null) Pawn.health.RemoveHediff(hediff);
|
||||||
int totalFollicularHours = PeriodRandomizer(Stage.Follicular); // The total amount of time for both bleeding and follicular
|
int totalFollicularHours = PeriodRandomizer(Stage.Follicular); // The total amount of time for both bleeding and follicular
|
||||||
if (totalFollicularHours <= currentIntervalHours) // We've bled for so long that we completely missed the follicular phase
|
if (totalFollicularHours <= currentIntervalHours) // We've bled for so long that we completely missed the follicular phase
|
||||||
GoOvulatoryStage();
|
GoOvulatoryStage();
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using RimWorld;
|
using RimWorld;
|
||||||
using System.Linq;
|
|
||||||
using Verse;
|
using Verse;
|
||||||
|
|
||||||
namespace RJW_Menstruation
|
namespace RJW_Menstruation
|
||||||
|
@ -62,12 +61,17 @@ namespace RJW_Menstruation
|
||||||
if (curStageHrs >= currentIntervalHours)
|
if (curStageHrs >= currentIntervalHours)
|
||||||
{
|
{
|
||||||
Hediff hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_MenstrualCramp);
|
Hediff hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_MenstrualCramp);
|
||||||
if (hediff != null && !Pawn.GetMenstruationComps().Any(comp => comp != this && comp.curStage == Stage.Bleeding)) Pawn.health.RemoveHediff(hediff);
|
if (hediff != null) Pawn.health.RemoveHediff(hediff);
|
||||||
estrusflag = false;
|
estrusflag = false;
|
||||||
GoNextStage(Stage.Anestrus);
|
GoNextStage(Stage.Anestrus);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else base.BleedingAction();
|
else
|
||||||
|
{
|
||||||
|
if (curStageHrs < currentIntervalHours / 4) for (int i = 0; i < Configurations.CycleAcceleration; i++) BleedOut();
|
||||||
|
curStageHrs += Configurations.CycleAcceleration;
|
||||||
|
StayCurrentStage();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void PregnantAction()
|
protected override void PregnantAction()
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
using RimWorld;
|
using RimWorld;
|
||||||
using rjw;
|
using rjw;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using UnityEngine;
|
||||||
using Verse;
|
using Verse;
|
||||||
|
|
||||||
namespace RJW_Menstruation
|
namespace RJW_Menstruation
|
||||||
|
@ -13,9 +12,6 @@ namespace RJW_Menstruation
|
||||||
{
|
{
|
||||||
protected Dictionary<Pawn, Pawn> enzygoticSiblings = new Dictionary<Pawn, Pawn>(); // Each pawn and who they split from
|
protected Dictionary<Pawn, Pawn> enzygoticSiblings = new Dictionary<Pawn, Pawn>(); // Each pawn and who they split from
|
||||||
|
|
||||||
protected readonly MethodInfo TryGetInheritedXenotype = typeof(PregnancyUtility).GetMethod("TryGetInheritedXenotype", BindingFlags.Static | BindingFlags.NonPublic, null, new Type[] { typeof(Pawn), typeof(Pawn), typeof(XenotypeDef).MakeByRefType() }, null );
|
|
||||||
protected readonly MethodInfo ShouldByHybrid = typeof(PregnancyUtility).GetMethod("ShouldByHybrid", BindingFlags.Static | BindingFlags.NonPublic, null, new Type[] { typeof(Pawn), typeof(Pawn) }, null);
|
|
||||||
|
|
||||||
public override void DiscoverPregnancy()
|
public override void DiscoverPregnancy()
|
||||||
{
|
{
|
||||||
PregnancyThought();
|
PregnancyThought();
|
||||||
|
@ -435,13 +431,9 @@ namespace RJW_Menstruation
|
||||||
baby.genes.xenotypeName = mother.genes.xenotypeName;
|
baby.genes.xenotypeName = mother.genes.xenotypeName;
|
||||||
baby.genes.iconDef = mother.genes.iconDef;
|
baby.genes.iconDef = mother.genes.iconDef;
|
||||||
}
|
}
|
||||||
|
XenotypeDef xenoTypeDef = BabyXenoTypeDecider(mother, father, out bool hybridBaby);
|
||||||
object[] args = new object[] { mother, father, null };
|
if (xenoTypeDef != null) baby.genes.SetXenotypeDirect(xenoTypeDef);
|
||||||
if ((bool)TryGetInheritedXenotype.Invoke(null, args))
|
if (hybridBaby)
|
||||||
{
|
|
||||||
baby.genes.SetXenotypeDirect((XenotypeDef)args[2]);
|
|
||||||
}
|
|
||||||
else if((bool)ShouldByHybrid.Invoke(null, new object[] { mother, father }))
|
|
||||||
{
|
{
|
||||||
baby.genes.hybrid = true;
|
baby.genes.hybrid = true;
|
||||||
baby.genes.xenotypeName = "Hybrid".Translate();
|
baby.genes.xenotypeName = "Hybrid".Translate();
|
||||||
|
@ -646,6 +638,39 @@ namespace RJW_Menstruation
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public XenotypeDef BabyXenoTypeDecider(Pawn mother, Pawn father, out bool hybrid)
|
||||||
|
{
|
||||||
|
hybrid = false;
|
||||||
|
bool hybridMother = mother?.genes?.hybrid ?? false;
|
||||||
|
bool hybridFather = father?.genes?.hybrid ?? false;
|
||||||
|
if (hybridMother && hybridFather)
|
||||||
|
{
|
||||||
|
hybrid = true;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
XenotypeDef motherInheritableXenotype = mother?.genes?.Xenotype;
|
||||||
|
XenotypeDef fatherInheritableXenotype = father?.genes?.Xenotype;
|
||||||
|
if (!(motherInheritableXenotype?.inheritable ?? false)) motherInheritableXenotype = null;
|
||||||
|
if (!(fatherInheritableXenotype?.inheritable ?? false)) fatherInheritableXenotype = null;
|
||||||
|
|
||||||
|
// If they're the same (or both null)
|
||||||
|
if (motherInheritableXenotype == fatherInheritableXenotype)
|
||||||
|
{
|
||||||
|
// Both null, but one's a hybrid
|
||||||
|
if (motherInheritableXenotype == null && (hybridMother || hybridFather))
|
||||||
|
hybrid = true;
|
||||||
|
|
||||||
|
return motherInheritableXenotype;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If one is null and the other isn't
|
||||||
|
if ((motherInheritableXenotype == null) != (fatherInheritableXenotype == null)) return motherInheritableXenotype ?? fatherInheritableXenotype;
|
||||||
|
|
||||||
|
// So two different inheritable ones
|
||||||
|
hybrid = true;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public PawnKindDef GetHybrid(Pawn first, Pawn second)
|
public PawnKindDef GetHybrid(Pawn first, Pawn second)
|
||||||
{
|
{
|
||||||
PawnKindDef res = null;
|
PawnKindDef res = null;
|
||||||
|
|
|
@ -4,7 +4,6 @@ Version 1.0.8.5
|
||||||
- Impregnation fetishists are significantly less likely to pull out.
|
- Impregnation fetishists are significantly less likely to pull out.
|
||||||
- Some males will release small amounts of semen into a womb during vaginal sex before their actual ejaculation.
|
- Some males will release small amounts of semen into a womb during vaginal sex before their actual ejaculation.
|
||||||
- Babies born from multiple pregnancy will properly produce the prompt to name them.
|
- Babies born from multiple pregnancy will properly produce the prompt to name them.
|
||||||
- Hopefully improve compatibility with xenotype inhertiance-altering mods for multiple pregnancy.
|
|
||||||
- Experimental "periodic ovulator" cycle type, currently not used. See Patches/Hediffs_Private_Parts_Animal.xml.
|
- Experimental "periodic ovulator" cycle type, currently not used. See Patches/Hediffs_Private_Parts_Animal.xml.
|
||||||
|
|
||||||
Version 1.0.8.4
|
Version 1.0.8.4
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue