private void DoubleTheFun(Map map) { FunSpell result = GenCollection.RandomElementByWeight <FunSpell>(TableOfFun, GetWeight); while (result.defName == "Cults_SpellDoubleTheFun") { result = GenCollection.RandomElementByWeight <FunSpell>(TableOfFun, GetWeight); } IncidentDef temp = DefDatabase <IncidentDef> .GetNamed(result.defName); FunSpell result2 = GenCollection.RandomElementByWeight <FunSpell>(TableOfFun, GetWeight); while (result2.defName == "Cults_SpellDoubleTheFun") { result2 = GenCollection.RandomElementByWeight <FunSpell>(TableOfFun, GetWeight); } IncidentDef temp2 = DefDatabase <IncidentDef> .GetNamed(result2.defName); if (temp != null && temp2 != null) { map.GetComponent <MapComponent_SacrificeTracker>().wasDoubleTheFun = true; map.GetComponent <MapComponent_SacrificeTracker>().lastSideEffect = temp; map.GetComponent <MapComponent_SacrificeTracker>().lastDoubleSideEffect = temp2; CultUtility.CastSpell(temp, map); CultUtility.CastSpell(temp2, map); return; } Cthulhu.Utility.DebugReport("Failed to utilize " + temp.ToString()); Cthulhu.Utility.DebugReport("Failed to utilize " + temp2.ToString()); }
static void Prefix(IncidentDef ___def) { if (HotseatSettings.enableStorytellerSwitching) { Log.Message("[Hotseat]: Event " + ___def.ToString() + " fired"); } }
public void RollTableOfFun(Map map) { FunSpell result = GenCollection.RandomElementByWeight <FunSpell>(TableOfFun, GetWeight); if (result.defName == "Cults_SpellDoubleTheFun") { Cthulhu.Utility.DebugReport("Double The Fun!"); DoubleTheFun(map); return; } IncidentDef temp = DefDatabase <IncidentDef> .GetNamed(result.defName); if (temp != null) { map.GetComponent <MapComponent_SacrificeTracker>().lastSideEffect = temp; CultUtility.CastSpell(temp, map); return; } Cthulhu.Utility.DebugReport("Failed to utilize " + temp.ToString()); }
/// <summary> /// Lt.Bob - Unifies debug information to central command (__instance) /// </summary> /// <param name="parms"></param> /// <param name="IncDef"></param> public static void DebugParms(IncidentParms parms, IncidentDef IncDef = null) { Log.Message(" PS=- parms= " + parms.ToString(), false); if (parms.quest != null) { Log.Message(" PS=- parms.quest= " + parms.quest.ToString(), false); Log.Message(" PS=- parms.quest.PartsListForReading= " + parms.quest.PartsListForReading, false); } else { Log.Message(" PS=- parms.quest= NULL", false); } if (parms.questTag != null) { Log.Message(" PS=- parms.questTag= " + parms.questTag.ToString(), false); } else { Log.Message(" PS=- parms.questTag= NULL", false); } if (parms.questScriptDef != null) { Log.Message(" PS=- parms.questScriptDef= " + parms.questScriptDef.ToString(), false); } else { Log.Message(" PS=- parms.questScriptDef= NULL", false); } if (IncDef == null) { Log.Message(" PS=- IncidentDef= NULL", false); return; } Log.Message(" PS=- IncidentDef= " + IncDef.ToString(), false); if (IncDef.defName != null) { Log.Message(" PS=- IncidentDef.defName= " + IncDef.defName, false); return; } Log.Message(" PS=- IncidentDef.defName= NULL", false); }