private static void FillDeity(IdeoFoundation_Deity __instance, IdeoFoundation_Deity.Deity deity) { /* * Gender supremeGender = __instance.ideo.SupremeGender; * if (supremeGender != Gender.None) * { * deity.gender = supremeGender; * } * else * { * deity.gender = Gen.RandomEnumValue<Gender>(true); * } */ MemeDef relatedMeme; MemeDef relatedMeme2; if (deity.relatedMeme == null) { if ((from x in __instance.ideo.memes where !__instance.deities.Any((IdeoFoundation_Deity.Deity y) => y.relatedMeme == x) select x).TryRandomElement(out relatedMeme)) { deity.relatedMeme = relatedMeme; } else if (__instance.ideo.memes.TryRandomElement(out relatedMeme2)) { deity.relatedMeme = relatedMeme2; } } }
public static void GenerateSpecificDeities(IdeoFoundation_Deity __instance) { __instance.deities.Clear(); if (__instance.ideo.culture.defName.StartsWith("OG_")) { if (__instance.ideo.culture.defName.Contains("Mechanicus")) { IdeoFoundation_Deity.Deity omnissiah = DeityUtility.Omnissiah.cloneDeity(); FillDeity(__instance, omnissiah); __instance.deities.Add(omnissiah); return; } if (__instance.ideo.culture.defName.Contains("Imperial")) { IdeoFoundation_Deity.Deity emperor = DeityUtility.Emperor.cloneDeity(); FillDeity(__instance, emperor); __instance.deities.Add(emperor); return; } if (__instance.ideo.culture.defName.Contains("Greenskin") || __instance.ideo.culture.defName.Contains("Orkoid")) { IdeoFoundation_Deity.Deity gork = DeityUtility.Gork.cloneDeity(); IdeoFoundation_Deity.Deity mork = DeityUtility.Mork.cloneDeity(); FillDeity(__instance, gork); __instance.deities.Add(gork); FillDeity(__instance, mork); __instance.deities.Add(mork); return; } if (__instance.ideo.culture.defName.Contains("Kroot")) { IdeoFoundation_Deity.Deity vawk = DeityUtility.Vawk.cloneDeity(); IdeoFoundation_Deity.Deity gmork = DeityUtility.Gmork.cloneDeity(); FillDeity(__instance, vawk); __instance.deities.Add(vawk); FillDeity(__instance, gmork); __instance.deities.Add(gmork); return; } if (__instance.ideo.culture.defName.Contains("Aeldari")) { IdeoFoundation_Deity.Deity khaine = DeityUtility.Khaine.cloneDeity(); IdeoFoundation_Deity.Deity ynnead = DeityUtility.Ynnead.cloneDeity(); IdeoFoundation_Deity.Deity cegorach = DeityUtility.Cegorach.cloneDeity(); FillDeity(__instance, khaine); __instance.deities.Add(khaine); FillDeity(__instance, ynnead); __instance.deities.Add(ynnead); FillDeity(__instance, Cegorach); __instance.deities.Add(cegorach); return; } } }
public static IdeoFoundation_Deity.Deity cloneDeity(this IdeoFoundation_Deity.Deity deity) { return(new IdeoFoundation_Deity.Deity() { name = deity.name, iconPath = deity.iconPath, type = deity.type, gender = deity.gender, relatedMeme = deity.relatedMeme }); }