Exemplo n.º 1
0
        public static bool IsPregnant(this Pawn pawn, bool mustBeVisible = false)
        {
            var set = pawn.health.hediffSet;

            return(set.HasHediff(HediffDefOf.Pregnant, mustBeVisible) ||
                   Hediff_BasePregnancy.KnownPregnancies().Any(x => set.HasHediff(HediffDef.Named(x), mustBeVisible)));
        }
        public static Hediff GetPregnancy(Pawn pawn)
        {
            var set = pawn.health.hediffSet;

            Hediff preg =
                Hediff_BasePregnancy.KnownPregnancies()
                .Select(x => set.GetFirstHediffOfDef(HediffDef.Named(x)))
                .FirstOrDefault(x => x != null) ??
                set.GetFirstHediffOfDef(HediffDef.Named("Pregnant"));

            return(preg);
        }
 //Plant babies for human/bestiality pregnancy
 public static void PregnancyDecider(Pawn mother, Pawn father)
 {
     //human-human
     if (RJWPregnancySettings.humanlike_pregnancy_enabled && xxx.is_human(mother) && xxx.is_human(father))
     {
         CompEggLayer compEggLayer = mother.TryGetComp <CompEggLayer>();
         if (compEggLayer != null)
         {
             // fertilize eggs of humanlikes ?!
             if (!compEggLayer.FullyFertilized)
             {
                 compEggLayer.Fertilize(father);
             }
         }
         else
         {
             Hediff_BasePregnancy.Create <Hediff_HumanlikePregnancy>(mother, father);
         }
     }
     //human-animal
     //maybe make separate option for human males vs female animals???
     else if (RJWPregnancySettings.bestial_pregnancy_enabled && ((xxx.is_human(mother) && xxx.is_animal(father)) || (xxx.is_animal(mother) && xxx.is_human(father))))
     {
         CompEggLayer compEggLayer = mother.TryGetComp <CompEggLayer>();
         if (compEggLayer != null)
         {
             // cant fertilize eggs
         }
         else
         {
             Hediff_BasePregnancy.Create <Hediff_BestialPregnancy>(mother, father);
         }
     }
     //animal-animal
     else if (xxx.is_animal(mother) && xxx.is_animal(father))
     {
         CompEggLayer compEggLayer = mother.TryGetComp <CompEggLayer>();
         if (compEggLayer != null)
         {
             // fertilize eggs of same species
             if (mother.kindDef == father.kindDef)
             {
                 compEggLayer.Fertilize(father);
             }
         }
         else if (RJWPregnancySettings.animal_pregnancy_enabled)
         {
             Hediff_BasePregnancy.Create <Hediff_BestialPregnancy>(mother, father);
         }
     }
 }
        private static bool ProcessVanillaPregnancy(Hediff_Pregnant pregnancy, Pawn mother, Pawn father)
        {
            void CreateAndBirth <T>() where T : Hediff_BasePregnancy
            {
                T hediff = Hediff_BasePregnancy.Create <T>(mother, father);

                //hediff.Initialize(mother, father);
                hediff.GiveBirth();
                if (pregnancy != null)
                {
                    mother.health.RemoveHediff(pregnancy);
                }
            }

            if (father == null)
            {
                father = Hediff_BasePregnancy.Trytogetfather(ref mother);
            }

            Log.Message("patches_pregnancy::PATCH_Hediff_Pregnant::DoBirthSpawn():Vanilla_pregnancy birthing:" + xxx.get_pawnname(mother));
            if (RJWPregnancySettings.animal_pregnancy_enabled && ((father == null || xxx.is_animal(father)) && xxx.is_animal(mother)))
            {
                //RJW Bestial pregnancy animal-animal
                Log.Message(" override as Bestial birthing(animal-animal): Father-" + xxx.get_pawnname(father) + " Mother-" + xxx.get_pawnname(mother));
                CreateAndBirth <Hediff_BestialPregnancy>();
                return(false);
            }
            else if (RJWPregnancySettings.bestial_pregnancy_enabled && ((xxx.is_animal(father) && xxx.is_human(mother)) || (xxx.is_human(father) && xxx.is_animal(mother))))
            {
                //RJW Bestial pregnancy human-animal
                Log.Message(" override as Bestial birthing(human-animal): Father-" + xxx.get_pawnname(father) + " Mother-" + xxx.get_pawnname(mother));
                CreateAndBirth <Hediff_BestialPregnancy>();
                return(false);
            }
            else if (RJWPregnancySettings.humanlike_pregnancy_enabled && (xxx.is_human(father) && xxx.is_human(mother)))
            {
                //RJW Humanlike pregnancy
                Log.Message(" override as Humanlike birthing: Father-" + xxx.get_pawnname(father) + " Mother-" + xxx.get_pawnname(mother));
                CreateAndBirth <Hediff_HumanlikePregnancy>();
                return(false);
            }
            else
            {
                Log.Warning("Hediff_Pregnant::DoBirthSpawn() - rjw checks failed, vanilla pregnancy birth");
                Log.Warning("Hediff_Pregnant::DoBirthSpawn(): Father-" + xxx.get_pawnname(father) + " Mother-" + xxx.get_pawnname(mother));
                //vanilla pregnancy code, no effects on rjw

                return(true);
            }
        }
        private static bool ProcessRJWPregnancy(Pawn mother, Pawn father)
        {
            Hediff_BasePregnancy preg =
                (Hediff_BasePregnancy)mother.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("RJW_pregnancy")) ??                  //RJW Humanlike pregnancy
                (Hediff_BasePregnancy)mother.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("RJW_pregnancy_beast")) ??            //RJW Bestial pregnancy
                (Hediff_BasePregnancy)mother.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("RJW_pregnancy_mech"));               //RJW Bestial pregnancy

            if (preg != null)
            {
                Log.Message($"patches_pregnancy::{preg.GetType().Name}::DoBirthSpawn() birthing:" + xxx.get_pawnname(mother));
                preg.GiveBirth();
                return(true);
            }

            return(false);
        }
        private static bool ProcessDebugPregnancy(Pawn mother, Pawn father)
        {
            void CreateAndBirth <T>() where T : Hediff_BasePregnancy
            {
                T hediff = Hediff_BasePregnancy.Create <T>(mother, father);

                //hediff.Initialize(mother, father);
                hediff.GiveBirth();
            }

            //CreateAndBirth<Hediff_HumanlikePregnancy>();
            //CreateAndBirth<Hediff_BestialPregnancy>();
            //CreateAndBirth<Hediff_MechanoidPregnancy>();
            //return false;

            //debug, add RJW pregnancy and birth it
            Log.Message("patches_pregnancy::PATCH_Hediff_Pregnant::DoBirthSpawn():Debug_pregnancy birthing:" + xxx.get_pawnname(mother));
            if (father == null)
            {
                father = Hediff_BasePregnancy.Trytogetfather(ref mother);

                if (RJWPregnancySettings.bestial_pregnancy_enabled && ((xxx.is_animal(father) || xxx.is_animal(mother))) ||
                    (xxx.is_animal(mother) && RJWPregnancySettings.animal_pregnancy_enabled))
                {
                    //RJW Bestial pregnancy
                    Log.Message(" override as Bestial birthing, mother: " + xxx.get_pawnname(mother));
                    CreateAndBirth <Hediff_BestialPregnancy>();
                }
                else if (RJWPregnancySettings.humanlike_pregnancy_enabled && ((father == null || xxx.is_human(father)) && xxx.is_human(mother)))
                {
                    //RJW Humanlike pregnancy
                    Log.Message(" override as Humanlike birthing, mother: " + xxx.get_pawnname(mother));
                    CreateAndBirth <Hediff_HumanlikePregnancy>();
                }
                else
                {
                    Log.Warning("Hediff_Pregnant::DoBirthSpawn() - debug vanilla pregnancy birth");
                    return(true);
                }
            }
            return(false);
        }
Exemplo n.º 7
0
        public override IEnumerable <BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
        {
            BodyPartRecord part = pawn.RaceProps.body.corePart;

            if (recipe.appliedOnFixedBodyParts[0] != null)
            {
                part = pawn.RaceProps.body.AllParts.Find(x => x.def == recipe.appliedOnFixedBodyParts[0]);
            }
            if (part != null)
            {
                bool isMatch = Hediff_BasePregnancy.KnownPregnancies()                                                                              // For every known pregnancy
                               .Where(x => pawn.health.hediffSet.HasHediff(HediffDef.Named(x), true) && recipe.removesHediff == HediffDef.Named(x)) // Find matching bodyparts
                               .Select(x => (Hediff_BasePregnancy)pawn.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named(x)))                    // get pregnancy hediff
                               .Where(pregnancy => pregnancy.is_checked)                                                                            // Find checked pregnancies (should be visible pregnancies there?)
                               .Any();                                                                                                              // return true if found something
                if (isMatch)
                {
                    yield return(part);
                }
            }
        }
        //called by aftersex (including rape, breed, etc)
        //called by mcevent

        //pawn - "father"; partner = mother
        public static void impregnate(Pawn pawn, Pawn partner, xxx.rjwSextype sextype = xxx.rjwSextype.None)
        {
            if (RJWSettings.DevMode)
            {
                Log.Message("Rimjobworld::impregnate(" + sextype + "):: " + xxx.get_pawnname(pawn) + " + " + xxx.get_pawnname(partner) + ":");
            }

            //"mech" pregnancy
            if (sextype == xxx.rjwSextype.MechImplant)
            {
                if (RJWPregnancySettings.mechanoid_pregnancy_enabled)
                {
                    if (RJWSettings.DevMode)
                    {
                        Log.Message(" mechanoid pregnancy");
                    }

                    // removing old pregnancies
                    if (RJWSettings.DevMode)
                    {
                        Log.Message("[RJW] removing other pregnancies");
                    }
                    var preg = GetPregnancy(partner);
                    if (preg != null)
                    {
                        if (preg is Hediff_BasePregnancy)
                        {
                            (preg as Hediff_BasePregnancy).Kill();
                        }
                        else
                        {
                            partner.health.RemoveHediff(preg);
                        }
                    }

                    // new pregnancy
                    Hediff_MechanoidPregnancy hediff = Hediff_BasePregnancy.Create <Hediff_MechanoidPregnancy>(partner, pawn);

                    return;

                    /*
                     * // Not an actual pregnancy. This implants mechanoid tech into the target.
                     * //may lead to pregnancy
                     * //old "chip pregnancies", maybe integrate them somehow?
                     * //Rand.PopState();
                     * //Rand.PushState(RJW_Multiplayer.PredictableSeed());
                     * HediffDef_MechImplants egg = (from x in DefDatabase<HediffDef_MechImplants>.AllDefs	select x).RandomElement();
                     * if (egg != null)
                     * {
                     *      if (RJWSettings.DevMode) Log.Message(" planting MechImplants:" + egg.ToString());
                     *      PlantSomething(egg, partner, !Genital_Helper.has_vagina(partner), 1);
                     *      return;
                     * }
                     * else
                     * {
                     *      if (RJWSettings.DevMode) Log.Message(" no mech implant found");
                     * }*/
                }
                return;
            }

            // Sextype can result in pregnancy.
            if (!(sextype == xxx.rjwSextype.Vaginal || sextype == xxx.rjwSextype.DoublePenetration))
            {
                return;
            }

            //Log.Message("[RJW] RaceImplantEggs()" + pawn.RaceImplantEggs());
            //"insect" pregnancy
            //straight, female (partner) recives egg insertion from other/sex starter (pawn)
            var pawnpartBPR    = Genital_Helper.get_genitalsBPR(pawn);
            var pawnparts      = Genital_Helper.get_PartsHediffList(pawn, pawnpartBPR);
            var partnerpartBPR = Genital_Helper.get_genitalsBPR(partner);
            var partnerparts   = Genital_Helper.get_PartsHediffList(partner, partnerpartBPR);

            if (Genital_Helper.has_vagina(partner, partnerparts) &&
                (Genital_Helper.has_ovipositorF(pawn, pawnparts) ||
                 (Genital_Helper.has_ovipositorM(pawn, pawnparts) ||
                  (Genital_Helper.has_penis_fertile(pawn, pawnparts) && pawn.RaceImplantEggs())))
                )
            {
                DoEgg(pawn, partner);
                return;
            }
            //reverse, female (pawn) starts sex/passive bestiality and fills herself with eggs - this is likely f****d up and needs fixing at jobdriver, processsex and aftersex levels
            else
            if (Genital_Helper.has_vagina(pawn, pawnparts) &&
                (Genital_Helper.has_ovipositorF(partner, partnerparts) ||
                 (Genital_Helper.has_ovipositorM(partner, partnerparts) ||
                  (Genital_Helper.has_penis_fertile(partner, partnerparts) && pawn.RaceImplantEggs())))
                )
            {
                DoEgg(partner, pawn);
                return;
            }

            //"normal" and "beastial" pregnancy
            if (RJWSettings.DevMode)
            {
                Log.Message(" 'normal' pregnancy checks");
            }

            //futa-futa docking?
            //if (CanImpregnate(partner, pawn, sextype) && CanImpregnate(pawn, partner, sextype))
            //{
            //Log.Message("[RJW] futa-futa docking...");
            //return;
            //Doimpregnate(pawn, partner);
            //Doimpregnate(partner, pawn);
            //}
            //normal, when female is passive/recives interaction
            if (Genital_Helper.has_penis_fertile(pawn, pawnparts) && Genital_Helper.has_vagina(partner, partnerparts) && CanImpregnate(pawn, partner, sextype))
            {
                if (RJWSettings.DevMode)
                {
                    Log.Message(" impregnate forward");
                }
                Doimpregnate(pawn, partner);
            }
            //reverse, when female active/starts interaction
            else if (Genital_Helper.has_vagina(pawn, pawnparts) && Genital_Helper.has_penis_fertile(partner, partnerparts) && CanImpregnate(partner, pawn, sextype))
            {
                if (RJWSettings.DevMode)
                {
                    Log.Message(" impregnate reverse");
                }
                Doimpregnate(partner, pawn);
            }
        }
Exemplo n.º 9
0
        private static bool on_begin_DoBirthSpawn(ref Pawn mother, ref Pawn father)
        {
            //--Log.Message("patches_pregnancy::PATCH_Hediff_Pregnant::DoBirthSpawn() called");

            if (mother == null)
            {
                Log.Error("Hediff_Pregnant::DoBirthSpawn() - no mother defined -> exit");
                return(false);
            }

            //vanilla debug?
            if (mother.gender == Gender.Male)
            {
                Log.Error("Hediff_Pregnant::DoBirthSpawn() - mother is male -> exit");
                return(false);
            }

            //Rand.PopState();
            //Rand.PushState(RJW_Multiplayer.PredictableSeed());

            // get a reference to the hediff we are applying
            //do birth for vanilla pregnancy Hediff
            //if using rjw pregnancies - add RJW pregnancy Hediff and birth it instead
            Hediff_Pregnant self = (Hediff_Pregnant)mother.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("Pregnant"));

            if (self != null)
            {
                if (father == null)
                {
                    father = Hediff_BasePregnancy.Trytogetfather(ref mother);
                }
                Log.Message("patches_pregnancy::PATCH_Hediff_Pregnant::DoBirthSpawn():Vanilla_pregnancy birthing:" + xxx.get_pawnname(mother));
                if (RJWPregnancySettings.animal_pregnancy_enabled && ((father == null || xxx.is_animal(father)) && xxx.is_animal(mother)))
                {
                    //RJW Bestial pregnancy animal-animal
                    Log.Message(" override as Bestial birthing(animal-animal): Father-" + xxx.get_pawnname(father) + " Mother-" + xxx.get_pawnname(mother));
                    Hediff_BestialPregnancy.Create(mother, father);
                    Hediff_BestialPregnancy hediff = (Hediff_BestialPregnancy)mother.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("RJW_pregnancy_beast"));
                    hediff.Initialize(mother, father);
                    hediff.GiveBirth();
                    if (self != null)
                    {
                        mother.health.RemoveHediff(self);
                    }

                    return(false);
                }
                else if (RJWPregnancySettings.bestial_pregnancy_enabled && ((xxx.is_animal(father) && xxx.is_human(mother)) || (xxx.is_human(father) && xxx.is_animal(mother))))
                {
                    //RJW Bestial pregnancy human-animal
                    Log.Message(" override as Bestial birthing(human-animal): Father-" + xxx.get_pawnname(father) + " Mother-" + xxx.get_pawnname(mother));
                    Hediff_BestialPregnancy.Create(mother, father);
                    Hediff_BestialPregnancy hediff = (Hediff_BestialPregnancy)mother.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("RJW_pregnancy_beast"));
                    hediff.Initialize(mother, father);
                    hediff.GiveBirth();
                    if (self != null)
                    {
                        mother.health.RemoveHediff(self);
                    }

                    return(false);
                }
                else if (RJWPregnancySettings.humanlike_pregnancy_enabled && (xxx.is_human(father) && xxx.is_human(mother)))
                {
                    //RJW Humanlike pregnancy
                    Log.Message(" override as Humanlike birthing: Father-" + xxx.get_pawnname(father) + " Mother-" + xxx.get_pawnname(mother));
                    Hediff_HumanlikePregnancy.Create(mother, father);
                    Hediff_HumanlikePregnancy hediff = (Hediff_HumanlikePregnancy)mother.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("RJW_pregnancy"));
                    hediff.Initialize(mother, father);
                    hediff.GiveBirth();
                    if (self != null)
                    {
                        mother.health.RemoveHediff(self);
                    }

                    return(false);
                }
                else
                {
                    Log.Warning("Hediff_Pregnant::DoBirthSpawn() - rjw checks failed, vanilla pregnancy birth");
                    Log.Warning("Hediff_Pregnant::DoBirthSpawn(): Father-" + xxx.get_pawnname(father) + " Mother-" + xxx.get_pawnname(mother));
                    //vanilla pregnancy code, no effects on rjw
                    int num = (mother.RaceProps.litterSizeCurve == null) ? 1 : Mathf.RoundToInt(Rand.ByCurve(mother.RaceProps.litterSizeCurve));
                    if (num < 1)
                    {
                        num = 1;
                    }
                    PawnGenerationRequest request = new PawnGenerationRequest(mother.kindDef, mother.Faction, PawnGenerationContext.NonPlayer, -1, forceGenerateNewPawn: false, newborn: true);
                    Pawn pawn = null;
                    for (int i = 0; i < num; i++)
                    {
                        pawn = PawnGenerator.GeneratePawn(request);
                        if (PawnUtility.TrySpawnHatchedOrBornPawn(pawn, mother))
                        {
                            if (pawn.playerSettings != null && mother.playerSettings != null)
                            {
                                pawn.playerSettings.AreaRestriction = mother.playerSettings.AreaRestriction;
                            }
                            if (pawn.RaceProps.IsFlesh)
                            {
                                pawn.relations.AddDirectRelation(PawnRelationDefOf.Parent, mother);
                                if (father != null)
                                {
                                    pawn.relations.AddDirectRelation(PawnRelationDefOf.Parent, father);
                                }
                            }
                        }
                        else
                        {
                            Find.WorldPawns.PassToWorld(pawn, PawnDiscardDecideMode.Discard);
                        }
                        TaleRecorder.RecordTale(TaleDefOf.GaveBirth, mother, pawn);
                    }
                    if (mother.Spawned)
                    {
                        FilthMaker.MakeFilth(mother.Position, mother.Map, ThingDefOf.Filth_AmnioticFluid, mother.LabelIndefinite(), 5);
                        if (mother.caller != null)
                        {
                            mother.caller.DoCall();
                        }
                        if (pawn.caller != null)
                        {
                            pawn.caller.DoCall();
                        }
                    }
                    if (self != null)
                    {
                        mother.health.RemoveHediff(self);
                    }

                    return(false);
                }
            }

            // do birth for existing RJW pregnancies

            Hediff_HumanlikePregnancy rjwH = (Hediff_HumanlikePregnancy)mother.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("RJW_pregnancy"));

            if (rjwH != null)
            {
                //RJW Bestial pregnancy
                Log.Message("patches_pregnancy::PATCH_Hediff_Pregnant::DoBirthSpawn():RJW_pregnancy birthing:" + xxx.get_pawnname(mother));
                rjwH.GiveBirth();
                if (self == null)
                {
                    return(false);
                }
            }

            Hediff_BestialPregnancy rjwB = (Hediff_BestialPregnancy)mother.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("RJW_pregnancy_beast"));

            if (rjwB != null)
            {
                //RJW Humanlike pregnancy
                Log.Message("patches_pregnancy::PATCH_Hediff_Pregnant::DoBirthSpawn():RJW_pregnancy_beast birthing:" + xxx.get_pawnname(mother));
                rjwB.GiveBirth();
                if (self == null)
                {
                    return(false);
                }
            }

            //debug, add RJW pregnancy and birth it
            Log.Message("patches_pregnancy::PATCH_Hediff_Pregnant::DoBirthSpawn():Debug_pregnancy birthing:" + xxx.get_pawnname(mother));
            if (father == null)
            {
                father = Hediff_BasePregnancy.Trytogetfather(ref mother);
            }

            /*
             * if (true)
             * {
             *      //RJW Mech pregnancy
             *      Log.Message(" override as mech birthing:" + xxx.get_pawnname(mother));
             *      Hediff_MechanoidPregnancy.Create(mother, father);
             *      Hediff_MechanoidPregnancy hediff = (Hediff_MechanoidPregnancy)mother.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("RJW_pregnancy_mech"));
             *      hediff.GiveBirth();
             *      return false;
             * }
             */

            if (RJWPregnancySettings.bestial_pregnancy_enabled && ((xxx.is_animal(father) || xxx.is_animal(mother))) ||
                (xxx.is_animal(mother) && RJWPregnancySettings.animal_pregnancy_enabled))
            {
                //RJW Bestial pregnancy
                Log.Message(" override as Bestial birthing, mother: " + xxx.get_pawnname(mother));
                Hediff_BestialPregnancy.Create(mother, father);
                Hediff_BestialPregnancy hediff = (Hediff_BestialPregnancy)mother.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("RJW_pregnancy_beast"));
                hediff.GiveBirth();
            }
            else if (RJWPregnancySettings.humanlike_pregnancy_enabled && ((father == null || xxx.is_human(father)) && xxx.is_human(mother)))
            {
                //RJW Humanlike pregnancy
                Log.Message(" override as Humanlike birthing, mother: " + xxx.get_pawnname(mother));
                Hediff_HumanlikePregnancy.Create(mother, father);
                Hediff_HumanlikePregnancy hediff = (Hediff_HumanlikePregnancy)mother.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("RJW_pregnancy"));
                hediff.GiveBirth();
            }
            else
            {
                Log.Warning("Hediff_Pregnant::DoBirthSpawn() - debug vanilla pregnancy birth");
                //vanilla code
                int num = (mother.RaceProps.litterSizeCurve == null) ? 1 : Mathf.RoundToInt(Rand.ByCurve(mother.RaceProps.litterSizeCurve));
                if (num < 1)
                {
                    num = 1;
                }
                PawnGenerationRequest request = new PawnGenerationRequest(mother.kindDef, mother.Faction, PawnGenerationContext.NonPlayer, -1, forceGenerateNewPawn: false, newborn: true);
                Pawn pawn = null;
                for (int i = 0; i < num; i++)
                {
                    pawn = PawnGenerator.GeneratePawn(request);
                    if (PawnUtility.TrySpawnHatchedOrBornPawn(pawn, mother))
                    {
                        if (pawn.playerSettings != null && mother.playerSettings != null)
                        {
                            pawn.playerSettings.AreaRestriction = mother.playerSettings.AreaRestriction;
                        }
                        if (pawn.RaceProps.IsFlesh)
                        {
                            pawn.relations.AddDirectRelation(PawnRelationDefOf.Parent, mother);
                            if (father != null)
                            {
                                pawn.relations.AddDirectRelation(PawnRelationDefOf.Parent, father);
                            }
                        }
                    }
                    else
                    {
                        Find.WorldPawns.PassToWorld(pawn, PawnDiscardDecideMode.Discard);
                    }
                    TaleRecorder.RecordTale(TaleDefOf.GaveBirth, mother, pawn);
                }
                if (mother.Spawned)
                {
                    FilthMaker.MakeFilth(mother.Position, mother.Map, ThingDefOf.Filth_AmnioticFluid, mother.LabelIndefinite(), 5);
                    if (mother.caller != null)
                    {
                        mother.caller.DoCall();
                    }
                    if (pawn.caller != null)
                    {
                        pawn.caller.DoCall();
                    }
                }
                if (self != null)
                {
                    mother.health.RemoveHediff(self);
                }
            }
            return(false);
        }