private void Run_onRunStartGlobal(Run run) { Logger.LogDebug("Run started on difficulty index: " + run.selectedDifficulty); //Only do stuff when Diluvian is selected. if (myDefs.TryGetValue(run.selectedDifficulty, out var def) && HooksApplied == false) { HooksApplied = true; if (NetworkServer.active) { var message = def.StartMessages[Run.instance.runRNG.RangeInt(0, def.StartMessages.Length)]; ChatMessage.SendColored(message, def.Color); //Make our hooks. SharedHooks.ApplyBears(); SharedHooks.SetupCombatDirectorChanges(def.EliteModifier); SharedHooks.ApplyBloodShrineRandom(); } SharedHooks.ApplyRegenChanges(def.HealthRegenMod, def.MonsterRegenMod); SharedHooks.ApplyOSPHook(); def.ApplyHooks(); BuildLanguage(def.Language, true); } }
private void Run_onRunDestroyGlobal(Run run) { if (myDefs.TryGetValue(run.selectedDifficulty, out var def) && HooksApplied) { SharedHooks.UndoBears(); SharedHooks.UndoCombatDirectorChanges(); SharedHooks.UndoBloodShrineRandom(); SharedHooks.UndoRegenChanges(); SharedHooks.UndoOSPHook(); BuildLanguage(DefaultLanguage, false); DefaultLanguage.Clear(); def.UndoHooks(); HooksApplied = false; } }