internal static void RerollBurntBuildings() { int numParameters = uConsole.GetNumParameters(); if (numParameters < 1 || numParameters > 1) { uConsole.Log("| This command requires a single argument (e.g. help)"); PrintUsage(); return; } string targetArea = uConsole.GetString().ToLower(); if (targetArea.Contains("help")) { PrintUsage(); return; } if (targetArea.Contains("interloper")) { if (ExperienceModeManager.GetCurrentExperienceModeType() != ExperienceModeType.Interloper) { uConsole.Log("| This command can only be used on Interloper"); PrintUsage(); return; } if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name != "CoastalRegion") { uConsole.Log("| This command can only be used outside in Coastal Highway"); PrintUsage(); return; } if (Settings.settings.randomiseInterloper) { uConsole.Log("| Randomising Coastal Highway building spawns on Interloper"); } if (!Settings.settings.randomiseInterloper) { uConsole.Log("| Reverting randomisation of Coastal Highway building spawns on Interloper"); } RerollSpawner(FindAllSpawners()); return; } RandomSpawnObject spawner = FindSpawner(targetArea); if (!spawner) { uConsole.Log("| Error: Could not find specified TargetArea in the current scene"); PrintUsage(); return; } else { RerollSpawner(spawner); uConsole.Log("| Rerolled burnt buildings in TargetArea"); } }
public static FirearmAvailability GetFirearmAvailability() { if (GameManager.IsStoryMode()) { if (SaveGameSystem.m_CurrentEpisode == Episode.One || SaveGameSystem.m_CurrentEpisode == Episode.Two) { return(FirearmAvailability.Rifle); } else { return(FirearmAvailability.All); } } ExperienceModeType experienceModeType = ExperienceModeManager.GetCurrentExperienceModeType(); switch (experienceModeType) { case ExperienceModeType.Interloper: return(FirearmAvailability.None); case ExperienceModeType.Custom: return(GetCustomFirearmAvailability()); default: return(FirearmAvailability.All); } }
private static void Prefix(RandomSpawnObject __instance) { if (ExperienceModeManager.GetCurrentExperienceModeType() != ExperienceModeType.Interloper || UnityEngine.SceneManagement.SceneManager.GetActiveScene().name != "CoastalRegion") { return; } if (__instance.m_RerollAfterGameHours == 0f) { if (Settings.settings.randomiseInterloper) { if (Implementation.interloperSpawner == __instance.gameObject.name) { __instance.m_NumObjectsToEnableInterloper = 0; } else if (Implementation.coastalSpawners.Contains <string>(__instance.gameObject.name)) { __instance.m_NumObjectsToEnableInterloper = 1; } } else { if (Implementation.interloperSpawner == __instance.gameObject.name) { __instance.m_NumObjectsToEnableInterloper = 1; } else if (Implementation.coastalSpawners.Contains <string>(__instance.gameObject.name)) { __instance.m_NumObjectsToEnableInterloper = 0; } } } }
public static DifficultyLevel GetDifficultyLevel() { if (GameManager.IsStoryMode()) { return(DifficultyLevel.Storymode); } ExperienceModeType experienceModeType = ExperienceModeManager.GetCurrentExperienceModeType(); switch (experienceModeType) { case ExperienceModeType.Pilgrim: return(DifficultyLevel.Pilgram); case ExperienceModeType.Voyageur: return(DifficultyLevel.Voyager); case ExperienceModeType.Stalker: return(DifficultyLevel.Stalker); case ExperienceModeType.Interloper: return(DifficultyLevel.Interloper); case ExperienceModeType.Custom: return(GetCustomDifficultyLevel()); case ExperienceModeType.ChallengeArchivist: return(DifficultyLevel.Challenge); case ExperienceModeType.ChallengeDeadManWalking: return(DifficultyLevel.Challenge); case ExperienceModeType.ChallengeHunted: return(DifficultyLevel.Challenge); case ExperienceModeType.ChallengeHuntedPart2: return(DifficultyLevel.Challenge); case ExperienceModeType.ChallengeNomad: return(DifficultyLevel.Challenge); case ExperienceModeType.ChallengeNowhereToHide: return(DifficultyLevel.Challenge); case ExperienceModeType.ChallengeRescue: return(DifficultyLevel.Challenge); case ExperienceModeType.ChallengeWhiteout: return(DifficultyLevel.Challenge); default: return(DifficultyLevel.Other); } }
private static bool Prefix(ref bool __result) { if (ExperienceModeManager.GetCurrentExperienceModeType() == ExperienceModeType.Interloper) { __result = false; return(false); } else { return(true); } }
private static bool Prefix(ExperienceModeManager __instance, ref float __result) { int wildlifeSpawnFrequency = (int)__instance.GetCustomMode().m_WildlifeSpawnFrequency; if (wildlifeSpawnFrequency >= 0 && wildlifeSpawnFrequency < RESPAWN_MODIFIERS.Length) { __result = RESPAWN_MODIFIERS[wildlifeSpawnFrequency]; } else { __result = 1f; } return(false); // Don't run original method }
private static void Postfix(Panel_SelectRegion_Map __instance, bool enable) { if (!enable) { return; } if (ExperienceModeManager.GetCurrentExperienceModeType() == ExperienceModeType.Interloper) { GameRegion[] interloperRegions = GameManager.Instance().m_SandboxConfig.m_InterloperRegions; foreach (SelectRegionItem item in __instance.m_Items) { item.gameObject.SetActive(interloperRegions.Contains(item.m_Region)); } } else { foreach (SelectRegionItem item in __instance.m_Items) { item.gameObject.SetActive(true); } } }
private static void Postfix() { if (ExperienceModeManager.GetCurrentExperienceModeType() != ExperienceModeType.Interloper || UnityEngine.SceneManagement.SceneManager.GetActiveScene().name != "CoastalRegion") { return; } GameObject fishingCabin = GameObject.Find(Implementation.fishingCabin); if (fishingCabin is null) { MelonLoader.MelonLogger.Error("Could not find fishing cabin"); return; } if (Settings.settings.randomiseInterloper) { GameObject.Destroy(fishingCabin.GetComponent <DisableObjectForXPMode>()); fishingCabin.SetActive(true); } else { fishingCabin.SetActive(false); } }
private static bool Prefix(SelectRegionItem item) { return(ExperienceModeManager.GetCurrentExperienceModeType() != ExperienceModeType.Interloper || !item || GameManager.Instance().m_SandboxConfig.m_InterloperRegions.Contains(item.m_Region)); }
private static void Prefix() { overrideSceneToLoad = (ExperienceModeManager.GetCurrentExperienceModeType() == ExperienceModeType.Interloper); }