Replace parent.pawn with Pawn everywhere

This commit is contained in:
lutepickle 2022-08-23 08:30:54 -07:00
parent b9ffcc0dc5
commit c1dc6827fd
5 changed files with 130 additions and 131 deletions

Binary file not shown.

View file

@ -68,7 +68,7 @@ namespace RJW_Menstruation
get get
{ {
if (babyHalfAge > 0f) return babyHalfAge; if (babyHalfAge > 0f) return babyHalfAge;
List<LifeStageAge> ages = parent.pawn.def.race.lifeStageAges; List<LifeStageAge> ages = Pawn.def.race.lifeStageAges;
if (ages?.Count > 1) if (ages?.Count > 1)
babyHalfAge = ages[1].minAge / 2; babyHalfAge = ages[1].minAge / 2;
@ -165,8 +165,8 @@ namespace RJW_Menstruation
try try
{ {
if ( if (
!parent.pawn.IsHashIntervalTick(tickInterval) || !Pawn.IsHashIntervalTick(tickInterval) ||
!parent.pawn.Spawned // TODO: Add option to simulate off-map pawns !Pawn.Spawned // TODO: Add option to simulate off-map pawns
) )
{ {
return; return;
@ -177,7 +177,7 @@ namespace RJW_Menstruation
} }
catch (Exception ex) catch (Exception ex)
{ {
Log.Error($"Error processing breasts of {parent.pawn}: {ex}"); Log.Error($"Error processing breasts of {Pawn}: {ex}");
} }
} }
@ -185,14 +185,14 @@ namespace RJW_Menstruation
public override void CompPostPostAdd(DamageInfo? dinfo) public override void CompPostPostAdd(DamageInfo? dinfo)
{ {
if (!loaded) Initialize(); if (!loaded) Initialize();
if (ageOfLastBirth > parent.pawn.ageTracker.AgeChronologicalTicks) ageOfLastBirth = CalculateLastBirth(); // catch transplant issues if (ageOfLastBirth > Pawn.ageTracker.AgeChronologicalTicks) ageOfLastBirth = CalculateLastBirth(); // catch transplant issues
} }
public override void CompPostPostRemoved() public override void CompPostPostRemoved()
{ {
if (parent.pawn.health.hediffSet.hediffs.Contains(parent)) if (Pawn.health.hediffSet.hediffs.Contains(parent))
{ {
Log.Warning($"Attempted to remove breast comp from wrong pawn ({parent.pawn})."); Log.Warning($"Attempted to remove breast comp from wrong pawn ({Pawn}).");
return; return;
} }
base.CompPostPostRemoved(); base.CompPostPostRemoved();
@ -201,23 +201,23 @@ namespace RJW_Menstruation
protected long CalculateLastBirth() protected long CalculateLastBirth()
{ {
long youngestAge = (long)(BabyHalfAge * GenDate.TicksPerYear) * -2; // So a newborn isn't considered a new mother, either long youngestAge = (long)(BabyHalfAge * GenDate.TicksPerYear) * -2; // So a newborn isn't considered a new mother, either
if ((parent.pawn.relations?.ChildrenCount ?? 0) > 0) if ((Pawn.relations?.ChildrenCount ?? 0) > 0)
{ {
foreach (Pawn child in parent.pawn.relations.Children) foreach (Pawn child in Pawn.relations.Children)
{ {
bool isFetus = false; bool isFetus = false;
if (parent.pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().Any(preg => preg.babies.Contains(child))) if (Pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().Any(preg => preg.babies.Contains(child)))
{ {
isFetus = true; isFetus = true;
break; break;
} }
if ( if (
parent.pawn.ageTracker.BirthAbsTicks - child.ageTracker.BirthAbsTicks > ageOfLastBirth && Pawn.ageTracker.BirthAbsTicks - child.ageTracker.BirthAbsTicks > ageOfLastBirth &&
!isFetus && !isFetus &&
child.GetMother() == parent.pawn // Don't do Dad's boobs child.GetMother() == Pawn // Don't do Dad's boobs
) )
youngestAge = parent.pawn.ageTracker.BirthAbsTicks - child.ageTracker.BirthAbsTicks; youngestAge = Pawn.ageTracker.BirthAbsTicks - child.ageTracker.BirthAbsTicks;
} }
} }
return youngestAge; return youngestAge;
@ -254,7 +254,7 @@ namespace RJW_Menstruation
protected void CalculateBreastSize() protected void CalculateBreastSize()
{ {
// Scenario A: the youngest child is less than halfway into babyhood: Full size // Scenario A: the youngest child is less than halfway into babyhood: Full size
if (ageOfLastBirth + BabyHalfAge * GenDate.TicksPerYear > parent.pawn.ageTracker.AgeBiologicalTicks) if (ageOfLastBirth + BabyHalfAge * GenDate.TicksPerYear > Pawn.ageTracker.AgeBiologicalTicks)
{ {
debugGrowthStatus = "Full size due to young child"; debugGrowthStatus = "Full size due to young child";
if (breastSizeIncreased < MaxBreastIncrement) if (breastSizeIncreased < MaxBreastIncrement)
@ -264,9 +264,9 @@ namespace RJW_Menstruation
} }
} }
// Scenario B: Pregnant, grow in the second half of first trimester // Scenario B: Pregnant, grow in the second half of first trimester
else if (parent.pawn.IsRJWPregnant()) else if (Pawn.IsRJWPregnant())
{ {
float pregnancySize = Mathf.InverseLerp(breastGrowthStart, breastGrowthEnd, parent.pawn.GetFarthestPregnancyProgress()) * MaxBreastIncrement; float pregnancySize = Mathf.InverseLerp(breastGrowthStart, breastGrowthEnd, Pawn.GetFarthestPregnancyProgress()) * MaxBreastIncrement;
if (breastSizeIncreased > pregnancySize) if (breastSizeIncreased > pregnancySize)
{ {
debugGrowthStatus = "Shrinking due to being oversize for pregnancy"; debugGrowthStatus = "Shrinking due to being oversize for pregnancy";
@ -298,10 +298,10 @@ namespace RJW_Menstruation
protected void CalculateNipples() protected void CalculateNipples()
{ {
float newNippleProgress; float newNippleProgress;
if (ageOfLastBirth + BabyHalfAge * GenDate.TicksPerYear > parent.pawn.ageTracker.AgeBiologicalTicks) if (ageOfLastBirth + BabyHalfAge * GenDate.TicksPerYear > Pawn.ageTracker.AgeBiologicalTicks)
newNippleProgress = 1f; newNippleProgress = 1f;
else if (parent.pawn.IsRJWPregnant()) else if (Pawn.IsRJWPregnant())
newNippleProgress = nippleTransitions.Evaluate(parent.pawn.GetFarthestPregnancyProgress()); newNippleProgress = nippleTransitions.Evaluate(Pawn.GetFarthestPregnancyProgress());
else else
newNippleProgress = 0f; newNippleProgress = 0f;
@ -353,7 +353,7 @@ namespace RJW_Menstruation
cachedNipple = baseNipple + nippleProgress * nippleChange; cachedNipple = baseNipple + nippleProgress * nippleChange;
// For some reason, Props can go null when RJW relocates the chest (e.g. some animals), so catch that // For some reason, Props can go null when RJW relocates the chest (e.g. some animals), so catch that
cachedColor = Colors.CMYKLerp(parent.pawn.story?.SkinColor ?? Color.white, (Props?.BlackNippleColor ?? CompProperties_Breast.DefaultBlacknippleColor.ToColor), Alpha); cachedColor = Colors.CMYKLerp(Pawn.story?.SkinColor ?? Color.white, (Props?.BlackNippleColor ?? CompProperties_Breast.DefaultBlacknippleColor.ToColor), Alpha);
} }
public void CopyBreastProperties(HediffComp_Breast original) public void CopyBreastProperties(HediffComp_Breast original)

View file

@ -75,7 +75,7 @@ namespace RJW_Menstruation
{ {
get get
{ {
if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) return false; if (Pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) return false;
switch (curStage) switch (curStage)
{ {

View file

@ -124,7 +124,7 @@ namespace RJW_Menstruation
get get
{ {
if (pregnancy == null) return null; if (pregnancy == null) return null;
else if (!parent.pawn.health.hediffSet.hediffs.Contains(pregnancy)) else if (!Pawn.health.hediffSet.hediffs.Contains(pregnancy))
{ {
pregnancy = null; pregnancy = null;
return null; return null;
@ -143,7 +143,7 @@ namespace RJW_Menstruation
float avglittersize; float avglittersize;
try try
{ {
avglittersize = Mathf.Max(Rand.ByCurveAverage(parent.pawn.def.race.litterSizeCurve), 1.0f); avglittersize = Mathf.Max(Rand.ByCurveAverage(Pawn.def.race.litterSizeCurve), 1.0f);
} }
catch catch
{ {
@ -153,7 +153,7 @@ namespace RJW_Menstruation
opcache = (int)(RaceCyclesPerYear() * opcache = (int)(RaceCyclesPerYear() *
avglittersize * avglittersize *
6f * 6f *
(parent.pawn.def.race.lifeExpectancy / ThingDefOf.Human.race.lifeExpectancy)); (Pawn.def.race.lifeExpectancy / ThingDefOf.Human.race.lifeExpectancy));
return opcache; return opcache;
} }
} }
@ -186,7 +186,7 @@ namespace RJW_Menstruation
{ {
get get
{ {
float res = Props.maxCumCapacity * parent.pawn.BodySize; float res = Props.maxCumCapacity * Pawn.BodySize;
if (curStage != Stage.Pregnant || (pregnancy?.Severity ?? 0f) < 0.175f) res *= 500f; if (curStage != Stage.Pregnant || (pregnancy?.Severity ?? 0f) < 0.175f) res *= 500f;
return res; return res;
} }
@ -196,7 +196,7 @@ namespace RJW_Menstruation
{ {
get get
{ {
if (xxx.has_quirk(parent.pawn, "Breeder")) return 0.5f; if (xxx.has_quirk(Pawn, "Breeder")) return 0.5f;
return 1.0f; return 1.0f;
} }
@ -207,8 +207,8 @@ namespace RJW_Menstruation
get get
{ {
float factor = 1.0f; float factor = 1.0f;
if (parent.pawn.Has(Quirk.Breeder)) factor = 10.0f; if (Pawn.Has(Quirk.Breeder)) factor = 10.0f;
return parent.pawn.health.capacities.GetLevel(xxx.reproduction) * Props.baseImplantationChanceFactor * factor; return Pawn.health.capacities.GetLevel(xxx.reproduction) * Props.baseImplantationChanceFactor * factor;
} }
} }
public IEnumerable<string> GetCumsInfo public IEnumerable<string> GetCumsInfo
@ -420,7 +420,7 @@ namespace RJW_Menstruation
{ {
get get
{ {
if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) return false; if (Pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) return false;
switch (curStage) switch (curStage)
{ {
@ -451,7 +451,7 @@ namespace RJW_Menstruation
{ {
try try
{ {
Color c = parent.pawn.def.race.BloodDef.graphicData.color; Color c = Pawn.def.race.BloodDef.graphicData.color;
return c; return c;
} }
catch catch
@ -467,7 +467,7 @@ namespace RJW_Menstruation
{ {
if (breastcache == null) if (breastcache == null)
{ {
breastcache = parent.pawn.GetBreastComp(); breastcache = Pawn.GetBreastComp();
} }
return breastcache; return breastcache;
} }
@ -506,8 +506,8 @@ namespace RJW_Menstruation
// Luteal will appear to progress, hitting the end of the phase when the pregnancy is discovered // Luteal will appear to progress, hitting the end of the phase when the pregnancy is discovered
float discoveryTime = 0.5f; float discoveryTime = 0.5f;
if (parent.pawn.story?.bodyType == BodyTypeDefOf.Thin) discoveryTime = 0.25f; if (Pawn.story?.bodyType == BodyTypeDefOf.Thin) discoveryTime = 0.25f;
else if (parent.pawn.story?.bodyType == BodyTypeDefOf.Female) discoveryTime = 0.35f; else if (Pawn.story?.bodyType == BodyTypeDefOf.Female) discoveryTime = 0.35f;
// Estimated; there's no way to get the exact value after the fact without writing it into the save // Estimated; there's no way to get the exact value after the fact without writing it into the save
float lutealProgressWhenImplanted = Math.Min(0.5f, maxImplantDelayHours / (Props.lutealIntervalDays * 24)); float lutealProgressWhenImplanted = Math.Min(0.5f, maxImplantDelayHours / (Props.lutealIntervalDays * 24));
@ -559,16 +559,16 @@ namespace RJW_Menstruation
try try
{ {
if ( if (
!parent.pawn.IsHashIntervalTick(tickInterval) || !Pawn.IsHashIntervalTick(tickInterval) ||
!parent.pawn.Spawned || // TODO: Add option to simulate off-map pawns !Pawn.Spawned || // TODO: Add option to simulate off-map pawns
(parent.pawn.IsAnimal() && !Configurations.EnableAnimalCycle) (Pawn.IsAnimal() && !Configurations.EnableAnimalCycle)
) )
{ {
return; return;
} }
CumOut(); CumOut();
if (pregnancy == null && parent.pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) curStage = Stage.Young; if (pregnancy == null && Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) curStage = Stage.Young;
switch (curStage) switch (curStage)
{ {
case Stage.Follicular: case Stage.Follicular:
@ -614,7 +614,7 @@ namespace RJW_Menstruation
} }
catch (Exception ex) catch (Exception ex)
{ {
Log.Error($"Error processing womb of {parent.pawn}: {ex}"); Log.Error($"Error processing womb of {Pawn}: {ex}");
} }
} }
@ -622,9 +622,9 @@ namespace RJW_Menstruation
{ {
// If a hediff is removed from a pawn that does not have it, CompPostPostRemoved is still called on the pawn that does. // If a hediff is removed from a pawn that does not have it, CompPostPostRemoved is still called on the pawn that does.
// If it was a legitimate removal, then it won't be in this pawn's hediff list anymore, as that removal occurs first // If it was a legitimate removal, then it won't be in this pawn's hediff list anymore, as that removal occurs first
if (parent.pawn.health.hediffSet.hediffs.Contains(parent)) if (Pawn.health.hediffSet.hediffs.Contains(parent))
{ {
Log.Warning($"Attempted to remove menstruation comp from wrong pawn ({parent.pawn})."); Log.Warning($"Attempted to remove menstruation comp from wrong pawn ({Pawn}).");
return; return;
} }
if (!(pregnancy is Hediff_MechanoidPregnancy)) if (!(pregnancy is Hediff_MechanoidPregnancy))
@ -667,7 +667,7 @@ namespace RJW_Menstruation
public void CumIn(Pawn pawn, float volume, float fertility = 1.0f, ThingDef filthdef = null) public void CumIn(Pawn pawn, float volume, float fertility = 1.0f, ThingDef filthdef = null)
{ {
if (volume <= 0) return; if (volume <= 0) return;
if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) fertility /= 100f; if (Pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) fertility /= 100f;
float cumd = TotalCumPercent; float cumd = TotalCumPercent;
float tmp = TotalCum + volume; float tmp = TotalCum + volume;
if (tmp > CumCapacity) if (tmp > CumCapacity)
@ -701,7 +701,7 @@ namespace RJW_Menstruation
} }
cumd = TotalCumPercent - cumd; cumd = TotalCumPercent - cumd;
parent.pawn.records.AddTo(VariousDefOf.AmountofCreampied, volume); Pawn.records.AddTo(VariousDefOf.AmountofCreampied, volume);
AfterCumIn(pawn); AfterCumIn(pawn);
AfterFluidIn(cumd); AfterFluidIn(cumd);
} }
@ -777,13 +777,13 @@ namespace RJW_Menstruation
protected void BeforeCumOut(out Absorber absorber) protected void BeforeCumOut(out Absorber absorber)
{ {
Hediff asa = parent.pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_ASA); Hediff asa = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_ASA);
float asafactor = asa?.Severity ?? 0f; float asafactor = asa?.Severity ?? 0f;
if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) antisperm = 0.70f + asafactor; if (Pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) antisperm = 0.70f + asafactor;
else antisperm = 0.0f + asafactor; else antisperm = 0.0f + asafactor;
absorber = (Absorber)parent.pawn.apparel?.WornApparel?.Find(x => x is Absorber); absorber = (Absorber)Pawn.apparel?.WornApparel?.Find(x => x is Absorber);
if (absorber != null) if (absorber != null)
{ {
absorber.WearEffect(); absorber.WearEffect();
@ -796,7 +796,7 @@ namespace RJW_Menstruation
/// </summary> /// </summary>
protected virtual void AfterCumOut() protected virtual void AfterCumOut()
{ {
parent.pawn.needs?.mood?.thoughts?.memories?.TryGainMemory(VariousDefOf.LeakingFluids); Pawn.needs?.mood?.thoughts?.memories?.TryGainMemory(VariousDefOf.LeakingFluids);
} }
/// <summary> /// <summary>
@ -822,13 +822,13 @@ namespace RJW_Menstruation
List<string> filthlabels = new List<string>(); List<string> filthlabels = new List<string>();
BeforeCumOut(out Absorber absorber); BeforeCumOut(out Absorber absorber);
if (cums.NullOrEmpty()) return; if (cums.NullOrEmpty()) return;
if (TotalCum > Props.maxCumCapacity * parent.pawn.BodySize) leakfactor = Math.Min(1 + (TotalCum - Props.maxCumCapacity * parent.pawn.BodySize) / 10, 2f); if (TotalCum > Props.maxCumCapacity * Pawn.BodySize) leakfactor = Math.Min(1 + (TotalCum - Props.maxCumCapacity * Pawn.BodySize) / 10, 2f);
if (absorber != null && absorber.dirty && !absorber.LeakAfterDirty) leakfactor = 0f; if (absorber != null && absorber.dirty && !absorber.LeakAfterDirty) leakfactor = 0f;
if (parent.pawn.jobs?.curJob?.def == xxx.knotted) leakfactor = 0f; if (Pawn.jobs?.curJob?.def == xxx.knotted) leakfactor = 0f;
List<Cum> removecums = new List<Cum>(); List<Cum> removecums = new List<Cum>();
foreach (Cum cum in cums) foreach (Cum cum in cums)
{ {
cum.CumEffects(parent.pawn); cum.CumEffects(Pawn);
float vd = cum.DismishNatural(leakfactor, antisperm); float vd = cum.DismishNatural(leakfactor, antisperm);
cum.MakeThinner(Configurations.CycleAcceleration); cum.MakeThinner(Configurations.CycleAcceleration);
totalleak += AbsorbCum(vd, absorber); totalleak += AbsorbCum(vd, absorber);
@ -913,7 +913,7 @@ namespace RJW_Menstruation
cums.Remove(cum); cums.Remove(cum);
} }
removecums.Clear(); removecums.Clear();
return new CumMixture(parent.pawn, totalleak, cumlabels, color, mixtureDef, pure); return new CumMixture(Pawn, totalleak, cumlabels, color, mixtureDef, pure);
} }
/// <summary> /// <summary>
@ -959,7 +959,7 @@ namespace RJW_Menstruation
if (cycleVariability < 0f) cycleVariability = MenstruationUtility.RandomVariabilityPercent(); if (cycleVariability < 0f) cycleVariability = MenstruationUtility.RandomVariabilityPercent();
if (currentIntervalHours < 0) if (currentIntervalHours < 0)
{ {
if (parent.pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) curStage = Stage.Young; if (Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) curStage = Stage.Young;
else if (!IsBreedingSeason()) curStage = Stage.Anestrus; else if (!IsBreedingSeason()) curStage = Stage.Anestrus;
else curStage = RandomStage(); else curStage = RandomStage();
if (curStage == Stage.Follicular) if (curStage == Stage.Follicular)
@ -979,7 +979,7 @@ namespace RJW_Menstruation
if (pregnancy == null) if (pregnancy == null)
{ {
// If this womb isn't marked pregnant, search for pregnancies that have no womb and claim one // If this womb isn't marked pregnant, search for pregnancies that have no womb and claim one
foreach (Hediff_BasePregnancy preg in parent.pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>()) foreach (Hediff_BasePregnancy preg in Pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>())
{ {
if (preg.GetMenstruationComp() == null) if (preg.GetMenstruationComp() == null)
{ {
@ -991,7 +991,7 @@ namespace RJW_Menstruation
} }
} }
//Log.Message(parent.pawn.Label + " - Initialized menstruation comp"); //Log.Message(Pawn.Label + " - Initialized menstruation comp");
loaded = true; loaded = true;
} }
@ -1017,19 +1017,18 @@ namespace RJW_Menstruation
public int GetOvaryPowerByAge() public int GetOvaryPowerByAge()
{ {
Pawn pawn = parent.pawn;
float avglittersize; float avglittersize;
try try
{ {
avglittersize = Mathf.Max(Rand.ByCurveAverage(pawn.def.race.litterSizeCurve), 1.0f); avglittersize = Mathf.Max(Rand.ByCurveAverage(Pawn.def.race.litterSizeCurve), 1.0f);
} }
catch (NullReferenceException) catch (NullReferenceException)
{ {
avglittersize = 1.0f; avglittersize = 1.0f;
} }
float fertStartAge = pawn.RaceProps.lifeStageAges?.Find(stage => stage.def.reproductive)?.minAge ?? 0.0f; float fertStartAge = Pawn.RaceProps.lifeStageAges?.Find(stage => stage.def.reproductive)?.minAge ?? 0.0f;
float fertEndAge = pawn.RaceProps.lifeExpectancy * (pawn.IsAnimal() ? RJWPregnancySettings.fertility_endage_female_animal : RJWPregnancySettings.fertility_endage_female_humanlike); float fertEndAge = Pawn.RaceProps.lifeExpectancy * (Pawn.IsAnimal() ? RJWPregnancySettings.fertility_endage_female_animal : RJWPregnancySettings.fertility_endage_female_humanlike);
if (fertEndAge < fertStartAge) fertEndAge = fertStartAge; if (fertEndAge < fertStartAge) fertEndAge = fertStartAge;
float raceCyclesPerYear = RaceCyclesPerYear(); float raceCyclesPerYear = RaceCyclesPerYear();
@ -1037,7 +1036,7 @@ namespace RJW_Menstruation
int lifetimeEggs = (int)(lifetimeCycles * avglittersize * Utility.RandGaussianLike(0.70f, 1.30f, 5)); int lifetimeEggs = (int)(lifetimeCycles * avglittersize * Utility.RandGaussianLike(0.70f, 1.30f, 5));
float pawnCyclesPerYear = raceCyclesPerYear * cycleSpeed; float pawnCyclesPerYear = raceCyclesPerYear * cycleSpeed;
float pawnCyclesElapsed = Mathf.Max((pawn.ageTracker.AgeBiologicalYearsFloat - fertStartAge) * pawnCyclesPerYear, 0.0f); float pawnCyclesElapsed = Mathf.Max((Pawn.ageTracker.AgeBiologicalYearsFloat - fertStartAge) * pawnCyclesPerYear, 0.0f);
int pawnEggsUsed = PawnEggsUsed(pawnCyclesElapsed, avglittersize); int pawnEggsUsed = PawnEggsUsed(pawnCyclesElapsed, avglittersize);
return Math.Max(lifetimeEggs - pawnEggsUsed, 0); return Math.Max(lifetimeEggs - pawnEggsUsed, 0);
@ -1054,16 +1053,16 @@ namespace RJW_Menstruation
ovarypower = GetOvaryPowerByAge(); ovarypower = GetOvaryPowerByAge();
if (ovarypower < 1) if (ovarypower < 1)
{ {
Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Menopause, parent.pawn); Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Menopause, Pawn);
hediff.Severity = 0.2f; hediff.Severity = 0.2f;
parent.pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(parent.pawn)); Pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(Pawn));
curStage = Stage.Young; curStage = Stage.Young;
} }
else if (ovarypower < OvaryPowerThreshold) else if (ovarypower < OvaryPowerThreshold)
{ {
Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Climacteric, parent.pawn); Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Climacteric, Pawn);
hediff.Severity = Mathf.InverseLerp(OvaryPowerThreshold, 0, ovarypower); hediff.Severity = Mathf.InverseLerp(OvaryPowerThreshold, 0, ovarypower);
parent.pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(parent.pawn)); Pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(Pawn));
} }
} }
} }
@ -1082,7 +1081,7 @@ namespace RJW_Menstruation
{ {
if (Configurations.EnableMenopause && ovarypower < OvaryPowerThreshold) if (Configurations.EnableMenopause && ovarypower < OvaryPowerThreshold)
{ {
if (sexNeed == null) sexNeed = parent.pawn.needs.TryGetNeed(VariousDefOf.SexNeed); if (sexNeed == null) sexNeed = Pawn.needs.TryGetNeed(VariousDefOf.SexNeed);
else else
{ {
if (sexNeed.CurLevel < 0.5) sexNeed.CurLevel += 0.01f; if (sexNeed.CurLevel < 0.5) sexNeed.CurLevel += 0.01f;
@ -1093,16 +1092,16 @@ namespace RJW_Menstruation
public void SetEstrus(int days) public void SetEstrus(int days)
{ {
HediffDef estrusdef = Props.concealedEstrus ? VariousDefOf.Hediff_Estrus_Concealed : VariousDefOf.Hediff_Estrus; HediffDef estrusdef = Props.concealedEstrus ? VariousDefOf.Hediff_Estrus_Concealed : VariousDefOf.Hediff_Estrus;
Hediff hediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(estrusdef); Hediff hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(estrusdef);
if (Props.concealedEstrus) if (Props.concealedEstrus)
{ {
if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.Hediff_Estrus)) return; if (Pawn.health.hediffSet.HasHediff(VariousDefOf.Hediff_Estrus)) return;
} }
else else
{ {
Hediff concealedHediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Estrus_Concealed); Hediff concealedHediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Estrus_Concealed);
if (concealedHediff != null) parent.pawn.health.RemoveHediff(concealedHediff); if (concealedHediff != null) Pawn.health.RemoveHediff(concealedHediff);
} }
if (hediff != null) if (hediff != null)
@ -1111,9 +1110,9 @@ namespace RJW_Menstruation
} }
else else
{ {
hediff = HediffMaker.MakeHediff(estrusdef, parent.pawn); hediff = HediffMaker.MakeHediff(estrusdef, Pawn);
hediff.Severity = (float)days / Configurations.CycleAcceleration + 0.2f; hediff.Severity = (float)days / Configurations.CycleAcceleration + 0.2f;
parent.pawn.health.AddHediff(hediff); Pawn.health.AddHediff(hediff);
} }
} }
@ -1121,7 +1120,7 @@ namespace RJW_Menstruation
{ {
if (Props.breedingSeason == SeasonalBreed.Always) return true; if (Props.breedingSeason == SeasonalBreed.Always) return true;
int tile = parent.pawn.Tile; int tile = Pawn.Tile;
if (tile < 0) tile = Find.AnyPlayerHomeMap?.Tile ?? -1; if (tile < 0) tile = Find.AnyPlayerHomeMap?.Tile ?? -1;
if (tile < 0) return true; if (tile < 0) return true;
switch (GenLocalDate.Season(tile)) switch (GenLocalDate.Season(tile))
@ -1144,7 +1143,7 @@ namespace RJW_Menstruation
protected Pawn Fertilize() protected Pawn Fertilize()
{ {
if (cums.NullOrEmpty()) return null; if (cums.NullOrEmpty()) return null;
List<Cum> eligibleCum = cums.FindAll(cum => !cum.notcum && cum.FertVolume > 0 && cum.pawn != null && (RJWPregnancySettings.bestial_pregnancy_enabled || xxx.is_animal(parent.pawn) == xxx.is_animal(cum.pawn))); List<Cum> eligibleCum = cums.FindAll(cum => !cum.notcum && cum.FertVolume > 0 && cum.pawn != null && (RJWPregnancySettings.bestial_pregnancy_enabled || xxx.is_animal(Pawn) == xxx.is_animal(cum.pawn)));
if (eligibleCum.Count == 0) return null; if (eligibleCum.Count == 0) return null;
float totalFertPower = eligibleCum.Sum(cum => cum.FertVolume); float totalFertPower = eligibleCum.Sum(cum => cum.FertVolume);
@ -1152,7 +1151,7 @@ namespace RJW_Menstruation
if (Rand.Range(0.0f, 1.0f) > 1.0f - Mathf.Pow(1.0f - Configurations.FertilizeChance, totalFertPower * Props.basefertilizationChanceFactor)) if (Rand.Range(0.0f, 1.0f) > 1.0f - Mathf.Pow(1.0f - Configurations.FertilizeChance, totalFertPower * Props.basefertilizationChanceFactor))
return null; return null;
parent.pawn.records.AddTo(VariousDefOf.AmountofFertilizedEggs, 1); Pawn.records.AddTo(VariousDefOf.AmountofFertilizedEggs, 1);
float selection = Rand.Range(0.0f, totalFertPower); float selection = Rand.Range(0.0f, totalFertPower);
foreach (Cum cum in eligibleCum) foreach (Cum cum in eligibleCum)
@ -1183,7 +1182,7 @@ namespace RJW_Menstruation
deadeggs.Add(egg); deadeggs.Add(egg);
continue; continue;
} }
else if (parent.pawn.health.hediffSet.GetHediffs<Hediff_InsectEgg>().Any() || pregnancy is Hediff_MechanoidPregnancy) else if (Pawn.health.hediffSet.GetHediffs<Hediff_InsectEgg>().Any() || pregnancy is Hediff_MechanoidPregnancy)
{ {
deadeggs.Add(egg); deadeggs.Add(egg);
continue; continue;
@ -1196,7 +1195,7 @@ namespace RJW_Menstruation
{ {
if (pregnancy is Hediff_MultiplePregnancy h) if (pregnancy is Hediff_MultiplePregnancy h)
{ {
h.AddNewBaby(parent.pawn, egg.fertilizer); h.AddNewBaby(Pawn, egg.fertilizer);
} }
pregnant = true; pregnant = true;
deadeggs.Add(egg); deadeggs.Add(egg);
@ -1211,15 +1210,15 @@ namespace RJW_Menstruation
{ {
if (!Configurations.UseMultiplePregnancy) if (!Configurations.UseMultiplePregnancy)
{ {
PregnancyHelper.PregnancyDecider(parent.pawn, egg.fertilizer); PregnancyHelper.PregnancyDecider(Pawn, egg.fertilizer);
// I hate having to do this, but it gets the newest pregnancy // I hate having to do this, but it gets the newest pregnancy
pregnancy = parent.pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().MaxBy(hediff => hediff.loadID); pregnancy = Pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().MaxBy(hediff => hediff.loadID);
pregnant = true; pregnant = true;
break; break;
} }
else else
{ {
pregnancy = Hediff_BasePregnancy.Create<Hediff_MultiplePregnancy>(parent.pawn, egg.fertilizer); pregnancy = Hediff_BasePregnancy.Create<Hediff_MultiplePregnancy>(Pawn, egg.fertilizer);
pregnant = true; pregnant = true;
deadeggs.Add(egg); deadeggs.Add(egg);
} }
@ -1248,7 +1247,7 @@ namespace RJW_Menstruation
protected void BleedOut() protected void BleedOut()
{ {
CumIn(parent.pawn, Rand.Range(0.02f * Configurations.BleedingAmount, 0.04f * Configurations.BleedingAmount), Translations.Menstrual_Blood, -5.0f, parent.pawn.def.race?.BloodDef ?? ThingDefOf.Filth_Blood); CumIn(Pawn, Rand.Range(0.02f * Configurations.BleedingAmount, 0.04f * Configurations.BleedingAmount), Translations.Menstrual_Blood, -5.0f, Pawn.def.race?.BloodDef ?? ThingDefOf.Filth_Blood);
Cum blood = GetNotCum(Translations.Menstrual_Blood); Cum blood = GetNotCum(Translations.Menstrual_Blood);
if (blood != null) blood.Color = BloodColor; if (blood != null) blood.Color = BloodColor;
} }
@ -1260,8 +1259,8 @@ namespace RJW_Menstruation
/// <param name="amount"></param> /// <param name="amount"></param>
protected void MakeCumFilth(Cum cum, float amount) protected void MakeCumFilth(Cum cum, float amount)
{ {
if (parent.pawn.Map == null) return; if (Pawn.Map == null) return;
if (amount >= minmakefilthvalue) FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn?.LabelShort ?? "Unknown"); if (amount >= minmakefilthvalue) FilthMaker.TryMakeFilth(Pawn.Position, Pawn.Map, cum.FilthDef, cum.pawn?.LabelShort ?? "Unknown");
} }
/// <summary> /// <summary>
@ -1276,7 +1275,7 @@ namespace RJW_Menstruation
if (absorber == null) if (absorber == null)
{ {
//if (amount >= minmakefilthvalue) FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn.LabelShort); //if (amount >= minmakefilthvalue) FilthMaker.TryMakeFilth(Pawn.Position, Pawn.Map, cum.FilthDef, cum.pawn.LabelShort);
return amount; return amount;
} }
@ -1284,11 +1283,11 @@ namespace RJW_Menstruation
absorber.SetColor(Colors.CMYKLerp(GetCumMixtureColor, absorber.DrawColor, 1f - amount / absorbable)); absorber.SetColor(Colors.CMYKLerp(GetCumMixtureColor, absorber.DrawColor, 1f - amount / absorbable));
if (absorber.dirty) if (absorber.dirty)
{ {
//if (absorber.LeakAfterDirty) FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn.LabelShort); //if (absorber.LeakAfterDirty) FilthMaker.TryMakeFilth(Pawn.Position, Pawn.Map, cum.FilthDef, cum.pawn.LabelShort);
return amount; return amount;
} }
absorber.absorbedfluids += amount; absorber.absorbedfluids += amount;
if (absorber.absorbedfluids > absorbable && !parent.pawn.apparel.IsLocked(absorber)) if (absorber.absorbedfluids > absorbable && !Pawn.apparel.IsLocked(absorber))
{ {
absorber.def = absorber.DirtyDef; absorber.def = absorber.DirtyDef;
//absorber.fluidColor = GetCumMixtureColor; //absorber.fluidColor = GetCumMixtureColor;
@ -1299,10 +1298,10 @@ namespace RJW_Menstruation
protected float MakeCumFilthMixture(float amount, List<string> cumlabels) protected float MakeCumFilthMixture(float amount, List<string> cumlabels)
{ {
if (parent.pawn.Map == null) return 0; if (Pawn.Map == null) return 0;
if (amount >= minmakefilthvalue) if (amount >= minmakefilthvalue)
{ {
FilthMaker_Colored.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, VariousDefOf.FilthMixture, cumlabels, GetCumMixtureColor, false); FilthMaker_Colored.TryMakeFilth(Pawn.Position, Pawn.Map, VariousDefOf.FilthMixture, cumlabels, GetCumMixtureColor, false);
} }
return amount; return amount;
} }
@ -1335,11 +1334,11 @@ namespace RJW_Menstruation
protected void AddCrampPain() protected void AddCrampPain()
{ {
Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_MenstrualCramp, parent.pawn); Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_MenstrualCramp, Pawn);
hediff.Severity = crampPain * Rand.Range(0.9f, 1.1f); hediff.Severity = crampPain * Rand.Range(0.9f, 1.1f);
HediffCompProperties_SeverityPerDay Prop = (HediffCompProperties_SeverityPerDay)hediff.TryGetComp<HediffComp_SeverityPerDay>().props; HediffCompProperties_SeverityPerDay Prop = (HediffCompProperties_SeverityPerDay)hediff.TryGetComp<HediffComp_SeverityPerDay>().props;
Prop.severityPerDay = -hediff.Severity / (currentIntervalHours / 24) * Configurations.CycleAcceleration; Prop.severityPerDay = -hediff.Severity / (currentIntervalHours / 24) * Configurations.CycleAcceleration;
parent.pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(parent.pawn)); Pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(Pawn));
} }
protected virtual void FollicularAction(bool climacteric) protected virtual void FollicularAction(bool climacteric)
@ -1383,7 +1382,7 @@ namespace RJW_Menstruation
float eggnum; float eggnum;
try try
{ {
eggnum = Rand.ByCurve(parent.pawn.def.race.litterSizeCurve); eggnum = Rand.ByCurve(Pawn.def.race.litterSizeCurve);
} }
catch (NullReferenceException) catch (NullReferenceException)
{ {
@ -1391,7 +1390,7 @@ namespace RJW_Menstruation
} }
catch (ArgumentException e) catch (ArgumentException e)
{ {
Log.Warning($"Invalid litterSizeCurve for {parent.pawn.def}: {e}"); Log.Warning($"Invalid litterSizeCurve for {Pawn.def}: {e}");
eggnum = 1; eggnum = 1;
} }
eggnum += eggstack; eggnum += eggstack;
@ -1406,19 +1405,19 @@ namespace RJW_Menstruation
if (Configurations.EnableMenopause && ovarypower < 1) if (Configurations.EnableMenopause && ovarypower < 1)
{ {
eggs.Clear(); eggs.Clear();
Hediff hediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Climacteric); Hediff hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Climacteric);
if (hediff != null) parent.pawn.health.RemoveHediff(hediff); if (hediff != null) Pawn.health.RemoveHediff(hediff);
hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Menopause, parent.pawn); hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Menopause, Pawn);
hediff.Severity = 0.2f; hediff.Severity = 0.2f;
parent.pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(parent.pawn)); Pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(Pawn));
ovarypower = 0; ovarypower = 0;
GoNextStage(Stage.Young); GoNextStage(Stage.Young);
} }
else if (Configurations.EnableMenopause && ovarypower < OvaryPowerThreshold) else if (Configurations.EnableMenopause && ovarypower < OvaryPowerThreshold)
{ {
Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Climacteric, parent.pawn); Hediff hediff = HediffMaker.MakeHediff(VariousDefOf.Hediff_Climacteric, Pawn);
hediff.Severity = Mathf.InverseLerp(OvaryPowerThreshold, 0, ovarypower); hediff.Severity = Mathf.InverseLerp(OvaryPowerThreshold, 0, ovarypower);
parent.pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(parent.pawn)); Pawn.health.AddHediff(hediff, Genital_Helper.get_genitalsBPR(Pawn));
GoNextStage(Stage.ClimactericLuteal); GoNextStage(Stage.ClimactericLuteal);
} }
else else
@ -1485,8 +1484,8 @@ namespace RJW_Menstruation
} }
else if (curStageHrs >= currentIntervalHours) else if (curStageHrs >= currentIntervalHours)
{ {
Hediff hediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_MenstrualCramp); Hediff hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_MenstrualCramp);
if (hediff != null) parent.pawn.health.RemoveHediff(hediff); if (hediff != null) Pawn.health.RemoveHediff(hediff);
int totalFollicularHours = PeriodRandomizer(climacteric ? Stage.ClimactericFollicular : Stage.Follicular, climacteric ? 6.0f : 1.0f); // The total amount of time for both bleeding and follicular int totalFollicularHours = PeriodRandomizer(climacteric ? Stage.ClimactericFollicular : Stage.Follicular, climacteric ? 6.0f : 1.0f); // 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(climacteric); GoOvulatoryStage(climacteric);
@ -1513,7 +1512,7 @@ namespace RJW_Menstruation
Implant(); Implant();
} }
if (parent.pawn.health.hediffSet.hediffs.Contains(pregnancy)) if (Pawn.health.hediffSet.hediffs.Contains(pregnancy))
{ {
curStageHrs += 1; curStageHrs += 1;
StayCurrentStageConst(Stage.Pregnant); StayCurrentStageConst(Stage.Pregnant);
@ -1533,7 +1532,7 @@ namespace RJW_Menstruation
{ {
GoNextStage(Stage.ClimactericFollicular); GoNextStage(Stage.ClimactericFollicular);
} }
else if (parent.pawn.health.capacities.GetLevel(xxx.reproduction) == 0) else if (Pawn.health.capacities.GetLevel(xxx.reproduction) == 0)
{ {
GoNextStage(Stage.Young); GoNextStage(Stage.Young);
} }
@ -1555,7 +1554,7 @@ namespace RJW_Menstruation
{ {
RemoveClimactericEffect(); RemoveClimactericEffect();
} }
if (parent.pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) if (Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0)
{ {
StayCurrentStageConst(Stage.Young); StayCurrentStageConst(Stage.Young);
} }
@ -1580,54 +1579,54 @@ namespace RJW_Menstruation
protected virtual void ThoughtCumInside(Pawn cummer) protected virtual void ThoughtCumInside(Pawn cummer)
{ {
if (!xxx.is_human(parent.pawn) || !xxx.is_human(cummer)) return; if (!xxx.is_human(Pawn) || !xxx.is_human(cummer)) return;
if ((cummer.Has(Quirk.Teratophile) != (parent.pawn.GetStatValue(StatDefOf.PawnBeauty) >= 0)) || if ((cummer.Has(Quirk.Teratophile) != (Pawn.GetStatValue(StatDefOf.PawnBeauty) >= 0)) ||
cummer.Has(Quirk.ImpregnationFetish) || cummer.Has(Quirk.ImpregnationFetish) ||
cummer.Has(Quirk.Breeder)) cummer.Has(Quirk.Breeder))
{ {
if (cummer.relations.OpinionOf(parent.pawn) <= -25) if (cummer.relations.OpinionOf(Pawn) <= -25)
{ {
cummer.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideM, parent.pawn); cummer.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideM, Pawn);
} }
else else
{ {
cummer.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideM, parent.pawn); cummer.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideM, Pawn);
} }
} }
if (IsDangerDay) if (IsDangerDay)
{ {
if (parent.pawn.Has(Quirk.Breeder) || parent.pawn.Has(Quirk.ImpregnationFetish)) if (Pawn.Has(Quirk.Breeder) || Pawn.Has(Quirk.ImpregnationFetish))
{ {
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFFetish, cummer); Pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFFetish, cummer);
} }
else if (parent.pawn.relations.OpinionOf(cummer) <= -5) else if (Pawn.relations.OpinionOf(cummer) <= -5)
{ {
parent.pawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(VariousDefOf.CameInsideF, cummer); Pawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(VariousDefOf.CameInsideF, cummer);
parent.pawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(VariousDefOf.HaterCameInsideFEstrus, cummer); Pawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(VariousDefOf.HaterCameInsideFEstrus, cummer);
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideF, cummer); Pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideF, cummer);
} }
else if (parent.pawn.IsInEstrus() && parent.pawn.relations.OpinionOf(cummer) < RJWHookupSettings.MinimumRelationshipToHookup) else if (Pawn.IsInEstrus() && Pawn.relations.OpinionOf(cummer) < RJWHookupSettings.MinimumRelationshipToHookup)
{ {
parent.pawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(VariousDefOf.CameInsideF, cummer); Pawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(VariousDefOf.CameInsideF, cummer);
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideFEstrus, cummer); Pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideFEstrus, cummer);
} }
else if (!parent.pawn.relations.DirectRelationExists(PawnRelationDefOf.Spouse, cummer) && !parent.pawn.relations.DirectRelationExists(PawnRelationDefOf.Fiance, cummer)) else if (!Pawn.relations.DirectRelationExists(PawnRelationDefOf.Spouse, cummer) && !Pawn.relations.DirectRelationExists(PawnRelationDefOf.Fiance, cummer))
{ {
if (parent.pawn.health.capacities.GetLevel(xxx.reproduction) < 0.50f) parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFLowFert, cummer); if (Pawn.health.capacities.GetLevel(xxx.reproduction) < 0.50f) Pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFLowFert, cummer);
else parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideF, cummer); else Pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideF, cummer);
} }
} }
else else
{ {
if (parent.pawn.Has(Quirk.Breeder) || parent.pawn.Has(Quirk.ImpregnationFetish)) if (Pawn.Has(Quirk.Breeder) || Pawn.Has(Quirk.ImpregnationFetish))
{ {
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFFetishSafe, cummer); Pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFFetishSafe, cummer);
} }
else if (parent.pawn.relations.OpinionOf(cummer) <= -5) else if (Pawn.relations.OpinionOf(cummer) <= -5)
{ {
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideFSafe, cummer); Pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideFSafe, cummer);
} }
} }
} }
@ -1635,11 +1634,11 @@ namespace RJW_Menstruation
protected virtual void TaleCumInside(Pawn cummer) protected virtual void TaleCumInside(Pawn cummer)
{ {
// Only make the tale for human-on-human, consentual sex. Otherwise the art just gets too hard to phrase properly // Only make the tale for human-on-human, consentual sex. Otherwise the art just gets too hard to phrase properly
if (!xxx.is_human(parent.pawn) || !xxx.is_human(cummer) || parent.pawn == cummer) return; if (!xxx.is_human(Pawn) || !xxx.is_human(cummer) || Pawn == cummer) return;
if (parent.pawn.CurJobDef != xxx.casual_sex && parent.pawn.CurJobDef != xxx.gettin_loved) return; if (Pawn.CurJobDef != xxx.casual_sex && Pawn.CurJobDef != xxx.gettin_loved) return;
if (!(parent.pawn.IsColonist || parent.pawn.IsPrisonerOfColony) && !(cummer.IsColonist || cummer.IsPrisonerOfColony)) return; if (!(Pawn.IsColonist || Pawn.IsPrisonerOfColony) && !(cummer.IsColonist || cummer.IsPrisonerOfColony)) return;
if (!IsDangerDay) return; if (!IsDangerDay) return;
TaleRecorder.RecordTale(VariousDefOf.TaleCameInside, new object[] { cummer, parent.pawn }); TaleRecorder.RecordTale(VariousDefOf.TaleCameInside, new object[] { cummer, Pawn });
} }
protected void GoNextStage(Stage nextstage, bool calculateHours = true) protected void GoNextStage(Stage nextstage, bool calculateHours = true)
@ -1680,10 +1679,10 @@ namespace RJW_Menstruation
protected void RemoveClimactericEffect() protected void RemoveClimactericEffect()
{ {
Hediff hediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Climacteric); Hediff hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Climacteric);
if (hediff != null) parent.pawn.health.RemoveHediff(hediff); if (hediff != null) Pawn.health.RemoveHediff(hediff);
hediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Menopause); hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Menopause);
if (hediff != null) parent.pawn.health.RemoveHediff(hediff); if (hediff != null) Pawn.health.RemoveHediff(hediff);
if (curStage == Stage.ClimactericBleeding) curStage = Stage.Bleeding; if (curStage == Stage.ClimactericBleeding) curStage = Stage.Bleeding;
else if (curStage == Stage.ClimactericFollicular) curStage = Stage.Follicular; else if (curStage == Stage.ClimactericFollicular) curStage = Stage.Follicular;
else if (curStage == Stage.ClimactericLuteal) curStage = Stage.Luteal; else if (curStage == Stage.ClimactericLuteal) curStage = Stage.Luteal;
@ -1714,10 +1713,10 @@ namespace RJW_Menstruation
protected float InterspeciesImplantFactor(Pawn fertilizer) protected float InterspeciesImplantFactor(Pawn fertilizer)
{ {
if (fertilizer.def.defName == parent.pawn.def.defName) return 1.0f; if (fertilizer.def.defName == Pawn.def.defName) return 1.0f;
else else
{ {
if (RJWPregnancySettings.complex_interspecies) return SexUtility.BodySimilarity(parent.pawn, fertilizer); if (RJWPregnancySettings.complex_interspecies) return SexUtility.BodySimilarity(Pawn, fertilizer);
else return RJWPregnancySettings.interspecies_impregnation_modifier; else return RJWPregnancySettings.interspecies_impregnation_modifier;
} }
} }