using RimWorld; using rjw; using Verse; namespace RJWSexperience.Ideology { public static class IdeoUtility { public static bool IsSubmissive(this Pawn pawn) { Ideo ideo = pawn.Ideo; if (ideo == null) return false; if (ideo.HasPrecept(VariousDefOf.Submissive_Female) && pawn.gender == Gender.Female) return true; else if (ideo.HasPrecept(VariousDefOf.Submissive_Male) && pawn.gender == Gender.Male) return true; return false; } public static float GetPreceptsMtbMultiplier(Ideo ideo) where T : Precepts.DefExtension_ModifyMtb { float finalMultiplier = 1f; for (int i = 0; i < ideo.PreceptsListForReading.Count; i++) { T defExtension = ideo.PreceptsListForReading[i].def.GetModExtension(); if (defExtension == null) continue; finalMultiplier *= defExtension.multiplier; } return finalMultiplier; } public static float getGenitalSize(Pawn p) { if (p == null) return 0f; // Iff the pawn has multiple genitalia, the "best" is picked (the biggest penis or tightest vagina) float best_seen_size = 0f; foreach (Hediff part in rjw.Genital_Helper.get_AllPartsHediffList(p)) { // Only check for Vaginas and Penises, not for Anus or for things not categorized as primary sexual parts if (Genital_Helper.is_penis(part) || Genital_Helper.is_vagina(part)) { best_seen_size = part.Severity > best_seen_size ? part.Severity : best_seen_size; } } // For Women, the scale is inverted. if (p.gender == Gender.Female) return 1 - best_seen_size; return best_seen_size; } } }