public static float ChanceOfBecomingChildOf(Pawn child, Pawn father, Pawn mother, PawnGenerationRequest?childGenerationRequest, PawnGenerationRequest?fatherGenerationRequest, PawnGenerationRequest?motherGenerationRequest)
        {
            if (father != null && father.gender != Gender.Male)
            {
                Log.Warning("Tried to calculate chance for father with gender \"" + father.gender + "\".", false);
                return(0f);
            }
            if (mother != null && mother.gender != Gender.Female)
            {
                Log.Warning("Tried to calculate chance for mother with gender \"" + mother.gender + "\".", false);
                return(0f);
            }
            if (father != null && child.GetFather() != null && child.GetFather() != father)
            {
                return(0f);
            }
            if (mother != null && child.GetMother() != null && child.GetMother() != mother)
            {
                return(0f);
            }
            if (mother != null && father != null && !LovePartnerRelationUtility.LovePartnerRelationExists(mother, father) && !LovePartnerRelationUtility.ExLovePartnerRelationExists(mother, father))
            {
                return(0f);
            }
            float?melanin         = ChildRelationUtility.GetMelanin(child, childGenerationRequest);
            float?melanin2        = ChildRelationUtility.GetMelanin(father, fatherGenerationRequest);
            float?melanin3        = ChildRelationUtility.GetMelanin(mother, motherGenerationRequest);
            bool  fatherIsNew     = father != null && child.GetFather() != father;
            bool  motherIsNew     = mother != null && child.GetMother() != mother;
            float skinColorFactor = ChildRelationUtility.GetSkinColorFactor(melanin, melanin2, melanin3, fatherIsNew, motherIsNew);

            if (skinColorFactor <= 0f)
            {
                return(0f);
            }
            float num  = 1f;
            float num2 = 1f;
            float num3 = 1f;
            float num4 = 1f;

            if (father != null && child.GetFather() == null)
            {
                num = ChildRelationUtility.GetParentAgeFactor(father, child, 14f, 30f, 50f);
                if (num == 0f)
                {
                    return(0f);
                }
                if (father.story.traits.HasTrait(TraitDefOf.Gay))
                {
                    num4 = 0.1f;
                }
            }
            if (mother != null && child.GetMother() == null)
            {
                num2 = ChildRelationUtility.GetParentAgeFactor(mother, child, 16f, 27f, 45f);
                if (num2 == 0f)
                {
                    return(0f);
                }
                int num5 = ChildRelationUtility.NumberOfChildrenFemaleWantsEver(mother);
                if (mother.relations.ChildrenCount >= num5)
                {
                    return(0f);
                }
                num3 = 1f - (float)mother.relations.ChildrenCount / (float)num5;
                if (mother.story.traits.HasTrait(TraitDefOf.Gay))
                {
                    num4 = 0.1f;
                }
            }
            float num6 = 1f;

            if (mother != null)
            {
                Pawn firstDirectRelationPawn = mother.relations.GetFirstDirectRelationPawn(PawnRelationDefOf.Spouse, null);
                if (firstDirectRelationPawn != null && firstDirectRelationPawn != father)
                {
                    num6 *= 0.15f;
                }
            }
            if (father != null)
            {
                Pawn firstDirectRelationPawn2 = father.relations.GetFirstDirectRelationPawn(PawnRelationDefOf.Spouse, null);
                if (firstDirectRelationPawn2 != null && firstDirectRelationPawn2 != mother)
                {
                    num6 *= 0.15f;
                }
            }
            return(skinColorFactor * num * num2 * num3 * num6 * num4);
        }