using RimWorld; using rjw; using rjw.Modules.Interactions.Rules.PartKindUsageRules.Implementation; using System; using System.Collections.Generic; using System.Linq; using Verse; namespace RJW_Menstruation { public static class VariousDefOf { public static readonly ThingDef CumFilth = DefDatabase.GetNamed("FilthCum"); public static readonly ThingDef GirlCumFilth = DefDatabase.GetNamed("FilthGirlCum"); public static readonly ThingDef Tampon = DefDatabase.GetNamed("Absorber_Tampon"); public static readonly ThingDef Tampon_Dirty = DefDatabase.GetNamed("Absorber_Tampon_Dirty"); public static readonly ThingDef FilthMixture = DefDatabase.GetNamed("FilthMixture"); public static readonly HediffDef RJW_IUD = DefDatabase.GetNamed("RJW_IUD"); public static readonly HediffDef Hediff_MenstrualCramp = DefDatabase.GetNamed("Hediff_MenstrualCramp"); public static readonly HediffDef Hediff_Estrus = DefDatabase.GetNamed("Hediff_Estrus"); public static readonly HediffDef Hediff_Estrus_Concealed = DefDatabase.GetNamed("Hediff_Estrus_Concealed"); public static readonly HediffDef Hediff_ASA = DefDatabase.GetNamed("Hediff_ASA"); public static readonly StatDef MaxAbsorbable = DefDatabase.GetNamed("MaxAbsorbable"); public static readonly NeedDef SexNeed = DefDatabase.GetNamed("Sex"); public static readonly JobDef VaginaWashing = DefDatabase.GetNamed("VaginaWashing"); public static readonly JobDef Job_LactateSelf = DefDatabase.GetNamed("LactateSelf"); public static readonly ThoughtDef LeakingFluids = DefDatabase.GetNamed("LeakingFluids"); public static readonly ThoughtDef CameInsideF = DefDatabase.GetNamed("CameInsideF"); public static readonly ThoughtDef CameInsideFLowFert = DefDatabase.GetNamed("CameInsideFLowFert"); public static readonly ThoughtDef CameInsideFFetish = DefDatabase.GetNamed("CameInsideFFetish"); public static readonly ThoughtDef CameInsideFFetishSafe = DefDatabase.GetNamed("CameInsideFFetishSafe"); public static readonly ThoughtDef HaterCameInsideFSafe = DefDatabase.GetNamed("HaterCameInsideFSafe"); public static readonly ThoughtDef HaterCameInsideF = DefDatabase.GetNamed("HaterCameInsideF"); public static readonly ThoughtDef HaterCameInsideFEstrus = DefDatabase.GetNamed("HaterCameInsideFEstrus"); public static readonly ThoughtDef CameInsideM = DefDatabase.GetNamed("CameInsideM"); public static readonly ThoughtDef HaterCameInsideM = DefDatabase.GetNamed("HaterCameInsideM"); public static readonly ThoughtDef UnwantedPregnancy = DefDatabase.GetNamed("UnwantedPregnancy"); public static readonly ThoughtDef UnwantedPregnancyMild = DefDatabase.GetNamed("UnwantedPregnancyMild"); public static readonly ThoughtDef TookContraceptivePill = DefDatabase.GetNamed("TookContraceptivePill"); public static readonly ThoughtDef HateTookContraceptivePill = DefDatabase.GetNamed("HateTookContraceptivePill"); public static readonly CompProperties_Menstruation HumanVaginaCompProperties = (CompProperties_Menstruation)Genital_Helper.average_vagina.comps.FirstOrDefault(x => x is CompProperties_Menstruation); public static readonly KeyBindingDef OpenStatusWindowKey = DefDatabase.GetNamed("OpenStatusWindow"); public static readonly RecordDef AmountofCreampied = DefDatabase.GetNamed("AmountofCreampied"); public static readonly RecordDef AmountofFertilizedEggs = DefDatabase.GetNamed("AmountofFertilizedEggs"); public static readonly TaleDef TaleCameInside = DefDatabase.GetNamed("CameInside"); public static readonly GeneDef ShortEggLifetime = DefDatabase.GetNamed("Menstruation_ShortEggLifetime"); public static readonly GeneDef DoubleEggLifetime = DefDatabase.GetNamed("Menstruation_DoubleEggLifetime"); public static readonly GeneDef QuadEggLifetime = DefDatabase.GetNamed("Menstruation_QuadEggLifetime"); public static readonly GeneDef NeverEstrus = DefDatabase.GetNamed("Menstruation_NeverEstrus"); public static readonly GeneDef FullEstrus = DefDatabase.GetNamed("Menstruation_FullEstrus"); public static readonly GeneDef DoubleOvulation = DefDatabase.GetNamed("Menstruation_DoubleOvulation"); public static readonly GeneDef QuadOvulation = DefDatabase.GetNamed("Menstruation_QuadOvulation"); public static readonly GeneDef NoBleeding = DefDatabase.GetNamed("Menstruation_NoBleeding"); public static readonly HashSet WombGenes = new HashSet() { ShortEggLifetime, DoubleEggLifetime, QuadEggLifetime, NeverEstrus, FullEstrus, DoubleOvulation, QuadOvulation, NoBleeding }; private static List allraces = null; private static List allkinds = null; private static HashSet allvaginas = null; private static HashSet allanuses = null; private static HashSet allbreasts = null; public static List AllRaces { get { if (allraces != null) return allraces; List allThings = DefDatabase.AllDefsListForReading; allraces = allThings.FindAll(x => x.race != null && x.race.IsFlesh); return allraces; } } public static List AllKinds { get { if (allkinds != null) return allkinds; List allKinds = DefDatabase.AllDefsListForReading; allkinds = allKinds.FindAll(x => x.race != null); return allkinds; } } public static HashSet AllVaginas { get { if (allvaginas != null) return allvaginas; allvaginas = new HashSet(); foreach(HediffDef hediffDef in DefDatabase.AllDefsListForReading) { if (hediffDef.comps.NullOrEmpty()) continue; foreach (HediffCompProperties comp in hediffDef.comps) { if (comp.compClass == typeof(HediffComp_Menstruation) || (comp.compClass?.IsSubclassOf(typeof(HediffComp_Menstruation)) ?? false)) { allvaginas.Add(hediffDef); break; } } } return allvaginas; } } public static HashSet AllAnuses { get { if (allanuses != null) return allanuses; allanuses = new HashSet(); foreach (HediffDef hediffDef in DefDatabase.AllDefsListForReading) { if (hediffDef.comps.NullOrEmpty()) continue; foreach (HediffCompProperties comp in hediffDef.comps) { if (comp.compClass == typeof(HediffComp_Anus) || (comp.compClass?.IsSubclassOf(typeof(HediffComp_Anus)) ?? false)) { allanuses.Add(hediffDef); break; } } } return allanuses; } } public static HashSet AllBreasts { get { if (allbreasts != null) return allbreasts; allbreasts = new HashSet(); foreach(HediffDef hediffDef in DefDatabase.AllDefsListForReading) { if (hediffDef.comps.NullOrEmpty()) continue; foreach(HediffCompProperties comp in hediffDef.comps) { if (comp.compClass == typeof(HediffComp_Breast) || (comp.compClass?.IsSubclassOf(typeof(HediffComp_Breast)) ?? false)) { allbreasts.Add(hediffDef); break; } } } return allbreasts; } } // Defs from Milkable Colonists public static readonly HediffDef Hediff_Lactating_Drug = DefDatabase.GetNamedSilentFail("Lactating_Drug"); public static readonly HediffDef Hediff_Lactating_Natural = DefDatabase.GetNamedSilentFail("Lactating_Natural"); public static readonly HediffDef Hediff_Lactating_Permanent = DefDatabase.GetNamedSilentFail("Lactating_Permanent"); public static readonly HediffDef Hediff_Heavy_Lactating_Permanent = DefDatabase.GetNamedSilentFail("Heavy_Lactating_Permanent"); public static readonly JobDef Job_LactateSelf_MC = DefDatabase.GetNamedSilentFail("LactateSelf_MC"); // Defs from Sexperience Ideology public static readonly PreceptDef Pregnancy_Elevated = DefDatabase.GetNamedSilentFail("Pregnancy_Elevated"); public static readonly PreceptDef Pregnancy_Holy = DefDatabase.GetNamedSilentFail("Pregnancy_Holy"); public static readonly PreceptDef Pregnancy_Required = DefDatabase.GetNamedSilentFail("Pregnancy_Required"); } }