Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of ZetasTwitchRedeems v0.0.1
ZetasTwitchRedeems.dll
Decompiled a day agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using CSync.Lib; using GameNetcodeStuff; using HarmonyLib; using LethalLevelLoader; using LethalModDataLib.Attributes; using LethalModDataLib.Features; using LethalModDataLib.Helpers; using SimpleTwitchChat; using TwitchChatAPI.Objects; using Unity.Netcode; using UnityEngine; using WeatherRegistry; using ZetasTwitchRedeems.RedeemPatches; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("ConfigurableJesterFear")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ConfigurableJesterFear")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("97ca82ec-7595-4152-af5f-32dbe96ae567")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace ZetasTwitchRedeems { public class ConfigHandler : SyncedConfig2<ConfigHandler> { public ConfigEntry<bool> resetData; public ConfigEntry<bool> forceGiftRedeem; public ConfigEntry<string> forceGiftRedeemID; public ConfigEntry<bool> forceDiceRedeem; public ConfigEntry<string> forceDiceRedeemID; public ConfigEntry<bool> forceSuitChangeRedeem; public ConfigEntry<string> forceSuitChangeRedeemID; public ConfigEntry<bool> forceWeatherChangeRedeem; public ConfigEntry<string> forceWeatherChangeRedeemID; public ConfigEntry<bool> weatherChangeHard; public ConfigEntry<bool> forceMoonChangeRedeem; public ConfigEntry<string> forceMoonChangeRedeemID; public ConfigEntry<bool> moonChangeHard; public ConfigEntry<bool> forceRouteRandomRedeem; public ConfigEntry<string> forceRouteRandomRedeemID; public ConfigEntry<bool> whiteboardReplaceRedeem; public ConfigEntry<string> whiteboardReplaceRedeemID; public ConfigEntry<bool> TTSRedeem; public ConfigEntry<string> TTSRedeemID; public ConfigHandler(ConfigFile cfg) : base("ZetaArcade.ZetasTwitchRedeems") { resetData = cfg.Bind<bool>("General", "Reset Data? (CAUTION)", false, "If true, then whenever this mod is loaded, all existing Redeem data will be wiped. This is useful if say, many Redeems were spammed before and you don't want the data persisting between saves. Keep this enabled if you don't want Redeems to persist between lobbies."); forceWeatherChangeRedeem = cfg.Bind<bool>("Redeems (Moon Change)", "Force Weather Change?", false, "If true, then when the associated Redeem is triggered, the mod will attempt to force-land you on the cheapest moon with the specified Weather from the user's redeem message. This check will occur every 5s in orbit when a weather is queued up."); weatherChangeHard = cfg.Bind<bool>("Redeems (Moon Change)", "Hard Weather Change", false, "If true, then when a Weather change Redeem is used, the ship will be FORCIBLY routed to a moon with that weather, regardless of how many credits you have. If false, it will instead try to 'route' you to the desired moon IF you have enough credits (and it isn't locked)."); forceWeatherChangeRedeemID = cfg.Bind<string>("Redeems (Moon Change)", "Force Weather Change ID", "", "The Twitch Redeem ID associated with this action. You can get the Redeem IDs via enabling 'Print Redeem Info' in the 'Debugging' section of this config and then triggering a Redeem in your chat whilst this mod is loaded (Your stream shouldn't need to be online, it should work offline too) to get it printed in the log."); forceMoonChangeRedeem = cfg.Bind<bool>("Redeems (Moon Change)", "Force Moon Change?", false, "If true, then when the associated Redeem is triggered, the mod will attempt to route you to the moon specified by the user's redeem message. This check will occur every 5s in orbit when a moon is queued up."); moonChangeHard = cfg.Bind<bool>("Redeems (Moon Change)", "Hard Moon Change", false, "If true, then when a Moon change Redeem is used, the ship will be FORCIBLY routed to it, regardless of how many credits you have. If false, it will instead try to 'route' you to the desired moon IF you have enough credits (and it isn't locked)."); forceGiftRedeem = cfg.Bind<bool>("Redeems (Misc)", "Force Gift?", false, "If true, then when the associated Redeem is triggered, the next Gift you pickup will be automatically opened. If multiple are queued up, they will stack."); forceGiftRedeemID = cfg.Bind<string>("Redeems (Misc)", "Force Gift Redeem ID", "", "The Twitch Redeem ID associated with this action. You can get the Redeem IDs via enabling 'Print Redeem Info' in the 'Debugging' section of this config and then triggering a Redeem in your chat whilst this mod is loaded (Your stream shouldn't need to be online, it should work offline too) to get it printed in the log."); forceDiceRedeem = cfg.Bind<bool>("Redeems (Misc)", "Force Dice?", false, "If true, then when the associated Redeem is triggered, the next Dice you pickup will be automatically opened. If multiple are queued up, they will stack. Requires Emergency Dice Updated to work."); forceDiceRedeemID = cfg.Bind<string>("Redeems (Misc)", "Force Dice Redeem ID", "", "The Twitch Redeem ID associated with this action. You can get the Redeem IDs via enabling 'Print Redeem Info' in the 'Debugging' section of this config and then triggering a Redeem in your chat whilst this mod is loaded (Your stream shouldn't need to be online, it should work offline too) to get it printed in the log."); forceSuitChangeRedeem = cfg.Bind<bool>("Redeems (Misc)", "(Unused) Force Suit Change?", false, "If true, then when the associated Redeem is triggered, the mod will attempt to change your suit matching the name they specified. Requires SuitTerminal to work."); forceSuitChangeRedeemID = cfg.Bind<string>("Redeems (Misc)", "(Unused) Force Suit Change ID", "", "The Twitch Redeem ID associated with this action. You can get the Redeem IDs via enabling 'Print Redeem Info' in the 'Debugging' section of this config and then triggering a Redeem in your chat whilst this mod is loaded (Your stream shouldn't need to be online, it should work offline too) to get it printed in the log."); forceMoonChangeRedeemID = cfg.Bind<string>("Redeems (Moon Change)", "(Unused) Force Moon Change ID", "", "The Twitch Redeem ID associated with this action. You can get the Redeem IDs via enabling 'Print Redeem Info' in the 'Debugging' section of this config and then triggering a Redeem in your chat whilst this mod is loaded (Your stream shouldn't need to be online, it should work offline too) to get it printed in the log."); whiteboardReplaceRedeem = cfg.Bind<bool>("Redeems (Misc)", "(Unused) Replace Whiteboard Redeem?", false, "If true, then when the associated Redeem is triggered, the Whiteboard text will be replaced with whatever the user specified. Requires Whiteboard to work."); whiteboardReplaceRedeemID = cfg.Bind<string>("Redeems (Misc)", "(Unused) Replace Whiteboard Redeem ID", "", "The Twitch Redeem ID associated with this action. You can get the Redeem IDs via enabling 'Print Redeem Info' in the 'Debugging' section of this config and then triggering a Redeem in your chat whilst this mod is loaded (Your stream shouldn't need to be online, it should work offline too) to get it printed in the log."); TTSRedeem = cfg.Bind<bool>("Redeems (Misc)", "(Unused) Force TTS?", false, "If true, then when the associated Redeem is triggered, the player will blurt out whatever the user specified them to say as TTS. Requires MelaniesVoice to work."); TTSRedeemID = cfg.Bind<string>("Redeems (Misc)", "(Unused) Force TTS ID", "", "The Twitch Redeem ID associated with this action. You can get the Redeem IDs via enabling 'Print Redeem Info' in the 'Debugging' section of this config and then triggering a Redeem in your chat whilst this mod is loaded (Your stream shouldn't need to be online, it should work offline too) to get it printed in the log."); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("ZetaArcade.ZetasTwitchRedeems", "ZetasTwitchRedeems", "0.0.1")] public class ZTRBase : BaseUnityPlugin { private Harmony harmony = new Harmony("ZetaArcade.ZetasTwitchRedeems"); public static ManualLogSource Logger; public static ZTRBase Instance; internal static ModData ModDataInstance; internal static ConfigHandler Config; private void Awake() { //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Expected O, but got Unknown if ((Object)(object)Instance == (Object)null) { Instance = this; } TwitchHandler.OnRedeemEvent += HandleRedeem; Logger = ((BaseUnityPlugin)this).Logger; Config = new ConfigHandler(((BaseUnityPlugin)this).Config); ModDataInstance = new ModData(); ModDataHandler.RegisterInstance((object)ModDataInstance, "ZTRDataInstance"); if (Config.resetData.Value) { Logger.LogWarning((object)"ModData being reset!"); ModDataInstance.ResetData(); } Type type = AccessTools.TypeByName("TestAccountVariety.Hazards.GiftMimic.GiftMimic"); if (type != null) { Logger.LogInfo((object)"TestAccountVariety Gift Mimic detected, applying patch."); MethodInfo methodInfo = AccessTools.Method(type, "OpenGiftClientRpc", (Type[])null, (Type[])null); if (methodInfo != null) { harmony.Patch((MethodBase)methodInfo, (HarmonyMethod)null, new HarmonyMethod(typeof(DiceGiftRedeems.GiftMimicPatch), "AfterOpen", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } else { Logger.LogInfo((object)"TestAccountVariety not found, skipping patch."); } Logger.LogInfo((object)"Plugin is loaded!"); harmony.PatchAll(); } private static void HandleRedeem(ulong playerID, bool doHighlight, bool doChatMessage, string chatMessage, TwitchMessage message, string desiredPrefixColor, string desiredUsernameColor, string desiredChatColor, bool isTip, bool isRedeemEvil) { //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) string text = ""; string value = ""; if (((TwitchMessage)(ref message)).Tags.TryGetValue("custom-reward-id", out value)) { if (value != "" && value == Config.whiteboardReplaceRedeemID.Value && Config.whiteboardReplaceRedeem.Value) { text += "Change Whiteboard..."; } if (value != "" && value == Config.forceDiceRedeemID.Value && Config.forceDiceRedeem.Value) { isRedeemEvil = true; text += "Roll Dice..."; DiceGiftRedeems.AddDiceDebt(1); } if (value != "" && value == Config.forceGiftRedeemID.Value && Config.forceGiftRedeem.Value) { isRedeemEvil = true; text += "Open Gift..."; DiceGiftRedeems.AddGiftDebt(1); } if (value != "" && value == Config.forceSuitChangeRedeemID.Value && Config.forceSuitChangeRedeem.Value) { text += "Suit Change..."; } if (value != "" && value == Config.TTSRedeemID.Value && Config.TTSRedeem.Value) { isRedeemEvil = true; text += "TTS..."; } if (value != "" && value == Config.forceWeatherChangeRedeemID.Value && Config.forceWeatherChangeRedeem.Value) { isRedeemEvil = true; text += "Weather Change..."; MoonChangeRedeem.SetNewWeatherName(((TwitchMessage)(ref message)).Message, reset: false); } if (value != "" && value == Config.forceMoonChangeRedeemID.Value && Config.forceMoonChangeRedeem.Value) { isRedeemEvil = true; text += "Moon Change..."; MoonChangeRedeem.SetNewMoonName(((TwitchMessage)(ref message)).Message, reset: false); } if (text != "") { string text2 = "Redeemed " + text; TwitchUser user = ((TwitchMessage)(ref message)).User; TwitchHandler.NewRedeemMessage(playerID, false, true, text2, ((TwitchUser)(ref user)).DisplayName, desiredPrefixColor, desiredUsernameColor, desiredChatColor, true, isRedeemEvil); } } } } public class ModData { [ModData(/*Could not decode attribute arguments.*/)] public string NextMoonName = ""; [ModData(/*Could not decode attribute arguments.*/)] public string NextWeatherName = ""; [ModData(/*Could not decode attribute arguments.*/)] public int GiftDebt = 0; [ModData(/*Could not decode attribute arguments.*/)] public int DiceDebt = 0; public void ZMTSaveData() { SaveLoadHandler.SaveData(ModDataHelper.GetModDataKey((object)this, "NextMoonName")); SaveLoadHandler.SaveData(ModDataHelper.GetModDataKey((object)this, "NextWeatherName")); SaveLoadHandler.SaveData(ModDataHelper.GetModDataKey((object)this, "GiftDebt")); SaveLoadHandler.SaveData(ModDataHelper.GetModDataKey((object)this, "DiceDebt")); } public void ZMTLoadData() { SaveLoadHandler.LoadData(ModDataHelper.GetModDataKey((object)this, "NextMoonName")); SaveLoadHandler.LoadData(ModDataHelper.GetModDataKey((object)this, "NextWeatherName")); SaveLoadHandler.LoadData(ModDataHelper.GetModDataKey((object)this, "GiftDebt")); SaveLoadHandler.LoadData(ModDataHelper.GetModDataKey((object)this, "DiceDebt")); } public void ResetData() { NextMoonName = ""; NextWeatherName = ""; GiftDebt = 0; DiceDebt = 0; ZMTSaveData(); } } public static class PluginInfo { public const string modGUID = "ZetaArcade.ZetasTwitchRedeems"; public const string modName = "ZetasTwitchRedeems"; public const string modVersion = "0.0.1"; } } namespace ZetasTwitchRedeems.RedeemPatches { internal class DiceGiftRedeems : MonoBehaviour { [HarmonyPatch(typeof(GrabbableObject), "GrabItem")] internal class GrabItemPatch { [HarmonyPostfix] private static void Postfix(GrabbableObject __instance) { if ((Object)(object)__instance == (Object)null || !Object.op_Implicit((Object)(object)StartOfRound.Instance) || StartOfRound.Instance.inShipPhase || !StartOfRound.Instance.shipHasLanded) { return; } ConfigHandler config = ZTRBase.Config; if (config.forceDiceRedeem.Value || config.forceGiftRedeem.Value) { ZTRBase.Logger.LogInfo((object)("Detected item: " + __instance.itemProperties.itemName)); string text = __instance.itemProperties.itemName.ToLowerInvariant(); if (diceNames.Contains(text) && ZTRBase.ModDataInstance.DiceDebt > 0) { ZTRBase.Logger.LogInfo((object)("Item " + text + " is a Dice!")); ZTRBase.Logger.LogInfo((object)("Dice debt is " + ZTRBase.ModDataInstance.DiceDebt + ", using item")); __instance.ItemActivate(true, true); AddDiceDebt(-1); } else if (text == "gift" && ZTRBase.ModDataInstance.GiftDebt > 0) { ZTRBase.Logger.LogInfo((object)("Item " + text + " is a Gift!")); ZTRBase.Logger.LogInfo((object)("Gift debt is " + ZTRBase.ModDataInstance.GiftDebt + ", using item")); __instance.ItemActivate(true, true); AddGiftDebt(-1); } } } } public static class GiftMimicPatch { public static void AfterOpen(object __instance) { if (NetworkManager.Singleton.IsHost) { ZTRBase.Logger.LogInfo((object)"GiftMimic opened!"); if (ZTRBase.ModDataInstance.GiftDebt > 0) { AddGiftDebt(-1); } } } } private static string[] diceNames = new string[8] { "chronos", "code rebirth die", "gambler", "rusty", "sacrificer", "steve le dice", "surfaced die", "the saint" }; public static void AddGiftDebt(int amount) { ZTRBase.Logger.LogInfo((object)("Gift debt was: " + ZTRBase.ModDataInstance.GiftDebt)); ZTRBase.ModDataInstance.GiftDebt += amount; ZTRBase.Logger.LogInfo((object)("Gift debt increased by: " + amount + ", it is now: " + ZTRBase.ModDataInstance.GiftDebt)); ZTRBase.ModDataInstance.ZMTSaveData(); } public static void AddDiceDebt(int amount) { ZTRBase.Logger.LogInfo((object)("Dice debt was: " + ZTRBase.ModDataInstance.DiceDebt)); ZTRBase.ModDataInstance.DiceDebt += amount; ZTRBase.Logger.LogInfo((object)("Dice debt increased by: " + amount + ", it is now: " + ZTRBase.ModDataInstance.DiceDebt)); ZTRBase.ModDataInstance.ZMTSaveData(); } } internal class MoonChangeRedeem : MonoBehaviour { [HarmonyPatch(typeof(StartOfRound))] internal class StartOfRoundPatch { private static GameNetworkManager ___gameNetworkManager = GameNetworkManager.Instance; private static float rerouteCheckTimer = 0f; [HarmonyPatch("Update")] [HarmonyPostfix] private static void ForceRerouteShip(StartOfRound __instance) { if (!___gameNetworkManager.isHostingGame) { return; } rerouteCheckTimer += Time.deltaTime; if (rerouteCheckTimer < 5f) { return; } rerouteCheckTimer = 0f; if (__instance.CanChangeLevels() && TimeOfDay.Instance.daysUntilDeadline != 0 && !isRerouting) { if (ZTRBase.Config.forceMoonChangeRedeem.Value && ZTRBase.ModDataInstance.NextMoonName != "") { RerouteShip(___gameNetworkManager, ZTRBase.ModDataInstance.NextMoonName, isWeather: false, ZTRBase.Config.moonChangeHard.Value); } else if (ZTRBase.Config.forceWeatherChangeRedeem.Value && ZTRBase.ModDataInstance.NextWeatherName != "") { RerouteShip(___gameNetworkManager, ZTRBase.ModDataInstance.NextWeatherName, isWeather: true, ZTRBase.Config.weatherChangeHard.Value); } } } } [HarmonyPatch(typeof(TimeOfDay))] internal class TimeOfDayPatch { private static GameNetworkManager ___gameNetworkManager = GameNetworkManager.Instance; [HarmonyPostfix] [HarmonyPatch("SetBuyingRateForDay")] private static void UpdateProfitQuotaCurrentTimePatch() { } } [HarmonyPatch(typeof(Terminal))] internal class TerminalPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void GatherGroupCreditsValue(ref int ___groupCredits) { groupCredits = ___groupCredits; } } public static int groupCredits; private static bool isRerouting = false; private static GameNetworkManager ___gameNetworkManager = GameNetworkManager.Instance; public static void SetNewMoonName(string newMoonName, bool reset) { if (!___gameNetworkManager.isHostingGame) { return; } if (!reset) { if ((Object)(object)GetMoonByName(newMoonName) != (Object)null) { ZTRBase.ModDataInstance.NextMoonName = GetMoonByName(newMoonName).NumberlessPlanetName; ZTRBase.ModDataInstance.ZMTSaveData(); } else { PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController; ulong playerClientId = localPlayerController.playerClientId; TwitchHandler.NewRedeemMessage(playerClientId, false, true, "ERROR: Moon Name could not be found: " + newMoonName, "N/A", "", "", "", true, true); } } else { ZTRBase.ModDataInstance.NextMoonName = ""; ZTRBase.ModDataInstance.ZMTSaveData(); } } public static void SetNewWeatherName(string newWeatherName, bool reset) { if (!___gameNetworkManager.isHostingGame) { return; } if (!reset) { PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController; ulong playerClientId = localPlayerController.playerClientId; try { Weather val = WeatherManager.Weathers.Find((Weather x) => string.Equals(NormalizeStringName(x.Name), NormalizeStringName(newWeatherName), StringComparison.OrdinalIgnoreCase)); if (val != null) { ZTRBase.ModDataInstance.NextWeatherName = val.Name; ZTRBase.ModDataInstance.ZMTSaveData(); } else { TwitchHandler.NewRedeemMessage(playerClientId, false, true, "ERROR: Weather Name could not be found: " + newWeatherName, "N/A", "#FFFFFF", "#FFFFFF", "#FFFFFF", true, true); } return; } catch (Exception) { TwitchHandler.NewRedeemMessage(playerClientId, false, true, "ERROR: Weather Name could not be found: " + newWeatherName, "N/A", "#FFFFFF", "#FFFFFF", "#FFFFFF", true, true); return; } } ZTRBase.ModDataInstance.NextWeatherName = ""; ZTRBase.ModDataInstance.ZMTSaveData(); } public static void RerouteShip(GameNetworkManager networkManager, string destination, bool isWeather, bool isForce) { if (!Object.op_Implicit((Object)(object)StartOfRound.Instance) || !Object.op_Implicit((Object)(object)StartOfRound.Instance.currentLevel) || !networkManager.isHostingGame) { return; } int num = 0; ExtendedLevel val; int levelID; if (isWeather) { List<ExtendedLevel> cheapestMoonsWithWeather = GetCheapestMoonsWithWeather(destination); if (cheapestMoonsWithWeather == null) { return; } if (cheapestMoonsWithWeather.Count == 1) { val = cheapestMoonsWithWeather[0]; levelID = val.SelectableLevel.levelID; } else { val = cheapestMoonsWithWeather[Random.Range(0, cheapestMoonsWithWeather.Count)]; levelID = val.SelectableLevel.levelID; } } else { if (!((Object)(object)GetMoonByName(destination) != (Object)null)) { return; } val = GetMoonByName(destination); levelID = val.SelectableLevel.levelID; } if (val.IsRouteLocked) { return; } bool flag; if (isForce) { num = Mathf.Clamp(groupCredits - val.RoutePrice, 0, 99999); flag = true; } else { int num2 = groupCredits - val.RoutePrice; if (num2 < 0) { flag = false; } else { num = Mathf.Clamp(groupCredits - val.RoutePrice, 0, 99999); flag = true; } } if (flag) { isRerouting = true; StartOfRound.Instance.ChangeLevelServerRpc(levelID, num); StartOfRound.Instance.ChangeLevel(levelID); if (isWeather) { SetNewWeatherName("Nothing", reset: true); } else { SetNewMoonName("Nothing", reset: true); } isRerouting = false; } } private static ExtendedLevel GetMoonByName(string name) { foreach (ExtendedLevel extendedLevel in PatchedContent.ExtendedLevels) { if ((Object)(object)extendedLevel == (Object)null || !NormalizeStringName(extendedLevel.NumberlessPlanetName).Equals(NormalizeStringName(name), StringComparison.OrdinalIgnoreCase)) { continue; } return extendedLevel; } return null; } private static string NormalizeStringName(string s) { return s.Replace(" ", "").ToLowerInvariant(); } public static List<ExtendedLevel> GetCheapestMoonsWithWeather(string weatherName) { List<ExtendedLevel> list = new List<ExtendedLevel>(); int num = -1; foreach (ExtendedLevel extendedLevel in PatchedContent.ExtendedLevels) { if (!((Object)(object)extendedLevel == (Object)null) && !extendedLevel.IsRouteLocked && !(extendedLevel.SelectableLevel.PlanetName == StartOfRound.Instance.currentLevel.PlanetName) && NormalizeStringName(WeatherManager.GetCurrentWeather(extendedLevel.SelectableLevel).Name) == NormalizeStringName(weatherName)) { if (num == -1 || num == extendedLevel.RoutePrice) { num = extendedLevel.RoutePrice; list.Add(extendedLevel); } else if (num > extendedLevel.RoutePrice) { list.Clear(); list.Add(extendedLevel); num = extendedLevel.RoutePrice; } } } if (list.Count < 1) { return null; } return list; } } }