Ejemplo n.º 1
0
        public static string GetTraitRollChanceText(TraitDef traitDef)
        {
            string pecentMale   = GetTraitRollChance(traitDef, Gender.Male).ToString("0.0");
            string pecentFemale = GetTraitRollChance(traitDef, Gender.Female).ToString("0.0");

            if (traitDef.GetGenderSpecificCommonality(Gender.Male) == traitDef.GetGenderSpecificCommonality(Gender.Female))
            {
                return($"({pecentMale}%)");
            }
            return($"(♂:{pecentMale}%,♀:{pecentFemale}%)");
        }
Ejemplo n.º 2
0
        public static float GetTraitRollChance(TraitDef traitDef, Gender gender = Gender.Male)
        {
            float total = GetTotalTraitCommonality(gender);

            return(traitDef.GetGenderSpecificCommonality(gender) * 100 / total);
        }