public static bool KinseyException(ref TraitSet __instance, Trait trait) { Pawn pawn = Traverse.Create(__instance).Field("pawn").GetValue <Pawn>(); Pawn_SexualityTracker ps = null; if (pawn.GetComp <CompPsychology>() != null && pawn.GetComp <CompPsychology>().isPsychologyPawn) { ps = pawn.GetComp <CompPsychology>().Sexuality; } if (ps != null && PsychologyBase.ActivateKinsey() && trait.def == TraitDefOf.Gay) { return(false); } if (ps != null && PsychologyBase.ActivateKinsey() && ps.romanticDrive < 0.5f) { if (trait.def == TraitDefOfPsychology.Codependent) { return(false); } } if (ps != null && PsychologyBase.ActivateKinsey() && ps.sexDrive < 0.5f) { if (trait.def == TraitDefOfPsychology.Lecher) { return(false); } } return(true); }
public static void GRXenoSexDrive(ref float __result, ref Pawn_SexualityTracker __instance, ref Pawn ___pawn) { SimpleCurve curve = GradualRomanceMod.GetSexDriveCurveFor(___pawn); if (curve != null) { __result = curve.Evaluate(___pawn.ageTracker.AgeBiologicalYearsFloat) * Mathf.InverseLerp(0f, 0.5f, __instance.sexDrive); if (___pawn.def.GetModExtension <XenoRomanceExtension>().canGoIntoHeat == false) { __result = Mathf.Clamp01(__result); } else { __result = Mathf.Min(__result, 0f); } } }
public static bool GRRandKinsey(ref int __result, ref Pawn_SexualityTracker __instance, ref Pawn ___pawn) { int averageKinsey; Gender pawnGender = ___pawn.gender; XenoRomanceExtension extension = ___pawn.def.GetModExtension <XenoRomanceExtension>(); if (extension.averageKinseyFemale >= 0 && pawnGender == Gender.Female) { averageKinsey = extension.averageKinseyFemale; } else if (extension.averageKinseyMale >= 0 && pawnGender == Gender.Male) { averageKinsey = extension.averageKinseyMale; } else if (pawnGender == Gender.Female) { switch (GradualRomanceMod.averageKinseyFemale) { case GradualRomanceMod.KinseyDescriptor.ExclusivelyHeterosexual: averageKinsey = 0; break; case GradualRomanceMod.KinseyDescriptor.MostlyHeterosexual: averageKinsey = 1; break; case GradualRomanceMod.KinseyDescriptor.LeansHeterosexual: averageKinsey = 2; break; case GradualRomanceMod.KinseyDescriptor.Bisexual: averageKinsey = 3; break; case GradualRomanceMod.KinseyDescriptor.LeansHomosexual: averageKinsey = 4; break; case GradualRomanceMod.KinseyDescriptor.MostlyHomosexual: averageKinsey = 5; break; case GradualRomanceMod.KinseyDescriptor.ExclusivelyHomosexual: averageKinsey = 6; break; default: averageKinsey = 0; break; } } else if (pawnGender == Gender.Male) { switch (GradualRomanceMod.averageKinseyMale) { case GradualRomanceMod.KinseyDescriptor.ExclusivelyHeterosexual: averageKinsey = 0; break; case GradualRomanceMod.KinseyDescriptor.MostlyHeterosexual: averageKinsey = 1; break; case GradualRomanceMod.KinseyDescriptor.LeansHeterosexual: averageKinsey = 2; break; case GradualRomanceMod.KinseyDescriptor.Bisexual: averageKinsey = 3; break; case GradualRomanceMod.KinseyDescriptor.LeansHomosexual: averageKinsey = 4; break; case GradualRomanceMod.KinseyDescriptor.MostlyHomosexual: averageKinsey = 5; break; case GradualRomanceMod.KinseyDescriptor.ExclusivelyHomosexual: averageKinsey = 6; break; default: averageKinsey = 0; break; } } else { averageKinsey = 0; } float fAverageKinsey = averageKinsey; __result = Mathf.Clamp((int)Rand.GaussianAsymmetric(fAverageKinsey, ((fAverageKinsey + 1f) / 2.5f), (Mathf.Abs(fAverageKinsey - 7f) / 2.5f)), 0, 6); return(false); }