mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Compare commits
No commits in common. "64923264b986be685e36ed8936e3d1b1bad44943" and "9654c4e3477527158ddf6d8217c033336b06ae3b" have entirely different histories.
64923264b9
...
9654c4e347
5 changed files with 9 additions and 27 deletions
Binary file not shown.
|
@ -21,22 +21,7 @@ namespace RJW_Menstruation
|
||||||
|
|
||||||
public bool HasBaby
|
public bool HasBaby
|
||||||
{
|
{
|
||||||
get => !babies.NullOrEmpty();
|
get => !babies.NullOrEmpty();
|
||||||
}
|
|
||||||
|
|
||||||
public int BabyCount
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (babies == null) return 0;
|
|
||||||
else return babies.Count;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Pawn PeekBaby()
|
|
||||||
{
|
|
||||||
if (babies.NullOrEmpty()) return null;
|
|
||||||
else return babies.First();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Pawn PopBaby()
|
public Pawn PopBaby()
|
||||||
|
@ -172,7 +157,7 @@ namespace RJW_Menstruation
|
||||||
// Easier to work out twins that way
|
// Easier to work out twins that way
|
||||||
|
|
||||||
// From e.g. a vat
|
// From e.g. a vat
|
||||||
if (!(birtherThing is Pawn mother) || !xxx.is_human(mother) || !mother.ShouldCycle())
|
if (!(birtherThing is Pawn mother) || !xxx.is_human(mother))
|
||||||
return PawnGenerator.GeneratePawn(request);
|
return PawnGenerator.GeneratePawn(request);
|
||||||
|
|
||||||
// No babies found. Could be an unmodified pregnancy
|
// No babies found. Could be an unmodified pregnancy
|
||||||
|
@ -215,7 +200,7 @@ namespace RJW_Menstruation
|
||||||
{
|
{
|
||||||
private static Thing ApplyBirthLoop(RitualOutcomePossibility outcome, float quality, Precept_Ritual ritual, List<GeneDef> genes, Pawn geneticMother, Thing birtherThing, Pawn father, Pawn doctor, LordJob_Ritual lordJobRitual, RitualRoleAssignments assignments, bool preventLetter)
|
private static Thing ApplyBirthLoop(RitualOutcomePossibility outcome, float quality, Precept_Ritual ritual, List<GeneDef> genes, Pawn geneticMother, Thing birtherThing, Pawn father, Pawn doctor, LordJob_Ritual lordJobRitual, RitualRoleAssignments assignments, bool preventLetter)
|
||||||
{
|
{
|
||||||
if (birtherThing is Pawn mother && mother.ShouldCycle())
|
if (birtherThing is Pawn mother)
|
||||||
{
|
{
|
||||||
HediffComp_PregeneratedBabies comp = mother.health.hediffSet.GetFirstHediff<Hediff_LaborPushing>().TryGetComp<HediffComp_PregeneratedBabies>();
|
HediffComp_PregeneratedBabies comp = mother.health.hediffSet.GetFirstHediff<Hediff_LaborPushing>().TryGetComp<HediffComp_PregeneratedBabies>();
|
||||||
if (comp?.HasBaby ?? false)
|
if (comp?.HasBaby ?? false)
|
||||||
|
@ -225,7 +210,7 @@ namespace RJW_Menstruation
|
||||||
float birthQuality = PregnancyUtility.GetBirthQualityFor(mother);
|
float birthQuality = PregnancyUtility.GetBirthQualityFor(mother);
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
Pawn baby = comp.PeekBaby();
|
Pawn baby = comp.babies[0];
|
||||||
Pawn thisFather = baby.GetFather() ?? father;
|
Pawn thisFather = baby.GetFather() ?? father;
|
||||||
baby.relations.ClearAllRelations(); // To keep ApplyBirthOutcome from erroring when it tries to set up relations
|
baby.relations.ClearAllRelations(); // To keep ApplyBirthOutcome from erroring when it tries to set up relations
|
||||||
|
|
||||||
|
@ -271,7 +256,7 @@ namespace RJW_Menstruation
|
||||||
{
|
{
|
||||||
private static Thing ApplyBirthLoop(RitualOutcomePossibility outcome, float quality, Precept_Ritual ritual, List<GeneDef> genes, Pawn geneticMother, Thing birtherThing, Pawn father, Pawn doctor, LordJob_Ritual lordJobRitual, RitualRoleAssignments assignments)
|
private static Thing ApplyBirthLoop(RitualOutcomePossibility outcome, float quality, Precept_Ritual ritual, List<GeneDef> genes, Pawn geneticMother, Thing birtherThing, Pawn father, Pawn doctor, LordJob_Ritual lordJobRitual, RitualRoleAssignments assignments)
|
||||||
{
|
{
|
||||||
if (birtherThing is Pawn mother && mother.ShouldCycle())
|
if (birtherThing is Pawn mother)
|
||||||
{
|
{
|
||||||
HediffComp_PregeneratedBabies comp = mother.health.hediffSet.GetFirstHediff<Hediff_LaborPushing>().TryGetComp<HediffComp_PregeneratedBabies>();
|
HediffComp_PregeneratedBabies comp = mother.health.hediffSet.GetFirstHediff<Hediff_LaborPushing>().TryGetComp<HediffComp_PregeneratedBabies>();
|
||||||
if (comp?.HasBaby ?? false)
|
if (comp?.HasBaby ?? false)
|
||||||
|
@ -284,7 +269,7 @@ namespace RJW_Menstruation
|
||||||
// Though even if it does, that's probably okay. More babies more memories after all
|
// Though even if it does, that's probably okay. More babies more memories after all
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
Pawn baby = comp.PeekBaby();
|
Pawn baby = comp.babies[0];
|
||||||
Pawn thisFather = baby.GetFather() ?? father;
|
Pawn thisFather = baby.GetFather() ?? father;
|
||||||
baby.relations.ClearAllRelations();
|
baby.relations.ClearAllRelations();
|
||||||
|
|
||||||
|
|
|
@ -118,8 +118,8 @@ namespace RJW_Menstruation
|
||||||
}
|
}
|
||||||
else if (babiescomp?.HasBaby ?? false)
|
else if (babiescomp?.HasBaby ?? false)
|
||||||
{
|
{
|
||||||
babydef = babiescomp.PeekBaby().def;
|
babydef = babiescomp.babies.First().def;
|
||||||
babycount = babiescomp.BabyCount;
|
babycount = babiescomp.babies.Count;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -68,9 +68,6 @@ namespace RJW_Menstruation
|
||||||
PawnKindDef motherKindDef = Utility.GetRacesPawnKind(mother);
|
PawnKindDef motherKindDef = Utility.GetRacesPawnKind(mother);
|
||||||
PawnKindDef fatherKindDef = Utility.GetRacesPawnKind(father);
|
PawnKindDef fatherKindDef = Utility.GetRacesPawnKind(father);
|
||||||
|
|
||||||
if (motherKindDef is CreepJoinerFormKindDef) motherKindDef = PawnKindDefOf.Colonist;
|
|
||||||
if (fatherKindDef is CreepJoinerFormKindDef) fatherKindDef = PawnKindDefOf.Colonist;
|
|
||||||
|
|
||||||
PawnKindDef spawn_kind_def = motherKindDef;
|
PawnKindDef spawn_kind_def = motherKindDef;
|
||||||
|
|
||||||
int flag = 0;
|
int flag = 0;
|
||||||
|
|
|
@ -178,7 +178,7 @@ namespace RJW_Menstruation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HediffComp_PregeneratedBabies babiescomp = comp.Pregnancy.TryGetComp<HediffComp_PregeneratedBabies>();
|
HediffComp_PregeneratedBabies babiescomp = comp.Pregnancy.TryGetComp<HediffComp_PregeneratedBabies>();
|
||||||
return babiescomp?.PeekBaby();
|
return babiescomp?.babies?.FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void DrawBreastIcon(this Pawn pawn, Rect rect)
|
public static void DrawBreastIcon(this Pawn pawn, Rect rect)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue