Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void PrepareDefs()
- {
- MethodInfo shortHashGiver = typeof(ShortHashGiver).GetMethod("GiveShortHash", BindingFlags.NonPublic | BindingFlags.Static);
- #region MapConditions
- {
- MapConditionDef wrathConditionDef = new MapConditionDef()
- {
- defName = "wrathConditionDef",
- conditionClass = typeof(CustomIncidentCall.MapCondition_WrathBombing),
- label = "wrath of the dead",
- description = "The gods sent their pawn down in human form to serve your colony... and you failed him",
- endMessage = "The gods are satisfied with your pain",
- preventRain = false,
- canBePermanent = true
- };
- wrathConditionDef.ResolveReferences();
- wrathConditionDef.PostLoad();
- DefDatabase<MapConditionDef>.Add(wrathConditionDef);
- AnkhDefs.wrathCondition = wrathConditionDef;
- }
- #endregion
- #region Incidents
- {
- IncidentDef miracleHeal = new IncidentDef()
- {
- defName = "MiracleHeal",
- label = "miracle heal",
- targetType = IncidentTargetType.BaseMap,
- workerClass = typeof(CustomIncidentCall.MiracleHeal),
- baseChance = 10
- };
- miracleHeal.ResolveReferences();
- miracleHeal.PostLoad();
- shortHashGiver.Invoke(null, new object[] { miracleHeal });
- DefDatabase<IncidentDef>.Add(miracleHeal);
- AnkhDefs.miracleHeal = miracleHeal;
- }
- #endregion
- #region Buildings
- {
- ThingDef zap = new ThingDef()
- {
- defName = "ZAPActivator",
- thingClass = typeof(Buildings.Building_ZAP),
- label = "ZAP Activator",
- description = "This device is little more than an altar to Zap, engraved with his jagged yellow symbol. It will defend the ones favored by zap.",
- size = new IntVec2(1, 1),
- passability = Traversability.PassThroughOnly,
- category = ThingCategory.Building,
- tickerType = TickerType.Rare,
- selectable = true,
- designationCategory = DesignationCategoryDefOf.Structure,
- useHitPoints = false,
- altitudeLayer = AltitudeLayer.Building,
- leaveResourcesWhenKilled = true,
- resourcesFractionWhenDeconstructed = 1,
- rotatable = false,
- graphicData = new GraphicData()
- {
- texPath = "SH_zap",
- graphicClass = typeof(Graphic_Single),
- shaderType = ShaderType.CutoutComplex,
- drawSize = new Vector2(1, 1)
- },
- statBases = new List<StatModifier>()
- {
- new StatModifier()
- {
- stat = StatDefOf.MaxHitPoints,
- value = 500
- },
- new StatModifier()
- {
- stat = StatDefOf.WorkToMake,
- value = 200
- },
- new StatModifier()
- {
- stat = StatDefOf.Flammability,
- value = 0
- },
- new StatModifier()
- {
- stat = StatDefOf.Beauty,
- value = 4
- }
- },
- costList = new List<ThingCountClass>()
- {
- //new ThingCountClass(ThingDefOf.ChunkSlagSteel, 2)
- },
- building = new BuildingProperties()
- {
- isInert = true,
- ignoreNeedsPower = true
- },
- minifiedDef = ThingDef.Named("MinifiedFurniture")
- };
- zap.blueprintDef = (ThingDef) typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { zap, false, null });
- zap.blueprintDef.ResolveReferences();
- zap.blueprintDef.PostLoad();
- ThingDef minifiedDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { zap, true, zap.blueprintDef });
- minifiedDef.ResolveReferences();
- minifiedDef.PostLoad();
- zap.frameDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewFrameDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { zap});
- zap.frameDef.ResolveReferences();
- zap.frameDef.PostLoad();
- zap.ResolveReferences();
- zap.PostLoad();
- shortHashGiver.Invoke(null, new object[] { zap });
- shortHashGiver.Invoke(null, new object[] { minifiedDef });
- shortHashGiver.Invoke(null, new object[] { zap.blueprintDef });
- shortHashGiver.Invoke(null, new object[] { zap.frameDef });
- DefDatabase<ThingDef>.Add(zap);
- DefDatabase<ThingDef>.Add(minifiedDef);
- DefDatabase<ThingDef>.Add(zap.blueprintDef);
- DefDatabase<ThingDef>.Add(zap.frameDef);
- zap.designationCategory.ResolveReferences();
- zap.designationCategory.PostLoad();
- AnkhDefs.zapActivator = zap;
- }
- {
- ThingDef therm = new ThingDef()
- {
- defName = "THERMActivator",
- thingClass = typeof(Buildings.Building_THERM),
- label = "THERM Activator",
- description = "This device is little more than an altar to Therm, engraved with his fiery symbol. Use it to invoke therm's favor.",
- size = new IntVec2(1, 1),
- passability = Traversability.PassThroughOnly,
- category = ThingCategory.Building,
- selectable = true,
- designationCategory = DesignationCategoryDefOf.Structure,
- useHitPoints = false,
- altitudeLayer = AltitudeLayer.Building,
- leaveResourcesWhenKilled = true,
- resourcesFractionWhenDeconstructed = 1,
- rotatable = false,
- graphicData = new GraphicData()
- {
- texPath = "SH_therm",
- graphicClass = typeof(Graphic_Single),
- shaderType = ShaderType.CutoutComplex,
- drawSize = new Vector2(1, 1)
- },
- statBases = new List<StatModifier>()
- {
- new StatModifier()
- {
- stat = StatDefOf.MaxHitPoints,
- value = 500
- },
- new StatModifier()
- {
- stat = StatDefOf.WorkToMake,
- value = 200
- },
- new StatModifier()
- {
- stat = StatDefOf.Flammability,
- value = 0
- },
- new StatModifier()
- {
- stat = StatDefOf.Beauty,
- value = 4
- }
- },
- costList = new List<ThingCountClass>()
- {
- //new ThingCountClass(ThingDefOf.ChunkSlagSteel, 2)
- },
- building = new BuildingProperties()
- {
- isInert = true,
- ignoreNeedsPower = true
- },
- minifiedDef = ThingDef.Named("MinifiedFurniture")
- };
- therm.blueprintDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { therm, false, null });
- therm.blueprintDef.ResolveReferences();
- therm.blueprintDef.PostLoad();
- ThingDef minifiedDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { therm, true, therm.blueprintDef });
- minifiedDef.ResolveReferences();
- minifiedDef.PostLoad();
- therm.frameDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewFrameDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { therm });
- therm.frameDef.ResolveReferences();
- therm.frameDef.PostLoad();
- therm.ResolveReferences();
- therm.PostLoad();
- shortHashGiver.Invoke(null, new object[] { therm });
- shortHashGiver.Invoke(null, new object[] { minifiedDef });
- shortHashGiver.Invoke(null, new object[] { therm.blueprintDef });
- shortHashGiver.Invoke(null, new object[] { therm.frameDef });
- DefDatabase<ThingDef>.Add(therm);
- DefDatabase<ThingDef>.Add(minifiedDef);
- DefDatabase<ThingDef>.Add(therm.blueprintDef);
- DefDatabase<ThingDef>.Add(therm.frameDef);
- therm.designationCategory.ResolveReferences();
- therm.designationCategory.PostLoad();
- AnkhDefs.thermActivator = therm;
- }
- {
- ThingDef peg = new ThingDef()
- {
- defName = "PEGActivator",
- thingClass = typeof(Buildings.Building_PEG),
- label = "PEG Activator",
- description = "This device is little more than an altar to Peg, engraved with her skully sign. It will defend the ones favored by peg.",
- size = new IntVec2(1, 1),
- passability = Traversability.PassThroughOnly,
- category = ThingCategory.Building,
- selectable = true,
- designationCategory = DesignationCategoryDefOf.Structure,
- useHitPoints = false,
- altitudeLayer = AltitudeLayer.Building,
- leaveResourcesWhenKilled = true,
- resourcesFractionWhenDeconstructed = 1,
- rotatable = false,
- graphicData = new GraphicData()
- {
- texPath = "SH_peg",
- graphicClass = typeof(Graphic_Single),
- shaderType = ShaderType.CutoutComplex,
- drawSize = new Vector2(1, 1)
- },
- statBases = new List<StatModifier>()
- {
- new StatModifier()
- {
- stat = StatDefOf.MaxHitPoints,
- value = 500
- },
- new StatModifier()
- {
- stat = StatDefOf.WorkToMake,
- value = 200
- },
- new StatModifier()
- {
- stat = StatDefOf.Flammability,
- value = 0
- },
- new StatModifier()
- {
- stat = StatDefOf.Beauty,
- value = 4
- }
- },
- costList = new List<ThingCountClass>()
- {
- //new ThingCountClass(ThingDefOf.ChunkSlagSteel, 2)
- },
- building = new BuildingProperties()
- {
- isInert = true,
- ignoreNeedsPower = true
- },
- minifiedDef = ThingDef.Named("MinifiedFurniture")
- };
- peg.blueprintDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { peg, false, null });
- peg.blueprintDef.ResolveReferences();
- peg.blueprintDef.PostLoad();
- ThingDef minifiedDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { peg, true, peg.blueprintDef });
- minifiedDef.ResolveReferences();
- minifiedDef.PostLoad();
- peg.frameDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewFrameDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { peg });
- peg.frameDef.ResolveReferences();
- peg.frameDef.PostLoad();
- peg.ResolveReferences();
- peg.PostLoad();
- shortHashGiver.Invoke(null, new object[] { peg });
- shortHashGiver.Invoke(null, new object[] { minifiedDef });
- shortHashGiver.Invoke(null, new object[] { peg.blueprintDef });
- shortHashGiver.Invoke(null, new object[] { peg.frameDef });
- DefDatabase<ThingDef>.Add(peg);
- DefDatabase<ThingDef>.Add(minifiedDef);
- DefDatabase<ThingDef>.Add(peg.blueprintDef);
- DefDatabase<ThingDef>.Add(peg.frameDef);
- peg.designationCategory.ResolveReferences();
- peg.designationCategory.PostLoad();
- AnkhDefs.pegActivator = peg;
- }
- {
- ThingDef repo = new ThingDef()
- {
- defName = "REPOActivator",
- thingClass = typeof(Buildings.Building_REPO),
- label = "REPO Activator",
- description = "This device is little more than an altar to Repo. Use it to restore.",
- size = new IntVec2(1, 1),
- passability = Traversability.PassThroughOnly,
- category = ThingCategory.Building,
- selectable = true,
- designationCategory = DesignationCategoryDefOf.Structure,
- useHitPoints = false,
- altitudeLayer = AltitudeLayer.Building,
- leaveResourcesWhenKilled = true,
- resourcesFractionWhenDeconstructed = 1,
- rotatable = false,
- graphicData = new GraphicData()
- {
- texPath = "SH_repo",
- graphicClass = typeof(Graphic_Single),
- shaderType = ShaderType.CutoutComplex,
- drawSize = new Vector2(1, 1)
- },
- statBases = new List<StatModifier>()
- {
- new StatModifier()
- {
- stat = StatDefOf.MaxHitPoints,
- value = 500
- },
- new StatModifier()
- {
- stat = StatDefOf.WorkToMake,
- value = 200
- },
- new StatModifier()
- {
- stat = StatDefOf.Flammability,
- value = 0
- },
- new StatModifier()
- {
- stat = StatDefOf.Beauty,
- value = 4
- }
- },
- costList = new List<ThingCountClass>()
- {
- //new ThingCountClass(ThingDefOf.ChunkSlagSteel, 2)
- },
- building = new BuildingProperties()
- {
- isInert = true,
- ignoreNeedsPower = true
- },
- minifiedDef = ThingDef.Named("MinifiedFurniture")
- };
- repo.blueprintDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { repo, false, null });
- repo.blueprintDef.ResolveReferences();
- repo.blueprintDef.PostLoad();
- ThingDef minifiedDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { repo, true, repo.blueprintDef });
- minifiedDef.ResolveReferences();
- minifiedDef.PostLoad();
- repo.frameDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewFrameDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { repo });
- repo.frameDef.ResolveReferences();
- repo.frameDef.PostLoad();
- repo.ResolveReferences();
- repo.PostLoad();
- shortHashGiver.Invoke(null, new object[] { repo });
- shortHashGiver.Invoke(null, new object[] { minifiedDef });
- shortHashGiver.Invoke(null, new object[] { repo.blueprintDef });
- shortHashGiver.Invoke(null, new object[] { repo.frameDef });
- DefDatabase<ThingDef>.Add(repo);
- DefDatabase<ThingDef>.Add(minifiedDef);
- DefDatabase<ThingDef>.Add(repo.blueprintDef);
- DefDatabase<ThingDef>.Add(repo.frameDef);
- repo.designationCategory.ResolveReferences();
- repo.designationCategory.PostLoad();
- AnkhDefs.repoActivator = repo;
- }
- {
- ThingDef bob = new ThingDef()
- {
- defName = "BOBActivator",
- thingClass = typeof(Buildings.Building_BOB),
- label = "BOB Activator",
- description = "This device is little more than an altar to Bob.",
- size = new IntVec2(1, 1),
- passability = Traversability.PassThroughOnly,
- category = ThingCategory.Building,
- selectable = true,
- designationCategory = DesignationCategoryDefOf.Structure,
- useHitPoints = false,
- altitudeLayer = AltitudeLayer.Building,
- leaveResourcesWhenKilled = true,
- resourcesFractionWhenDeconstructed = 1,
- rotatable = false,
- graphicData = new GraphicData()
- {
- texPath = "SH_bob",
- graphicClass = typeof(Graphic_Single),
- shaderType = ShaderType.CutoutComplex,
- drawSize = new Vector2(1, 1)
- },
- statBases = new List<StatModifier>()
- {
- new StatModifier()
- {
- stat = StatDefOf.MaxHitPoints,
- value = 500
- },
- new StatModifier()
- {
- stat = StatDefOf.WorkToMake,
- value = 200
- },
- new StatModifier()
- {
- stat = StatDefOf.Flammability,
- value = 0
- },
- new StatModifier()
- {
- stat = StatDefOf.Beauty,
- value = 4
- }
- },
- costList = new List<ThingCountClass>()
- {
- //new ThingCountClass(ThingDefOf.ChunkSlagSteel, 2)
- },
- building = new BuildingProperties()
- {
- isInert = true,
- ignoreNeedsPower = true
- },
- minifiedDef = ThingDef.Named("MinifiedFurniture")
- };
- bob.blueprintDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { bob, false, null });
- bob.blueprintDef.ResolveReferences();
- bob.blueprintDef.PostLoad();
- ThingDef minifiedDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { bob, true, bob.blueprintDef });
- minifiedDef.ResolveReferences();
- minifiedDef.PostLoad();
- bob.frameDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewFrameDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { bob });
- bob.frameDef.ResolveReferences();
- bob.frameDef.PostLoad();
- bob.ResolveReferences();
- bob.PostLoad();
- shortHashGiver.Invoke(null, new object[] { bob });
- shortHashGiver.Invoke(null, new object[] { minifiedDef });
- shortHashGiver.Invoke(null, new object[] { bob.blueprintDef });
- shortHashGiver.Invoke(null, new object[] { bob.frameDef });
- DefDatabase<ThingDef>.Add(bob);
- DefDatabase<ThingDef>.Add(minifiedDef);
- DefDatabase<ThingDef>.Add(bob.blueprintDef);
- DefDatabase<ThingDef>.Add(bob.frameDef);
- bob.designationCategory.ResolveReferences();
- bob.designationCategory.PostLoad();
- AnkhDefs.bobActivator = bob;
- }
- {
- ThingDef rootsy = new ThingDef()
- {
- defName = "ROOTSYActivator",
- thingClass = typeof(Buildings.Building_ROOTSY),
- label = "ROOTSY Activator",
- description = "This device is little more than an altar to Rootsy.",
- size = new IntVec2(1, 1),
- passability = Traversability.PassThroughOnly,
- category = ThingCategory.Building,
- selectable = true,
- designationCategory = DesignationCategoryDefOf.Structure,
- useHitPoints = false,
- altitudeLayer = AltitudeLayer.Building,
- leaveResourcesWhenKilled = true,
- resourcesFractionWhenDeconstructed = 1,
- rotatable = false,
- graphicData = new GraphicData()
- {
- texPath = "SH_rootsy",
- graphicClass = typeof(Graphic_Single),
- shaderType = ShaderType.CutoutComplex,
- drawSize = new Vector2(1, 1)
- },
- statBases = new List<StatModifier>()
- {
- new StatModifier()
- {
- stat = StatDefOf.MaxHitPoints,
- value = 500
- },
- new StatModifier()
- {
- stat = StatDefOf.WorkToMake,
- value = 200
- },
- new StatModifier()
- {
- stat = StatDefOf.Flammability,
- value = 0
- },
- new StatModifier()
- {
- stat = StatDefOf.Beauty,
- value = 4
- }
- },
- costList = new List<ThingCountClass>()
- {
- //new ThingCountClass(ThingDefOf.ChunkSlagSteel, 2)
- },
- building = new BuildingProperties()
- {
- isInert = true,
- ignoreNeedsPower = true
- },
- minifiedDef = ThingDef.Named("MinifiedFurniture")
- };
- rootsy.blueprintDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { rootsy, false, null });
- rootsy.blueprintDef.ResolveReferences();
- rootsy.blueprintDef.PostLoad();
- ThingDef minifiedDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { rootsy, true, rootsy.blueprintDef });
- minifiedDef.ResolveReferences();
- minifiedDef.PostLoad();
- rootsy.frameDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewFrameDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { rootsy });
- rootsy.frameDef.ResolveReferences();
- rootsy.frameDef.PostLoad();
- rootsy.ResolveReferences();
- rootsy.PostLoad();
- shortHashGiver.Invoke(null, new object[] { rootsy });
- shortHashGiver.Invoke(null, new object[] { minifiedDef });
- shortHashGiver.Invoke(null, new object[] { rootsy.blueprintDef });
- shortHashGiver.Invoke(null, new object[] { rootsy.frameDef });
- DefDatabase<ThingDef>.Add(rootsy);
- DefDatabase<ThingDef>.Add(minifiedDef);
- DefDatabase<ThingDef>.Add(rootsy.blueprintDef);
- DefDatabase<ThingDef>.Add(rootsy.frameDef);
- rootsy.designationCategory.ResolveReferences();
- rootsy.designationCategory.PostLoad();
- AnkhDefs.rootsyActivator = rootsy;
- }
- {
- ThingDef humour = new ThingDef()
- {
- defName = "HUMOURActivator",
- thingClass = typeof(Buildings.Building_HUMOUR),
- label = "HUMOUR Activator",
- description = "This device is little more than an altar to Humour.",
- size = new IntVec2(1, 1),
- passability = Traversability.PassThroughOnly,
- category = ThingCategory.Building,
- selectable = true,
- designationCategory = DesignationCategoryDefOf.Structure,
- useHitPoints = false,
- altitudeLayer = AltitudeLayer.Building,
- leaveResourcesWhenKilled = true,
- resourcesFractionWhenDeconstructed = 1,
- rotatable = false,
- graphicData = new GraphicData()
- {
- texPath = "SH_humour",
- graphicClass = typeof(Graphic_Single),
- shaderType = ShaderType.CutoutComplex,
- drawSize = new Vector2(1, 1)
- },
- statBases = new List<StatModifier>()
- {
- new StatModifier()
- {
- stat = StatDefOf.MaxHitPoints,
- value = 500
- },
- new StatModifier()
- {
- stat = StatDefOf.WorkToMake,
- value = 200
- },
- new StatModifier()
- {
- stat = StatDefOf.Flammability,
- value = 0
- },
- new StatModifier()
- {
- stat = StatDefOf.Beauty,
- value = 4
- }
- },
- costList = new List<ThingCountClass>()
- {
- //new ThingCountClass(ThingDefOf.ChunkSlagSteel, 2)
- },
- building = new BuildingProperties()
- {
- isInert = true,
- ignoreNeedsPower = true
- },
- minifiedDef = ThingDef.Named("MinifiedFurniture")
- };
- humour.blueprintDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { humour, false, null });
- humour.blueprintDef.ResolveReferences();
- humour.blueprintDef.PostLoad();
- ThingDef minifiedDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { humour, true, humour.blueprintDef });
- minifiedDef.ResolveReferences();
- minifiedDef.PostLoad();
- humour.frameDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewFrameDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { humour });
- humour.frameDef.ResolveReferences();
- humour.frameDef.PostLoad();
- humour.ResolveReferences();
- humour.PostLoad();
- shortHashGiver.Invoke(null, new object[] { humour });
- shortHashGiver.Invoke(null, new object[] { minifiedDef });
- shortHashGiver.Invoke(null, new object[] { humour.blueprintDef });
- shortHashGiver.Invoke(null, new object[] { humour.frameDef });
- DefDatabase<ThingDef>.Add(humour);
- DefDatabase<ThingDef>.Add(minifiedDef);
- DefDatabase<ThingDef>.Add(humour.blueprintDef);
- DefDatabase<ThingDef>.Add(humour.frameDef);
- humour.designationCategory.ResolveReferences();
- humour.designationCategory.PostLoad();
- AnkhDefs.humourActivator = humour;
- }
- {
- ThingDef dorf = new ThingDef()
- {
- defName = "DORFActivator",
- thingClass = typeof(Buildings.Building_DORF),
- label = "DORF Activator",
- description = "This device is little more than an altar to Dorf.",
- size = new IntVec2(1, 1),
- passability = Traversability.PassThroughOnly,
- category = ThingCategory.Building,
- selectable = true,
- designationCategory = DesignationCategoryDefOf.Structure,
- useHitPoints = false,
- altitudeLayer = AltitudeLayer.Building,
- leaveResourcesWhenKilled = true,
- resourcesFractionWhenDeconstructed = 1,
- rotatable = false,
- graphicData = new GraphicData()
- {
- texPath = "SH_dorf",
- graphicClass = typeof(Graphic_Single),
- shaderType = ShaderType.CutoutComplex,
- drawSize = new Vector2(1, 1)
- },
- statBases = new List<StatModifier>()
- {
- new StatModifier()
- {
- stat = StatDefOf.MaxHitPoints,
- value = 500
- },
- new StatModifier()
- {
- stat = StatDefOf.WorkToMake,
- value = 200
- },
- new StatModifier()
- {
- stat = StatDefOf.Flammability,
- value = 0
- },
- new StatModifier()
- {
- stat = StatDefOf.Beauty,
- value = 4
- }
- },
- costList = new List<ThingCountClass>()
- {
- //new ThingCountClass(ThingDefOf.ChunkSlagSteel, 2)
- },
- building = new BuildingProperties()
- {
- isInert = true,
- ignoreNeedsPower = true
- },
- minifiedDef = ThingDef.Named("MinifiedFurniture")
- };
- dorf.blueprintDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { dorf, false, null });
- dorf.blueprintDef.ResolveReferences();
- dorf.blueprintDef.PostLoad();
- ThingDef minifiedDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { dorf, true, dorf.blueprintDef });
- minifiedDef.ResolveReferences();
- minifiedDef.PostLoad();
- dorf.frameDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewFrameDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { dorf });
- dorf.frameDef.ResolveReferences();
- dorf.frameDef.PostLoad();
- dorf.ResolveReferences();
- dorf.PostLoad();
- shortHashGiver.Invoke(null, new object[] { dorf });
- shortHashGiver.Invoke(null, new object[] { minifiedDef });
- shortHashGiver.Invoke(null, new object[] { dorf.blueprintDef });
- shortHashGiver.Invoke(null, new object[] { dorf.frameDef });
- DefDatabase<ThingDef>.Add(dorf);
- DefDatabase<ThingDef>.Add(minifiedDef);
- DefDatabase<ThingDef>.Add(dorf.blueprintDef);
- DefDatabase<ThingDef>.Add(dorf.frameDef);
- dorf.designationCategory.ResolveReferences();
- dorf.designationCategory.PostLoad();
- AnkhDefs.dorfActivator = dorf;
- }
- #endregion
- #region Thoughts
- {
- ThoughtDef fnarghWrath = new ThoughtDef()
- {
- defName = "FnarghWrath",
- durationDays = 1.0f,
- stackLimit = 100,
- stackedEffectMultiplier = 1f,
- stages = new List<ThoughtStage>()
- {
- new ThoughtStage()
- {
- label = "Fnargh's wrath",
- description = "Fnargh's presence in my mind is like a thousand writhing insects.",
- baseMoodEffect = -20f
- }
- }
- };
- fnarghWrath.ResolveReferences();
- fnarghWrath.PostLoad();
- shortHashGiver.Invoke(null, new object[] { fnarghWrath });
- DefDatabase<ThoughtDef>.Add(fnarghWrath);
- AnkhDefs.fnarghWrath = fnarghWrath;
- }
- {
- ThoughtDef fnarghFavor = new ThoughtDef()
- {
- defName = "FnarghFavor",
- durationDays = 1.0f,
- stackLimit = 100,
- stackedEffectMultiplier = 1f,
- stages = new List<ThoughtStage>()
- {
- new ThoughtStage()
- {
- label = "Fnargh's favor",
- description = "Fnargh's presence in my mind soothes me. Everything seems just a little bit better.",
- baseMoodEffect = 20f
- }
- }
- };
- fnarghFavor.ResolveReferences();
- fnarghFavor.PostLoad();
- shortHashGiver.Invoke(null, new object[] { fnarghFavor });
- DefDatabase<ThoughtDef>.Add(fnarghFavor);
- AnkhDefs.fnarghFavor = fnarghFavor;
- }
- #endregion
- #region Traits
- {
- TraitDef fiveKnuckleShuffle = new TraitDef()
- {
- defName = "fiveKnuckleShuffle",
- label = "iamdar's Five Knuckle Shuffle",
- description = "Downward Dick's good good touchin' has enhanced your focus and manipulation!",
- degreeDatas = new List<TraitDegreeData>()
- {
- new TraitDegreeData()
- {
- label = "iamdar's Five Knuckle Shuffle",
- description = "Downward Dick's good good touchin' has enhanced your focus and manipulation!"
- }
- }
- };
- fiveKnuckleShuffle.ResolveReferences();
- fiveKnuckleShuffle.PostLoad();
- shortHashGiver.Invoke(null, new object[] { fiveKnuckleShuffle });
- DefDatabase<TraitDef>.Add(fiveKnuckleShuffle);
- AnkhDefs.ankhTraits.Add(fiveKnuckleShuffle);
- AnkhDefs.fiveKnuckleShuffle = fiveKnuckleShuffle;
- }
- {
- TraitDef coneOfShame = new TraitDef()
- {
- defName = "coneOfShame",
- label = "chiky's Cone of Shame",
- description = " Downward Dick's good good touchin' has enhanced your focus and your visual acuity!",
- degreeDatas = new List<TraitDegreeData>()
- {
- new TraitDegreeData()
- {
- label = "chiky's Cone of Shame",
- description = " Downward Dick's good good touchin' has enhanced your focus and your visual acuity!"
- }
- }
- };
- coneOfShame.ResolveReferences();
- coneOfShame.PostLoad();
- shortHashGiver.Invoke(null, new object[] { coneOfShame });
- DefDatabase<TraitDef>.Add(coneOfShame);
- AnkhDefs.ankhTraits.Add(coneOfShame);
- AnkhDefs.coneOfShame = coneOfShame;
- }
- {
- TraitDef thrustsOfVeneration = new TraitDef()
- {
- defName = "thrustsOfVeneration",
- label = "Ucefzach's Thrusts",
- description = "Downward Dick's good good touchin' has made you a more effective warrior!",
- degreeDatas = new List<TraitDegreeData>()
- {
- new TraitDegreeData()
- {
- label = "Ucefzach's Thrusts",
- description = "Downward Dick's good good touchin' has made you a more effective warrior!",
- statOffsets = new List<StatModifier>()
- {
- new StatModifier()
- {
- stat = StatDefOf.MeleeHitChance,
- value = 0.5f
- },
- new StatModifier()
- {
- stat = StatDefOf.AimingDelayFactor,
- value = -0.5f
- }
- }
- }
- }
- };
- thrustsOfVeneration.ResolveReferences();
- thrustsOfVeneration.PostLoad();
- shortHashGiver.Invoke(null, new object[] { thrustsOfVeneration });
- DefDatabase<TraitDef>.Add(thrustsOfVeneration);
- AnkhDefs.ankhTraits.Add(thrustsOfVeneration);
- }
- {
- TraitDef armoredTouch = new TraitDef()
- {
- defName = "armoredTouch",
- label = "Southpond's En-Armored Touch",
- description = "Downward Dick's good good touchin' has surrounded you with a magical armored barrier!",
- degreeDatas = new List<TraitDegreeData>()
- {
- new TraitDegreeData()
- {
- label = "Southpond's En-Armored Touch",
- description = "Downward Dick's good good touchin' has surrounded you with a magical armored barrier!",
- statOffsets = new List<StatModifier>()
- {
- new StatModifier()
- {
- stat = StatDefOf.ArmorRating_Blunt,
- value = 0.5f
- },
- new StatModifier()
- {
- stat = StatDefOf.ArmorRating_Electric,
- value = 0.5f
- },
- new StatModifier()
- {
- stat = StatDefOf.ArmorRating_Heat,
- value = 0.5f
- },
- new StatModifier()
- {
- stat = StatDefOf.ArmorRating_Sharp,
- value = 0.5f
- }
- }
- }
- }
- };
- armoredTouch.ResolveReferences();
- armoredTouch.PostLoad();
- shortHashGiver.Invoke(null, new object[] { armoredTouch });
- DefDatabase<TraitDef>.Add(armoredTouch);
- AnkhDefs.ankhTraits.Add(armoredTouch);
- }
- {
- TraitDef teaAndScones = new TraitDef()
- {
- defName = "teaAndScones",
- label = "maebak's tea and scones",
- description = "Downward Dick's good good touchin' has increased your healing rate!",
- degreeDatas = new List<TraitDegreeData>()
- {
- new TraitDegreeData()
- {
- label = "maebak's tea and scones",
- description = "Downward Dick's good good touchin' has increased your healing rate!",
- statOffsets = new List<StatModifier>()
- {
- new StatModifier()
- {
- stat = StatDefOf.ImmunityGainSpeed,
- value = 1.5f
- }
- }
- }
- }
- };
- teaAndScones.ResolveReferences();
- teaAndScones.PostLoad();
- shortHashGiver.Invoke(null, new object[] { teaAndScones });
- DefDatabase<TraitDef>.Add(teaAndScones);
- AnkhDefs.ankhTraits.Add(teaAndScones);
- AnkhDefs.teaAndScones = teaAndScones;
- }
- #endregion
- #region Hediffs
- {
- HediffDef fiveKnuckleShuffleHediff = new HediffDef()
- {
- defName = "fiveKnuckleShuffleHediff",
- label = "iamdar's five knuckle shuffle",
- description = "Whatever.. pladd tell me something",
- hediffClass = typeof(Hediff),
- stages = new List<HediffStage>()
- {
- new HediffStage()
- {
- capMods = new List<PawnCapacityModifier>()
- {
- new PawnCapacityModifier()
- {
- capacity = PawnCapacityDefOf.Consciousness,
- offset = 0.4f
- },
- new PawnCapacityModifier()
- {
- capacity = PawnCapacityDefOf.Manipulation,
- offset = 0.4f
- }
- },
- everVisible = false
- }
- }
- };
- fiveKnuckleShuffleHediff.ResolveReferences();
- fiveKnuckleShuffleHediff.PostLoad();
- shortHashGiver.Invoke(null, new object[] { fiveKnuckleShuffleHediff });
- DefDatabase<HediffDef>.Add(fiveKnuckleShuffleHediff);
- AnkhDefs.fiveKnuckleShuffleHediff = fiveKnuckleShuffleHediff;
- }
- {
- HediffDef coneOfShameHediff = new HediffDef()
- {
- defName = "coneOfShameHediff",
- label = "chiky's Cone of Shame",
- description = "Whatever.. pladd tell me something",
- hediffClass = typeof(Hediff),
- stages = new List<HediffStage>()
- {
- new HediffStage()
- {
- capMods = new List<PawnCapacityModifier>()
- {
- new PawnCapacityModifier()
- {
- capacity = PawnCapacityDefOf.Consciousness,
- offset = 0.4f
- },
- new PawnCapacityModifier()
- {
- capacity = PawnCapacityDefOf.Sight,
- offset = 0.4f
- }
- },
- everVisible = false
- }
- }
- };
- coneOfShameHediff.ResolveReferences();
- coneOfShameHediff.PostLoad();
- shortHashGiver.Invoke(null, new object[] { coneOfShameHediff });
- DefDatabase<HediffDef>.Add(coneOfShameHediff);
- AnkhDefs.coneOfShameHediff = coneOfShameHediff;
- }
- #endregion
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement