// TODO: learn how to add to option menu in game for modifying public static void Init() { GetThings.Add(ThingDefOf.AIPersonaCore); GetThings.Add(ThingDefOf.OrbitalTargeterBombardment); GetThings.Add(ThingDefOf.OrbitalTargeterPowerBeam); GetThings.Add(ThingDefOf.TechprofSubpersonaCore); GetThings.Add(ThingDefOf.VanometricPowerCell); GetThings.Add(ThingDefOf.InfiniteChemreactor); GetThings.Add(ThingDefOf.PsychicEmanator); GetThings.Add(ThingDefOf.PowerBeam); GetPawns.Add(PawnKindDefOf.Thrumbo); GetPawns.Add(PawnKindDefOf.Megascarab); GetPawns.Add(PawnKindDefOf.Megaspider); GetPawns.Add(PawnKindDefOf.Spelopede); GetPawns.Add(PawnKindDefOf.Alphabeaver); var validThings = from thing in DefDatabase <ThingDef> .AllDefsListForReading where thing.recipeMaker != null || thing.researchPrerequisites != null select thing; Log.Message("[A Petition For Provisions] Caching tech-level for things"); foreach (var validThing in validThings) { var currentTechLevel = TechLevel.Neolithic; if (validThing.researchPrerequisites?.Count > 0) { foreach (var validThingResearchPrerequisite in validThing.researchPrerequisites) { if (validThingResearchPrerequisite.techLevel > currentTechLevel) { currentTechLevel = validThingResearchPrerequisite.techLevel; } } } if (validThing.recipeMaker?.researchPrerequisites?.Count > 0) { foreach (var validThingResearchPrerequisite in validThing.recipeMaker.researchPrerequisites) { if (validThingResearchPrerequisite.techLevel > currentTechLevel) { currentTechLevel = validThingResearchPrerequisite.techLevel; } } } if (validThing.recipeMaker?.researchPrerequisite?.techLevel > currentTechLevel) { currentTechLevel = validThing.recipeMaker.researchPrerequisite.techLevel; } researchTechCache.Add(validThing, currentTechLevel); } Log.Message("[A Petition For Provisions] Caching complete"); }
public static void Add(ThingDef def) { GetThings.Add(def); }