Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 40.54 KB | None | 0 0
  1. static void PrepareDefs()
  2. {
  3. MethodInfo shortHashGiver = typeof(ShortHashGiver).GetMethod("GiveShortHash", BindingFlags.NonPublic | BindingFlags.Static);
  4.  
  5. #region MapConditions
  6. {
  7. MapConditionDef wrathConditionDef = new MapConditionDef()
  8. {
  9. defName = "wrathConditionDef",
  10. conditionClass = typeof(CustomIncidentCall.MapCondition_WrathBombing),
  11. label = "wrath of the dead",
  12. description = "The gods sent their pawn down in human form to serve your colony... and you failed him",
  13. endMessage = "The gods are satisfied with your pain",
  14. preventRain = false,
  15. canBePermanent = true
  16. };
  17. wrathConditionDef.ResolveReferences();
  18. wrathConditionDef.PostLoad();
  19. DefDatabase<MapConditionDef>.Add(wrathConditionDef);
  20. AnkhDefs.wrathCondition = wrathConditionDef;
  21. }
  22. #endregion
  23. #region Incidents
  24. {
  25. IncidentDef miracleHeal = new IncidentDef()
  26. {
  27. defName = "MiracleHeal",
  28. label = "miracle heal",
  29. targetType = IncidentTargetType.BaseMap,
  30. workerClass = typeof(CustomIncidentCall.MiracleHeal),
  31. baseChance = 10
  32. };
  33. miracleHeal.ResolveReferences();
  34. miracleHeal.PostLoad();
  35. shortHashGiver.Invoke(null, new object[] { miracleHeal });
  36. DefDatabase<IncidentDef>.Add(miracleHeal);
  37. AnkhDefs.miracleHeal = miracleHeal;
  38. }
  39. #endregion
  40. #region Buildings
  41. {
  42. ThingDef zap = new ThingDef()
  43. {
  44. defName = "ZAPActivator",
  45. thingClass = typeof(Buildings.Building_ZAP),
  46. label = "ZAP Activator",
  47. 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.",
  48. size = new IntVec2(1, 1),
  49. passability = Traversability.PassThroughOnly,
  50. category = ThingCategory.Building,
  51. tickerType = TickerType.Rare,
  52. selectable = true,
  53. designationCategory = DesignationCategoryDefOf.Structure,
  54. useHitPoints = false,
  55. altitudeLayer = AltitudeLayer.Building,
  56. leaveResourcesWhenKilled = true,
  57. resourcesFractionWhenDeconstructed = 1,
  58. rotatable = false,
  59. graphicData = new GraphicData()
  60. {
  61. texPath = "SH_zap",
  62. graphicClass = typeof(Graphic_Single),
  63. shaderType = ShaderType.CutoutComplex,
  64. drawSize = new Vector2(1, 1)
  65. },
  66. statBases = new List<StatModifier>()
  67. {
  68. new StatModifier()
  69. {
  70. stat = StatDefOf.MaxHitPoints,
  71. value = 500
  72. },
  73. new StatModifier()
  74. {
  75. stat = StatDefOf.WorkToMake,
  76. value = 200
  77. },
  78. new StatModifier()
  79. {
  80. stat = StatDefOf.Flammability,
  81. value = 0
  82. },
  83. new StatModifier()
  84. {
  85. stat = StatDefOf.Beauty,
  86. value = 4
  87. }
  88. },
  89. costList = new List<ThingCountClass>()
  90. {
  91. //new ThingCountClass(ThingDefOf.ChunkSlagSteel, 2)
  92. },
  93. building = new BuildingProperties()
  94. {
  95. isInert = true,
  96. ignoreNeedsPower = true
  97. },
  98. minifiedDef = ThingDef.Named("MinifiedFurniture")
  99. };
  100. zap.blueprintDef = (ThingDef) typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { zap, false, null });
  101. zap.blueprintDef.ResolveReferences();
  102. zap.blueprintDef.PostLoad();
  103.  
  104. ThingDef minifiedDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { zap, true, zap.blueprintDef });
  105. minifiedDef.ResolveReferences();
  106. minifiedDef.PostLoad();
  107.  
  108. zap.frameDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewFrameDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { zap});
  109. zap.frameDef.ResolveReferences();
  110. zap.frameDef.PostLoad();
  111.  
  112. zap.ResolveReferences();
  113. zap.PostLoad();
  114.  
  115. shortHashGiver.Invoke(null, new object[] { zap });
  116. shortHashGiver.Invoke(null, new object[] { minifiedDef });
  117. shortHashGiver.Invoke(null, new object[] { zap.blueprintDef });
  118. shortHashGiver.Invoke(null, new object[] { zap.frameDef });
  119.  
  120. DefDatabase<ThingDef>.Add(zap);
  121. DefDatabase<ThingDef>.Add(minifiedDef);
  122. DefDatabase<ThingDef>.Add(zap.blueprintDef);
  123. DefDatabase<ThingDef>.Add(zap.frameDef);
  124. zap.designationCategory.ResolveReferences();
  125. zap.designationCategory.PostLoad();
  126. AnkhDefs.zapActivator = zap;
  127. }
  128. {
  129. ThingDef therm = new ThingDef()
  130. {
  131. defName = "THERMActivator",
  132. thingClass = typeof(Buildings.Building_THERM),
  133. label = "THERM Activator",
  134. description = "This device is little more than an altar to Therm, engraved with his fiery symbol. Use it to invoke therm's favor.",
  135. size = new IntVec2(1, 1),
  136. passability = Traversability.PassThroughOnly,
  137. category = ThingCategory.Building,
  138. selectable = true,
  139. designationCategory = DesignationCategoryDefOf.Structure,
  140. useHitPoints = false,
  141. altitudeLayer = AltitudeLayer.Building,
  142. leaveResourcesWhenKilled = true,
  143. resourcesFractionWhenDeconstructed = 1,
  144. rotatable = false,
  145. graphicData = new GraphicData()
  146. {
  147. texPath = "SH_therm",
  148. graphicClass = typeof(Graphic_Single),
  149. shaderType = ShaderType.CutoutComplex,
  150. drawSize = new Vector2(1, 1)
  151. },
  152. statBases = new List<StatModifier>()
  153. {
  154. new StatModifier()
  155. {
  156. stat = StatDefOf.MaxHitPoints,
  157. value = 500
  158. },
  159. new StatModifier()
  160. {
  161. stat = StatDefOf.WorkToMake,
  162. value = 200
  163. },
  164. new StatModifier()
  165. {
  166. stat = StatDefOf.Flammability,
  167. value = 0
  168. },
  169. new StatModifier()
  170. {
  171. stat = StatDefOf.Beauty,
  172. value = 4
  173. }
  174. },
  175. costList = new List<ThingCountClass>()
  176. {
  177. //new ThingCountClass(ThingDefOf.ChunkSlagSteel, 2)
  178. },
  179. building = new BuildingProperties()
  180. {
  181. isInert = true,
  182. ignoreNeedsPower = true
  183. },
  184. minifiedDef = ThingDef.Named("MinifiedFurniture")
  185. };
  186. therm.blueprintDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { therm, false, null });
  187. therm.blueprintDef.ResolveReferences();
  188. therm.blueprintDef.PostLoad();
  189.  
  190. ThingDef minifiedDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { therm, true, therm.blueprintDef });
  191. minifiedDef.ResolveReferences();
  192. minifiedDef.PostLoad();
  193.  
  194. therm.frameDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewFrameDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { therm });
  195. therm.frameDef.ResolveReferences();
  196. therm.frameDef.PostLoad();
  197.  
  198. therm.ResolveReferences();
  199. therm.PostLoad();
  200.  
  201. shortHashGiver.Invoke(null, new object[] { therm });
  202. shortHashGiver.Invoke(null, new object[] { minifiedDef });
  203. shortHashGiver.Invoke(null, new object[] { therm.blueprintDef });
  204. shortHashGiver.Invoke(null, new object[] { therm.frameDef });
  205.  
  206. DefDatabase<ThingDef>.Add(therm);
  207. DefDatabase<ThingDef>.Add(minifiedDef);
  208. DefDatabase<ThingDef>.Add(therm.blueprintDef);
  209. DefDatabase<ThingDef>.Add(therm.frameDef);
  210. therm.designationCategory.ResolveReferences();
  211. therm.designationCategory.PostLoad();
  212. AnkhDefs.thermActivator = therm;
  213. }
  214. {
  215. ThingDef peg = new ThingDef()
  216. {
  217. defName = "PEGActivator",
  218. thingClass = typeof(Buildings.Building_PEG),
  219. label = "PEG Activator",
  220. description = "This device is little more than an altar to Peg, engraved with her skully sign. It will defend the ones favored by peg.",
  221. size = new IntVec2(1, 1),
  222. passability = Traversability.PassThroughOnly,
  223. category = ThingCategory.Building,
  224. selectable = true,
  225. designationCategory = DesignationCategoryDefOf.Structure,
  226. useHitPoints = false,
  227. altitudeLayer = AltitudeLayer.Building,
  228. leaveResourcesWhenKilled = true,
  229. resourcesFractionWhenDeconstructed = 1,
  230. rotatable = false,
  231. graphicData = new GraphicData()
  232. {
  233. texPath = "SH_peg",
  234. graphicClass = typeof(Graphic_Single),
  235. shaderType = ShaderType.CutoutComplex,
  236. drawSize = new Vector2(1, 1)
  237. },
  238. statBases = new List<StatModifier>()
  239. {
  240. new StatModifier()
  241. {
  242. stat = StatDefOf.MaxHitPoints,
  243. value = 500
  244. },
  245. new StatModifier()
  246. {
  247. stat = StatDefOf.WorkToMake,
  248. value = 200
  249. },
  250. new StatModifier()
  251. {
  252. stat = StatDefOf.Flammability,
  253. value = 0
  254. },
  255. new StatModifier()
  256. {
  257. stat = StatDefOf.Beauty,
  258. value = 4
  259. }
  260. },
  261. costList = new List<ThingCountClass>()
  262. {
  263. //new ThingCountClass(ThingDefOf.ChunkSlagSteel, 2)
  264. },
  265. building = new BuildingProperties()
  266. {
  267. isInert = true,
  268. ignoreNeedsPower = true
  269. },
  270. minifiedDef = ThingDef.Named("MinifiedFurniture")
  271. };
  272. peg.blueprintDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { peg, false, null });
  273. peg.blueprintDef.ResolveReferences();
  274. peg.blueprintDef.PostLoad();
  275.  
  276. ThingDef minifiedDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { peg, true, peg.blueprintDef });
  277. minifiedDef.ResolveReferences();
  278. minifiedDef.PostLoad();
  279.  
  280. peg.frameDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewFrameDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { peg });
  281. peg.frameDef.ResolveReferences();
  282. peg.frameDef.PostLoad();
  283.  
  284. peg.ResolveReferences();
  285. peg.PostLoad();
  286.  
  287. shortHashGiver.Invoke(null, new object[] { peg });
  288. shortHashGiver.Invoke(null, new object[] { minifiedDef });
  289. shortHashGiver.Invoke(null, new object[] { peg.blueprintDef });
  290. shortHashGiver.Invoke(null, new object[] { peg.frameDef });
  291.  
  292. DefDatabase<ThingDef>.Add(peg);
  293. DefDatabase<ThingDef>.Add(minifiedDef);
  294. DefDatabase<ThingDef>.Add(peg.blueprintDef);
  295. DefDatabase<ThingDef>.Add(peg.frameDef);
  296. peg.designationCategory.ResolveReferences();
  297. peg.designationCategory.PostLoad();
  298. AnkhDefs.pegActivator = peg;
  299. }
  300. {
  301. ThingDef repo = new ThingDef()
  302. {
  303. defName = "REPOActivator",
  304. thingClass = typeof(Buildings.Building_REPO),
  305. label = "REPO Activator",
  306. description = "This device is little more than an altar to Repo. Use it to restore.",
  307. size = new IntVec2(1, 1),
  308. passability = Traversability.PassThroughOnly,
  309. category = ThingCategory.Building,
  310. selectable = true,
  311. designationCategory = DesignationCategoryDefOf.Structure,
  312. useHitPoints = false,
  313. altitudeLayer = AltitudeLayer.Building,
  314. leaveResourcesWhenKilled = true,
  315. resourcesFractionWhenDeconstructed = 1,
  316. rotatable = false,
  317. graphicData = new GraphicData()
  318. {
  319. texPath = "SH_repo",
  320. graphicClass = typeof(Graphic_Single),
  321. shaderType = ShaderType.CutoutComplex,
  322. drawSize = new Vector2(1, 1)
  323. },
  324. statBases = new List<StatModifier>()
  325. {
  326. new StatModifier()
  327. {
  328. stat = StatDefOf.MaxHitPoints,
  329. value = 500
  330. },
  331. new StatModifier()
  332. {
  333. stat = StatDefOf.WorkToMake,
  334. value = 200
  335. },
  336. new StatModifier()
  337. {
  338. stat = StatDefOf.Flammability,
  339. value = 0
  340. },
  341. new StatModifier()
  342. {
  343. stat = StatDefOf.Beauty,
  344. value = 4
  345. }
  346. },
  347. costList = new List<ThingCountClass>()
  348. {
  349. //new ThingCountClass(ThingDefOf.ChunkSlagSteel, 2)
  350. },
  351. building = new BuildingProperties()
  352. {
  353. isInert = true,
  354. ignoreNeedsPower = true
  355. },
  356. minifiedDef = ThingDef.Named("MinifiedFurniture")
  357. };
  358. repo.blueprintDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { repo, false, null });
  359. repo.blueprintDef.ResolveReferences();
  360. repo.blueprintDef.PostLoad();
  361.  
  362. ThingDef minifiedDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { repo, true, repo.blueprintDef });
  363. minifiedDef.ResolveReferences();
  364. minifiedDef.PostLoad();
  365.  
  366. repo.frameDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewFrameDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { repo });
  367. repo.frameDef.ResolveReferences();
  368. repo.frameDef.PostLoad();
  369.  
  370. repo.ResolveReferences();
  371. repo.PostLoad();
  372.  
  373. shortHashGiver.Invoke(null, new object[] { repo });
  374. shortHashGiver.Invoke(null, new object[] { minifiedDef });
  375. shortHashGiver.Invoke(null, new object[] { repo.blueprintDef });
  376. shortHashGiver.Invoke(null, new object[] { repo.frameDef });
  377.  
  378. DefDatabase<ThingDef>.Add(repo);
  379. DefDatabase<ThingDef>.Add(minifiedDef);
  380. DefDatabase<ThingDef>.Add(repo.blueprintDef);
  381. DefDatabase<ThingDef>.Add(repo.frameDef);
  382. repo.designationCategory.ResolveReferences();
  383. repo.designationCategory.PostLoad();
  384.  
  385. AnkhDefs.repoActivator = repo;
  386. }
  387. {
  388. ThingDef bob = new ThingDef()
  389. {
  390. defName = "BOBActivator",
  391. thingClass = typeof(Buildings.Building_BOB),
  392. label = "BOB Activator",
  393. description = "This device is little more than an altar to Bob.",
  394. size = new IntVec2(1, 1),
  395. passability = Traversability.PassThroughOnly,
  396. category = ThingCategory.Building,
  397. selectable = true,
  398. designationCategory = DesignationCategoryDefOf.Structure,
  399. useHitPoints = false,
  400. altitudeLayer = AltitudeLayer.Building,
  401. leaveResourcesWhenKilled = true,
  402. resourcesFractionWhenDeconstructed = 1,
  403. rotatable = false,
  404. graphicData = new GraphicData()
  405. {
  406. texPath = "SH_bob",
  407. graphicClass = typeof(Graphic_Single),
  408. shaderType = ShaderType.CutoutComplex,
  409. drawSize = new Vector2(1, 1)
  410. },
  411. statBases = new List<StatModifier>()
  412. {
  413. new StatModifier()
  414. {
  415. stat = StatDefOf.MaxHitPoints,
  416. value = 500
  417. },
  418. new StatModifier()
  419. {
  420. stat = StatDefOf.WorkToMake,
  421. value = 200
  422. },
  423. new StatModifier()
  424. {
  425. stat = StatDefOf.Flammability,
  426. value = 0
  427. },
  428. new StatModifier()
  429. {
  430. stat = StatDefOf.Beauty,
  431. value = 4
  432. }
  433. },
  434. costList = new List<ThingCountClass>()
  435. {
  436. //new ThingCountClass(ThingDefOf.ChunkSlagSteel, 2)
  437. },
  438. building = new BuildingProperties()
  439. {
  440. isInert = true,
  441. ignoreNeedsPower = true
  442. },
  443. minifiedDef = ThingDef.Named("MinifiedFurniture")
  444. };
  445. bob.blueprintDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { bob, false, null });
  446. bob.blueprintDef.ResolveReferences();
  447. bob.blueprintDef.PostLoad();
  448.  
  449. ThingDef minifiedDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { bob, true, bob.blueprintDef });
  450. minifiedDef.ResolveReferences();
  451. minifiedDef.PostLoad();
  452.  
  453. bob.frameDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewFrameDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { bob });
  454. bob.frameDef.ResolveReferences();
  455. bob.frameDef.PostLoad();
  456.  
  457. bob.ResolveReferences();
  458. bob.PostLoad();
  459.  
  460. shortHashGiver.Invoke(null, new object[] { bob });
  461. shortHashGiver.Invoke(null, new object[] { minifiedDef });
  462. shortHashGiver.Invoke(null, new object[] { bob.blueprintDef });
  463. shortHashGiver.Invoke(null, new object[] { bob.frameDef });
  464.  
  465. DefDatabase<ThingDef>.Add(bob);
  466. DefDatabase<ThingDef>.Add(minifiedDef);
  467. DefDatabase<ThingDef>.Add(bob.blueprintDef);
  468. DefDatabase<ThingDef>.Add(bob.frameDef);
  469. bob.designationCategory.ResolveReferences();
  470. bob.designationCategory.PostLoad();
  471. AnkhDefs.bobActivator = bob;
  472. }
  473. {
  474. ThingDef rootsy = new ThingDef()
  475. {
  476. defName = "ROOTSYActivator",
  477. thingClass = typeof(Buildings.Building_ROOTSY),
  478. label = "ROOTSY Activator",
  479. description = "This device is little more than an altar to Rootsy.",
  480. size = new IntVec2(1, 1),
  481. passability = Traversability.PassThroughOnly,
  482. category = ThingCategory.Building,
  483. selectable = true,
  484. designationCategory = DesignationCategoryDefOf.Structure,
  485. useHitPoints = false,
  486. altitudeLayer = AltitudeLayer.Building,
  487. leaveResourcesWhenKilled = true,
  488. resourcesFractionWhenDeconstructed = 1,
  489. rotatable = false,
  490. graphicData = new GraphicData()
  491. {
  492. texPath = "SH_rootsy",
  493. graphicClass = typeof(Graphic_Single),
  494. shaderType = ShaderType.CutoutComplex,
  495. drawSize = new Vector2(1, 1)
  496. },
  497. statBases = new List<StatModifier>()
  498. {
  499. new StatModifier()
  500. {
  501. stat = StatDefOf.MaxHitPoints,
  502. value = 500
  503. },
  504. new StatModifier()
  505. {
  506. stat = StatDefOf.WorkToMake,
  507. value = 200
  508. },
  509. new StatModifier()
  510. {
  511. stat = StatDefOf.Flammability,
  512. value = 0
  513. },
  514. new StatModifier()
  515. {
  516. stat = StatDefOf.Beauty,
  517. value = 4
  518. }
  519. },
  520. costList = new List<ThingCountClass>()
  521. {
  522. //new ThingCountClass(ThingDefOf.ChunkSlagSteel, 2)
  523. },
  524. building = new BuildingProperties()
  525. {
  526. isInert = true,
  527. ignoreNeedsPower = true
  528. },
  529. minifiedDef = ThingDef.Named("MinifiedFurniture")
  530. };
  531. rootsy.blueprintDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { rootsy, false, null });
  532. rootsy.blueprintDef.ResolveReferences();
  533. rootsy.blueprintDef.PostLoad();
  534.  
  535. ThingDef minifiedDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { rootsy, true, rootsy.blueprintDef });
  536. minifiedDef.ResolveReferences();
  537. minifiedDef.PostLoad();
  538.  
  539. rootsy.frameDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewFrameDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { rootsy });
  540. rootsy.frameDef.ResolveReferences();
  541. rootsy.frameDef.PostLoad();
  542.  
  543. rootsy.ResolveReferences();
  544. rootsy.PostLoad();
  545.  
  546. shortHashGiver.Invoke(null, new object[] { rootsy });
  547. shortHashGiver.Invoke(null, new object[] { minifiedDef });
  548. shortHashGiver.Invoke(null, new object[] { rootsy.blueprintDef });
  549. shortHashGiver.Invoke(null, new object[] { rootsy.frameDef });
  550.  
  551. DefDatabase<ThingDef>.Add(rootsy);
  552. DefDatabase<ThingDef>.Add(minifiedDef);
  553. DefDatabase<ThingDef>.Add(rootsy.blueprintDef);
  554. DefDatabase<ThingDef>.Add(rootsy.frameDef);
  555. rootsy.designationCategory.ResolveReferences();
  556. rootsy.designationCategory.PostLoad();
  557. AnkhDefs.rootsyActivator = rootsy;
  558. }
  559. {
  560. ThingDef humour = new ThingDef()
  561. {
  562. defName = "HUMOURActivator",
  563. thingClass = typeof(Buildings.Building_HUMOUR),
  564. label = "HUMOUR Activator",
  565. description = "This device is little more than an altar to Humour.",
  566. size = new IntVec2(1, 1),
  567. passability = Traversability.PassThroughOnly,
  568. category = ThingCategory.Building,
  569. selectable = true,
  570. designationCategory = DesignationCategoryDefOf.Structure,
  571. useHitPoints = false,
  572. altitudeLayer = AltitudeLayer.Building,
  573. leaveResourcesWhenKilled = true,
  574. resourcesFractionWhenDeconstructed = 1,
  575. rotatable = false,
  576. graphicData = new GraphicData()
  577. {
  578. texPath = "SH_humour",
  579. graphicClass = typeof(Graphic_Single),
  580. shaderType = ShaderType.CutoutComplex,
  581. drawSize = new Vector2(1, 1)
  582. },
  583. statBases = new List<StatModifier>()
  584. {
  585. new StatModifier()
  586. {
  587. stat = StatDefOf.MaxHitPoints,
  588. value = 500
  589. },
  590. new StatModifier()
  591. {
  592. stat = StatDefOf.WorkToMake,
  593. value = 200
  594. },
  595. new StatModifier()
  596. {
  597. stat = StatDefOf.Flammability,
  598. value = 0
  599. },
  600. new StatModifier()
  601. {
  602. stat = StatDefOf.Beauty,
  603. value = 4
  604. }
  605. },
  606. costList = new List<ThingCountClass>()
  607. {
  608. //new ThingCountClass(ThingDefOf.ChunkSlagSteel, 2)
  609. },
  610. building = new BuildingProperties()
  611. {
  612. isInert = true,
  613. ignoreNeedsPower = true
  614. },
  615. minifiedDef = ThingDef.Named("MinifiedFurniture")
  616. };
  617. humour.blueprintDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { humour, false, null });
  618. humour.blueprintDef.ResolveReferences();
  619. humour.blueprintDef.PostLoad();
  620.  
  621. ThingDef minifiedDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { humour, true, humour.blueprintDef });
  622. minifiedDef.ResolveReferences();
  623. minifiedDef.PostLoad();
  624.  
  625. humour.frameDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewFrameDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { humour });
  626. humour.frameDef.ResolveReferences();
  627. humour.frameDef.PostLoad();
  628.  
  629. humour.ResolveReferences();
  630. humour.PostLoad();
  631.  
  632. shortHashGiver.Invoke(null, new object[] { humour });
  633. shortHashGiver.Invoke(null, new object[] { minifiedDef });
  634. shortHashGiver.Invoke(null, new object[] { humour.blueprintDef });
  635. shortHashGiver.Invoke(null, new object[] { humour.frameDef });
  636.  
  637. DefDatabase<ThingDef>.Add(humour);
  638. DefDatabase<ThingDef>.Add(minifiedDef);
  639. DefDatabase<ThingDef>.Add(humour.blueprintDef);
  640. DefDatabase<ThingDef>.Add(humour.frameDef);
  641. humour.designationCategory.ResolveReferences();
  642. humour.designationCategory.PostLoad();
  643. AnkhDefs.humourActivator = humour;
  644. }
  645. {
  646. ThingDef dorf = new ThingDef()
  647. {
  648. defName = "DORFActivator",
  649. thingClass = typeof(Buildings.Building_DORF),
  650. label = "DORF Activator",
  651. description = "This device is little more than an altar to Dorf.",
  652. size = new IntVec2(1, 1),
  653. passability = Traversability.PassThroughOnly,
  654. category = ThingCategory.Building,
  655. selectable = true,
  656. designationCategory = DesignationCategoryDefOf.Structure,
  657. useHitPoints = false,
  658. altitudeLayer = AltitudeLayer.Building,
  659. leaveResourcesWhenKilled = true,
  660. resourcesFractionWhenDeconstructed = 1,
  661. rotatable = false,
  662. graphicData = new GraphicData()
  663. {
  664. texPath = "SH_dorf",
  665. graphicClass = typeof(Graphic_Single),
  666. shaderType = ShaderType.CutoutComplex,
  667. drawSize = new Vector2(1, 1)
  668. },
  669. statBases = new List<StatModifier>()
  670. {
  671. new StatModifier()
  672. {
  673. stat = StatDefOf.MaxHitPoints,
  674. value = 500
  675. },
  676. new StatModifier()
  677. {
  678. stat = StatDefOf.WorkToMake,
  679. value = 200
  680. },
  681. new StatModifier()
  682. {
  683. stat = StatDefOf.Flammability,
  684. value = 0
  685. },
  686. new StatModifier()
  687. {
  688. stat = StatDefOf.Beauty,
  689. value = 4
  690. }
  691. },
  692. costList = new List<ThingCountClass>()
  693. {
  694. //new ThingCountClass(ThingDefOf.ChunkSlagSteel, 2)
  695. },
  696. building = new BuildingProperties()
  697. {
  698. isInert = true,
  699. ignoreNeedsPower = true
  700. },
  701. minifiedDef = ThingDef.Named("MinifiedFurniture")
  702. };
  703. dorf.blueprintDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { dorf, false, null });
  704. dorf.blueprintDef.ResolveReferences();
  705. dorf.blueprintDef.PostLoad();
  706.  
  707. ThingDef minifiedDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewBlueprintDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { dorf, true, dorf.blueprintDef });
  708. minifiedDef.ResolveReferences();
  709. minifiedDef.PostLoad();
  710.  
  711. dorf.frameDef = (ThingDef)typeof(ThingDefGenerator_Buildings).GetMethod("NewFrameDef_Thing", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { dorf });
  712. dorf.frameDef.ResolveReferences();
  713. dorf.frameDef.PostLoad();
  714.  
  715. dorf.ResolveReferences();
  716. dorf.PostLoad();
  717.  
  718. shortHashGiver.Invoke(null, new object[] { dorf });
  719. shortHashGiver.Invoke(null, new object[] { minifiedDef });
  720. shortHashGiver.Invoke(null, new object[] { dorf.blueprintDef });
  721. shortHashGiver.Invoke(null, new object[] { dorf.frameDef });
  722.  
  723. DefDatabase<ThingDef>.Add(dorf);
  724. DefDatabase<ThingDef>.Add(minifiedDef);
  725. DefDatabase<ThingDef>.Add(dorf.blueprintDef);
  726. DefDatabase<ThingDef>.Add(dorf.frameDef);
  727. dorf.designationCategory.ResolveReferences();
  728. dorf.designationCategory.PostLoad();
  729. AnkhDefs.dorfActivator = dorf;
  730. }
  731. #endregion
  732. #region Thoughts
  733. {
  734. ThoughtDef fnarghWrath = new ThoughtDef()
  735. {
  736. defName = "FnarghWrath",
  737. durationDays = 1.0f,
  738. stackLimit = 100,
  739. stackedEffectMultiplier = 1f,
  740. stages = new List<ThoughtStage>()
  741. {
  742. new ThoughtStage()
  743. {
  744. label = "Fnargh's wrath",
  745. description = "Fnargh's presence in my mind is like a thousand writhing insects.",
  746. baseMoodEffect = -20f
  747. }
  748. }
  749. };
  750. fnarghWrath.ResolveReferences();
  751. fnarghWrath.PostLoad();
  752. shortHashGiver.Invoke(null, new object[] { fnarghWrath });
  753. DefDatabase<ThoughtDef>.Add(fnarghWrath);
  754. AnkhDefs.fnarghWrath = fnarghWrath;
  755. }
  756. {
  757. ThoughtDef fnarghFavor = new ThoughtDef()
  758. {
  759. defName = "FnarghFavor",
  760. durationDays = 1.0f,
  761. stackLimit = 100,
  762. stackedEffectMultiplier = 1f,
  763. stages = new List<ThoughtStage>()
  764. {
  765. new ThoughtStage()
  766. {
  767. label = "Fnargh's favor",
  768. description = "Fnargh's presence in my mind soothes me. Everything seems just a little bit better.",
  769. baseMoodEffect = 20f
  770. }
  771. }
  772. };
  773. fnarghFavor.ResolveReferences();
  774. fnarghFavor.PostLoad();
  775. shortHashGiver.Invoke(null, new object[] { fnarghFavor });
  776. DefDatabase<ThoughtDef>.Add(fnarghFavor);
  777. AnkhDefs.fnarghFavor = fnarghFavor;
  778. }
  779. #endregion
  780. #region Traits
  781. {
  782. TraitDef fiveKnuckleShuffle = new TraitDef()
  783. {
  784. defName = "fiveKnuckleShuffle",
  785. label = "iamdar's Five Knuckle Shuffle",
  786. description = "Downward Dick's good good touchin' has enhanced your focus and manipulation!",
  787. degreeDatas = new List<TraitDegreeData>()
  788. {
  789. new TraitDegreeData()
  790. {
  791. label = "iamdar's Five Knuckle Shuffle",
  792. description = "Downward Dick's good good touchin' has enhanced your focus and manipulation!"
  793. }
  794. }
  795. };
  796. fiveKnuckleShuffle.ResolveReferences();
  797. fiveKnuckleShuffle.PostLoad();
  798. shortHashGiver.Invoke(null, new object[] { fiveKnuckleShuffle });
  799. DefDatabase<TraitDef>.Add(fiveKnuckleShuffle);
  800. AnkhDefs.ankhTraits.Add(fiveKnuckleShuffle);
  801. AnkhDefs.fiveKnuckleShuffle = fiveKnuckleShuffle;
  802. }
  803. {
  804. TraitDef coneOfShame = new TraitDef()
  805. {
  806. defName = "coneOfShame",
  807. label = "chiky's Cone of Shame",
  808. description = " Downward Dick's good good touchin' has enhanced your focus and your visual acuity!",
  809. degreeDatas = new List<TraitDegreeData>()
  810. {
  811. new TraitDegreeData()
  812. {
  813. label = "chiky's Cone of Shame",
  814. description = " Downward Dick's good good touchin' has enhanced your focus and your visual acuity!"
  815. }
  816. }
  817. };
  818. coneOfShame.ResolveReferences();
  819. coneOfShame.PostLoad();
  820. shortHashGiver.Invoke(null, new object[] { coneOfShame });
  821. DefDatabase<TraitDef>.Add(coneOfShame);
  822. AnkhDefs.ankhTraits.Add(coneOfShame);
  823. AnkhDefs.coneOfShame = coneOfShame;
  824. }
  825. {
  826. TraitDef thrustsOfVeneration = new TraitDef()
  827. {
  828. defName = "thrustsOfVeneration",
  829. label = "Ucefzach's Thrusts",
  830. description = "Downward Dick's good good touchin' has made you a more effective warrior!",
  831. degreeDatas = new List<TraitDegreeData>()
  832. {
  833. new TraitDegreeData()
  834. {
  835. label = "Ucefzach's Thrusts",
  836. description = "Downward Dick's good good touchin' has made you a more effective warrior!",
  837. statOffsets = new List<StatModifier>()
  838. {
  839. new StatModifier()
  840. {
  841. stat = StatDefOf.MeleeHitChance,
  842. value = 0.5f
  843. },
  844. new StatModifier()
  845. {
  846. stat = StatDefOf.AimingDelayFactor,
  847. value = -0.5f
  848. }
  849. }
  850. }
  851. }
  852. };
  853. thrustsOfVeneration.ResolveReferences();
  854. thrustsOfVeneration.PostLoad();
  855. shortHashGiver.Invoke(null, new object[] { thrustsOfVeneration });
  856. DefDatabase<TraitDef>.Add(thrustsOfVeneration);
  857. AnkhDefs.ankhTraits.Add(thrustsOfVeneration);
  858. }
  859. {
  860. TraitDef armoredTouch = new TraitDef()
  861. {
  862. defName = "armoredTouch",
  863. label = "Southpond's En-Armored Touch",
  864. description = "Downward Dick's good good touchin' has surrounded you with a magical armored barrier!",
  865. degreeDatas = new List<TraitDegreeData>()
  866. {
  867. new TraitDegreeData()
  868. {
  869. label = "Southpond's En-Armored Touch",
  870. description = "Downward Dick's good good touchin' has surrounded you with a magical armored barrier!",
  871. statOffsets = new List<StatModifier>()
  872. {
  873. new StatModifier()
  874. {
  875. stat = StatDefOf.ArmorRating_Blunt,
  876. value = 0.5f
  877. },
  878. new StatModifier()
  879. {
  880. stat = StatDefOf.ArmorRating_Electric,
  881. value = 0.5f
  882. },
  883. new StatModifier()
  884. {
  885. stat = StatDefOf.ArmorRating_Heat,
  886. value = 0.5f
  887. },
  888. new StatModifier()
  889. {
  890. stat = StatDefOf.ArmorRating_Sharp,
  891. value = 0.5f
  892. }
  893. }
  894. }
  895. }
  896. };
  897. armoredTouch.ResolveReferences();
  898. armoredTouch.PostLoad();
  899. shortHashGiver.Invoke(null, new object[] { armoredTouch });
  900. DefDatabase<TraitDef>.Add(armoredTouch);
  901. AnkhDefs.ankhTraits.Add(armoredTouch);
  902. }
  903. {
  904. TraitDef teaAndScones = new TraitDef()
  905. {
  906. defName = "teaAndScones",
  907. label = "maebak's tea and scones",
  908. description = "Downward Dick's good good touchin' has increased your healing rate!",
  909. degreeDatas = new List<TraitDegreeData>()
  910. {
  911. new TraitDegreeData()
  912. {
  913. label = "maebak's tea and scones",
  914. description = "Downward Dick's good good touchin' has increased your healing rate!",
  915. statOffsets = new List<StatModifier>()
  916. {
  917. new StatModifier()
  918. {
  919. stat = StatDefOf.ImmunityGainSpeed,
  920. value = 1.5f
  921. }
  922. }
  923. }
  924. }
  925. };
  926. teaAndScones.ResolveReferences();
  927. teaAndScones.PostLoad();
  928. shortHashGiver.Invoke(null, new object[] { teaAndScones });
  929. DefDatabase<TraitDef>.Add(teaAndScones);
  930. AnkhDefs.ankhTraits.Add(teaAndScones);
  931. AnkhDefs.teaAndScones = teaAndScones;
  932. }
  933. #endregion
  934. #region Hediffs
  935. {
  936. HediffDef fiveKnuckleShuffleHediff = new HediffDef()
  937. {
  938. defName = "fiveKnuckleShuffleHediff",
  939. label = "iamdar's five knuckle shuffle",
  940. description = "Whatever.. pladd tell me something",
  941. hediffClass = typeof(Hediff),
  942. stages = new List<HediffStage>()
  943. {
  944. new HediffStage()
  945. {
  946. capMods = new List<PawnCapacityModifier>()
  947. {
  948. new PawnCapacityModifier()
  949. {
  950. capacity = PawnCapacityDefOf.Consciousness,
  951. offset = 0.4f
  952. },
  953. new PawnCapacityModifier()
  954. {
  955. capacity = PawnCapacityDefOf.Manipulation,
  956. offset = 0.4f
  957. }
  958. },
  959. everVisible = false
  960. }
  961. }
  962. };
  963. fiveKnuckleShuffleHediff.ResolveReferences();
  964. fiveKnuckleShuffleHediff.PostLoad();
  965. shortHashGiver.Invoke(null, new object[] { fiveKnuckleShuffleHediff });
  966. DefDatabase<HediffDef>.Add(fiveKnuckleShuffleHediff);
  967. AnkhDefs.fiveKnuckleShuffleHediff = fiveKnuckleShuffleHediff;
  968. }
  969. {
  970. HediffDef coneOfShameHediff = new HediffDef()
  971. {
  972. defName = "coneOfShameHediff",
  973. label = "chiky's Cone of Shame",
  974. description = "Whatever.. pladd tell me something",
  975. hediffClass = typeof(Hediff),
  976. stages = new List<HediffStage>()
  977. {
  978. new HediffStage()
  979. {
  980. capMods = new List<PawnCapacityModifier>()
  981. {
  982. new PawnCapacityModifier()
  983. {
  984. capacity = PawnCapacityDefOf.Consciousness,
  985. offset = 0.4f
  986. },
  987. new PawnCapacityModifier()
  988. {
  989. capacity = PawnCapacityDefOf.Sight,
  990. offset = 0.4f
  991. }
  992. },
  993. everVisible = false
  994. }
  995. }
  996. };
  997. coneOfShameHediff.ResolveReferences();
  998. coneOfShameHediff.PostLoad();
  999. shortHashGiver.Invoke(null, new object[] { coneOfShameHediff });
  1000. DefDatabase<HediffDef>.Add(coneOfShameHediff);
  1001. AnkhDefs.coneOfShameHediff = coneOfShameHediff;
  1002. }
  1003. #endregion
  1004. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement