public override float GenerationChance(Pawn generated, Pawn other, PawnGenerationRequest request) { float num = 1f; float num2 = 1f; if (other.GetFather() == null && other.GetMother() == null) { num2 = ((!request.FixedMelanin.HasValue) ? PawnSkinColors.GetMelaninCommonalityFactor(other.story.melanin) : ChildRelationUtility.GetMelaninSimilarityFactor(request.FixedMelanin.Value, other.story.melanin)); } else { num = ChildRelationUtility.ChanceOfBecomingChildOf(generated, other.GetFather(), other.GetMother(), request, null, null); } float num3 = Mathf.Abs(generated.ageTracker.AgeChronologicalYearsFloat - other.ageTracker.AgeChronologicalYearsFloat); float num4 = 1f; if (num3 > 40.0) { num4 = 0.2f; } else if (num3 > 10.0) { num4 = 0.65f; } return(num * num2 * num4 * base.BaseGenerationChanceFactor(generated, other, request)); }
public static void TryToShareChildrenForGeneratedLovePartner(Pawn generated, Pawn other, PawnGenerationRequest request, float extraChanceFactor) { if (generated.gender != other.gender) { List <Pawn> list = other.relations.Children.ToList(); for (int i = 0; i < list.Count; i++) { Pawn pawn = list[i]; float num = 1f; if (generated.gender == Gender.Male) { num = ChildRelationUtility.ChanceOfBecomingChildOf(pawn, generated, other, null, request, null); } else if (generated.gender == Gender.Female) { num = ChildRelationUtility.ChanceOfBecomingChildOf(pawn, other, generated, null, null, request); } num *= extraChanceFactor; if (Rand.Value < num) { if (generated.gender == Gender.Male) { pawn.SetFather(generated); } else if (generated.gender == Gender.Female) { pawn.SetMother(generated); } } } } }
public override float GenerationChance(Pawn generated, Pawn other, PawnGenerationRequest request) { float num = 0f; if (other.gender == Gender.Male) { num = ChildRelationUtility.ChanceOfBecomingChildOf(generated, other, other.GetSpouseOppositeGender(), new PawnGenerationRequest?(request), null, null); } else if (other.gender == Gender.Female) { num = ChildRelationUtility.ChanceOfBecomingChildOf(generated, other.GetSpouseOppositeGender(), other, new PawnGenerationRequest?(request), null, null); } return(num * base.BaseGenerationChanceFactor(generated, other, request)); }
public override float GenerationChance(Pawn generated, Pawn other, PawnGenerationRequest request) { float num = 0f; if (generated.gender == Gender.Male) { num = ChildRelationUtility.ChanceOfBecomingChildOf(other, generated, other.GetMother(), null, request, null); } else if (generated.gender == Gender.Female) { num = ChildRelationUtility.ChanceOfBecomingChildOf(other, other.GetFather(), generated, null, null, request); } return(num * BaseGenerationChanceFactor(generated, other, request)); }