Update birth faction assignments to match RJW's.

This commit is contained in:
lutepickle 2022-04-29 07:00:41 -07:00
parent 4c2233659a
commit 47d249e716
3 changed files with 26 additions and 8 deletions

Binary file not shown.

View file

@ -125,9 +125,23 @@ namespace RJW_Menstruation
if (mother.Faction != baby.Faction) if (mother.Faction != baby.Faction)
baby.SetFaction(mother.Faction); baby.SetFaction(mother.Faction);
} }
if (mother.IsPrisonerOfColony) if (mother.IsSlaveOfColony)
{ {
baby.guest.CapturedBy(Faction.OfPlayer); if (mother.SlaveFaction != null)
baby.SetFaction(mother.SlaveFaction);
else if (mother.HomeFaction != null)
baby.SetFaction(mother.HomeFaction);
else if (mother.Faction != null)
baby.SetFaction(mother.Faction);
else
baby.SetFaction(Faction.OfPlayer);
baby.guest.SetGuestStatus(Faction.OfPlayer, GuestStatus.Slave);
}
else if (mother.IsPrisonerOfColony)
{
if (mother.HomeFaction != null)
baby.SetFaction(mother.HomeFaction);
baby.guest.SetGuestStatus(Faction.OfPlayer, GuestStatus.Prisoner);
} }
foreach (Pawn sibling in siblings) foreach (Pawn sibling in siblings)
@ -159,13 +173,15 @@ namespace RJW_Menstruation
if (mother.Faction != baby.Faction) if (mother.Faction != baby.Faction)
baby.SetFaction(mother.Faction); baby.SetFaction(mother.Faction);
} }
foreach (Pawn sibling in siblings) if (!RJWSettings.Disable_bestiality_pregnancy_relations)
{ {
baby.relations.AddDirectRelation(PawnRelationDefOf.Sibling, sibling); foreach (Pawn sibling in siblings)
{
baby.relations.AddDirectRelation(PawnRelationDefOf.Sibling, sibling);
}
siblings.Add(baby);
} }
siblings.Add(baby);
Train(baby, mother); Train(baby, mother);
PostBirth(mother, father, baby); PostBirth(mother, father, baby);
@ -324,7 +340,7 @@ namespace RJW_Menstruation
PawnGenerationRequest request = new PawnGenerationRequest( PawnGenerationRequest request = new PawnGenerationRequest(
newborn: true, newborn: true,
allowDowned: true, allowDowned: true,
faction: mother.IsPrisoner ? null : mother.Faction, faction: mother.Faction,
canGeneratePawnRelations: false, canGeneratePawnRelations: false,
forceGenerateNewPawn: true, forceGenerateNewPawn: true,
colonistRelationChanceFactor: 0, colonistRelationChanceFactor: 0,
@ -425,7 +441,7 @@ namespace RJW_Menstruation
UpdateTraits(baby, parentTraits); UpdateTraits(baby, parentTraits);
Rand.PopState(); Rand.PopState();
} }
else if (baby.relations != null) else if (baby.relations != null && !RJWSettings.Disable_bestiality_pregnancy_relations)
{ {
baby.relations.AddDirectRelation(VariousDefOf.Relation_birthgiver, mother); baby.relations.AddDirectRelation(VariousDefOf.Relation_birthgiver, mother);
mother.relations.AddDirectRelation(VariousDefOf.Relation_spawn, baby); mother.relations.AddDirectRelation(VariousDefOf.Relation_spawn, baby);

View file

@ -3,6 +3,8 @@ Version 1.0.6.1
- Fix errors when a hybrid refers to an invalid race. - Fix errors when a hybrid refers to an invalid race.
- A pawn in estrus will prefer partners and sex types that would result in pregnancy. - A pawn in estrus will prefer partners and sex types that would result in pregnancy.
- Optional (default disabled) alternative casual hookup settings for a pawn in visible estrus. - Optional (default disabled) alternative casual hookup settings for a pawn in visible estrus.
- Babies born to slaves will have the right faction.
- Respect RJW's bestiality pregnancy relations setting.
- Contributed by amevarashi: - Contributed by amevarashi:
- Fix womb cleaning job if no buckets on the map. - Fix womb cleaning job if no buckets on the map.