diff --git a/Source/Modules/Pregnancy/Hediffs/Hediff_BasePregnancy.cs b/Source/Modules/Pregnancy/Hediffs/Hediff_BasePregnancy.cs index 39d301972c69f26dbe7559b8387f4f6984716540..92229b86a916fc4bdbab5a76785c6674c9643d18 100644 --- a/Source/Modules/Pregnancy/Hediffs/Hediff_BasePregnancy.cs +++ b/Source/Modules/Pregnancy/Hediffs/Hediff_BasePregnancy.cs @@ -503,22 +503,50 @@ namespace rjw { if (xxx.is_human(mother)) { - mother.health.AddHediff(HediffDef.Named("PostPregnancy"), null, null); - mother.health.AddHediff(HediffDef.Named("Lactating"), mother.RaceProps.body.AllParts.Find(x => x.def.defName == "Torso"), null); - mother.needs.mood.thoughts.memories.TryGainMemory(ThoughtDef.Named("IGaveBirth")); + //BnC compatibility + if (DefDatabase<HediffDef>.GetNamedSilentFail("BnC_RJW_PostPregnancy") == null) + { + mother.health.AddHediff(HediffDef.Named("PostPregnancy"), null, null); + mother.health.AddHediff(HediffDef.Named("Lactating"), mother.RaceProps.body.AllParts.Find(x => x.def.defName == "Chest"), null); + } + if (xxx.is_human(baby)) + if (mother.records.GetAsInt(xxx.CountOfBirthHuman) == 0 && + mother.records.GetAsInt(xxx.CountOfBirthAnimal) == 0 && + mother.records.GetAsInt(xxx.CountOfBirthInsect) == 0 ) + { + mother.needs.mood.thoughts.memories.TryGainMemory(ThoughtDef.Named("IGaveBirthFirstTime")); + } + else + { + mother.needs.mood.thoughts.memories.TryGainMemory(ThoughtDef.Named("IGaveBirth")); + } } - if (xxx.is_human(father)) - { - father.needs.mood.thoughts.memories.TryGainMemory(ThoughtDef.Named("PartnerGaveBirth")); - } + if (xxx.is_human(baby)) + if (xxx.is_human(father)) + { + father.needs.mood.thoughts.memories.TryGainMemory(ThoughtDef.Named("PartnerGaveBirth")); + } if (xxx.is_human(baby)) { - Log.Message("Rewriting story of " + baby); - baby.story.childhood = BackstoryDatabase.allBackstories["NA_Childhood"]; + Log.Message("[RJW]PostBirth:: Rewriting story of " + baby); + var disabledBaby = BackstoryDatabase.allBackstories["CustomBackstory_NA_Childhood_Disabled"]; + if (disabledBaby != null) + { + baby.story.childhood = disabledBaby; + } + else + { + Log.Error("Couldn't find the required Backstory: CustomBackstory_NA_Childhood_Disabled!"); + baby.story.childhood = null; + } } } + if (baby.playerSettings != null && mother.playerSettings != null) + { + baby.playerSettings.AreaRestriction = mother.playerSettings.AreaRestriction; + } //spawn futa bool isfuta = spawnfutachild(baby, mother, father);