Give animal children the standard mother/father relations instead of the old RJW_Sire/RJW_Pup ones

This commit is contained in:
lutepickle 2022-07-02 07:51:23 -07:00
parent b7a911000e
commit d186afa8ba
3 changed files with 5 additions and 12 deletions

Binary file not shown.

View File

@ -423,7 +423,7 @@ namespace RJW_Menstruation
Pawn baby = PawnGenerator.GeneratePawn(request); Pawn baby = PawnGenerator.GeneratePawn(request);
if (baby != null) if (baby != null)
{ {
if (xxx.is_human(baby)) if (xxx.is_human(baby) || (baby.relations != null && !RJWSettings.Disable_bestiality_pregnancy_relations))
{ {
baby.SetMother(mother); baby.SetMother(mother);
if (mother != father) if (mother != father)
@ -434,23 +434,15 @@ namespace RJW_Menstruation
baby.relations.AddDirectRelation(PawnRelationDefOf.Parent, father); baby.relations.AddDirectRelation(PawnRelationDefOf.Parent, father);
} }
} }
}
if (xxx.is_human(baby))
{
// Ensure the same inherited traits are chosen each run // Ensure the same inherited traits are chosen each run
// Has to happen right here so GeneratePawn up there still gets unique results // 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 Rand.PushState(traitSeed); // With a seed just to make sure that fraternal twins *don't* get trait-duped
UpdateTraits(baby, parentTraits); UpdateTraits(baby, parentTraits);
Rand.PopState(); Rand.PopState();
} }
else if (baby.relations != null && !RJWSettings.Disable_bestiality_pregnancy_relations)
{
baby.relations.AddDirectRelation(VariousDefOf.Relation_birthgiver, mother);
mother.relations.AddDirectRelation(VariousDefOf.Relation_spawn, baby);
if (mother != father)
{
baby.relations.AddDirectRelation(VariousDefOf.Relation_birthgiver, father);
father.relations.AddDirectRelation(VariousDefOf.Relation_spawn, baby);
}
}
} }
else Log.Error("Baby not generated. Request: " + request.ToString()); else Log.Error("Baby not generated. Request: " + request.ToString());
return baby; return baby;

View File

@ -22,6 +22,7 @@ namespace RJW_Menstruation
public static readonly HediffDef Hediff_Estrus_Concealed = DefDatabase<HediffDef>.GetNamed("Hediff_Estrus_Concealed"); public static readonly HediffDef Hediff_Estrus_Concealed = DefDatabase<HediffDef>.GetNamed("Hediff_Estrus_Concealed");
public static readonly HediffDef Hediff_ASA = DefDatabase<HediffDef>.GetNamed("Hediff_ASA"); public static readonly HediffDef Hediff_ASA = DefDatabase<HediffDef>.GetNamed("Hediff_ASA");
public static readonly StatDef MaxAbsorbable = DefDatabase<StatDef>.GetNamed("MaxAbsorbable"); public static readonly StatDef MaxAbsorbable = DefDatabase<StatDef>.GetNamed("MaxAbsorbable");
// Obsolete, kept for compatibility for now
public static readonly PawnRelationDef Relation_birthgiver = DefDatabase<PawnRelationDef>.AllDefs.FirstOrDefault(d => d.defName == "RJW_Sire"); public static readonly PawnRelationDef Relation_birthgiver = DefDatabase<PawnRelationDef>.AllDefs.FirstOrDefault(d => d.defName == "RJW_Sire");
public static readonly PawnRelationDef Relation_spawn = DefDatabase<PawnRelationDef>.AllDefs.FirstOrDefault(d => d.defName == "RJW_Pup"); public static readonly PawnRelationDef Relation_spawn = DefDatabase<PawnRelationDef>.AllDefs.FirstOrDefault(d => d.defName == "RJW_Pup");
public static readonly NeedDef SexNeed = DefDatabase<NeedDef>.GetNamed("Sex"); public static readonly NeedDef SexNeed = DefDatabase<NeedDef>.GetNamed("Sex");