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 RouteRandomRedexed v1.6.2
Index154.RouteRandomRedexed.dll
Decompiled 3 weeks agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using LethalConstellations.PluginCore; using Microsoft.CodeAnalysis; using RandomRouteOnly; using RouteRandomRedexed.Helpers; using TMPro; using UnityEngine; using UnityEngine.Video; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Index154.RouteRandomRedexed")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.6.2.0")] [assembly: AssemblyInformationalVersion("1.6.2+38c8b9ad9890a69b23c8fc1e151d8e7edf87868c")] [assembly: AssemblyProduct("RouteRandomRedexed")] [assembly: AssemblyTitle("Index154.RouteRandomRedexed")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.6.2.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace RouteRandomRedexed { internal class ConstellationsCompat { internal static bool IsLevelInConstellation(SelectableLevel level) { return ClassMapper.IsLevelInConstellation(level, ""); } } internal class RandomRouteOnlyCompat { internal static List<CompatibleNoun> FilterRecentLevels(List<CompatibleNoun> routePlanetNodes) { List<CompatibleNoun> list = routePlanetNodes.ToList(); foreach (CompatibleNoun item in list.ToList()) { TerminalNode nodeAfterConfirmation = item.result.GetNodeAfterConfirmation(); SelectableLevel val = StartOfRound.Instance.levels[nodeAfterConfirmation.buyRerouteToMoon]; if (Helper.recentLevels.Contains(val.levelID)) { list.Remove(item); } } if (list.Count > 0) { routePlanetNodes = list; } else { Helper.recentLevels.Clear(); } return routePlanetNodes; } internal static TerminalNode GetWeightedRandom(List<CompatibleNoun> routePlanetNodes) { List<int> list = new List<int>(); foreach (CompatibleNoun item in routePlanetNodes.ToList()) { TerminalNode nodeAfterConfirmation = item.result.GetNodeAfterConfirmation(); int levelID2 = StartOfRound.Instance.levels[nodeAfterConfirmation.buyRerouteToMoon].levelID; list.Add(levelID2); } int num = 0; foreach (KeyValuePair<int, ConfigEntry<int>> levelWeight in ConfigManager.levelWeights) { if (list.Contains(levelWeight.Key)) { num += levelWeight.Value.Value; } } int num2 = Random.Range(1, num + 1); RouteRandomRedexed.Log.LogDebug((object)("Level selection roll = " + num2)); int num3 = 0; foreach (int levelID in list) { if (num2 <= ConfigManager.levelWeights[levelID].Value) { RouteRandomRedexed.Log.LogInfo((object)("Randomly selected level " + ((Object)Helper.levels.Where((SelectableLevel i) => i.levelID == levelID).FirstOrDefault()).name)); break; } num3++; num2 -= ConfigManager.levelWeights[levelID].Value; RouteRandomRedexed.Log.LogDebug((object)("Skipping level " + levelID)); } return routePlanetNodes[num3].result; } } [BepInPlugin("Index154.RouteRandomRedexed", "RouteRandomRedexed", "1.6.2")] public class RouteRandomRedexed : BaseUnityPlugin { public static bool constellationsLoaded; public static bool randomRouteOnlyLoaded; public static ConfigEntry<bool> ConfigAllowMildWeather; public static ConfigEntry<bool> ConfigAllowDustCloudsWeather; public static ConfigEntry<bool> ConfigAllowRainyWeather; public static ConfigEntry<bool> ConfigAllowStormyWeather; public static ConfigEntry<bool> ConfigAllowFoggyWeather; public static ConfigEntry<bool> ConfigAllowFloodedWeather; public static ConfigEntry<bool> ConfigAllowEclipsedWeather; public static ConfigEntry<bool> ConfigAllowCostlyPlanets; public static ConfigEntry<bool> ConfigRemoveCostOfCostlyPlanets; public static ConfigEntry<bool> ConfigSkipConfirmation; public static ConfigEntry<bool> ConfigDifferentPlanetEachTime; public static ConfigEntry<bool> ConfigHidePlanet; public static ConfigEntry<bool> ConfigConstellationSupport; public static ConfigEntry<bool> ConfigUseWeights; public static RouteRandomRedexed Instance { get; private set; } internal static ManualLogSource Log { get; private set; } internal static Harmony? Harmony { get; set; } private void Awake() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Instance = this; LoadConfigs(); if (Harmony == null) { Harmony = new Harmony("Index154.RouteRandomRedexed"); } Harmony.PatchAll(); Log.LogInfo((object)"Index154.RouteRandomRedexed has loaded!"); } internal static void Unpatch() { Log.LogDebug((object)"Unpatching..."); Harmony? harmony = Harmony; if (harmony != null) { harmony.UnpatchSelf(); } Log.LogDebug((object)"Finished unpatching!"); } private void LoadConfigs() { ConfigAllowMildWeather = ((BaseUnityPlugin)this).Config.Bind<bool>("Allowed Weathers", "AllowMildWeather", true, "Whether or not to allow the 'Mild' weather to be chosen by the 'route randomfilterweather' command"); ConfigAllowDustCloudsWeather = ((BaseUnityPlugin)this).Config.Bind<bool>("Allowed Weathers", "AllowDustCloudsWeather", false, "Whether or not to allow the 'Dust Clouds' weather to be chosen by the 'route randomfilterweather' command"); ConfigAllowRainyWeather = ((BaseUnityPlugin)this).Config.Bind<bool>("Allowed Weathers", "AllowRainyWeather", false, "Whether or not to allow the 'Rainy' weather to be chosen by the 'route randomfilterweather' command"); ConfigAllowStormyWeather = ((BaseUnityPlugin)this).Config.Bind<bool>("Allowed Weathers", "AllowStormyWeather", false, "Whether or not to allow the 'Stormy' weather to be chosen by the 'route randomfilterweather' command"); ConfigAllowFoggyWeather = ((BaseUnityPlugin)this).Config.Bind<bool>("Allowed Weathers", "AllowFoggyWeather", false, "Whether or not to allow the 'Foggy' weather to be chosen by the 'route randomfilterweather' command"); ConfigAllowFloodedWeather = ((BaseUnityPlugin)this).Config.Bind<bool>("Allowed Weathers", "AllowFloodedWeather", false, "Whether or not to allow the 'Flooded' weather to be chosen by the 'route randomfilterweather' command"); ConfigAllowEclipsedWeather = ((BaseUnityPlugin)this).Config.Bind<bool>("Allowed Weathers", "AllowEclipsedWeather", false, "Whether or not to allow the 'Eclipsed' weather to be chosen by the 'route randomfilterweather' command"); ConfigAllowCostlyPlanets = ((BaseUnityPlugin)this).Config.Bind<bool>("Costly Planets", "AllowCostlyPlanets", false, "Whether or not to allow costly planets (85-Rend, 7-Dine, 8-Titan). NOTE: You will still be prompted to pay the fee to fly there, enable the MakeCostlyPlanetsFree option to avoid that"); ConfigRemoveCostOfCostlyPlanets = ((BaseUnityPlugin)this).Config.Bind<bool>("Costly Planets", "RemoveCostOfCostlyPlanets", false, "Whether or not to remove the cost of costly planets when they're chosen randomly and allows them to be chosen even when AllowCostlyPlanets is false"); ConfigSkipConfirmation = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "SkipConfirmation", false, "Whether or not to skip the confirmation screen when using 'route random' or 'route randomwithweather' commands"); ConfigDifferentPlanetEachTime = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "DifferentPlanetEachTime", false, "Prevents 'route random' and 'route randomwithweather' commands from choosing the same planet you're on"); ConfigHidePlanet = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "HidePlanet", false, "Hides the planet you get randomly routed to, both in the terminal response and at the helm. NOTE: This will ALWAYS hide the orbited planet (even when selected manually) and will skip the confirmation screen"); ConfigConstellationSupport = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "LethalConstellationsSupport", true, "Turns on compatibility logic for the mod LethalConstellations. Route random will only select moons from the current constellation if enabled"); ConfigUseWeights = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Use RandomRouteOnly moon weights", true, "Whether to use the moon weights configured in RandomRouteOnly's config for random moon selection"); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "Index154.RouteRandomRedexed"; public const string PLUGIN_NAME = "RouteRandomRedexed"; public const string PLUGIN_VERSION = "1.6.2"; } } namespace RouteRandomRedexed.Patches { [HarmonyPatch(typeof(StartOfRound))] public class StartOfRoundPatch { [HarmonyPostfix] [HarmonyPatch("Start")] private static void Compat() { if (Chainloader.PluginInfos.ContainsKey("com.github.darmuh.LethalConstellations")) { RouteRandomRedexed.constellationsLoaded = true; } if (Chainloader.PluginInfos.ContainsKey("Index154.RandomRouteOnly")) { RouteRandomRedexed.randomRouteOnlyLoaded = true; } } [HarmonyPostfix] [HarmonyPatch("SetMapScreenInfoToCurrentLevel")] public static void HideMapScreenInfo(StartOfRound __instance, VideoPlayer ___screenLevelVideoReel, TextMeshProUGUI ___screenLevelDescription) { if (!(((Object)__instance.currentLevel).name == "CompanyBuildingLevel") && RouteRandomRedexed.ConfigHidePlanet.Value) { ((TMP_Text)___screenLevelDescription).text = "Orbiting: [REDACTED]\nPopulation: Unknown\nConditions: Unknown\nFauna: Unknown\nWeather: Unknown"; ((Behaviour)___screenLevelVideoReel).enabled = false; ___screenLevelVideoReel.clip = null; ((Component)___screenLevelVideoReel).gameObject.SetActive(false); ___screenLevelVideoReel.Stop(); } } } [HarmonyPatch(typeof(Terminal))] public class TerminalPatch { private static readonly TerminalNode noSuitablePlanetsNode = new TerminalNode { name = "NoSuitablePlanets", displayText = "\nNo suitable planets found.\nConsider route random.\n\n\n", clearPreviousText = true }; private static readonly TerminalNode hidePlanetHackNode = new TerminalNode { name = "HidePlanetHack", displayText = "\nRouting autopilot to [REDACTED].\nYour new balance is [playerCredits].\n\nPlease enjoy your flight.\n\n\n", clearPreviousText = true }; private static TerminalKeyword routeKeyword; private static TerminalKeyword randomKeyword; private static TerminalKeyword randomFilterWeatherKeyword; private static CompatibleNoun routeRandomCompatibleNoun; private static CompatibleNoun routeRandomFilterWeatherCompatibleNoun; private static readonly Random rand = new Random(); [HarmonyPostfix] [HarmonyPatch("Awake")] public static void AddNewTerminalWords(Terminal __instance) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown try { routeKeyword = __instance.GetKeyword("Route"); randomKeyword = new TerminalKeyword { word = "random", name = "Random", defaultVerb = routeKeyword, compatibleNouns = Array.Empty<CompatibleNoun>() }; randomFilterWeatherKeyword = new TerminalKeyword { word = "randomfilterweather", name = "RandomFilterWeather", defaultVerb = routeKeyword, compatibleNouns = Array.Empty<CompatibleNoun>() }; routeRandomCompatibleNoun = new CompatibleNoun(randomKeyword, new TerminalNode { name = "routeRandom", buyRerouteToMoon = -1, terminalOptions = Array.Empty<CompatibleNoun>() }); routeRandomFilterWeatherCompatibleNoun = new CompatibleNoun(randomFilterWeatherKeyword, new TerminalNode { name = "routeRandomFilterWeather", buyRerouteToMoon = -1, terminalOptions = Array.Empty<CompatibleNoun>() }); TerminalKeyword keyword = __instance.GetKeyword("Moons"); TerminalNode specialKeywordResult = keyword.specialKeywordResult; specialKeywordResult.displayText += "* Random // Routes you to a random moon, regardless of weather conditions\n* RandomFilterWeather // Routes you to a random moon, filtering out disallowed weather conditions\n\n"; __instance.AddKeywords(randomKeyword, randomFilterWeatherKeyword); __instance.AddCompatibleNounsToKeyword("Route", routeRandomCompatibleNoun, routeRandomFilterWeatherCompatibleNoun); } catch (Exception ex) { RouteRandomRedexed.Log.LogError((object)"Failed to add Terminal keywords and compatible nouns!"); RouteRandomRedexed.Log.LogError((object)ex); } } [HarmonyPostfix] [HarmonyPatch("ParsePlayerSentence")] public static TerminalNode RouteToRandomPlanet(TerminalNode __result, Terminal __instance) { //IL_0158: Unknown result type (might be due to invalid IL or missing references) if (__result == null || __instance == null) { RouteRandomRedexed.Log.LogDebug((object)$"Terminal node was null? ({__result == null})"); RouteRandomRedexed.Log.LogDebug((object)$"Terminal was null? ({__instance == null})"); return __result; } bool flag = ((Object)__result).name == "routeRandom"; bool flag2 = ((Object)__result).name == "routeRandomFilterWeather"; if (!flag && !flag2) { RouteRandomRedexed.Log.LogDebug((object)("Didn't choose random or randomfilterweather (chose " + ((Object)__result).name + ")")); return __result; } List<CompatibleNoun> list = routeKeyword.compatibleNouns.Where((CompatibleNoun noun) => noun.ResultIsRealMoon() && noun.ResultIsAffordable()).Distinct(new CompatibleNounComparer()).ToList(); RouteRandomRedexed.Log.LogInfo((object)$"Moons before filtering: {list.Count}"); if (flag2) { foreach (CompatibleNoun item in list.ToList()) { TerminalNode nodeAfterConfirmation = item.result.GetNodeAfterConfirmation(); SelectableLevel val = StartOfRound.Instance.levels[nodeAfterConfirmation.buyRerouteToMoon]; if (!WeatherIsAllowed(val.currentWeather)) { list.Remove(item); } } RouteRandomRedexed.Log.LogInfo((object)$"Moons after filtering weather: {list.Count}"); } if (RouteRandomRedexed.ConfigDifferentPlanetEachTime.Value) { list.RemoveAll((CompatibleNoun rpn) => rpn.result.GetNodeAfterConfirmation().NodeRoutesToCurrentOrbitedMoon()); RouteRandomRedexed.Log.LogInfo((object)$"Moons after filtering orbited moon: {list.Count}"); } if (RouteRandomRedexed.constellationsLoaded && RouteRandomRedexed.ConfigConstellationSupport.Value) { foreach (CompatibleNoun item2 in list.ToList()) { TerminalNode nodeAfterConfirmation2 = item2.result.GetNodeAfterConfirmation(); SelectableLevel level = StartOfRound.Instance.levels[nodeAfterConfirmation2.buyRerouteToMoon]; if (!ConstellationsCompat.IsLevelInConstellation(level)) { list.Remove(item2); } } RouteRandomRedexed.Log.LogInfo((object)$"Moons after filtering constellation: {list.Count}"); } if (RouteRandomRedexed.randomRouteOnlyLoaded) { list = RandomRouteOnlyCompat.FilterRecentLevels(list); RouteRandomRedexed.Log.LogInfo((object)$"Moons after filtering RandomRouteOnly recent moons list: {list.Count}"); } if (list.Count <= 0) { RouteRandomRedexed.Log.LogInfo((object)"No suitable moons found D:"); return noSuitablePlanetsNode; } TerminalNode val2 = (TerminalNode)((!RouteRandomRedexed.randomRouteOnlyLoaded || !RouteRandomRedexed.ConfigUseWeights.Value) ? ((object)rand.NextFromCollection(list).result) : ((object)RandomRouteOnlyCompat.GetWeightedRandom(list))); RouteRandomRedexed.Log.LogInfo((object)("Chosen moon: " + ((Object)val2).name)); if (RouteRandomRedexed.ConfigRemoveCostOfCostlyPlanets.Value) { if (TerminalHelper.TryMakeRouteMoonNodeFree(val2, out TerminalNode freeMoonNode)) { val2 = freeMoonNode; } RouteRandomRedexed.Log.LogInfo((object)"Made moon free!"); } if (RouteRandomRedexed.ConfigHidePlanet.Value) { TerminalNode nodeAfterConfirmation3 = val2.GetNodeAfterConfirmation(); hidePlanetHackNode.buyRerouteToMoon = nodeAfterConfirmation3.buyRerouteToMoon; hidePlanetHackNode.itemCost = ((!RouteRandomRedexed.ConfigRemoveCostOfCostlyPlanets.Value) ? nodeAfterConfirmation3.itemCost : 0); RouteRandomRedexed.Log.LogInfo((object)"Hidden moon!"); return hidePlanetHackNode; } return (TerminalNode)(RouteRandomRedexed.ConfigSkipConfirmation.Value ? ((object)val2.GetNodeAfterConfirmation()) : ((object)val2)); } private static bool WeatherIsAllowed(LevelWeatherType weatherType) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected I4, but got Unknown if (1 == 0) { } bool result = (weatherType - -1) switch { 0 => RouteRandomRedexed.ConfigAllowMildWeather.Value, 1 => RouteRandomRedexed.ConfigAllowDustCloudsWeather.Value, 2 => RouteRandomRedexed.ConfigAllowRainyWeather.Value, 3 => RouteRandomRedexed.ConfigAllowStormyWeather.Value, 4 => RouteRandomRedexed.ConfigAllowFoggyWeather.Value, 5 => RouteRandomRedexed.ConfigAllowFloodedWeather.Value, 6 => RouteRandomRedexed.ConfigAllowEclipsedWeather.Value, _ => false, }; if (1 == 0) { } return result; } } internal class CompatibleNounComparer : EqualityComparer<CompatibleNoun> { public override bool Equals(CompatibleNoun x, CompatibleNoun y) { return x != null && ((Object)x.result).name.Equals((y != null) ? ((Object)y.result).name : null, StringComparison.InvariantCultureIgnoreCase); } public override int GetHashCode(CompatibleNoun obj) { return ((object)obj.result).GetHashCode(); } } } namespace RouteRandomRedexed.Helpers { public static class RandomHelper { public static TSource NextFromCollection<TSource>(this Random rand, List<TSource> collection) { int index = rand.Next(collection.Count); return collection[index]; } } public static class TerminalHelper { public static TerminalKeyword GetKeyword(this Terminal terminal, string keywordName) { string keywordName2 = keywordName; return terminal.terminalNodes.allKeywords.First((TerminalKeyword kw) => ((Object)kw).name == keywordName2); } public static TerminalNode GetNodeAfterConfirmation(this TerminalNode node) { return node.terminalOptions.First((CompatibleNoun cn) => ((Object)cn.noun).name == "Confirm").result; } public static bool NodeRoutesToCurrentOrbitedMoon(this TerminalNode node) { return (Object)(object)StartOfRound.Instance.levels[node.buyRerouteToMoon] == (Object)(object)StartOfRound.Instance.currentLevel; } public static void AddKeyword(this Terminal terminal, TerminalKeyword newKeyword) { terminal.terminalNodes.allKeywords = CollectionExtensions.AddToArray<TerminalKeyword>(terminal.terminalNodes.allKeywords, newKeyword); } public static void AddKeywords(this Terminal terminal, params TerminalKeyword[] newKeywords) { foreach (TerminalKeyword newKeyword in newKeywords) { terminal.AddKeyword(newKeyword); } } public static void AddCompatibleNounToKeyword(this Terminal terminal, string keywordName, CompatibleNoun newCompatibleNoun) { string keywordName2 = keywordName; TerminalKeyword val = ((IEnumerable<TerminalKeyword>)terminal.terminalNodes.allKeywords).FirstOrDefault((Func<TerminalKeyword, bool>)((TerminalKeyword kw) => ((Object)kw).name == keywordName2)) ?? throw new ArgumentException("Failed to find keyword with name " + keywordName2); val.compatibleNouns = CollectionExtensions.AddToArray<CompatibleNoun>(val.compatibleNouns, newCompatibleNoun); } public static void AddCompatibleNounsToKeyword(this Terminal terminal, string keywordName, params CompatibleNoun[] newCompatibleNouns) { foreach (CompatibleNoun newCompatibleNoun in newCompatibleNouns) { terminal.AddCompatibleNounToKeyword(keywordName, newCompatibleNoun); } } public static bool ResultIsRealMoon(this CompatibleNoun compatibleNoun) { return compatibleNoun.result.buyRerouteToMoon == -2; } public static bool ResultIsAffordable(this CompatibleNoun compatibleNoun) { return compatibleNoun.result.itemCost <= 0 || RouteRandomRedexed.ConfigAllowCostlyPlanets.Value || RouteRandomRedexed.ConfigRemoveCostOfCostlyPlanets.Value; } public static bool TryMakeRouteMoonNodeFree(TerminalNode routeMoonNode, out TerminalNode freeMoonNode) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Expected O, but got Unknown //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Expected O, but got Unknown CompatibleNoun val = ((IEnumerable<CompatibleNoun>)routeMoonNode.terminalOptions).FirstOrDefault((Func<CompatibleNoun, bool>)((CompatibleNoun node) => ((Object)node.noun).name == "Confirm")); CompatibleNoun val2 = ((IEnumerable<CompatibleNoun>)routeMoonNode.terminalOptions).FirstOrDefault((Func<CompatibleNoun, bool>)((CompatibleNoun node) => ((Object)node.noun).name == "Deny")); if (val == null || val2 == null) { freeMoonNode = null; return false; } TerminalNode val3 = new TerminalNode { name = ((Object)val.result).name + "Free", buyRerouteToMoon = val.result.buyRerouteToMoon, clearPreviousText = true, displayText = val.result.displayText, itemCost = 0 }; TerminalNode val4 = new TerminalNode(); ((Object)val4).name = ((Object)routeMoonNode).name + "Free"; val4.buyRerouteToMoon = -2; val4.clearPreviousText = true; val4.displayPlanetInfo = routeMoonNode.displayPlanetInfo; val4.displayText = routeMoonNode.displayText; val4.itemCost = 0; val4.overrideOptions = true; val4.terminalOptions = (CompatibleNoun[])(object)new CompatibleNoun[2] { val2, new CompatibleNoun(val.noun, val3) }; freeMoonNode = val4; return true; } } }