Cut down on some indentation, remove whitespace here and there

This commit is contained in:
lutepickle 2022-07-11 08:21:42 -07:00
parent f585499871
commit 6ec27b6aba
10 changed files with 398 additions and 527 deletions

View file

@ -61,23 +61,20 @@ namespace RJW_Menstruation
{ {
get get
{ {
if (DNAcache != null) return DNAcache;
try
{
DNAcache = pawn.def.GetModExtension<PawnDNAModExtension>();
}
catch (NullReferenceException)
{
DNAcache = ThingDefOf.Human.GetModExtension<PawnDNAModExtension>();
}
if (DNAcache == null) if (DNAcache == null)
{ {
try DNAcache = ThingDefOf.Human.GetModExtension<PawnDNAModExtension>();
{
DNAcache = pawn.def.GetModExtension<PawnDNAModExtension>();
}
catch (NullReferenceException)
{
DNAcache = ThingDefOf.Human.GetModExtension<PawnDNAModExtension>();
}
if (DNAcache == null)
{
DNAcache = ThingDefOf.Human.GetModExtension<PawnDNAModExtension>();
}
return DNAcache;
} }
else return DNAcache; return DNAcache;
} }
} }
protected PawnDNAModExtension DNAcache = null; protected PawnDNAModExtension DNAcache = null;
@ -225,14 +222,13 @@ namespace RJW_Menstruation
public void CumEffects(Pawn pawn) public void CumEffects(Pawn pawn)
{ {
if (!notcum && DNA != null && volume >= 1.0f) if (notcum || DNA == null || volume < 1.0f) return;
{
List<IngestionOutcomeDoer> doers = DNA.ingestionOutcomeDoers;
if (!doers.NullOrEmpty()) for (int i = 0; i < doers.Count; i++) List<IngestionOutcomeDoer> doers = DNA.ingestionOutcomeDoers;
{
doers[i].DoIngestionOutcome(pawn, CumThing); if (!doers.NullOrEmpty()) for (int i = 0; i < doers.Count; i++)
} {
doers[i].DoIngestionOutcome(pawn, CumThing);
} }
} }
@ -240,8 +236,6 @@ namespace RJW_Menstruation
{ {
if (volume < 0.01f) volume = 0f; if (volume < 0.01f) volume = 0f;
} }
} }
public class CumMixture : Cum, IDisposable public class CumMixture : Cum, IDisposable
@ -282,16 +276,11 @@ namespace RJW_Menstruation
{ {
string res = ""; string res = "";
if (!cums.NullOrEmpty()) for(int i=0; i<cums.Count; i++) if (!cums.NullOrEmpty()) for(int i=0; i<cums.Count; i++)
{ {
res += cums[i]; res += cums[i];
if (i < cums.Count - 1) res += ", "; if (i < cums.Count - 1) res += ", ";
} }
return res; return res;
} }
} }
} }

View file

@ -94,21 +94,15 @@ namespace RJW_Menstruation
x.def == VariousDefOf.CameInsideF x.def == VariousDefOf.CameInsideF
|| x.def == VariousDefOf.CameInsideFFetish || x.def == VariousDefOf.CameInsideFFetish
|| x.def == VariousDefOf.HaterCameInsideF); || x.def == VariousDefOf.HaterCameInsideF);
if (!memories.NullOrEmpty()) if (memories.NullOrEmpty()) return;
foreach (Thought_Memory m in memories)
{ {
foreach (Thought_Memory m in memories) if (m.def == VariousDefOf.HaterCameInsideF) m.moodPowerFactor = 0.5f;
{ else m.moodPowerFactor = 0.3f;
if (m.def == VariousDefOf.HaterCameInsideF) m.moodPowerFactor = 0.5f;
else m.moodPowerFactor = 0.3f;
}
if (pawn.Has(Quirk.Breeder)) pawn.needs.mood.thoughts.memories.TryGainMemoryFast(VariousDefOf.HateTookContraceptivePill);
else pawn.needs.mood.thoughts.memories.TryGainMemoryFast(VariousDefOf.TookContraceptivePill);
} }
if (pawn.Has(Quirk.Breeder)) pawn.needs.mood.thoughts.memories.TryGainMemoryFast(VariousDefOf.HateTookContraceptivePill);
else pawn.needs.mood.thoughts.memories.TryGainMemoryFast(VariousDefOf.TookContraceptivePill);
} }
} }
} }

View file

@ -201,12 +201,12 @@ namespace RJW_Menstruation
{ {
get get
{ {
if (!cums.NullOrEmpty()) foreach (Cum cum in cums) if (cums.NullOrEmpty()) yield return Translations.Info_noCum;
{ else foreach (Cum cum in cums)
if (!cum.notcum) yield return String.Format(cum.pawn?.Label + ": {0:0.##}ml", cum.Volume); {
else yield return String.Format(cum.notcumLabel + ": {0:0.##}ml", cum.Volume); if (!cum.notcum) yield return String.Format(cum.pawn?.Label + ": {0:0.##}ml", cum.Volume);
} else yield return String.Format(cum.notcumLabel + ": {0:0.##}ml", cum.Volume);
else yield return Translations.Info_noCum; }
} }
} }
public Color GetCumMixtureColor public Color GetCumMixtureColor
@ -215,16 +215,15 @@ namespace RJW_Menstruation
{ {
Color mixedcolor = Color.white; Color mixedcolor = Color.white;
if (!cums.NullOrEmpty()) if (cums.NullOrEmpty()) return mixedcolor;
float mixedsofar = 0;
foreach (Cum cum in cums)
{ {
float mixedsofar = 0; if (cum.Volume > 0)
foreach (Cum cum in cums)
{ {
if (cum.Volume > 0) mixedcolor = Colors.CMYKLerp(mixedcolor, cum.Color, cum.Volume / (mixedsofar + cum.Volume));
{ mixedsofar += cum.Volume;
mixedcolor = Colors.CMYKLerp(mixedcolor, cum.Color, cum.Volume / (mixedsofar + cum.Volume));
mixedsofar += cum.Volume;
}
} }
} }
return mixedcolor; return mixedcolor;
@ -344,24 +343,23 @@ namespace RJW_Menstruation
{ {
get get
{ {
if (eggs.NullOrEmpty()) return "";
string res = ""; string res = "";
if (!eggs.NullOrEmpty()) int fertilized = 0;
foreach (Egg egg in eggs)
{ {
int fertilized = 0; if (egg.fertilized) fertilized++;
foreach (Egg egg in eggs) }
{ if (fertilized != 0) res += fertilized + " " + Translations.Dialog_WombInfo05;
if (egg.fertilized) fertilized++; if (fertilized != 0 && eggs.Count - fertilized != 0) res += ", ";
} if (cums.NullOrEmpty() || TotalFertCum == 0)
if (fertilized != 0) res += fertilized + " " + Translations.Dialog_WombInfo05; {
if (fertilized != 0 && eggs.Count - fertilized != 0) res += ", "; if (eggs.Count - fertilized != 0) res += eggs.Count - fertilized + " " + Translations.Dialog_WombInfo07;
if (cums.NullOrEmpty() || TotalFertCum == 0) }
{ else
if (eggs.Count - fertilized != 0) res += eggs.Count - fertilized + " " + Translations.Dialog_WombInfo07; {
} if (eggs.Count - fertilized != 0) res += eggs.Count - fertilized + " " + Translations.Dialog_WombInfo06;
else
{
if (eggs.Count - fertilized != 0) res += eggs.Count - fertilized + " " + Translations.Dialog_WombInfo06;
}
} }
return res; return res;
} }
@ -370,16 +368,12 @@ namespace RJW_Menstruation
{ {
get get
{ {
if (!eggs.NullOrEmpty()) if (eggs.NullOrEmpty() || cums.NullOrEmpty()) return false;
foreach (Cum cum in cums)
{ {
if (!cums.NullOrEmpty()) foreach (Cum cum in cums) if (cum.FertVolume > 0) return true;
{
if (cum.FertVolume > 0) return true;
}
return false;
} }
else return false; return false;
} }
} }
/// <summary> /// <summary>
@ -867,15 +861,13 @@ namespace RJW_Menstruation
/// <returns></returns> /// <returns></returns>
protected void FertilizationCheck() protected void FertilizationCheck()
{ {
if (!eggs.NullOrEmpty()) if (eggs.NullOrEmpty()) return;
foreach (Egg egg in eggs)
{ {
foreach (Egg egg in eggs) if (!egg.fertilized) egg.fertilizer = Fertilize();
if (egg.fertilizer != null)
{ {
if (!egg.fertilized) egg.fertilizer = Fertilize(); egg.fertilized = true;
if (egg.fertilizer != null)
{
egg.fertilized = true;
}
} }
} }
} }
@ -884,61 +876,61 @@ namespace RJW_Menstruation
{ {
Props = (CompProperties_Menstruation)props; Props = (CompProperties_Menstruation)props;
if (!Props.infertile) if (Props.infertile)
{
if (cycleSpeed < 0f) cycleSpeed = Utility.RandGaussianLike(0.8f, 1.2f);
if (cycleVariability < 0f) cycleVariability = MenstruationUtility.RandomVariabilityPercent();
if (currentIntervalHours < 0)
{
if (parent.pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) curStage = Stage.Young;
else if (!IsBreedingSeason()) curStage = Stage.Anestrus;
else curStage = RandomStage();
if (curStage == Stage.Follicular)
currentIntervalHours = PeriodRandomizer(Stage.Follicular) - PeriodRandomizer(Stage.Bleeding);
else
currentIntervalHours = PeriodRandomizer(curStage);
if (currentIntervalHours <= 0) currentIntervalHours = 1;
else if (currentIntervalHours < curStageHrs) curStageHrs = currentIntervalHours;
}
if (crampPain < 0) crampPain = PainRandomizer();
if (cums == null) cums = new List<Cum>();
if (eggs == null) eggs = new List<Egg>();
InitOvary();
Hediff_BasePregnancy pregnancy = parent.pawn.GetRJWPregnancy();
if (pregnancy != null)
{
Hediff hediff = PregnancyHelper.GetPregnancy(parent.pawn);
if (hediff != null)
{
if (hediff is Hediff_BasePregnancy preg)
{
currentIntervalHours = (int)(preg.GestationHours());
curStage = Stage.Pregnant;
}
}
}
if (parent.pawn.IsAnimal())
{
if (Configurations.EnableAnimalCycle)
{
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), GetNextUpdate(), parent.pawn, false);
}
}
else
{
if (pregnancy == null && parent.pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(Stage.Young), GetNextUpdate(), parent.pawn, false);
else HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), GetNextUpdate(), parent.pawn, false);
}
}
else
{ {
if (cums == null) cums = new List<Cum>(); if (cums == null) cums = new List<Cum>();
curStage = Stage.None; curStage = Stage.None;
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), GetNextUpdate(), parent.pawn, false); HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), GetNextUpdate(), parent.pawn, false);
loaded = true;
return;
}
if (cycleSpeed < 0f) cycleSpeed = Utility.RandGaussianLike(0.8f, 1.2f);
if (cycleVariability < 0f) cycleVariability = MenstruationUtility.RandomVariabilityPercent();
if (currentIntervalHours < 0)
{
if (parent.pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) curStage = Stage.Young;
else if (!IsBreedingSeason()) curStage = Stage.Anestrus;
else curStage = RandomStage();
if (curStage == Stage.Follicular)
currentIntervalHours = PeriodRandomizer(Stage.Follicular) - PeriodRandomizer(Stage.Bleeding);
else
currentIntervalHours = PeriodRandomizer(curStage);
if (currentIntervalHours <= 0) currentIntervalHours = 1;
else if (currentIntervalHours < curStageHrs) curStageHrs = currentIntervalHours;
}
if (crampPain < 0) crampPain = PainRandomizer();
if (cums == null) cums = new List<Cum>();
if (eggs == null) eggs = new List<Egg>();
InitOvary();
Hediff_BasePregnancy pregnancy = parent.pawn.GetRJWPregnancy();
if (pregnancy != null)
{
Hediff hediff = PregnancyHelper.GetPregnancy(parent.pawn);
if (hediff != null)
{
if (hediff is Hediff_BasePregnancy preg)
{
currentIntervalHours = (int)(preg.GestationHours());
curStage = Stage.Pregnant;
}
}
}
if (parent.pawn.IsAnimal())
{
if (Configurations.EnableAnimalCycle)
{
HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), GetNextUpdate(), parent.pawn, false);
}
}
else
{
if (pregnancy == null && parent.pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(Stage.Young), GetNextUpdate(), parent.pawn, false);
else HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(PeriodSimulator(curStage), GetNextUpdate(), parent.pawn, false);
} }
//Log.Message(parent.pawn.Label + " - Initialized menstruation comp"); //Log.Message(parent.pawn.Label + " - Initialized menstruation comp");
loaded = true; loaded = true;
@ -1120,85 +1112,83 @@ namespace RJW_Menstruation
protected bool Implant() protected bool Implant()
{ {
if (!eggs.NullOrEmpty()) if (eggs.NullOrEmpty()) return false;
List<Egg> deadeggs = new List<Egg>();
bool pregnant = false;
foreach (Egg egg in eggs)
{ {
List<Egg> deadeggs = new List<Egg>(); if (!egg.fertilized ||
bool pregnant = false; egg.fertstage < minImplantAgeHours ||
foreach (Egg egg in eggs) egg.position < Math.Min(Props.lutealIntervalDays / 2, maxImplantDelayDays) * 24)
continue;
else if (egg.fertilizer == null)
{ {
if (!egg.fertilized || deadeggs.Add(egg);
egg.fertstage < minImplantAgeHours || continue;
egg.position < Math.Min(Props.lutealIntervalDays / 2, maxImplantDelayDays) * 24) }
continue; else if (Rand.Range(0.0f, 1.0f) <= Configurations.ImplantationChance * ImplantFactor * InterspeciesImplantFactor(egg.fertilizer))
else if (egg.fertilizer == null) {
Hediff_BasePregnancy pregnancy = parent.pawn.GetRJWPregnancy();
if (pregnancy != null)
{ {
deadeggs.Add(egg); if (Configurations.UseMultiplePregnancy && Configurations.EnableHeteroOvularTwins)
continue;
}
else if (Rand.Range(0.0f, 1.0f) <= Configurations.ImplantationChance * ImplantFactor * InterspeciesImplantFactor(egg.fertilizer))
{
Hediff_BasePregnancy pregnancy = parent.pawn.GetRJWPregnancy();
if (pregnancy != null)
{ {
if (Configurations.UseMultiplePregnancy && Configurations.EnableHeteroOvularTwins) if (pregnancy is Hediff_MultiplePregnancy h)
{ {
if (pregnancy is Hediff_MultiplePregnancy h) h.AddNewBaby(parent.pawn, egg.fertilizer);
{
h.AddNewBaby(parent.pawn, egg.fertilizer);
}
pregnant = true;
deadeggs.Add(egg);
} }
else pregnant = true;
{ deadeggs.Add(egg);
pregnant = true;
break;
}
} }
else else
{ {
if (!Configurations.UseMultiplePregnancy) pregnant = true;
{ break;
PregnancyHelper.PregnancyDecider(parent.pawn, egg.fertilizer);
Hediff_BasePregnancy hediff = (Hediff_BasePregnancy)PregnancyHelper.GetPregnancy(parent.pawn);
currentIntervalHours = (int)hediff?.GestationHours();
pregnant = true;
break;
}
else
{
Hediff_BasePregnancy.Create<Hediff_MultiplePregnancy>(parent.pawn, egg.fertilizer);
Hediff_BasePregnancy hediff = (Hediff_BasePregnancy)PregnancyHelper.GetPregnancy(parent.pawn);
currentIntervalHours = (int)hediff?.GestationHours();
pregnant = true;
deadeggs.Add(egg);
}
} }
}
else deadeggs.Add(egg);
}
if (pregnant && (!Configurations.UseMultiplePregnancy || !Configurations.EnableHeteroOvularTwins))
{
eggs.Clear();
deadeggs.Clear();
return true;
}
else if (!deadeggs.NullOrEmpty())
{
foreach (Egg egg in deadeggs)
{
eggs.Remove(egg);
} }
deadeggs.Clear(); else
{
if (!Configurations.UseMultiplePregnancy)
{
PregnancyHelper.PregnancyDecider(parent.pawn, egg.fertilizer);
Hediff_BasePregnancy hediff = (Hediff_BasePregnancy)PregnancyHelper.GetPregnancy(parent.pawn);
currentIntervalHours = (int)hediff?.GestationHours();
pregnant = true;
break;
}
else
{
Hediff_BasePregnancy.Create<Hediff_MultiplePregnancy>(parent.pawn, egg.fertilizer);
Hediff_BasePregnancy hediff = (Hediff_BasePregnancy)PregnancyHelper.GetPregnancy(parent.pawn);
currentIntervalHours = (int)hediff?.GestationHours();
pregnant = true;
deadeggs.Add(egg);
}
}
} }
if (pregnant) return true; else deadeggs.Add(egg);
} }
return false;
if (pregnant && (!Configurations.UseMultiplePregnancy || !Configurations.EnableHeteroOvularTwins))
{
eggs.Clear();
deadeggs.Clear();
return true;
}
else if (!deadeggs.NullOrEmpty())
{
foreach (Egg egg in deadeggs)
{
eggs.Remove(egg);
}
deadeggs.Clear();
}
return pregnant;
} }
protected void BleedOut() protected void BleedOut()
@ -1229,32 +1219,26 @@ namespace RJW_Menstruation
protected float AbsorbCum(float amount, Absorber absorber) protected float AbsorbCum(float amount, Absorber absorber)
{ {
if (absorber != null) if (absorber == null)
{
float absorbable = absorber.GetStatValue(VariousDefOf.MaxAbsorbable);
absorber.SetColor(Colors.CMYKLerp(GetCumMixtureColor, absorber.DrawColor, 1f - amount / absorbable));
if (!absorber.dirty)
{
absorber.absorbedfluids += amount;
if (absorber.absorbedfluids > absorbable && !parent.pawn.apparel.IsLocked(absorber))
{
absorber.def = absorber.DirtyDef;
//absorber.fluidColor = GetCumMixtureColor;
absorber.dirty = true;
}
}
else
{
//if (absorber.LeakAfterDirty) FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn.LabelShort);
return amount;
}
}
else
{ {
//if (amount >= minmakefilthvalue) FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn.LabelShort); //if (amount >= minmakefilthvalue) FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn.LabelShort);
return amount; return amount;
} }
float absorbable = absorber.GetStatValue(VariousDefOf.MaxAbsorbable);
absorber.SetColor(Colors.CMYKLerp(GetCumMixtureColor, absorber.DrawColor, 1f - amount / absorbable));
if (absorber.dirty)
{
//if (absorber.LeakAfterDirty) FilthMaker.TryMakeFilth(parent.pawn.Position, parent.pawn.Map, cum.FilthDef, cum.pawn.LabelShort);
return amount;
}
absorber.absorbedfluids += amount;
if (absorber.absorbedfluids > absorbable && !parent.pawn.apparel.IsLocked(absorber))
{
absorber.def = absorber.DirtyDef;
//absorber.fluidColor = GetCumMixtureColor;
absorber.dirty = true;
}
return 0; return 0;
} }
@ -1545,55 +1529,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)) if (!xxx.is_human(parent.pawn) || !xxx.is_human(cummer)) return;
{
if ((cummer.Has(Quirk.Teratophile) != (parent.pawn.GetStatValue(StatDefOf.PawnBeauty) >= 0)) ||
cummer.Has(Quirk.ImpregnationFetish) ||
cummer.Has(Quirk.Breeder))
{
if (cummer.relations.OpinionOf(parent.pawn) <= -25)
{
cummer.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideM, parent.pawn);
}
else
{
cummer.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideM, parent.pawn);
}
}
if (IsDangerDay) if ((cummer.Has(Quirk.Teratophile) != (parent.pawn.GetStatValue(StatDefOf.PawnBeauty) >= 0)) ||
cummer.Has(Quirk.ImpregnationFetish) ||
cummer.Has(Quirk.Breeder))
{
if (cummer.relations.OpinionOf(parent.pawn) <= -25)
{ {
if (parent.pawn.Has(Quirk.Breeder) || parent.pawn.Has(Quirk.ImpregnationFetish)) cummer.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideM, parent.pawn);
{
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFFetish, cummer);
}
else if (parent.pawn.relations.OpinionOf(cummer) <= -5)
{
parent.pawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(VariousDefOf.CameInsideF, cummer);
parent.pawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(VariousDefOf.HaterCameInsideFEstrus, cummer);
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideF, cummer);
}
else if (parent.pawn.IsInEstrus() && parent.pawn.relations.OpinionOf(cummer) < RJWHookupSettings.MinimumRelationshipToHookup)
{
parent.pawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(VariousDefOf.CameInsideF, cummer);
parent.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))
{
if (parent.pawn.health.capacities.GetLevel(xxx.reproduction) < 0.50f) parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFLowFert, cummer);
else parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideF, cummer);
}
} }
else else
{ {
if (parent.pawn.Has(Quirk.Breeder) || parent.pawn.Has(Quirk.ImpregnationFetish)) cummer.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideM, parent.pawn);
{ }
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFFetishSafe, cummer); }
}
else if (parent.pawn.relations.OpinionOf(cummer) <= -5) if (IsDangerDay)
{ {
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideFSafe, cummer); if (parent.pawn.Has(Quirk.Breeder) || parent.pawn.Has(Quirk.ImpregnationFetish))
} {
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFFetish, cummer);
}
else if (parent.pawn.relations.OpinionOf(cummer) <= -5)
{
parent.pawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(VariousDefOf.CameInsideF, cummer);
parent.pawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(VariousDefOf.HaterCameInsideFEstrus, cummer);
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideF, cummer);
}
else if (parent.pawn.IsInEstrus() && parent.pawn.relations.OpinionOf(cummer) < RJWHookupSettings.MinimumRelationshipToHookup)
{
parent.pawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(VariousDefOf.CameInsideF, cummer);
parent.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))
{
if (parent.pawn.health.capacities.GetLevel(xxx.reproduction) < 0.50f) parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFLowFert, cummer);
else parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideF, cummer);
}
}
else
{
if (parent.pawn.Has(Quirk.Breeder) || parent.pawn.Has(Quirk.ImpregnationFetish))
{
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFFetishSafe, cummer);
}
else if (parent.pawn.relations.OpinionOf(cummer) <= -5)
{
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideFSafe, cummer);
} }
} }
} }
@ -1800,14 +1783,8 @@ namespace RJW_Menstruation
return Stage.Bleeding; return Stage.Bleeding;
default: return Stage.Follicular; default: return Stage.Follicular;
} }
} }
public class Egg : IExposable public class Egg : IExposable
{ {
public bool fertilized; public bool fertilized;
@ -1871,12 +1848,4 @@ namespace RJW_Menstruation
{ {
} }
} }
} }

View file

@ -238,36 +238,31 @@ namespace RJW_Menstruation
public static Texture2D GetAnalIcon(this Pawn pawn, bool drawOrigin = false) public static Texture2D GetAnalIcon(this Pawn pawn, bool drawOrigin = false)
{ {
var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).FirstOrDefault((Hediff h) => h.def.defName.ToLower().Contains("anus")); var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_anusBPR(pawn)).FirstOrDefault((Hediff h) => h.def.defName.ToLower().Contains("anus"));
if (hediff != null) if (hediff == null) return ContentFinder<Texture2D>.Get(("Genitals/Anal00"), true);
{
string icon;
float severity;
HediffComp_Anus comp = hediff.GetAnusComp();
if (comp != null)
{
CompProperties_Anus Props = (CompProperties_Anus)comp.props;
icon = Props.analTex ?? "Genitals/Anal";
if (drawOrigin) severity = comp.OriginAnusSize;
else severity = hediff.Severity;
}
else
{
icon = "Genitals/Anal";
severity = hediff.Severity;
}
if (severity < 0.20f) icon += "00"; //micro
else if (severity < 0.40f) icon += "01"; //tight
else if (severity < 0.60f) icon += "02"; //average
else if (severity < 0.80f) icon += "03"; //accomodating
else if (severity < 1.01f) icon += "04"; //cavernous
else icon += "05"; //abyssal
return ContentFinder<Texture2D>.Get((icon), true); string icon;
float severity;
HediffComp_Anus comp = hediff.GetAnusComp();
if (comp != null)
{
CompProperties_Anus Props = (CompProperties_Anus)comp.props;
icon = Props.analTex ?? "Genitals/Anal";
if (drawOrigin) severity = comp.OriginAnusSize;
else severity = hediff.Severity;
} }
else else
{ {
return ContentFinder<Texture2D>.Get(("Genitals/Anal00"), true); icon = "Genitals/Anal";
severity = hediff.Severity;
} }
if (severity < 0.20f) icon += "00"; //micro
else if (severity < 0.40f) icon += "01"; //tight
else if (severity < 0.60f) icon += "02"; //average
else if (severity < 0.80f) icon += "03"; //accomodating
else if (severity < 1.01f) icon += "04"; //cavernous
else icon += "05"; //abyssal
return ContentFinder<Texture2D>.Get((icon), true);
} }
public static float GestationHours(this Hediff_BasePregnancy hediff) public static float GestationHours(this Hediff_BasePregnancy hediff)

View file

@ -17,20 +17,19 @@ namespace RJW_Menstruation
protected void PregnancyThought() protected void PregnancyThought()
{ {
if (!is_discovered && xxx.is_human(pawn)) if (is_discovered ||
!xxx.is_human(pawn) ||
pawn.Has(Quirk.Breeder) ||
(pawn.relations?.DirectRelations?.Find(x => x.def.Equals(PawnRelationDefOf.Spouse) ||
x.def.Equals(PawnRelationDefOf.Fiance))) != null)
return;
if (pawn.Has(Quirk.ImpregnationFetish) || pawn.relations?.DirectRelations?.Find(x => x.def.Equals(PawnRelationDefOf.Lover)) != null)
{ {
if (!pawn.Has(Quirk.Breeder) && pawn.relations?.DirectRelations?.Find(x => x.def.Equals(PawnRelationDefOf.Spouse) || x.def.Equals(PawnRelationDefOf.Fiance)) == null) pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.UnwantedPregnancyMild);
{ }
if (pawn.Has(Quirk.ImpregnationFetish) || pawn.relations?.DirectRelations?.Find(x => x.def.Equals(PawnRelationDefOf.Lover)) != null) else
{ {
pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.UnwantedPregnancyMild); pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.UnwantedPregnancy);
}
else
{
pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.UnwantedPregnancy);
}
}
} }
} }
@ -67,22 +66,22 @@ namespace RJW_Menstruation
public string GetBabyInfo() public string GetBabyInfo()
{ {
if (babies.NullOrEmpty())
return "Null";
string res = ""; string res = "";
if (!babies.NullOrEmpty())
var babiesdistinct = babies.Distinct(new RaceComparer());
int iteration = 0;
foreach (Pawn baby in babiesdistinct)
{ {
var babiesdistinct = babies.Distinct(new RaceComparer()); int num = babies.Where(x => x.def.Equals(baby.def)).Count();
int iteration = 0; if (iteration > 0) res += ", ";
foreach (Pawn baby in babiesdistinct) res += num + " " + baby.def.label;
{ iteration++;
int num = babies.Where(x => x.def.Equals(baby.def)).Count();
if (iteration > 0) res += ", ";
res += num + " " + baby.def.label;
iteration++;
}
res += " " + Translations.Dialog_WombInfo02;
return res;
} }
return "Null"; res += " " + Translations.Dialog_WombInfo02;
return res;
} }
public string GetFatherInfo() public string GetFatherInfo()
@ -295,16 +294,15 @@ namespace RJW_Menstruation
protected void Train(Pawn baby, Pawn mother) protected void Train(Pawn baby, Pawn mother)
{ {
if (!xxx.is_human(baby) && baby.Faction == Faction.OfPlayer) if (xxx.is_human(baby) || baby.Faction != Faction.OfPlayer) return;
if (xxx.is_human(mother) && baby.Faction == Faction.OfPlayer && baby.training.CanAssignToTrain(TrainableDefOf.Obedience, out _).Accepted)
{ {
if (xxx.is_human(mother) && baby.Faction == Faction.OfPlayer && baby.training.CanAssignToTrain(TrainableDefOf.Obedience, out _).Accepted) baby.training.Train(TrainableDefOf.Obedience, mother);
{ }
baby.training.Train(TrainableDefOf.Obedience, mother); if (xxx.is_human(mother) && baby.Faction == Faction.OfPlayer && baby.training.CanAssignToTrain(TrainableDefOf.Tameness, out _).Accepted)
} {
if (xxx.is_human(mother) && baby.Faction == Faction.OfPlayer && baby.training.CanAssignToTrain(TrainableDefOf.Tameness, out _).Accepted) baby.training.Train(TrainableDefOf.Tameness, mother);
{
baby.training.Train(TrainableDefOf.Tameness, mother);
}
} }
} }
@ -421,30 +419,28 @@ namespace RJW_Menstruation
public Pawn GenerateBaby(PawnGenerationRequest request, Pawn mother, Pawn father, List<Trait> parentTraits, int traitSeed) public Pawn GenerateBaby(PawnGenerationRequest request, Pawn mother, Pawn father, List<Trait> parentTraits, int traitSeed)
{ {
Pawn baby = PawnGenerator.GeneratePawn(request); Pawn baby = PawnGenerator.GeneratePawn(request);
if (baby != null) if (baby == null)
{ {
if (xxx.is_human(baby) || (baby.relations != null && !RJWSettings.Disable_bestiality_pregnancy_relations)) Log.Error("Baby not generated. Request: " + request.ToString());
return null;
}
if (xxx.is_human(baby) || (baby.relations != null && !RJWSettings.Disable_bestiality_pregnancy_relations))
{
baby.SetMother(mother);
if (mother != father)
{ {
baby.SetMother(mother); if (father.gender != Gender.Female) baby.SetFather(father);
if (mother != father) else baby.relations.AddDirectRelation(PawnRelationDefOf.Parent, father);
{
if (father.gender != Gender.Female) baby.SetFather(father);
else
{
baby.relations.AddDirectRelation(PawnRelationDefOf.Parent, father);
}
}
}
if (xxx.is_human(baby))
{
// Ensure the same inherited traits are chosen each run
// Has to happen right here so GeneratePawn up there still gets unique results
Rand.PushState(traitSeed); // With a seed just to make sure that fraternal twins *don't* get trait-duped
UpdateTraits(baby, parentTraits);
Rand.PopState();
} }
} }
else Log.Error("Baby not generated. Request: " + request.ToString()); if (xxx.is_human(baby))
{
// Ensure the same inherited traits are chosen each run
// Has to happen right here so GeneratePawn up there still gets unique results
Rand.PushState(traitSeed); // With a seed just to make sure that fraternal twins *don't* get trait-duped
UpdateTraits(baby, parentTraits);
Rand.PopState();
}
return baby; return baby;
} }
@ -568,9 +564,6 @@ namespace RJW_Menstruation
if (!spawn_kind_def_list.NullOrEmpty()) spawn_kind_def = spawn_kind_def_list.RandomElement(); if (!spawn_kind_def_list.NullOrEmpty()) spawn_kind_def = spawn_kind_def_list.RandomElement();
} }
return spawn_kind_def; return spawn_kind_def;
} }

View file

@ -86,18 +86,18 @@ namespace RJW_Menstruation
{ {
if (partner.IsAnimal() && !Configurations.EnableAnimalCycle) return true; if (partner.IsAnimal() && !Configurations.EnableAnimalCycle) return true;
HediffComp_Menstruation comp = partner.GetMenstruationComp(); HediffComp_Menstruation comp = partner.GetMenstruationComp();
if (comp != null) if (comp == null)
{ {
if (AndroidsCompatibility.IsAndroid(pawn) && !AndroidsCompatibility.AndroidPenisFertility(pawn)) ModLog.Message("used original rjw method: Comp missing");
{ return true;
comp.CumIn(pawn, pawn.GetCumVolume(), 0); }
return false; else if (AndroidsCompatibility.IsAndroid(pawn) && !AndroidsCompatibility.AndroidPenisFertility(pawn))
} {
else comp.CumIn(pawn, pawn.GetCumVolume(), pawn.health.capacities.GetLevel(xxx.reproduction)); comp.CumIn(pawn, pawn.GetCumVolume(), 0);
return false; return false;
} }
ModLog.Message("used original rjw method: Comp missing"); else comp.CumIn(pawn, pawn.GetCumVolume(), pawn.health.capacities.GetLevel(xxx.reproduction));
return true; return false;
} }
} }

View file

@ -20,10 +20,7 @@ namespace RJW_Menstruation
public HybridExtension GetHybridExtension(string race) public HybridExtension GetHybridExtension(string race)
{ {
if (hybridExtension.NullOrEmpty()) return null; if (hybridExtension.NullOrEmpty()) return null;
else else return hybridExtension.Find(x => x.thingDef.defName.Equals(race));
{
return hybridExtension.Find(x => x.thingDef.defName.Equals(race));
}
} }
public PawnKindDef GetHybridWith(string race) public PawnKindDef GetHybridWith(string race)
@ -69,19 +66,13 @@ namespace RJW_Menstruation
XmlNodeList childNodes = xmlRoot.ChildNodes; XmlNodeList childNodes = xmlRoot.ChildNodes;
if (childNodes.Count >= 1) foreach (XmlNode node in childNodes) if (childNodes.Count >= 1) foreach (XmlNode node in childNodes)
{ {
#if DEBUG #if DEBUG
Log.Message(xmlRoot.Name + "HybridInfo: " + node.Name + " " + node.InnerText); Log.Message(xmlRoot.Name + "HybridInfo: " + node.Name + " " + node.InnerText);
#endif #endif
hybridInfo.Add(node.Name, ParseHelper.FromString<float>(node.InnerText)); hybridInfo.Add(node.Name, ParseHelper.FromString<float>(node.InnerText));
} }
} }
} }
public class HybridInformations : IExposable public class HybridInformations : IExposable
@ -145,9 +136,6 @@ namespace RJW_Menstruation
Scribe_Values.Look(ref thingDefName, "thingDefName"); Scribe_Values.Look(ref thingDefName, "thingDefName");
Scribe_Collections.Look(ref hybridExtension, "hybridExtension", LookMode.Deep, new object[0]); Scribe_Collections.Look(ref hybridExtension, "hybridExtension", LookMode.Deep, new object[0]);
} }
} }
public class HybridExtensionExposable : HybridExtension, IExposable public class HybridExtensionExposable : HybridExtension, IExposable
@ -197,10 +185,6 @@ namespace RJW_Menstruation
} }
} }
public class AbsorberModExtension : DefModExtension public class AbsorberModExtension : DefModExtension
{ {
public bool leakAfterDirty = false; public bool leakAfterDirty = false;
@ -222,8 +206,6 @@ namespace RJW_Menstruation
public Color fluidColor = Color.white; public Color fluidColor = Color.white;
public virtual void DirtyEffect() { } public virtual void DirtyEffect() { }
public virtual void WearEffect() public virtual void WearEffect()
@ -299,13 +281,5 @@ namespace RJW_Menstruation
color = value; color = value;
} }
} }
} }
} }

View file

@ -29,14 +29,8 @@ namespace RJW_Menstruation
if (!VariousDefOf.AllRaces.NullOrEmpty()) if (!VariousDefOf.AllRaces.NullOrEmpty())
foreach(ThingDef def in VariousDefOf.AllRaces) foreach(ThingDef def in VariousDefOf.AllRaces)
{ {
if (def.race != null) if (def.race == null || Configurations.IsOverrideExist(def)) continue;
{ raceList.Add(new FloatMenuOption(def.label, delegate { AddHybridOverride(def); }, def.uiIcon, Color.white));
if (Configurations.IsOverrideExist(def)) continue;
else
{
raceList.Add(new FloatMenuOption(def.label, delegate { AddHybridOverride(def);}, def.uiIcon, Color.white ));
}
}
} }
raceList.SortBy(x => x.Label); raceList.SortBy(x => x.Label);
} }
@ -44,16 +38,14 @@ namespace RJW_Menstruation
public void AddHybridOverride(ThingDef def) public void AddHybridOverride(ThingDef def)
{ {
FloatMenuOption option = raceList.FirstOrDefault(x => x.Label.Equals(def?.label)); FloatMenuOption option = raceList.FirstOrDefault(x => x.Label.Equals(def?.label));
if (option != null) if (option == null) return;
raceList.Remove(option);
if (Configurations.HybridOverride.NullOrEmpty())
{ {
raceList.Remove(option); Configurations.HybridOverride = new List<HybridInformations>();
if (Configurations.HybridOverride.NullOrEmpty())
{
Configurations.HybridOverride = new List<HybridInformations>();
}
Configurations.HybridOverride.Add(new HybridInformations(def));
Configurations.HybridOverride.SortBy(x => x.GetDef?.label ?? "Undefined");
} }
Configurations.HybridOverride.Add(new HybridInformations(def));
Configurations.HybridOverride.SortBy(x => x.GetDef?.label ?? "Undefined");
} }
@ -279,18 +271,19 @@ namespace RJW_Menstruation
protected void BuildRaceList() protected void BuildRaceList()
{ {
raceList.Clear(); raceList.Clear();
if (!VariousDefOf.AllRaces.NullOrEmpty()) if (VariousDefOf.AllRaces.NullOrEmpty()) return;
foreach (ThingDef def in VariousDefOf.AllRaces)
foreach (ThingDef def in VariousDefOf.AllRaces)
{
if (def.race != null)
{ {
if (def.race != null) if (info.hybridExtension.Exists(x => x.DefName == def.defName)) continue;
else
{ {
if (info.hybridExtension.Exists(x => x.DefName == def.defName)) continue; raceList.Add(new FloatMenuOption(def.label, delegate { AddHybridInfo(def); }, Widgets.GetIconFor(def), Color.white));
else
{
raceList.Add(new FloatMenuOption(def.label, delegate { AddHybridInfo(def); }, Widgets.GetIconFor(def), Color.white));
}
} }
} }
}
raceList.SortBy(x => x.Label); raceList.SortBy(x => x.Label);
} }

View file

@ -97,13 +97,10 @@ namespace RJW_Menstruation
var hedifflist = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_breastsBPR(pawn))?.FindAll((Hediff h) => h is Hediff_PartBaseNatural || h is Hediff_PartBaseArtifical); var hedifflist = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_breastsBPR(pawn))?.FindAll((Hediff h) => h is Hediff_PartBaseNatural || h is Hediff_PartBaseArtifical);
HediffComp_Breast result; HediffComp_Breast result;
if (hedifflist.NullOrEmpty()) return null; if (hedifflist.NullOrEmpty()) return null;
else foreach(Hediff h in hedifflist)
{ {
foreach(Hediff h in hedifflist) result = h.TryGetComp<HediffComp_Breast>();
{ if (result != null) return result;
result = h.TryGetComp<HediffComp_Breast>();
if (result != null) return result;
}
} }
return null; return null;
} }
@ -128,24 +125,19 @@ namespace RJW_Menstruation
var hedifflist = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn))?.FindAll((Hediff h) => h.def.defName.ToLower().Contains("vagina")); var hedifflist = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn))?.FindAll((Hediff h) => h.def.defName.ToLower().Contains("vagina"));
HediffComp_Menstruation result; HediffComp_Menstruation result;
if (hedifflist.NullOrEmpty()) return false; if (hedifflist.NullOrEmpty()) return false;
else foreach (Hediff h in hedifflist)
{ {
foreach (Hediff h in hedifflist) result = h.TryGetComp<HediffComp_Menstruation>();
{ if (result != null) return true;
result = h.TryGetComp<HediffComp_Menstruation>();
if (result != null) return true;
}
} }
return false; return false;
} }
public static bool HasMenstruationComp(this Hediff hediff) public static bool HasMenstruationComp(this Hediff hediff)
{ {
if (hediff is Hediff_PartBaseNatural || hediff is Hediff_PartBaseArtifical) if ((hediff is Hediff_PartBaseNatural || hediff is Hediff_PartBaseArtifical) && hediff.TryGetComp<HediffComp_Menstruation>() != null)
{ return true;
if (hediff.TryGetComp<HediffComp_Menstruation>() != null) return true; else return false;
}
return false;
} }
@ -299,29 +291,27 @@ namespace RJW_Menstruation
milkcomp = pawn.GetComp<CompMilkable>(); milkcomp = pawn.GetComp<CompMilkable>();
} }
if (milkcomp != null) if (milkcomp == null) return;
if (milkcomp is CompMilkable milkable)
{ {
if (milkcomp is CompMilkable milkable) bool active = (bool)milkcomp.GetPropertyValue("Active");
if (active)
{ {
bool active = (bool)milkcomp.GetPropertyValue("Active"); CompMilkable m = milkable;
if (active) res = Math.Max(m.Fullness, res);
{ Widgets.FillableBar(rect, Math.Min(res, 1.0f), TextureCache.MilkTexture, Texture2D.blackTexture, true);
CompMilkable m = milkable; DrawMilkBottle(rect, pawn, VariousDefOf.Job_LactateSelf, m.Fullness);
res = Math.Max(m.Fullness, res);
Widgets.FillableBar(rect, Math.Min(res, 1.0f), TextureCache.MilkTexture, Texture2D.blackTexture, true);
DrawMilkBottle(rect, pawn, VariousDefOf.Job_LactateSelf, m.Fullness);
}
} }
else }
else
{
bool active = (bool)milkcomp.GetPropertyValue("Active");
if (active)
{ {
bool active = (bool)milkcomp.GetPropertyValue("Active"); float fullness = (float)milkcomp.GetMemberValue("fullness");
if (active) res = Math.Max(fullness, res);
{ Widgets.FillableBar(rect, Math.Min(res, 1.0f), TextureCache.MilkTexture, Texture2D.blackTexture, true);
float fullness = (float)milkcomp.GetMemberValue("fullness"); DrawMilkBottle(rect, pawn, VariousDefOf.Job_LactateSelf_MC, fullness);
res = Math.Max(fullness, res);
Widgets.FillableBar(rect, Math.Min(res, 1.0f), TextureCache.MilkTexture, Texture2D.blackTexture, true);
DrawMilkBottle(rect, pawn, VariousDefOf.Job_LactateSelf_MC, fullness);
}
} }
} }
} }
@ -330,30 +320,29 @@ namespace RJW_Menstruation
{ {
Texture2D texture; Texture2D texture;
Rect buttonrect = new Rect(rect.x, rect.y, rect.height, rect.height); Rect buttonrect = new Rect(rect.x, rect.y, rect.height, rect.height);
if (fullness > 0.0f) if (fullness <= 0.0f) return;
{
if (fullness < 0.3f) texture = ContentFinder<Texture2D>.Get("Milk/Milkbottle_Small", false);
else if (fullness < 0.7f) texture = ContentFinder<Texture2D>.Get("Milk/Milkbottle_Medium", false);
else texture = ContentFinder<Texture2D>.Get("Milk/Milkbottle_Large", false);
GUIContent icon = new GUIContent(texture);
GUIStyle style = GUIStyle.none;
style.normal.background = texture;
string tooltip = Translations.Button_MilkTooltip;
TooltipHandler.TipRegion(buttonrect, tooltip); if (fullness < 0.3f) texture = ContentFinder<Texture2D>.Get("Milk/Milkbottle_Small", false);
if (GUI.Button(buttonrect, icon, style)) else if (fullness < 0.7f) texture = ContentFinder<Texture2D>.Get("Milk/Milkbottle_Medium", false);
else texture = ContentFinder<Texture2D>.Get("Milk/Milkbottle_Large", false);
GUIContent icon = new GUIContent(texture);
GUIStyle style = GUIStyle.none;
style.normal.background = texture;
string tooltip = Translations.Button_MilkTooltip;
TooltipHandler.TipRegion(buttonrect, tooltip);
if (GUI.Button(buttonrect, icon, style))
{
if (fullness < 0.1f
|| !pawn.IsColonistPlayerControlled
|| pawn.Downed) SoundDefOf.ClickReject.PlayOneShotOnCamera();
else
{ {
if (fullness < 0.1f SoundDefOf.Click.PlayOneShotOnCamera();
|| !pawn.IsColonistPlayerControlled pawn.jobs.TryTakeOrderedJob(new Verse.AI.Job(milkjob, pawn));
|| pawn.Downed) SoundDefOf.ClickReject.PlayOneShotOnCamera();
else
{
SoundDefOf.Click.PlayOneShotOnCamera();
pawn.jobs.TryTakeOrderedJob(new Verse.AI.Job(milkjob, pawn));
}
} }
Widgets.DrawHighlightIfMouseover(buttonrect);
} }
Widgets.DrawHighlightIfMouseover(buttonrect);
} }
@ -452,20 +441,7 @@ namespace RJW_Menstruation
public static bool ShouldShowWombGizmo(this Pawn pawn) public static bool ShouldShowWombGizmo(this Pawn pawn)
{ {
return Configurations.EnableWombIcon && (!pawn.IsAnimal() || Configurations.EnableAnimalCycle);
if (Configurations.EnableWombIcon)
{
if (!pawn.IsAnimal())
{
return true;
}
else if (Configurations.EnableAnimalCycle)
{
return true;
}
}
return false;
} }
} }
} }

View file

@ -55,12 +55,10 @@ namespace RJW_Menstruation
{ {
get get
{ {
if (allraces == null) if (allraces != null) return allraces;
{
List<ThingDef> allThings = DefDatabase<ThingDef>.AllDefsListForReading; List<ThingDef> allThings = DefDatabase<ThingDef>.AllDefsListForReading;
allraces = allThings.FindAll(x => x.race != null && x.race.IsFlesh); allraces = allThings.FindAll(x => x.race != null && x.race.IsFlesh);
}
return allraces; return allraces;
} }
} }
@ -68,29 +66,19 @@ namespace RJW_Menstruation
{ {
get get
{ {
if (allkinds == null) if (allkinds != null) return allkinds;
{
List<PawnKindDef> allKinds = DefDatabase<PawnKindDef>.AllDefsListForReading; List<PawnKindDef> allKinds = DefDatabase<PawnKindDef>.AllDefsListForReading;
allkinds = allKinds.FindAll(x => x.race != null); allkinds = allKinds.FindAll(x => x.race != null);
}
return allkinds; return allkinds;
} }
} }
// Defs from Milkable Colonists // Defs from Milkable Colonists
public static readonly HediffDef Hediff_Lactating_Drug = DefDatabase<HediffDef>.GetNamedSilentFail("Lactating_Drug"); public static readonly HediffDef Hediff_Lactating_Drug = DefDatabase<HediffDef>.GetNamedSilentFail("Lactating_Drug");
public static readonly HediffDef Hediff_Lactating_Natural = DefDatabase<HediffDef>.GetNamedSilentFail("Lactating_Natural"); public static readonly HediffDef Hediff_Lactating_Natural = DefDatabase<HediffDef>.GetNamedSilentFail("Lactating_Natural");
public static readonly HediffDef Hediff_Lactating_Permanent = DefDatabase<HediffDef>.GetNamedSilentFail("Lactating_Permanent"); public static readonly HediffDef Hediff_Lactating_Permanent = DefDatabase<HediffDef>.GetNamedSilentFail("Lactating_Permanent");
public static readonly HediffDef Hediff_Heavy_Lactating_Permanent = DefDatabase<HediffDef>.GetNamedSilentFail("Heavy_Lactating_Permanent"); public static readonly HediffDef Hediff_Heavy_Lactating_Permanent = DefDatabase<HediffDef>.GetNamedSilentFail("Heavy_Lactating_Permanent");
public static readonly JobDef Job_LactateSelf_MC = DefDatabase<JobDef>.GetNamedSilentFail("LactateSelf_MC"); public static readonly JobDef Job_LactateSelf_MC = DefDatabase<JobDef>.GetNamedSilentFail("LactateSelf_MC");
} }
} }