Exemplo n.º 1
0
        public static float PackmateGeneratorChance(
            Pawn generated,
            Pawn other,
            PawnGenerationRequest request,
            bool ex)
        {
            if ((double)generated.ageTracker.AgeBiologicalYearsFloat < 5.0)
            {
                if (!(generated.RaceProps.body.defName == AvaliDefs.RimValiBody.defName))
                {
                    return(0.0f);
                }
            }
            if (!(other.RaceProps.body.defName == AvaliDefs.RimValiBody.defName))
            {
                return(0.0f);
            }
            float num1 = 2f;
            float generationChanceAgeFactor1 = PackRelationUtilityWorker.GetGenerationChanceAgeFactor(generated);
            float generationChanceAgeFactor2 = PackRelationUtilityWorker.GetGenerationChanceAgeFactor(other);
            float chanceAgeGapFactor         = PackRelationUtilityWorker.GetGenerationChanceAgeGapFactor(generated, other, ex);
            float num4 = 2f;
            float num5 = !request.FixedMelanin.HasValue ? PawnSkinColors.GetMelaninCommonalityFactor(other.story.melanin) : ChildRelationUtility.GetMelaninSimilarityFactor(request.FixedMelanin.Value, other.story.melanin);

            return(num1 * generationChanceAgeFactor1 * generationChanceAgeFactor2 * chanceAgeGapFactor * num5 * num4);
        }
Exemplo n.º 2
0
 public override float GenerationChance(Pawn generated, Pawn other, PawnGenerationRequest request)
 {
     return(PackRelationUtilityWorker.PackmateGeneratorChance(generated, other, request, false) * this.BaseGenerationChanceFactor(generated, other, request));
 }