public static void sexualize_pawn(Pawn pawn) { //Log.Message("[RJW] sexualize_pawn( " + xxx.get_pawnname(pawn) + " ) called"); if (pawn == null) { return; } if (RaceGroupDef_Helper.TryGetRaceGroupDef(pawn, out var raceGroupDef) && raceGroupDef.hasSingleGender) { Log.Message($"[RJW] sexualize_pawn() - sexualizing single gender pawn {xxx.get_pawnname(pawn)} race: {raceGroupDef.defName}"); SexualizeSingleGenderPawn(pawn); } else if (pawn.RaceProps.hasGenders) { SexualizeGenderedPawn(pawn); } else { if (Current.ProgramState == ProgramState.Playing) // DO NOT run at world generation, throws error in generating relationship stuff { SexulaizeGenderlessPawn(pawn); return; } } if (!pawn.Dead) { //Add ticks at generation, so pawns don't instantly start lovin' when generated (esp. on scenario start). //if (xxx.RoMIsActive && pawn.health.hediffSet.HasHediff(HediffDef.Named("TM_ShapeshiftHD"))) // Rimworld of Magic's polymorph/shapeshift // pawn.mindState.canLovinTick = Find.TickManager.TicksGame + (int)(SexUtility.GenerateMinTicksToNextLovin(pawn) * Rand.Range(0.01f, 0.05f)); if (!xxx.is_insect(pawn)) { pawn.mindState.canLovinTick = Find.TickManager.TicksGame + (int)(SexUtility.GenerateMinTicksToNextLovin(pawn) * Rand.Range(0.1f, 1.0f)); } else { pawn.mindState.canLovinTick = Find.TickManager.TicksGame + (int)(SexUtility.GenerateMinTicksToNextLovin(pawn) * Rand.Range(0.01f, 0.2f)); } //Log.Message("[RJW] sexualize_pawn( " + xxx.get_pawnname(pawn) + " ) add sexneed"); if (pawn.RaceProps.Humanlike) { var sex_need = pawn.needs.TryGetNeed <Need_Sex>(); if (pawn.Faction != null && !(pawn.Faction?.IsPlayer ?? false) && sex_need != null) { sex_need.CurLevel = Rand.Range(0.01f, 0.75f); } } } }