using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using CleanestHud; using CleanestHud.HudChanges; using EntityStates.FalseSonBoss; using HG; using HG.Reflection; using IL.RoR2; using LeTai.Asset.TranslucentImage; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using On.EntityStates.FalseSonBoss; using On.RoR2; using On.RoR2.UI; using R2API; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RiskOfRoutes; using RiskOfRoutes.Helpers; using RiskOfRoutes.Items; using RiskOfRoutes.ModSupport; using RiskOfRoutes.StageModifiers; using RiskOfRoutes.StageModifiers.CombatModifiers; using RiskOfRoutes.StageModifiers.OtherModifiers; using RiskOfRoutes.StageModifiers.SceneModifiers; using RiskOfRoutes.UI; using RoR2; using RoR2.Artifacts; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.ExpansionManagement; using RoR2.Navigation; using RoR2.UI; using SamplePlugin; using SamplePlugin.StageModifiers; using SamplePlugin.StageModifiers.BossRewardModifiers; using SamplePlugin.StageModifiers.CombatModifiers; using SamplePlugin.StageModifiers.OtherModifiers; using SamplePlugin.StageModifiers.SceneModifiers; using TMPro; using Unity; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.SceneManagement; using UnityEngine.UI; using UnityHotReloadNS; [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("")] [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyInformationalVersion("1.0.0+185ee28e17662a4dc1d154a632ce73e7013649b2")] [assembly: AssemblyProduct("RiskOfRoutes")] [assembly: AssemblyTitle("RiskOfRoutes")] [assembly: AssemblyCompany("RiskOfRoutes")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] [CompilerGenerated] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class RouteMap { public class RouteNode { public RoutePortalType portalType; public int x; public int y; public bool visited; public bool shopVisited; public bool goldshoresVisited; public bool voidFieldsVisited; public RouteNode left; public RouteNode front; public RouteNode right; public RouteNode portalNode; public RouteNode(int x, int y) { portalType = RoutePortalType.None; this.x = x; this.y = y; } public List GetPaths(bool usePortalNode = false) { List list = new List(); if (left != null) { list.Add(left); } if (front != null) { list.Add(front); } if (right != null) { list.Add(right); } if (portalNode != null && usePortalNode) { list.Add(portalNode); } return list; } public override string ToString() { return $"Node:{x}.{y} with {GetPaths().Count} paths"; } } public int width; public int height; public int startingRoutes = 3; public bool isMoonVisited = false; public RouteNode[,] mapGrid; public RouteNode root; public bool isDirty = false; public RouteMap(Xoroshiro128Plus rng) { width = global::RiskOfRoutes.RiskOfRoutes.routeMapWidth.Value; height = 5; mapGrid = new RouteNode[width + 1, height]; mapGrid[0, 0] = new RouteNode(0, 0); root = mapGrid[0, 0]; root.visited = true; root.portalType = RoutePortalType.Starting; int num = 100; bool flag = false; List list = new List(); while (num > 0 && !flag) { num--; for (int i = 0; i < width; i++) { for (int j = 1; j < height; j++) { mapGrid[i, j] = new RouteNode(i, j); } } int num2 = 0; list = SetupPaths(rng); for (int k = 0; k < width; k++) { for (int l = 1; l < height; l++) { RouteNode routeNode = mapGrid[k, l]; if (routeNode == null) { Log.Error("this should happern"); } int count = routeNode.GetPaths().Count; if (count > 1) { num2++; } } } Log.Info($"Good oens count:{num2}"); flag = num2 > 2; if (!flag) { Log.Info("Trying to create map with more choices"); } } list.Sort((RouteNode a, RouteNode b) => a.x.CompareTo(b.x)); if (list.Count >= 1) { root.left = list[0]; } if (list.Count >= 2) { root.front = list[1]; } if (list.Count >= 3) { root.right = list[2]; } SetupRewards(rng); isDirty = true; } public void SetupRewards(Xoroshiro128Plus rng) { WeightedSelection val = new WeightedSelection(8); val.AddChoice(RoutePortalType.Heal, 1f); val.AddChoice(RoutePortalType.Combat, 1f); val.AddChoice(RoutePortalType.Utility, 1f); val.AddChoice(RoutePortalType.DroneType, 1f); WeightedSelection val2 = new WeightedSelection(8); val2.AddChoice(RoutePortalType.Heal, 1f); val2.AddChoice(RoutePortalType.Combat, 1f); val2.AddChoice(RoutePortalType.Utility, 1f); val2.AddChoice(RoutePortalType.DroneType, 1f); val2.AddChoice(RoutePortalType.ChefType, 0.8f); val2.AddChoice(RoutePortalType.Rare, 0.8f); for (int i = 0; i < width; i++) { if (mapGrid[i, 1].portalType != RoutePortalType.None) { mapGrid[i, 1].portalType = val.Evaluate(rng.nextNormalizedFloat); } if (mapGrid[i, 3].portalType != RoutePortalType.None) { mapGrid[i, 3].portalType = val2.Evaluate(rng.nextNormalizedFloat); } if (mapGrid[i, 2].portalType != RoutePortalType.None) { mapGrid[i, 2].portalType = val2.Evaluate(rng.nextNormalizedFloat); } if (mapGrid[i, 4].portalType != RoutePortalType.None) { mapGrid[i, 4].portalType = RoutePortalType.ChefType; } } HashSet memory = new HashSet(); List paths = root.GetPaths(); CheckNodeCorrect(root, rng, memory); foreach (RouteNode item in paths) { CheckNodeCorrect(item, rng, memory); } } public RouteNode GetRandomNodeOnFloor(int floor, Xoroshiro128Plus rng) { List list = new List(); for (int i = 0; i < width; i++) { RouteNode routeNode = mapGrid[i, floor]; if (routeNode != null && routeNode.portalType != RoutePortalType.None) { list.Add(routeNode); } } return rng.NextElementUniform(list); } private void CheckNodeCorrect(RouteNode node, Xoroshiro128Plus rng, HashSet memory) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) Vector2 item = default(Vector2); ((Vector2)(ref item))..ctor((float)node.x, (float)node.y); if (memory.Contains(item)) { return; } memory.Add(item); RoutePortalType routePortalType = RoutePortalType.None; List paths = node.GetPaths(); if (paths.Count == 0) { return; } routePortalType = node.portalType; foreach (RouteNode item2 in paths) { if (item2.portalType == node.portalType) { item2.portalType = RollPortalType(rng, node.portalType); } } if (paths.Count > 1) { if (paths.Count == 2) { if (paths[0].portalType == paths[1].portalType) { paths[1].portalType = RollPortalType(rng, paths[0].portalType, routePortalType); } } else if (paths.Count == 3) { if (paths[0].portalType == paths[1].portalType) { paths[1].portalType = RollPortalType(rng, paths[0].portalType, routePortalType); } if (paths[2].portalType == paths[0].portalType || paths[2].portalType == paths[1].portalType) { paths[2].portalType = RollPortalType(rng, paths[0].portalType, paths[1].portalType, routePortalType); } } } foreach (RouteNode item3 in paths) { CheckNodeCorrect(item3, rng, memory); } } private RoutePortalType RollPortalType(Xoroshiro128Plus rng, params RoutePortalType[] skipTypes) { WeightedSelection val = new WeightedSelection(8); RoutePortalType[] array = new RoutePortalType[6] { RoutePortalType.Combat, RoutePortalType.Heal, RoutePortalType.Utility, RoutePortalType.DroneType, RoutePortalType.Rare, RoutePortalType.ChefType }; RoutePortalType[] array2 = array; foreach (RoutePortalType routePortalType in array2) { if (!skipTypes.Contains(routePortalType)) { if (routePortalType == RoutePortalType.Rare || routePortalType == RoutePortalType.ChefType) { val.AddChoice(routePortalType, 0.8f); } else { val.AddChoice(routePortalType, 1f); } } } return val.Evaluate(rng.nextNormalizedFloat); } public List SetupPaths(Xoroshiro128Plus rng) { List list = new List(); List list2 = new List(); for (int i = 0; i < width; i++) { list2.Add(i); } for (int j = 0; j < startingRoutes; j++) { if (list2.Count == 0) { break; } int num = rng.NextElementUniform(list2); list2.Remove(num); RouteNode routeNode = mapGrid[num, 1]; if (routeNode != null) { routeNode.portalType = RoutePortalType.Rare; CreateRoute(routeNode, routeNode.x, routeNode.y, rng); list.Add(routeNode); } } return list; } public void CreateRoute(RouteNode curr, int x, int y, Xoroshiro128Plus rng) { if (y >= height - 1) { return; } List list = new List(); for (int i = 0; i < 3; i++) { int num = x - 1 + i; int num2 = y + 1; if (num >= 0 && num <= width - 1 && (i != 0 || mapGrid[num, y].right == null) && (i != 2 || mapGrid[num, y].left == null)) { list.Add(mapGrid[x - 1 + i, y + 1]); } } if (list.Count != 0) { RouteNode routeNode = rng.NextElementUniform(list); if (list.Count > 1 && rng.nextNormalizedFloat < 0.2f) { list.Remove(routeNode); RouteNode routeNode2 = rng.NextElementUniform(list); routeNode2.portalType = RoutePortalType.Rare; Connect(curr, routeNode2); CreateRoute(routeNode2, routeNode2.x, routeNode2.y, rng); } routeNode.portalType = RoutePortalType.Rare; Connect(curr, routeNode); CreateRoute(routeNode, routeNode.x, routeNode.y, rng); } } public RouteNode CreateColossusNode(RouteNode current, bool currentLayer = false) { if (current.y == height - 1 || current.y > 3) { return null; } int num = (currentLayer ? current.y : (current.y + 1)); Log.Info("Creating colossus node"); isDirty = true; RouteNode routeNode = null; for (int i = 0; i < width + 1; i++) { if (mapGrid[i, num] != null && (mapGrid[i, num].portalType == RoutePortalType.Colossus || mapGrid[i, num].portalType == RoutePortalType.FalseSon)) { routeNode = mapGrid[i, num]; Log.Info("Floor already has colossus node"); return routeNode; } } Log.Info("Has no colossus nodes"); for (int j = 0; j < width; j++) { int[] array = new int[2] { current.x + j, current.x - j }; int[] array2 = array; foreach (int num2 in array2) { if (num2 >= 0 && num2 < width && mapGrid[num2, num].portalType == RoutePortalType.None) { routeNode = mapGrid[num2, num]; break; } } if (routeNode != null) { break; } } if (routeNode == null) { Log.Warning("No place for colossus node, placing on extra"); mapGrid[width, num] = new RouteNode(width, num); routeNode = mapGrid[width, num]; } if (routeNode != null) { routeNode.portalType = ((num != 3) ? RoutePortalType.Colossus : RoutePortalType.FalseSon); current.portalNode = routeNode; if (routeNode.portalType == RoutePortalType.FalseSon) { ConnectToRandomNode(routeNode, thisLayer: true); } else { ConnectToRandomNode(routeNode); } return routeNode; } Log.Error("Still null"); return null; } public RouteNode CreateHardwareNode(RouteNode current) { int num = current.y + 1; Log.Info("Creating hardware node"); isDirty = true; RouteNode routeNode = null; for (int i = 0; i < width + 1; i++) { if (mapGrid[i, num] != null && (mapGrid[i, num].portalType == RoutePortalType.Hardware || mapGrid[i, num].portalType == RoutePortalType.SolusWing)) { routeNode = mapGrid[i, num]; Log.Info("Floor already has hardware node"); return routeNode; } } Log.Info("Has no hardware nodes"); for (int j = 0; j < width; j++) { int[] array = new int[2] { current.x + j, current.x - j }; int[] array2 = array; foreach (int num2 in array2) { if (num2 >= 0 && num2 < width && mapGrid[num2, num].portalType == RoutePortalType.None) { routeNode = mapGrid[num2, num]; break; } } if (routeNode != null) { break; } } if (routeNode == null) { Log.Warning("No place for hardware node, placing on extra"); mapGrid[width, num] = new RouteNode(width, num); routeNode = mapGrid[width, num]; } if (routeNode != null) { routeNode.portalType = ((num != 4) ? RoutePortalType.Hardware : RoutePortalType.SolusWing); current.portalNode = routeNode; return routeNode; } Log.Error("Still null"); return null; } private void ConnectToRandomNode(RouteNode node, bool thisLayer = false) { int y = node.y; int num = (thisLayer ? y : (y + 1)); List list = new List(); for (int i = 0; i < width; i++) { RouteNode routeNode = mapGrid[i, num]; if (routeNode != null && routeNode.portalType != RoutePortalType.None && routeNode != node) { list.Add(routeNode); } } if (list.Count > 0) { node.front = Run.instance.stageRng.NextElementUniform(list); } else { Log.Warning("ConnectToRandomNode: No valid target nodes to connect"); } } private void Connect(RouteNode curr, RouteNode next) { if (curr.x - next.x == -1) { curr.right = next; } else if (curr.x - next.x == 0) { curr.front = next; } else { curr.left = next; } } public RouteNode GetStartingNode() { return mapGrid[0, 0]; } } public enum RoutePortalType { None, Rare, ItemType, DroneType, ChefType, Colossus, Hardware, SolusWing, Goldshores, Shop, Arena, FalseSon, Starting, Combat, Heal, Utility, MoonTeleporter } public enum ModifierTier { None, Tier1, Tier2, Tier3 } public enum ModifierRarity { Common, Rare } namespace SamplePlugin { [Serializable] public struct ModifierSync : IEquatable { public string name; public int stack; public bool isArtifact; public ModifierSync(ModifierDef mod) { name = mod.name; stack = 1; isArtifact = mod.isArtifact; } public ModifierSync(ModifierDef mod, int stack) { name = mod.name; this.stack = stack; isArtifact = mod.isArtifact; } public bool Equals(ModifierSync other) { return name == other.name; } } [Serializable] public struct RouteNodeSync : IEquatable { public RoutePortalType portalType; public int x; public int y; public int frontX; public int frontY; public int leftX; public int leftY; public int rightX; public int rightY; public int bonusX; public int bonusY; public bool visited; public bool shopVisited; public bool goldshoresVisited; public bool voidFieldsVisited; public RouteNodeSync(RouteMap.RouteNode node) { x = -1; y = -1; frontX = -1; frontY = -1; leftX = -1; leftY = -1; rightX = -1; rightY = -1; bonusX = -1; bonusY = -1; x = node.x; y = node.y; visited = node.visited; portalType = node.portalType; RouteMap.RouteNode front = node.front; if (front != null) { frontX = front.x; frontY = front.y; } RouteMap.RouteNode left = node.left; if (left != null) { leftX = left.x; leftY = left.y; } RouteMap.RouteNode right = node.right; if (node.right != null) { rightX = right.x; rightY = right.y; } if (node.portalNode != null) { bonusX = node.portalNode.x; bonusY = node.portalNode.y; } shopVisited = node.shopVisited; goldshoresVisited = node.goldshoresVisited; voidFieldsVisited = node.voidFieldsVisited; } public bool Equals(RouteNodeSync other) { return x == other.x && y == other.y && visited == other.visited && portalType == other.portalType && frontX == other.frontX && frontY == other.frontY && leftX == other.leftX && leftY == other.leftY && rightX == other.rightX && rightY == other.rightY && bonusX == other.bonusX && bonusY == other.bonusY; } } public class SyncListModifier : SyncListStruct { public override void SerializeItem(NetworkWriter writer, ModifierSync item) { writer.Write(item.name); writer.WritePackedUInt32((uint)item.stack); writer.Write(item.isArtifact); } public override ModifierSync DeserializeItem(NetworkReader reader) { return new ModifierSync { name = reader.ReadString(), stack = (int)reader.ReadPackedUInt32(), isArtifact = reader.ReadBoolean() }; } } public class SyncListRouteNode : SyncListStruct { public override void SerializeItem(NetworkWriter writer, RouteNodeSync item) { writer.Write((int)item.portalType); writer.WritePackedUInt32((uint)item.x); writer.WritePackedUInt32((uint)item.y); writer.WritePackedUInt32((uint)item.frontX); writer.WritePackedUInt32((uint)item.frontY); writer.WritePackedUInt32((uint)item.leftX); writer.WritePackedUInt32((uint)item.leftY); writer.WritePackedUInt32((uint)item.rightX); writer.WritePackedUInt32((uint)item.rightY); writer.WritePackedUInt32((uint)item.bonusX); writer.WritePackedUInt32((uint)item.bonusY); writer.Write(item.visited); writer.Write(item.shopVisited); writer.Write(item.goldshoresVisited); writer.Write(item.voidFieldsVisited); } public override RouteNodeSync DeserializeItem(NetworkReader reader) { return new RouteNodeSync { portalType = (RoutePortalType)reader.ReadInt32(), x = (int)reader.ReadPackedUInt32(), y = (int)reader.ReadPackedUInt32(), frontX = (int)reader.ReadPackedUInt32(), frontY = (int)reader.ReadPackedUInt32(), leftX = (int)reader.ReadPackedUInt32(), leftY = (int)reader.ReadPackedUInt32(), rightX = (int)reader.ReadPackedUInt32(), rightY = (int)reader.ReadPackedUInt32(), bonusX = (int)reader.ReadPackedUInt32(), bonusY = (int)reader.ReadPackedUInt32(), visited = reader.ReadBoolean(), shopVisited = reader.ReadBoolean(), goldshoresVisited = reader.ReadBoolean(), voidFieldsVisited = reader.ReadBoolean() }; } } public class ModifierSlotConfiguration { public Dictionary positive = new Dictionary(); public Dictionary negative = new Dictionary(); } public class StageModifierDirector : NetworkBehaviour { public static StageModifierDirector instance; public static List activePortalInstances; public List runArtifactsApplied; public SyncListModifier modifiersSynced = new SyncListModifier(); public List routeNodesSynced = new List(); public int mapState = 0; public float stageEnterTime = 0f; [SyncVar] public int mapWidth; [SyncVar] public int mapHeight; [SyncVar] public bool isMoonVisited; [SyncVar] public Vector2 currentNodeSync = new Vector2(-1f, -1f); public Inventory monsterTeamInventory; public RouteMap routeMap; public RouteMap.RouteNode currentNode; [SyncVar(hook = "OnBaseCurseSyncedUpdate")] public float syncedBaseCurse = 0f; [SyncVar] public int cursePerStack = 0; public int punishCommandStack = 0; [SyncVar] public float punishmentTime = -1f; [SyncVar] public bool purifyLunarItemModifier; [SyncVar] public int doppelStackTime = 30; [SyncVar] public bool modifiersCanBeBanned = true; [SyncVar] public int commonDefaultStack = 5; [SyncVar] public int uncommonDefaultStack = 3; [SyncVar] public int legendaryDefaultStack = 1; [SyncVar] public int bossDefaultStack = 1; [SyncVar] public int commonExtraRange = 3; [SyncVar] public int uncommonExtraRange = 2; [SyncVar] public int legendaryExtraRange = 1; [SyncVar] public int bossExtraRange = 1; [SyncVar] public int chanceForExtra = 0; private static int kListmodifiersSynced; private static int kRpcRpcReceiveFullMap; public List activeModifiers { get; set; } public List reservedModifiers { get; set; } public HashSet bannedModifiersRun { get; set; } public HashSet bannedModifiersStage { get; set; } public int NetworkmapWidth { get { return mapWidth; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref mapWidth, 2u); } } public int NetworkmapHeight { get { return mapHeight; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref mapHeight, 4u); } } public bool NetworkisMoonVisited { get { return isMoonVisited; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref isMoonVisited, 8u); } } public Vector2 NetworkcurrentNodeSync { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return currentNodeSync; } [param: In] set { //IL_0001: Unknown result type (might be due to invalid IL or missing references) ((NetworkBehaviour)this).SetSyncVar(value, ref currentNodeSync, 16u); } } public float NetworksyncedBaseCurse { get { return syncedBaseCurse; } [param: In] set { ref float reference = ref syncedBaseCurse; if (NetworkServer.localClientActive && !((NetworkBehaviour)this).syncVarHookGuard) { ((NetworkBehaviour)this).syncVarHookGuard = true; OnBaseCurseSyncedUpdate(value); ((NetworkBehaviour)this).syncVarHookGuard = false; } ((NetworkBehaviour)this).SetSyncVar(value, ref reference, 32u); } } public int NetworkcursePerStack { get { return cursePerStack; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref cursePerStack, 64u); } } public float NetworkpunishmentTime { get { return punishmentTime; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref punishmentTime, 128u); } } public bool NetworkpurifyLunarItemModifier { get { return purifyLunarItemModifier; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref purifyLunarItemModifier, 256u); } } public int NetworkdoppelStackTime { get { return doppelStackTime; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref doppelStackTime, 512u); } } public bool NetworkmodifiersCanBeBanned { get { return modifiersCanBeBanned; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref modifiersCanBeBanned, 1024u); } } public int NetworkcommonDefaultStack { get { return commonDefaultStack; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref commonDefaultStack, 2048u); } } public int NetworkuncommonDefaultStack { get { return uncommonDefaultStack; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref uncommonDefaultStack, 4096u); } } public int NetworklegendaryDefaultStack { get { return legendaryDefaultStack; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref legendaryDefaultStack, 8192u); } } public int NetworkbossDefaultStack { get { return bossDefaultStack; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref bossDefaultStack, 16384u); } } public int NetworkcommonExtraRange { get { return commonExtraRange; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref commonExtraRange, 32768u); } } public int NetworkuncommonExtraRange { get { return uncommonExtraRange; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref uncommonExtraRange, 65536u); } } public int NetworklegendaryExtraRange { get { return legendaryExtraRange; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref legendaryExtraRange, 131072u); } } public int NetworkbossExtraRange { get { return bossExtraRange; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref bossExtraRange, 262144u); } } public int NetworkchanceForExtra { get { return chanceForExtra; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref chanceForExtra, 524288u); } } public void Awake() { instance = this; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); activeModifiers = new List(); reservedModifiers = new List(); bannedModifiersRun = new HashSet(); bannedModifiersStage = new HashSet(); activePortalInstances = new List(); Log.Info("Awake: StageModifierDirector created"); if (NetworkServer.active) { Run.onRunStartGlobal += Run_onRunStartGlobal; Run.onRunDestroyGlobal += Run_onRunDestroyGlobal; SceneDirector.onPrePopulateSceneServer += SceneDirector_onPrePopulateSceneServer; Stage.onServerStageComplete += Stage_onServerStageComplete; } ((SyncList)(object)modifiersSynced).InitializeBehaviour((NetworkBehaviour)(object)this, kListmodifiersSynced); } public void OnDestroy() { Run.onRunDestroyGlobal -= Run_onRunDestroyGlobal; Run.onRunStartGlobal -= Run_onRunStartGlobal; SceneDirector.onPrePopulateSceneServer -= SceneDirector_onPrePopulateSceneServer; Stage.onServerStageComplete -= Stage_onServerStageComplete; } public void OnConfigUpdated() { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Invalid comparison between Unknown and I4 //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Invalid comparison between Unknown and I4 //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Invalid comparison between Unknown and I4 //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Invalid comparison between Unknown and I4 //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Invalid comparison between Unknown and I4 bannedModifiersRun.Clear(); HashSet bannedPrinterItems = global::RiskOfRoutes.RiskOfRoutes.bannedPrinterItems; HashSet bannedEnemyItems = global::RiskOfRoutes.RiskOfRoutes.bannedEnemyItems; foreach (string item in bannedEnemyItems) { bannedModifiersRun.Add(item + "_EnemyItem"); } foreach (string item2 in bannedPrinterItems) { bannedModifiersRun.Add(item2 + "_Printer"); } Enumerator enumerator3 = ItemCatalog.allItemDefs.GetEnumerator(); try { while (enumerator3.MoveNext()) { ItemDef current3 = enumerator3.Current; if (current3.hidden) { bannedModifiersRun.Add(((Object)current3).name + "_EnemyItem"); bannedModifiersRun.Add(((Object)current3).name + "_Printer"); } if (current3.ContainsTag((ItemTag)4) && !global::RiskOfRoutes.RiskOfRoutes.canAppearWithAIBlacklisted.Value) { bannedModifiersRun.Add(((Object)current3).name + "_EnemyItem"); } if ((int)current3.tier == 4) { if (!global::RiskOfRoutes.RiskOfRoutes.enemyItemsAllowBoss.Value) { bannedModifiersRun.Add(((Object)current3).name + "_EnemyItem"); } } else if (((int)current3.tier == 6 || (int)current3.tier == 7 || (int)current3.tier == 8) && !global::RiskOfRoutes.RiskOfRoutes.enemyItemsAllowVoid.Value) { bannedModifiersRun.Add(((Object)current3).name + "_EnemyItem"); } if (((int)current3.tier != 0 && (int)current3.tier != 1) || current3.ContainsTag((ItemTag)15)) { bannedModifiersRun.Add(((Object)current3).name + "_Printer"); } } } finally { ((IDisposable)enumerator3/*cast due to .constrained prefix*/).Dispose(); } } private void Run_onRunStartGlobal(Run run) { //IL_00bd: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { GameObject val = Object.Instantiate(global::RiskOfRoutes.RiskOfRoutes.networkedInventoryPrefab); Object.DontDestroyOnLoad((Object)(object)val); monsterTeamInventory = val.GetComponent(); val.GetComponent().teamIndex = (TeamIndex)2; NetworkServer.Spawn(val); CreateRunConfiguration(); Log.Info(string.Format("{0}: Got punishmentTimeMinutes value - {1}", "Run_onRunStartGlobal", punishmentTime)); Log.Info("Creating route map"); routeMap = new RouteMap(run.runRNG); currentNode = routeMap.GetStartingNode(); currentNode.visited = true; NetworkcurrentNodeSync = new Vector2((float)currentNode.x, (float)currentNode.y); Log.Info($"Current:{currentNode.x},{currentNode.y} that has {currentNode.GetPaths().Count} paths"); routeMap.isDirty = true; } } private void Run_onRunDestroyGlobal(Run obj) { if (!NetworkServer.active) { return; } Log.Info(string.Format("{0}: Run ended, clearing {1} modifiers", "Run_onRunDestroyGlobal", activeModifiers.Count)); foreach (StageModifier activeModifier in activeModifiers) { if (activeModifier == null) { Log.Error("Run_onRunDestroyGlobal: Some active modifier was null"); } else { activeModifier.OnEnd(); } } reservedModifiers.Clear(); runArtifactsApplied.Clear(); ((SyncList)(object)modifiersSynced).Clear(); routeNodesSynced.Clear(); if (Object.op_Implicit((Object)(object)((Component)this).gameObject)) { Object.Destroy((Object)(object)((Component)this).gameObject); Log.Info("Run_onRunDestroyGlobal: StageModifierDirector destroyed"); } if (Object.op_Implicit((Object)(object)monsterTeamInventory)) { NetworkServer.Destroy(((Component)monsterTeamInventory).gameObject); } monsterTeamInventory = null; } private void SceneDirector_onPrePopulateSceneServer(SceneDirector obj) { Log.Info(string.Format("{0}: Stage started, applying {1} modifiers", "SceneDirector_onPrePopulateSceneServer", reservedModifiers.Count)); if (reservedModifiers.Count == 0) { return; } activeModifiers.Clear(); bannedModifiersStage.Clear(); foreach (ModifierSync reservedModifier in reservedModifiers) { StageModifier stageModifier = StageModifierCatalog.StageModifierFromDef(reservedModifier.name, reservedModifier.stack); if (stageModifier == null) { Log.Error("SceneDirector_onPrePopulateSceneServer: Modifier with def " + reservedModifier.name + " is null"); continue; } activeModifiers.Add(stageModifier); if (modifiersCanBeBanned) { bannedModifiersStage.Add(reservedModifier.name); } } foreach (ModifierSync reservedModifier2 in reservedModifiers) { ((SyncList)(object)modifiersSynced).Add(reservedModifier2); if (reservedModifier2.name == "SoulCost") { NetworkcursePerStack = reservedModifier2.stack; } } activePortalInstances.Clear(); reservedModifiers.Clear(); foreach (StageModifier activeModifier in activeModifiers) { activeModifier?.OnStart(); } SceneDef sceneDefForCurrentScene = SceneCatalog.GetSceneDefForCurrentScene(); stageEnterTime = Run.instance.GetRunStopwatch(); } private void Stage_onServerStageComplete(Stage obj) { //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Invalid comparison between Unknown and I4 //IL_01bc: Unknown result type (might be due to invalid IL or missing references) Log.Info($"Stage completed, clearing {activeModifiers.Count} modifiers"); foreach (StageModifier activeModifier in activeModifiers) { if (activeModifier == null) { Log.Error("Some of the modifiers is null"); } else { activeModifier.OnEnd(); } } activeModifiers.Clear(); ((SyncList)(object)modifiersSynced).Clear(); Log.Info($"Scene order:{Stage.instance.sceneDef.stageOrder}"); if (Stage.instance.sceneDef.stageOrder == 5 || (currentNode.x == 0 && currentNode.y == 0 && Stage.instance.sceneDef.baseSceneName != "bazaar" && (int)Stage.instance.sceneDef.sceneType == 1)) { Log.Info("Trying to create new map"); if (Object.op_Implicit((Object)(object)TeleporterInteraction.instance) && TeleporterInteraction.instance.sceneExitController.destinationScene.baseSceneName == "moon2" && TeleporterInteraction.instance.isCharged) { routeMap.isMoonVisited = true; } else { routeMap = new RouteMap(Run.instance.runRNG); Log.Info("Created new map"); currentNode = routeMap.GetStartingNode(); NetworkcurrentNodeSync = new Vector2((float)currentNode.x, (float)currentNode.y); Log.Info($"Current:{currentNode.x},{currentNode.y} that has {currentNode.GetPaths().Count} paths"); Log.Info($"Teleporter:{TeleporterInteraction.instance.sceneExitController.useRunNextStageScene}"); } } else { Log.Info("Not creating new map yet"); Log.Info($"\t{currentNode.x}:{currentNode.y}"); Log.Info($"\t{Stage.instance.sceneDef.stageOrder}"); } currentNode.visited = true; routeMap.isDirty = true; } private void CreateRunConfiguration() { NetworkcommonDefaultStack = global::RiskOfRoutes.RiskOfRoutes.commonDefaultStack.Value; NetworkuncommonDefaultStack = global::RiskOfRoutes.RiskOfRoutes.uncommonDefaultStack.Value; NetworklegendaryDefaultStack = global::RiskOfRoutes.RiskOfRoutes.legendaryDefaultStack.Value; NetworkbossDefaultStack = global::RiskOfRoutes.RiskOfRoutes.bossDefaultStack.Value; NetworkcommonExtraRange = global::RiskOfRoutes.RiskOfRoutes.commonExtraRange.Value; NetworkuncommonExtraRange = global::RiskOfRoutes.RiskOfRoutes.uncommonExtraRange.Value; NetworklegendaryExtraRange = global::RiskOfRoutes.RiskOfRoutes.legendaryExtraRange.Value; NetworkbossExtraRange = global::RiskOfRoutes.RiskOfRoutes.bossExtraRange.Value; NetworkchanceForExtra = global::RiskOfRoutes.RiskOfRoutes.chanceForExtra.Value; runArtifactsApplied = GetArtifactsAppliedThisRun(); if (global::RiskOfRoutes.RiskOfRoutes.negativeStackPunishment.Value) { NetworkpunishmentTime = global::RiskOfRoutes.RiskOfRoutes.punishmentTimeMinutes.Value; } else { NetworkpunishmentTime = -1f; } NetworkpurifyLunarItemModifier = global::RiskOfRoutes.RiskOfRoutes.lunarTurnToPearl.Value; NetworkdoppelStackTime = global::RiskOfRoutes.RiskOfRoutes.doppelStackTime.Value; NetworkmodifiersCanBeBanned = global::RiskOfRoutes.RiskOfRoutes.modifiersCanBeBanned.Value; bannedModifiersRun.Clear(); HashSet bannedPrinterItems = global::RiskOfRoutes.RiskOfRoutes.bannedPrinterItems; HashSet bannedEnemyItems = global::RiskOfRoutes.RiskOfRoutes.bannedEnemyItems; HashSet bannedLunarDefs = global::RiskOfRoutes.RiskOfRoutes.bannedLunarDefs; HashSet bannedArtifactDefs = global::RiskOfRoutes.RiskOfRoutes.bannedArtifactDefs; HashSet bannedModifierDefs = global::RiskOfRoutes.RiskOfRoutes.bannedModifierDefs; foreach (string item in bannedEnemyItems) { bannedModifiersRun.Add(item + "_EnemyItem"); } foreach (string item2 in bannedPrinterItems) { bannedModifiersRun.Add(item2 + "_Printer"); } foreach (string item3 in bannedLunarDefs) { bannedModifiersRun.Add(item3 + "_LunarItem"); } foreach (string item4 in bannedArtifactDefs) { bannedModifiersRun.Add(item4); } foreach (string bannedModifierDef in global::RiskOfRoutes.RiskOfRoutes.bannedModifierDefs) { bannedModifiersRun.Add(bannedModifierDef); } HashSet moddedArtifactsInfo = global::RiskOfRoutes.RiskOfRoutes.moddedArtifactsInfo; HashSet moddedLunarsInfo = global::RiskOfRoutes.RiskOfRoutes.moddedLunarsInfo; ArtifactDef[] artifactDefs = ArtifactCatalog.artifactDefs; foreach (ArtifactDef art in artifactDefs) { if (!StageModifierCatalog.artifactTiers.ContainsKey(art.cachedName) && !moddedArtifactsInfo.Any((DefInfo defInfo) => defInfo.name == art.cachedName)) { bannedModifiersRun.Add(art.cachedName); } } foreach (ItemDef lunar in StageModifierCatalog.lunarRegisteredDefs) { if (!StageModifierCatalog.lunarItemTiers.ContainsKey(((Object)lunar).name) && !moddedLunarsInfo.Any((DefInfo defInfo) => defInfo.name == ((Object)lunar).name)) { bannedModifiersRun.Add(((Object)lunar).name + "_LunarItem"); } } StageModifierCatalog.CreateRunPools(); } private void OnEnable() { Stage.onStageStartGlobal += OnStageStartClient; } private void OnDisable() { Stage.onStageStartGlobal -= OnStageStartClient; } private void OnStageStartClient(Stage obj) { if (!NetworkServer.active) { Log.Info("OnStageStartClient: on client"); LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser(); NetworkUser val = ((firstLocalUser != null) ? firstLocalUser.currentNetworkUser : null); if (!((Object)(object)val == (Object)null)) { Console.instance.SubmitCmd(val, "request_map", false); } } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCRequestMap(ConCommandArgs args) { if ((Object)(object)instance != (Object)null && instance.routeMap != null) { Log.Info("CCRequestMap: requested the map"); instance.routeMap.isDirty = true; } } protected virtual void FixedUpdate() { if (NetworkServer.active && routeMap != null && routeMap.isDirty) { UpdateRouteMap(); routeMap.isDirty = false; } } private void UpdateRouteMap() { Log.Info("UpdateRouteMap: Updating route map"); int width = routeMap.width; int height = routeMap.height; RouteNodeSync[] array = new RouteNodeSync[(width + 1) * height]; for (int i = 0; i < width + 1; i++) { for (int j = 0; j < height; j++) { int num = i * height + j; if (routeMap.mapGrid[i, j] != null) { array[num] = new RouteNodeSync(routeMap.mapGrid[i, j]); } else { array[num] = new RouteNodeSync(new RouteMap.RouteNode(-1, -1)); } } } NetworkmapWidth = width; NetworkmapHeight = height; NetworkisMoonVisited = routeMap.isMoonVisited; routeNodesSynced = new List(array); CallRpcReceiveFullMap(array, width, height, routeMap.isMoonVisited, stageEnterTime); } [ClientRpc] private void RpcReceiveFullMap(RouteNodeSync[] map, int width, int height, bool moon, float hostStageEnterTime) { NetworkmapWidth = width; NetworkmapHeight = height; NetworkisMoonVisited = moon; routeNodesSynced = new List(map); mapState++; stageEnterTime = hostStageEnterTime; Debug.Log((object)"RpcReceiveFullMap: Got map on client"); } private void OnBaseCurseSyncedUpdate(float newValue) { NetworksyncedBaseCurse = newValue; foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList) { if (!((Object)(object)readOnlyInstances.playerCharacterMasterController == (Object)null) && Object.op_Implicit((Object)(object)readOnlyInstances) && Object.op_Implicit((Object)(object)readOnlyInstances.GetBody())) { readOnlyInstances.GetBody().RecalculateStats(); } } } public unsafe List GetArtifactsAppliedThisRun() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) List list = new List(); RunEnabledArtifacts enumerator = RunArtifactManager.enabledArtifactsEnumerable.GetEnumerator(); try { while (((RunEnabledArtifacts)(ref enumerator)).MoveNext()) { ArtifactDef current = ((RunEnabledArtifacts)(ref enumerator)).Current; list.Add(current.cachedName); Log.Info("GetArtifactsAppliedThisRun: Added " + current.cachedName); } } finally { ((IDisposable)(*(RunEnabledArtifacts*)(&enumerator))/*cast due to .constrained prefix*/).Dispose(); } return list; } public void GetNextStageModifiers(GameObject portal) { //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Invalid comparison between I4 and Unknown RoutePortalManager component = portal.GetComponent(); if ((Object)(object)component == (Object)null || component.routeNode == null) { Log.Error("GetNextStageModifiers: Portal doesn't have routePortalManager or RouteNode, couldn't get modifiers."); return; } if (component.isObjectiveNode) { List pool = StageModifierCatalog.GetPool(RoutePortalType.MoonTeleporter); Log.Info("Boss modifiers pool: "); foreach (string item in pool) { Log.Info("\t" + item); } } HashSet hashSet = new HashSet(bannedModifiersRun); hashSet.UnionWith(bannedModifiersStage); Dictionary dictionary = new Dictionary(); ModifierSlotConfiguration modifierSlots = GetModifierSlots(Run.instance.stageRng, component.routeNode.portalType, hashSet); if (SceneHelper.IsSceneColossus((SceneIndex)component.destinationSceneIndex, includeFalseSonScene: false) || CheckPlayersHaveFalseSonHeart() > 0) { if (!bannedModifiersRun.Contains("Aurelionite")) { dictionary.Add("Aurelionite", 1); Log.Info("GetNextStageModifiers: Added aurelionite modifier to colossus portal"); } else { Log.Warning("Not adding aurelionite reward to collosus portal because modifier is banned"); } } if (component.destinationSceneIndex == (int)SceneCatalog.FindSceneIndex("conduitcanyon")) { List list = new List { "UpgradeDrones", "DroneBossRed" }; dictionary.Add(Run.instance.stageRng.NextElementUniform(list), 1); Log.Info("GetNextStageModifiers: Added rare drone modifier to hardware portal"); } if (component.routeNode.portalType == RoutePortalType.ChefType) { if (!bannedModifiersRun.Contains("WanderingChef")) { dictionary.Add("WanderingChef", 1); Log.Info("GetNextStageModifiers: Added chef modifier to route portal"); } else { Log.Warning("Not adding wandering chef to chef portal because modifier is banned"); } } if (CheckMountainShrine() && Run.instance.stageRng.nextNormalizedFloat > 0.5f && !bannedModifiersRun.Contains("Mountain")) { dictionary.Add("Mountain", TeleporterInteraction.instance.shrineBonusStacks); } if (CheckRepairAvailable() && Run.instance.stageRng.nextNormalizedFloat > 0.8f && !bannedModifiersRun.Contains("Repair")) { dictionary.Add("Repair", 1); } Dictionary positive = modifierSlots.positive; foreach (KeyValuePair item2 in positive) { for (int i = 0; i < item2.Value; i++) { List pool2 = StageModifierCatalog.GetPool(component.routeNode.portalType); ModifierDef modifierDef = StageModifierCatalog.SelectModifier(hashSet, component.routeNode.portalType, item2.Key, pool2); if (modifierDef == null) { continue; } int num = CalculateStack(modifierDef, item2.Key); if (modifierDef.name == "DamagePrinterModifier" || modifierDef.name == "HealingPrinterModifier" || modifierDef.name == "UtilityPrinterModifier" || modifierDef.name == "FoodRelatedPrinterModifier") { Log.Info("GetNextStageModifiers: got printer modifier"); List typePool = StageModifierCatalog.damageItems; if (modifierDef.name == "DamagePrinterModifier") { typePool = StageModifierCatalog.damageItems; } else if (modifierDef.name == "HealingPrinterModifier") { typePool = StageModifierCatalog.healingItems; } else if (modifierDef.name == "UtilityPrinterModifier") { typePool = StageModifierCatalog.utilityItems; } else if (modifierDef.name == "FoodRelatedPrinterModifier") { typePool = StageModifierCatalog.foodRelatedItems; } for (int j = 0; j < num; j++) { ModifierDef modifierDef2 = StageModifierCatalog.SelectModifier(hashSet, component.routeNode.portalType, ModifierTier.Tier1, typePool); if (modifierDef2 == null) { Log.Error("GetNextStageModifiers: got null printer modifier from item pool"); break; } hashSet.Add(modifierDef2.name); if (modifierDef2.conflictList != null) { foreach (string conflict in modifierDef2.conflictList) { hashSet.Add(conflict); } } if (!dictionary.ContainsKey(modifierDef2.name)) { dictionary.Add(modifierDef2.name, 1); } } continue; } hashSet.Add(modifierDef.name); if (modifierDef.conflictList != null) { foreach (string conflict2 in modifierDef.conflictList) { hashSet.Add(conflict2); } } if (dictionary.ContainsKey(modifierDef.name)) { dictionary[modifierDef.name] += num; } else { dictionary.Add(modifierDef.name, num); } } } Dictionary negative = modifierSlots.negative; List list2 = new List(); foreach (KeyValuePair item3 in negative) { for (int k = 0; k < item3.Value; k++) { List pool3 = StageModifierCatalog.GetPool(component.routeNode.portalType, isNegative: true); ModifierDef modifierDef3 = StageModifierCatalog.SelectModifier(hashSet, component.routeNode.portalType, item3.Key, pool3); if (modifierDef3 == null) { continue; } int num2 = CalculateStack(modifierDef3, item3.Key); if (modifierDef3.name == "EnemyItemModifier") { Log.Info($"Enemy item stack: {num2}"); List pool4 = StageModifierCatalog.GetPool(component.routeNode.portalType, isNegative: true, isItemPool: true); modifierDef3 = StageModifierCatalog.SelectModifier(hashSet, component.routeNode.portalType, item3.Key, pool4); if (modifierDef3 == null) { Log.Error("GetNextStageModifiers: Item is null"); continue; } Log.Info("Selected " + modifierDef3.name + " as enemy item modifier"); } hashSet.Add(modifierDef3.name); if (modifierDef3.conflictList != null) { foreach (string conflict3 in modifierDef3.conflictList) { hashSet.Add(conflict3); } } if (dictionary.ContainsKey(modifierDef3.name)) { dictionary[modifierDef3.name] += num2; continue; } dictionary.Add(modifierDef3.name, num2); list2.Add(modifierDef3); } } int num3 = (int)((Run.instance.GetRunStopwatch() - stageEnterTime) / (punishmentTime * 60f)); num3 += punishCommandStack; if (num3 > 0) { Log.Info(string.Format("{0}: Adding {1} punishment stacks", "GetNextStageModifiers", num3)); } IEnumerable source = list2.Where((ModifierDef s) => s.isStackable); if (num3 > 0) { if (source.Count() == 0) { Log.Warning("GetNextStageModifiers: There are no stackable negative modifiers to apply punish, adding new"); List pool5 = StageModifierCatalog.GetPool(component.routeNode.portalType, isNegative: true); while (num3 > 0) { int num4 = Mathf.Min(num3, 3); int num5 = Run.instance.stageRng.RangeInt(1, num4 + 1); ModifierTier tier = (ModifierTier)num5; ModifierDef modifierDef4 = StageModifierCatalog.SelectModifier(hashSet, component.routeNode.portalType, tier, pool5); while (modifierDef4 == null && num5 > 1) { num5--; tier = (ModifierTier)num5; modifierDef4 = StageModifierCatalog.SelectModifier(hashSet, component.routeNode.portalType, tier, pool5); } if (modifierDef4 == null) { Log.Warning("GetNextStageModifiers: Couldnt add new negative modifiers"); break; } hashSet.Add(modifierDef4.name); if (modifierDef4.conflictList != null) { foreach (string conflict4 in modifierDef4.conflictList) { hashSet.Add(conflict4); } } num3 -= num5; int num6 = 0; if (num3 > 0 && modifierDef4.isStackable) { num6 = Run.instance.stageRng.RangeInt(0, num3 + 1); num3 -= num6; } dictionary.Add(modifierDef4.name, 1 + num6); Log.Info(string.Format("{0}: Punish added new modifier {1} with stack {2}", "GetNextStageModifiers", modifierDef4.name, 1 + num6)); } } else { for (int num7 = 0; num7 < num3; num7++) { ModifierDef modifierDef5 = Run.instance.stageRng.NextElementUniform(source.ToArray()); if (dictionary.ContainsKey(modifierDef5.name)) { dictionary[modifierDef5.name]++; Log.Info("GetNextStageModifiers: Added 1 additional stack to " + modifierDef5.name); } } } } List list3 = new List(); foreach (KeyValuePair item4 in dictionary) { ModifierDef modifierDef6 = StageModifierCatalog.FindModifier(item4.Key); if (modifierDef6 == null) { return; } list3.Add(new ModifierSync(modifierDef6, item4.Value)); } ((SyncList)(object)component.stageModifiers).Clear(); foreach (ModifierSync item5 in list3) { ((SyncList)(object)component.stageModifiers).Add($"{item5.name}={item5.stack}={item5.isArtifact}"); } } private int CalculateStack(ModifierDef def, ModifierTier targetTier) { ModifierTier tier = def.tier; if (tier == targetTier) { return 1; } if ((tier == ModifierTier.Tier1 && targetTier == ModifierTier.Tier2) || (tier == ModifierTier.Tier2 && targetTier == ModifierTier.Tier3)) { return 2; } if (tier == ModifierTier.Tier1 && targetTier == ModifierTier.Tier3) { return 3; } return 1; } public ModifierSlotConfiguration GetModifierSlots(Xoroshiro128Plus rng, RoutePortalType type, HashSet banned) { WeightedSelection val = new WeightedSelection(8); if (type != RoutePortalType.Rare) { val.AddChoice(new ModifierSlotConfiguration { positive = { { ModifierTier.Tier1, 2 } }, negative = { { ModifierTier.Tier1, 1 } } }, 1f); val.AddChoice(new ModifierSlotConfiguration { positive = { { ModifierTier.Tier1, 2 } }, negative = { { ModifierTier.Tier2, 1 } } }, 1f); val.AddChoice(new ModifierSlotConfiguration { positive = { { ModifierTier.Tier2, 1 } }, negative = { { ModifierTier.Tier1, 2 } } }, 1f); } val.AddChoice(new ModifierSlotConfiguration { positive = { { ModifierTier.Tier3, 1 } }, negative = { { ModifierTier.Tier3, 1 } } }, 0.5f); val.AddChoice(new ModifierSlotConfiguration { positive = { { ModifierTier.Tier3, 1 } }, negative = { { ModifierTier.Tier2, 1 }, { ModifierTier.Tier1, 1 } } }, 0.5f); ModifierSlotConfiguration modifierSlotConfiguration = val.Evaluate(rng.nextNormalizedFloat); if (modifierSlotConfiguration.positive.ContainsKey(ModifierTier.Tier3)) { List pool = StageModifierCatalog.GetPool(type); if (StageModifierCatalog.SelectModifier(banned, type, ModifierTier.Tier3, pool) == null) { Log.Warning(string.Format("{0}: Couldnt get Tier3 modifier for node type {1}, using Tier2", "GetModifierSlots", type)); modifierSlotConfiguration.positive.Remove(ModifierTier.Tier3); if (modifierSlotConfiguration.positive.ContainsKey(ModifierTier.Tier2)) { modifierSlotConfiguration.positive[ModifierTier.Tier2] = modifierSlotConfiguration.positive[ModifierTier.Tier2] + 1; } else { modifierSlotConfiguration.positive.Add(ModifierTier.Tier2, 2); } } } return modifierSlotConfiguration; } public bool IsModifierActive(string name) { foreach (ModifierSync item in (SyncList)(object)modifiersSynced) { if (item.name == name) { return true; } } return false; } public void AddRoutePortalInstance(GameObject portal) { if ((Object)(object)portal == (Object)null) { Log.Error("AddRoutePortalInstance: Route portal is null, cant add instance"); return; } RoutePortalManager component = portal.GetComponent(); if ((Object)(object)component == (Object)null) { Log.Error("AddRoutePortalInstance: Route portal manager is null, cant add instance"); } else { activePortalInstances.Add(portal); } } public void GetModifiersFromRandomPortal() { if (activePortalInstances == null || activePortalInstances.Count == 0) { Log.Warning("GetModifiersFromRandomPortal: There are no portal instances to get modifiers from"); return; } GameObject val = Run.instance.stageRng.NextElementUniform(activePortalInstances); RoutePortalManager component = val.GetComponent(); if ((Object)(object)component == (Object)null) { Log.Warning("GetModifiersFromRandomPortal: Route portal manager is null, cant get modifiers"); return; } reservedModifiers.Clear(); foreach (string item in (SyncList)(object)component.stageModifiers) { string[] array = item.Split('='); instance.reservedModifiers.Add(new ModifierSync { name = array[0], stack = int.Parse(array[1]) }); } foreach (GameObject activePortalInstance in activePortalInstances) { GenericInteraction component2 = activePortalInstance.GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Behaviour)component2).enabled = false; } } } public void GetRouteNodeFromRandomPortal() { //IL_00ae: Unknown result type (might be due to invalid IL or missing references) if (activePortalInstances == null || activePortalInstances.Count == 0) { Log.Warning("GetRouteNodeFromRandomPortal: There are no portal active instances to get routeNode from"); return; } Log.Info(string.Format("{0}: Trying to get routeNode from {1} portal instances", "GetRouteNodeFromRandomPortal", activePortalInstances.Count)); GameObject val = Run.instance.stageRng.NextElementUniform(activePortalInstances); RoutePortalManager component = val.GetComponent(); if ((Object)(object)component == (Object)null) { Log.Warning("GetRouteNodeFromRandomPortal: Selected portal instance missing RoutePortalManager"); return; } currentNode = component.routeNode; NetworkcurrentNodeSync = new Vector2((float)currentNode.x, (float)currentNode.y); foreach (GameObject activePortalInstance in activePortalInstances) { GenericInteraction component2 = activePortalInstance.GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Behaviour)component2).enabled = false; } } } [Server] public bool CheckPlayersRedItem() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Invalid comparison between Unknown and I4 //IL_0096: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Boolean SamplePlugin.StageModifierDirector::CheckPlayersRedItem()' called on client"); return false; } int num = 0; foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList) { if ((Object)(object)readOnlyInstances.playerCharacterMasterController == (Object)null) { continue; } foreach (ItemIndex item in readOnlyInstances.inventory.itemAcquisitionOrder) { ItemDef itemDef = ItemCatalog.GetItemDef(item); if ((Object)(object)itemDef != (Object)null && (int)itemDef.tier == 2) { num += readOnlyInstances.inventory.GetItemCount(item); Log.Info(string.Format("{0}: Found red item:{1}", "CheckPlayersRedItem", itemDef)); } } } Log.Info(string.Format("{0}: Players have {1} red items right now", "CheckPlayersRedItem", num)); return num > 0; } [Server] public bool CheckPlayersYellowItem() { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Invalid comparison between Unknown and I4 //IL_00af: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Boolean SamplePlugin.StageModifierDirector::CheckPlayersYellowItem()' called on client"); return false; } int num = 0; foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList) { if ((Object)(object)readOnlyInstances.playerCharacterMasterController == (Object)null || !Object.op_Implicit((Object)(object)readOnlyInstances.inventory)) { continue; } foreach (ItemIndex item in readOnlyInstances.inventory.itemAcquisitionOrder) { ItemDef itemDef = ItemCatalog.GetItemDef(item); if ((Object)(object)itemDef != (Object)null && (int)itemDef.tier == 4) { num += readOnlyInstances.inventory.GetItemCount(item); Log.Info(string.Format("{0}: Found yellow item:{1}", "CheckPlayersYellowItem", itemDef)); } } } Log.Info(string.Format("{0}: Players have {1} yellow items right now", "CheckPlayersYellowItem", num)); return num > 0; } [Server] public bool CheckRepairAvailable() { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Boolean SamplePlugin.StageModifierDirector::CheckRepairAvailable()' called on client"); return false; } int num = 0; foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList) { if ((Object)(object)readOnlyInstances.playerCharacterMasterController == (Object)null || !Object.op_Implicit((Object)(object)readOnlyInstances.inventory)) { continue; } foreach (ItemIndex item in readOnlyInstances.inventory.itemAcquisitionOrder) { ItemDef itemDef = ItemCatalog.GetItemDef(item); if ((Object)(object)itemDef != (Object)null && itemDef.isConsumed && (Object)(object)itemDef != (Object)(object)Items.RegeneratingScrapConsumed && (Object)(object)itemDef != (Object)(object)Items.LowerPricedChestsConsumed && (Object)(object)itemDef != (Object)(object)Items.TeleportOnLowHealthConsumed) { num++; } } } Log.Info($"Players have {num} consumed items right now"); return num > 0; } [Server] public bool CheckMountainShrine() { if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Boolean SamplePlugin.StageModifierDirector::CheckMountainShrine()' called on client"); return false; } if (Object.op_Implicit((Object)(object)TeleporterInteraction.instance)) { return TeleporterInteraction.instance.shrineBonusStacks > 0; } return false; } [Server] public bool CheckArtifactOfDeathAvailable() { if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Boolean SamplePlugin.StageModifierDirector::CheckArtifactOfDeathAvailable()' called on client"); return false; } return Run.instance.participatingPlayerCount > 1 && !runArtifactsApplied.Contains("TeamDeath"); } [Server] public bool CheckArtifactAvailable(string name) { if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Boolean SamplePlugin.StageModifierDirector::CheckArtifactAvailable(System.String)' called on client"); return false; } return !runArtifactsApplied.Contains(name); } [Server] public int CheckPlayersHaveFoodItems() { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Int32 SamplePlugin.StageModifierDirector::CheckPlayersHaveFoodItems()' called on client"); return 0; } List list = new List { Items.FlatHealth, Items.Mushroom, Items.Infusion, Items.HealWhileSafe, Items.MushroomVoid }; int num = 0; foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList) { if ((Object)(object)readOnlyInstances.playerCharacterMasterController == (Object)null || !Object.op_Implicit((Object)(object)readOnlyInstances.inventory)) { continue; } foreach (ItemIndex item in readOnlyInstances.inventory.itemAcquisitionOrder) { ItemDef itemDef = ItemCatalog.GetItemDef(item); if ((Object)(object)itemDef != (Object)null && list.Contains(itemDef)) { num += readOnlyInstances.inventory.GetItemCount(itemDef); } } } Log.Info($"Players have {num} food related items right now"); return num; } public int CheckPlayersHaveFalseSonHeart() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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) int num = 0; foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList) { if ((Object)(object)readOnlyInstances.playerCharacterMasterController == (Object)null || !Object.op_Implicit((Object)(object)readOnlyInstances.inventory)) { continue; } foreach (ItemIndex item in readOnlyInstances.inventory.itemAcquisitionOrder) { ItemDef itemDef = ItemCatalog.GetItemDef(item); if ((Object)(object)itemDef != (Object)null && itemDef.itemIndex == ModItemsManager.falseSonBless.itemIndex) { num += readOnlyInstances.inventory.GetItemCount(itemDef); } } } Log.Info($"Players have {num} false son bless right now"); return num; } public List GetAvailableNodes() { if (currentNode != null) { return currentNode.GetPaths(); } Log.Error("GetAvailableNodes: Current node is null"); return null; } private void UNetVersion() { } protected static void InvokeSyncListmodifiersSynced(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"SyncList modifiersSynced called on server."); } else { ((SyncList)(object)((StageModifierDirector)(object)obj).modifiersSynced).HandleMsg(reader); } } protected static void InvokeRpcRpcReceiveFullMap(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcReceiveFullMap called on server."); } else { ((StageModifierDirector)(object)obj).RpcReceiveFullMap(GeneratedNetworkCode._ReadArrayRouteNodeSync_None(reader), (int)reader.ReadPackedUInt32(), (int)reader.ReadPackedUInt32(), reader.ReadBoolean(), reader.ReadSingle()); } } public void CallRpcReceiveFullMap(RouteNodeSync[] map, int width, int height, bool moon, float hostStageEnterTime) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcReceiveFullMap called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kRpcRpcReceiveFullMap); val.Write(((Component)this).GetComponent().netId); GeneratedNetworkCode._WriteArrayRouteNodeSync_None(val, map); val.WritePackedUInt32((uint)width); val.WritePackedUInt32((uint)height); val.Write(moon); val.Write(hostStageEnterTime); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcReceiveFullMap"); } static StageModifierDirector() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown kRpcRpcReceiveFullMap = -1012231583; NetworkBehaviour.RegisterRpcDelegate(typeof(StageModifierDirector), kRpcRpcReceiveFullMap, new CmdDelegate(InvokeRpcRpcReceiveFullMap)); kListmodifiersSynced = -163976013; NetworkBehaviour.RegisterSyncListDelegate(typeof(StageModifierDirector), kListmodifiersSynced, new CmdDelegate(InvokeSyncListmodifiersSynced)); NetworkCRC.RegisterBehaviour("StageModifierDirector", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) if (forceAll) { GeneratedNetworkCode._WriteStructSyncListModifier_None(writer, modifiersSynced); writer.WritePackedUInt32((uint)mapWidth); writer.WritePackedUInt32((uint)mapHeight); writer.Write(isMoonVisited); writer.Write(currentNodeSync); writer.Write(syncedBaseCurse); writer.WritePackedUInt32((uint)cursePerStack); writer.Write(punishmentTime); writer.Write(purifyLunarItemModifier); writer.WritePackedUInt32((uint)doppelStackTime); writer.Write(modifiersCanBeBanned); writer.WritePackedUInt32((uint)commonDefaultStack); writer.WritePackedUInt32((uint)uncommonDefaultStack); writer.WritePackedUInt32((uint)legendaryDefaultStack); writer.WritePackedUInt32((uint)bossDefaultStack); writer.WritePackedUInt32((uint)commonExtraRange); writer.WritePackedUInt32((uint)uncommonExtraRange); writer.WritePackedUInt32((uint)legendaryExtraRange); writer.WritePackedUInt32((uint)bossExtraRange); writer.WritePackedUInt32((uint)chanceForExtra); return true; } bool flag = false; if ((((NetworkBehaviour)this).syncVarDirtyBits & 1) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } GeneratedNetworkCode._WriteStructSyncListModifier_None(writer, modifiersSynced); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 2) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.WritePackedUInt32((uint)mapWidth); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 4) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.WritePackedUInt32((uint)mapHeight); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 8) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(isMoonVisited); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x10) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(currentNodeSync); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x20) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(syncedBaseCurse); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x40) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.WritePackedUInt32((uint)cursePerStack); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x80) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(punishmentTime); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x100) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(purifyLunarItemModifier); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x200) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.WritePackedUInt32((uint)doppelStackTime); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x400) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(modifiersCanBeBanned); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x800) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.WritePackedUInt32((uint)commonDefaultStack); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x1000) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.WritePackedUInt32((uint)uncommonDefaultStack); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x2000) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.WritePackedUInt32((uint)legendaryDefaultStack); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x4000) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.WritePackedUInt32((uint)bossDefaultStack); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x8000) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.WritePackedUInt32((uint)commonExtraRange); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x10000) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.WritePackedUInt32((uint)uncommonExtraRange); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x20000) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.WritePackedUInt32((uint)legendaryExtraRange); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x40000) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.WritePackedUInt32((uint)bossExtraRange); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x80000) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.WritePackedUInt32((uint)chanceForExtra); } if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); } return flag; } public override void OnDeserialize(NetworkReader reader, bool initialState) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) if (initialState) { GeneratedNetworkCode._ReadStructSyncListModifier_None(reader, modifiersSynced); mapWidth = (int)reader.ReadPackedUInt32(); mapHeight = (int)reader.ReadPackedUInt32(); isMoonVisited = reader.ReadBoolean(); currentNodeSync = reader.ReadVector2(); syncedBaseCurse = reader.ReadSingle(); cursePerStack = (int)reader.ReadPackedUInt32(); punishmentTime = reader.ReadSingle(); purifyLunarItemModifier = reader.ReadBoolean(); doppelStackTime = (int)reader.ReadPackedUInt32(); modifiersCanBeBanned = reader.ReadBoolean(); commonDefaultStack = (int)reader.ReadPackedUInt32(); uncommonDefaultStack = (int)reader.ReadPackedUInt32(); legendaryDefaultStack = (int)reader.ReadPackedUInt32(); bossDefaultStack = (int)reader.ReadPackedUInt32(); commonExtraRange = (int)reader.ReadPackedUInt32(); uncommonExtraRange = (int)reader.ReadPackedUInt32(); legendaryExtraRange = (int)reader.ReadPackedUInt32(); bossExtraRange = (int)reader.ReadPackedUInt32(); chanceForExtra = (int)reader.ReadPackedUInt32(); return; } int num = (int)reader.ReadPackedUInt32(); if ((num & 1) != 0) { GeneratedNetworkCode._ReadStructSyncListModifier_None(reader, modifiersSynced); } if ((num & 2) != 0) { mapWidth = (int)reader.ReadPackedUInt32(); } if ((num & 4) != 0) { mapHeight = (int)reader.ReadPackedUInt32(); } if ((num & 8) != 0) { isMoonVisited = reader.ReadBoolean(); } if ((num & 0x10) != 0) { currentNodeSync = reader.ReadVector2(); } if ((num & 0x20) != 0) { OnBaseCurseSyncedUpdate(reader.ReadSingle()); } if ((num & 0x40) != 0) { cursePerStack = (int)reader.ReadPackedUInt32(); } if ((num & 0x80) != 0) { punishmentTime = reader.ReadSingle(); } if ((num & 0x100) != 0) { purifyLunarItemModifier = reader.ReadBoolean(); } if ((num & 0x200) != 0) { doppelStackTime = (int)reader.ReadPackedUInt32(); } if ((num & 0x400) != 0) { modifiersCanBeBanned = reader.ReadBoolean(); } if ((num & 0x800) != 0) { commonDefaultStack = (int)reader.ReadPackedUInt32(); } if ((num & 0x1000) != 0) { uncommonDefaultStack = (int)reader.ReadPackedUInt32(); } if ((num & 0x2000) != 0) { legendaryDefaultStack = (int)reader.ReadPackedUInt32(); } if ((num & 0x4000) != 0) { bossDefaultStack = (int)reader.ReadPackedUInt32(); } if ((num & 0x8000) != 0) { commonExtraRange = (int)reader.ReadPackedUInt32(); } if ((num & 0x10000) != 0) { uncommonExtraRange = (int)reader.ReadPackedUInt32(); } if ((num & 0x20000) != 0) { legendaryExtraRange = (int)reader.ReadPackedUInt32(); } if ((num & 0x40000) != 0) { bossExtraRange = (int)reader.ReadPackedUInt32(); } if ((num & 0x80000) != 0) { chanceForExtra = (int)reader.ReadPackedUInt32(); } } } } namespace SamplePlugin.StageModifiers { public abstract class StageModifier { public int stack = 1; public abstract void OnStart(); public abstract void OnEnd(); protected GameObject TryPlaceObjectOnScene(SpawnCard spawnCard, string name = "object") { //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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return null; } if ((Object)(object)spawnCard == (Object)null) { Log.Error("Something went wrong with " + name + " spawncard"); return null; } if (!Object.op_Implicit((Object)(object)Run.instance)) { return null; } Log.Info("Trying to place " + name); GameObject val = null; for (int i = 0; i < 15; i++) { DirectorPlacementRule val2 = new DirectorPlacementRule { placementMode = (PlacementMode)4 }; val = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(spawnCard, val2, Run.instance.stageRng)); if (Object.op_Implicit((Object)(object)val)) { Log.Info($"Succesfully placed {name} on {val.transform.position}"); break; } Log.Error("Failed to place " + name + ", retrying"); } if ((Object)(object)val == (Object)null) { Log.Error("It was impossible to place " + name); } return val; } } } namespace SamplePlugin.StageModifiers.SceneModifiers { public class MoreDronesModifier : StageModifier { public MoreDronesModifier(int stack) { base.stack = stack; } public override void OnEnd() { Log.Info("MoreDronesModifier end"); } public override void OnStart() { Log.Info("MoreDronesModifier start"); PopulateDrones(); } public void PopulateDrones() { //IL_008d: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Invalid comparison between Unknown and I4 int num = 0; int sceneDirectorInteractibleCredits = ClassicStageInfo.instance.sceneDirectorInteractibleCredits; float num2 = (float)global::RiskOfRoutes.RiskOfRoutes.droneStackPercent.Value / 100f; int num3 = (int)((float)(sceneDirectorInteractibleCredits * stack) * num2); Log.Info(string.Format("{0}: Drone stack percent is {1}", "PopulateDrones", num2)); Log.Info("PopulateDrones: Spawning more drones"); ClassicStageInfo instance = ClassicStageInfo.instance; WeightedSelection val = new WeightedSelection(8); Category val2 = ((IEnumerable)instance.interactableCategories.categories).FirstOrDefault((Func)((Category c) => c.name == "Drones")); if (val2.cards.Length == 0) { Log.Error("PopulateDrones: No drones available on stage"); return; } DirectorCard[] cards = val2.cards; foreach (DirectorCard val3 in cards) { if (val3.IsAvailable()) { val.AddChoice(val3, (float)val3.selectionWeight); } } int num5 = 100; while (num3 > 0 && num5 > 0) { DirectorCard val4 = SelectCard(val, num3); if (val4 == null) { break; } if (!val4.IsAvailable()) { continue; } GameObject val5 = TryPlaceObjectOnScene(val4.spawnCard, ((Object)val4.spawnCard).name); if ((Object)(object)val5 != (Object)null) { PurchaseInteraction component = val5.GetComponent(); if (Object.op_Implicit((Object)(object)component) && (int)component.costType == 1) { component.Networkcost = Run.instance.GetDifficultyScaledCost(component.cost); } num3 -= val4.cost; num++; } num5--; } Log.Info(string.Format("{0}: Spawned {1} more drones", "PopulateDrones", num)); } private static DirectorCard SelectCard(WeightedSelection deck, int maxCost) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) WeightedSelection val = new WeightedSelection(maxCost); int i = 0; for (int count = deck.Count; i < count; i++) { ChoiceInfo choice = deck.GetChoice(i); if (choice.value.cost <= maxCost) { val.AddChoice(choice); } } if (val.Count == 0) { return null; } return val.Evaluate(Run.instance.stageRng.nextNormalizedFloat); } } public class PrinterItemModifier : StageModifier { public ItemDef selectedItem; public static InteractableSpawnCard printerSpawnCard; public PrinterItemModifier(string internalName) { selectedItem = stringToItemDef(internalName); if (!((Object)(object)selectedItem == (Object)null)) { CreatePrinterSpawnCard(); } } public static ItemDef stringToItemDef(string selectedItemName) { //IL_0002: 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_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Invalid comparison between Unknown and I4 //IL_0014: Unknown result type (might be due to invalid IL or missing references) ItemIndex val = ItemCatalog.FindItemIndex(selectedItemName); if ((int)val != -1) { return ItemCatalog.GetItemDef(val); } Log.Error("Error finding item"); return null; } public override void OnEnd() { Log.Info("PrinterItemModifier end"); } public override void OnStart() { Log.Info("PrinterItemModifier start"); SpawnPrinter(); } private void SpawnPrinter() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_0099: Unknown result type (might be due to invalid IL or missing references) GameObject val = TryPlaceObjectOnScene((SpawnCard)(object)printerSpawnCard, "Printer with " + ((Object)selectedItem).name); if (Object.op_Implicit((Object)(object)val)) { Log.Info($"printer appeared at {val.transform.position} on stage"); ShopTerminalBehavior component = val.GetComponent(); component.dropTable = null; component.selfGeneratePickup = false; component.itemTier = selectedItem.tier; PickupIndex pickupIndex = PickupCatalog.FindPickupIndex(selectedItem.itemIndex); UniquePickup val2 = new UniquePickup { pickupIndex = pickupIndex }; component.SetPickup(val2, false); } } private void CreatePrinterSpawnCard() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected I4, but got Unknown ItemTier tier = selectedItem.tier; if (1 == 0) { } InteractableSpawnCard val = (InteractableSpawnCard)((int)tier switch { 0 => AssetManager.tier1Printer, 1 => AssetManager.tier2Printer, 2 => AssetManager.tier3Printer, 4 => AssetManager.bossPrinter, _ => AssetManager.tier1Printer, }); if (1 == 0) { } InteractableSpawnCard val2 = val; if ((Object)(object)val2 != (Object)null) { printerSpawnCard = val2; } else { Log.Error("Asset path is invalid"); } } } public class RedPrinterModifier : StageModifier { public static InteractableSpawnCard redPrinterSpawnCard; public ItemTag tag; public RedPrinterModifier(int stack, ItemTag tag = (ItemTag)0) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) CreateRedPrinterSpawnCard(); base.stack = stack; this.tag = tag; } public override void OnEnd() { Log.Info("RedPrinter on end"); } public override void OnStart() { Log.Info("RedPrinter on start"); SpawnRedPrinter(); } private void SpawnRedPrinter() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Invalid comparison between Unknown and I4 //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) List availableTier3DropList = Run.instance.availableTier3DropList; List list = new List(); foreach (PickupIndex item in availableTier3DropList) { PickupDef pickupDef = PickupCatalog.GetPickupDef(item); if (pickupDef != null && (int)pickupDef.itemIndex != -1) { ItemDef itemDef = ItemCatalog.GetItemDef(pickupDef.itemIndex); if ((Object)(object)itemDef != (Object)null && itemDef.tags.Contains(tag)) { list.Add(item); } } } if (list.Count == 0) { Log.Error($"No red items available for tag {tag}"); list = availableTier3DropList; } for (int i = 0; i < stack; i++) { GameObject val = TryPlaceObjectOnScene((SpawnCard)(object)redPrinterSpawnCard, "Red item printer"); if (Object.op_Implicit((Object)(object)val)) { ShopTerminalBehavior component = val.GetComponent(); component.dropTable = null; component.selfGeneratePickup = false; PickupIndex pickupIndex = Run.instance.stageRng.NextElementUniform(list); UniquePickup val2 = new UniquePickup { pickupIndex = pickupIndex }; component.SetPickup(val2, false); } } } private void CreateRedPrinterSpawnCard() { InteractableSpawnCard tier3Printer = AssetManager.tier3Printer; if ((Object)(object)tier3Printer != (Object)null) { redPrinterSpawnCard = tier3Printer; } } } public class WanderingChefModifier : StageModifier { public static bool spawnCardCreated; public static InteractableSpawnCard chefSpawnCard; public override void OnEnd() { Log.Info("WanderingChef on end"); } public override void OnStart() { Log.Info("WanderingChef on start"); SpawnWanderingChef(); } private void SpawnWanderingChef() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) InteractableSpawnCard wanderingChefSpawnCard = AssetManager.wanderingChefSpawnCard; GameObject val = TryPlaceObjectOnScene((SpawnCard)(object)wanderingChefSpawnCard, "Wandering Chef"); if (Object.op_Implicit((Object)(object)val)) { Transform transform = val.transform; transform.position += val.transform.up * 1f; } } } public class YellowPrinterModifier : StageModifier { public static InteractableSpawnCard yellowPrinterSpawnCard; public ItemTag tag; public YellowPrinterModifier(int stack, ItemTag tag = (ItemTag)0) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) CreateYellowPrinterSpawnCard(); base.stack = stack; this.tag = tag; } public override void OnEnd() { Log.Info("YellowPrinterModifier on end"); } public override void OnStart() { Log.Info("YellowPrinterModifier on start"); SpawnYellowPrinter(); } private void SpawnYellowPrinter() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Invalid comparison between Unknown and I4 //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) List availableBossDropList = Run.instance.availableBossDropList; List list = new List(); foreach (PickupIndex item in availableBossDropList) { PickupDef pickupDef = PickupCatalog.GetPickupDef(item); if (pickupDef != null && (int)pickupDef.itemIndex != -1) { ItemDef itemDef = ItemCatalog.GetItemDef(pickupDef.itemIndex); if ((Object)(object)itemDef != (Object)null && itemDef.tags.Contains(tag)) { list.Add(item); } } } if (list.Count == 0) { Log.Error($"No yellow items available for tag {tag}"); list = availableBossDropList; } for (int i = 0; i < stack; i++) { GameObject val = TryPlaceObjectOnScene((SpawnCard)(object)yellowPrinterSpawnCard, "Yellow item printer"); if (Object.op_Implicit((Object)(object)val)) { ShopTerminalBehavior component = val.GetComponent(); component.dropTable = null; component.selfGeneratePickup = false; PickupIndex pickupIndex = Run.instance.stageRng.NextElementUniform(list); UniquePickup val2 = new UniquePickup { pickupIndex = pickupIndex }; component.SetPickup(val2, false); } } } private void CreateYellowPrinterSpawnCard() { InteractableSpawnCard bossPrinter = AssetManager.bossPrinter; if ((Object)(object)bossPrinter != (Object)null) { yellowPrinterSpawnCard = bossPrinter; } else { Log.Error("Asset path is invalid"); } } } } namespace SamplePlugin.StageModifiers.OtherModifiers { public class ArtifactModifier : StageModifier { private ArtifactDef currentArtifact; public ArtifactModifier(ArtifactDef artifact) { currentArtifact = artifact; } public ArtifactModifier(string name, bool isPositive) { currentArtifact = ArtifactCatalog.FindArtifactDef(name); if ((Object)(object)currentArtifact == (Object)null) { Log.Error("Could not find artifact by the name " + name); } else { name = currentArtifact.cachedName; } } public ArtifactModifier() { currentArtifact = Artifacts.MixEnemy; if ((Object)(object)currentArtifact == (Object)null) { Log.Error("CurrentArtifact is null"); } } public override void OnEnd() { Log.Info("ArtifactModifier on end"); if (Object.op_Implicit((Object)(object)currentArtifact)) { if (Object.op_Implicit((Object)(object)Run.instance)) { RunArtifactManager.instance.SetArtifactEnabled(currentArtifact, false); Log.Info("Succesfully disabled artifact: " + currentArtifact.cachedName); } else { Log.Info("Run already ended"); } } else { Log.Info("No current artifact for some reason"); } } public override void OnStart() { Log.Info("ArtifactModifier on start start"); if (Object.op_Implicit((Object)(object)currentArtifact)) { RunArtifactManager.instance.SetArtifactEnabled(currentArtifact, true); } else { Log.Info("No such artifact"); } } } public class RepairConsumedItemsModifier : StageModifier { public override void OnEnd() { Log.Info("Repair on end"); } public override void OnStart() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Invalid comparison between Unknown and I4 //IL_017f: Unknown result type (might be due to invalid IL or missing references) Log.Info("Repair on start"); foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList) { if (!Object.op_Implicit((Object)(object)readOnlyInstances.inventory)) { continue; } List list = new List(readOnlyInstances.inventory.itemAcquisitionOrder); foreach (ItemIndex item in list) { ItemDef itemDef = ItemCatalog.GetItemDef(item); if (!((Object)(object)itemDef != (Object)null) || !itemDef.isConsumed || !((Object)(object)itemDef != (Object)(object)Items.RegeneratingScrapConsumed) || !((Object)(object)itemDef != (Object)(object)Items.LowerPricedChestsConsumed) || !((Object)(object)itemDef != (Object)(object)Items.TeleportOnLowHealthConsumed)) { continue; } int itemCount = readOnlyInstances.inventory.GetItemCount(itemDef); readOnlyInstances.inventory.RemoveItem(itemDef, itemCount); ItemDef val = null; if ((Object)(object)itemDef == (Object)(object)Items.FragileDamageBonusConsumed) { val = Items.FragileDamageBonus; } else if ((Object)(object)itemDef == (Object)(object)Items.HealingPotionConsumed) { val = Items.HealingPotion; } else if ((Object)(object)itemDef == (Object)(object)Items.ExtraLifeVoidConsumed) { val = Items.ExtraLifeVoid; } else if ((Object)(object)itemDef == (Object)(object)Items.ExtraLifeConsumed) { val = Items.ExtraLife; } else { ItemIndex val2 = ItemCatalog.FindItemIndex(((Object)itemDef).name.Replace("Consumed", "")); if ((int)val2 != -1) { ItemDef itemDef2 = ItemCatalog.GetItemDef(val2); if ((Object)(object)itemDef2 != (Object)null) { val = itemDef2; } } } Log.Debug($"For consumed item{itemDef} in count {itemCount} found repaired {val}"); readOnlyInstances.inventory.GiveItem(val, itemCount); Log.Info("Succesfully repaired " + ((Object)itemDef).name); } } } } } namespace SamplePlugin.StageModifiers.CombatModifiers { public class EnemyItemsModifier : StageModifier { private ItemDef selectedItem; public EnemyItemsModifier(string internalName, int stack) { selectedItem = PrinterItemModifier.stringToItemDef(internalName); if (!((Object)(object)selectedItem == (Object)null)) { base.stack = stack; } } public override void OnEnd() { Log.Info("EnemyItems on end"); SpawnCard.onSpawnedServerGlobal -= SpawnCard_onSpawnedServerGlobal; StageModifierDirector.instance.monsterTeamInventory.CleanInventory(); } public override void OnStart() { Log.Info("EnemyItems on start"); int itemStack = GetItemStack(selectedItem, stack); StageModifierDirector.instance.monsterTeamInventory.GiveItemPermanent(selectedItem, itemStack); SpawnCard.onSpawnedServerGlobal += SpawnCard_onSpawnedServerGlobal; } private void SpawnCard_onSpawnedServerGlobal(SpawnResult spawnResult) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Invalid comparison between Unknown and I4 CharacterMaster val = (Object.op_Implicit((Object)(object)spawnResult.spawnedInstance) ? spawnResult.spawnedInstance.GetComponent() : null); if (Object.op_Implicit((Object)(object)val) && (int)val.teamIndex == 2) { val.inventory.AddItemsFrom(StageModifierDirector.instance.monsterTeamInventory); } } public static int GetItemStack(ItemDef def, int modStack) { //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Expected I4, but got Unknown int num = StageModifierDirector.instance?.commonDefaultStack ?? 5; int num2 = StageModifierDirector.instance?.uncommonDefaultStack ?? 3; int num3 = StageModifierDirector.instance?.legendaryDefaultStack ?? 1; int num4 = StageModifierDirector.instance?.bossDefaultStack ?? 1; int num5 = StageModifierDirector.instance?.commonExtraRange ?? 3; int num6 = StageModifierDirector.instance?.uncommonExtraRange ?? 2; int num7 = StageModifierDirector.instance?.legendaryExtraRange ?? 1; int num8 = StageModifierDirector.instance?.bossExtraRange ?? 1; int num9 = StageModifierDirector.instance?.chanceForExtra ?? 0; bool flag = false; if ((Object)(object)Run.instance != (Object)null && Run.instance.stageRng != null) { flag = Run.instance.stageRng.nextNormalizedFloat < (float)num9; } ItemTier tier = def.tier; ItemTier val = tier; return (int)val switch { 0 => num * modStack + (flag ? num5 : 0), 1 => num2 * modStack + (flag ? num6 : 0), 2 => num3 * modStack + (flag ? num7 : 0), 4 => num4 * modStack + (flag ? num4 : 0), 6 => num * modStack + (flag ? num5 : 0), 7 => num2 * modStack + (flag ? num6 : 0), 8 => num3 * modStack + (flag ? num7 : 0), 9 => num4 * modStack + (flag ? num4 : 0), _ => 1, }; } } public class LunarEnemiesModifier : StageModifier { public List lunarEnemies; public LunarEnemiesModifier(int stack) { base.stack = stack; } public override void OnEnd() { Log.Info("LunarEnemies on end"); } public override void OnStart() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) Log.Info("LunarEnemies on start"); int num = 0; int num2 = 0; if ((Object)(object)ClassicStageInfo.instance.monsterCategories == (Object)null || ClassicStageInfo.instance.monsterCategories.categories == null) { return; } Category[] categories = ClassicStageInfo.instance.monsterCategories.categories; foreach (Category val in categories) { if (val.name == "Basic Monsters") { DirectorCard[] cards = val.cards; foreach (DirectorCard val2 in cards) { num = Mathf.Max(num, val2.cost); } } if (val.name == "Minibosses") { DirectorCard[] cards2 = val.cards; foreach (DirectorCard val3 in cards2) { num2 = Mathf.Max(num2, val3.cost); } } } if (num == 0) { num = 40; } if (num2 == 0) { num2 = 200; } float num3 = Mathf.Max(0.1f, 1f - (float)(global::RiskOfRoutes.RiskOfRoutes.lunarStackPercent.Value * (stack - 1)) / 100f); num = (int)((float)num * num3); num2 = (int)((float)num2 * num3); CreateLunarEnemiesSpawnCards(num, num2); if (Object.op_Implicit((Object)(object)ClassicStageInfo.instance) && ClassicStageInfo.instance.monsterSelection != null) { ClassicStageInfo.instance.monsterSelection = GetSelectionFromCategories(ClassicStageInfo.instance.monsterCategories.categories); } foreach (CombatDirector instances in CombatDirector.instancesList) { if ((Object)(object)instances.monsterCards == (Object)null) { instances.currentMonsterCard = null; } } } private WeightedSelection GetSelectionFromCategories(Category[] categories) { //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) WeightedSelection val = new WeightedSelection(8); for (int i = 0; i < categories.Length; i++) { if (categories[i].name == "Basic Monsters") { ref DirectorCard[] cards = ref categories[i].cards; DirectorCard val2 = lunarEnemies[2]; ArrayUtils.ArrayAppend(ref cards, ref val2); Log.Info("Succesfully added " + ((Object)lunarEnemies[2].spawnCard).name + " to category " + categories[i].name); } else if (categories[i].name == "Minibosses") { ref DirectorCard[] cards2 = ref categories[i].cards; DirectorCard val2 = lunarEnemies[0]; ArrayUtils.ArrayAppend(ref cards2, ref val2); Log.Info("Succesfully added " + ((Object)lunarEnemies[0].spawnCard).name + " to category " + categories[i].name); ref DirectorCard[] cards3 = ref categories[i].cards; val2 = lunarEnemies[1]; ArrayUtils.ArrayAppend(ref cards3, ref val2); Log.Info("Succesfully added " + ((Object)lunarEnemies[1].spawnCard).name + " to category " + categories[i].name); } Category val3 = categories[i]; float num = SumAllWeightsInCategory(val3); float num2 = val3.selectionWeight / num; if (!(num > 0f)) { continue; } DirectorCard[] cards4 = val3.cards; foreach (DirectorCard val4 in cards4) { if (val4.IsAvailable()) { float num3 = (float)val4.selectionWeight * num2; val.AddChoice(val4, num3); } } } return val; } public float SumAllWeightsInCategory(Category category) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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) float num = 0f; for (int i = 0; i < category.cards.Length; i++) { if (category.cards[i] != null && category.cards[i].IsAvailable()) { num += (float)category.cards[i].selectionWeight; } } return num; } public void CreateLunarEnemiesSpawnCards(int basicCost, int miniBossCost) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown lunarEnemies = new List(); List list = new List(); CharacterSpawnCard val = Addressables.LoadAssetAsync((object)"RoR2/Base/LunarWisp/cscLunarWisp.asset").WaitForCompletion(); CharacterSpawnCard val2 = Addressables.LoadAssetAsync((object)"RoR2/Base/LunarGolem/cscLunarGolem.asset").WaitForCompletion(); CharacterSpawnCard val3 = Addressables.LoadAssetAsync((object)"RoR2/Base/LunarExploder/cscLunarExploder.asset").WaitForCompletion(); CharacterSpawnCard val4 = Object.Instantiate(val); CharacterSpawnCard val5 = Object.Instantiate(val2); CharacterSpawnCard val6 = Object.Instantiate(val3); ((SpawnCard)val4).directorCreditCost = miniBossCost; ((SpawnCard)val5).directorCreditCost = miniBossCost; ((SpawnCard)val6).directorCreditCost = basicCost; list.Add(val4); list.Add(val5); list.Add(val6); foreach (CharacterSpawnCard item2 in list) { DirectorCard item = new DirectorCard { spawnCard = (SpawnCard)(object)item2, selectionWeight = stack, minimumStageCompletions = 0 }; lunarEnemies.Add(item); } } } public class MoreElitesModifier : StageModifier { public Dictionary tierAndInitialPrice = new Dictionary(); public float defaultPercent = 0.33f; public MoreElitesModifier(int stack) { base.stack = stack; } public override void OnEnd() { Log.Info("MoreElites on end"); Log.Info("Restoring elite tier costs"); foreach (KeyValuePair item in tierAndInitialPrice) { item.Key.costMultiplier = item.Value; } } public override void OnStart() { Log.Info("MoreElites on start"); FieldInfo field = typeof(CombatDirector).GetField("eliteTiers", BindingFlags.Static | BindingFlags.NonPublic); if (!(field != null)) { return; } EliteTierDef[] array = (EliteTierDef[])field.GetValue(null); Log.Info($"Tier count{array.Length}"); for (int i = 0; i < array.Length - 1; i++) { EliteTierDef val = array[i]; if (val != null && val.costMultiplier != 1f) { float num = 1f - defaultPercent - (float)(stack - 1) * (float)global::RiskOfRoutes.RiskOfRoutes.elitesStackPercent.Value / 100f; Log.Info($"Cost for elite tier {val} lowered by {(float)(stack - 1) * (float)global::RiskOfRoutes.RiskOfRoutes.elitesStackPercent.Value / 100f}: {val.costMultiplier}->{val.costMultiplier * num}"); tierAndInitialPrice.Add(val, val.costMultiplier); val.costMultiplier = Mathf.Max(val.costMultiplier * num, 1f); } } } } public class OnlyFlyingEnemiesModifier : StageModifier { public override void OnEnd() { } public override void OnStart() { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) Log.Info("OnlyFlying on start"); Category[] categories = ClassicStageInfo.instance.monsterCategories.categories; if (categories == null) { Log.Error("Could not access categories"); return; } DirectorCardCategorySelection monsterCategories = ClassicStageInfo.instance.monsterCategories; ClassicStageInfo.instance.monsterSelection.Clear(); ClassicStageInfo.instance.monsterSelection = GetSelectionFromCategories(categories); if (ClassicStageInfo.instance.monsterSelection.Count == 0) { Log.Warning(""); } Log.Info("Available flying:"); for (int i = 0; i < ClassicStageInfo.instance.monsterSelection.Count; i++) { Log.Info("\t" + ((Object)ClassicStageInfo.instance.monsterSelection.GetChoice(i).value.spawnCard).name); } foreach (CombatDirector instances in CombatDirector.instancesList) { if ((Object)(object)instances.monsterCards == (Object)null) { instances.currentMonsterCard = null; } } } private WeightedSelection GetSelectionFromCategories(Category[] categories) { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) WeightedSelection val = new WeightedSelection(8); for (int i = 0; i < categories.Length; i++) { DirectorCard[] cards = categories[i].cards; DirectorCard[] array = cards.Where((DirectorCard card) => (int)card.spawnCard.nodeGraphType == 1).ToArray(); DirectorCard[] array2 = array; foreach (DirectorCard val2 in array2) { Log.Info("Flying enemy from Category:" + categories[i].name + ":" + ((Object)val2.spawnCard).name); } categories[i].cards = array; Category val3 = categories[i]; float num2 = SumAllWeightsInCategory(val3); float num3 = val3.selectionWeight / num2; if (!(num2 > 0f)) { continue; } DirectorCard[] cards2 = val3.cards; DirectorCard[] array3 = cards2; foreach (DirectorCard val4 in array3) { if (val4.IsAvailable()) { float num5 = (float)val4.selectionWeight * num3; val.AddChoice(val4, num5); } } } return val; } public float SumAllWeightsInCategory(Category category) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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) float num = 0f; for (int i = 0; i < category.cards.Length; i++) { if (category.cards[i] != null && category.cards[i].IsAvailable()) { num += (float)category.cards[i].selectionWeight; } } return num; } } public class Tier2ElitesEarlierModifier : StageModifier { public EliteTierDef modifiedTier; public Func modifiedAvailability; public float modifiedCostMultiplier; public Tier2ElitesEarlierModifier(int stack) { base.stack = stack; } public override void OnEnd() { Log.Info("Tier2Elites on end"); Log.Info("Restoring elite tier costs"); if (modifiedTier != null) { modifiedTier.isAvailable = modifiedAvailability; modifiedTier.costMultiplier = modifiedCostMultiplier; } else { Log.Error("Could not access elite tier that was modified"); } } public override void OnStart() { Log.Info("Tier2 elites start"); FieldInfo field = typeof(CombatDirector).GetField("eliteTiers", BindingFlags.Static | BindingFlags.NonPublic); if (!(field != null)) { return; } EliteTierDef[] array = (EliteTierDef[])field.GetValue(null); Log.Info($"Tier count{array.Length}"); for (int i = 0; i < array.Length - 1; i++) { EliteTierDef val = array[i]; EliteDef[] eliteTypes = val.eliteTypes; foreach (EliteDef val2 in eliteTypes) { if ((Object)(object)val2 != (Object)null && ((Object)val2).name.Contains("Poison")) { modifiedTier = val; modifiedAvailability = val.isAvailable; modifiedCostMultiplier = val.costMultiplier; val.isAvailable = (EliteRules rules) => true; float num = Mathf.Max(0.1f, 1f - (float)(global::RiskOfRoutes.RiskOfRoutes.tier2ElitesStackPercent.Value * (stack - 1)) / 100f); val.costMultiplier = Math.Max(6f * num, 1f); return; } } } } } public class VoidEnemiesModifier : StageModifier { public List voidEnemies; public VoidEnemiesModifier(int stack) { base.stack = stack; } public override void OnEnd() { Log.Info("VoidEnemies on end"); } public override void OnStart() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) Log.Info("VoidEnemies on start"); int num = 0; int num2 = 0; int num3 = 0; if ((Object)(object)ClassicStageInfo.instance.monsterCategories == (Object)null || ClassicStageInfo.instance.monsterCategories.categories == null) { return; } Category[] categories = ClassicStageInfo.instance.monsterCategories.categories; foreach (Category val in categories) { if (val.name == "Basic Monsters") { DirectorCard[] cards = val.cards; foreach (DirectorCard val2 in cards) { num = Mathf.Max(num, val2.cost); } } if (val.name == "Minibosses") { DirectorCard[] cards2 = val.cards; foreach (DirectorCard val3 in cards2) { num2 = Mathf.Max(num2, val3.cost); } } if (val.name == "Champions") { DirectorCard[] cards3 = val.cards; foreach (DirectorCard val4 in cards3) { num3 = Mathf.Max(num3, val4.cost); } } } if (num == 0) { num = 40; } if (num2 == 0) { num2 = 200; } if (num3 == 0 || num3 > 800) { num3 = 800; } float num4 = Mathf.Max(0.1f, 1f - (float)(global::RiskOfRoutes.RiskOfRoutes.voidStackPercent.Value * (stack - 1)) / 100f); num = (int)((float)num * num4); num2 = (int)((float)num2 * num4); num3 = (int)((float)num3 * num4); CreateVoidEnemiesSpawnCard(num, num2, num3); if (Object.op_Implicit((Object)(object)ClassicStageInfo.instance) && ClassicStageInfo.instance.monsterSelection != null) { ClassicStageInfo.instance.monsterSelection = GetSelectionFromCategories(ClassicStageInfo.instance.monsterCategories.categories); } foreach (CombatDirector instances in CombatDirector.instancesList) { if ((Object)(object)instances.monsterCards == (Object)null) { instances.currentMonsterCard = null; } } } private WeightedSelection GetSelectionFromCategories(Category[] categories) { //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) WeightedSelection val = new WeightedSelection(8); for (int i = 0; i < categories.Length; i++) { if (categories[i].name == "Basic Monsters") { ref DirectorCard[] cards = ref categories[i].cards; DirectorCard val2 = voidEnemies[2]; ArrayUtils.ArrayAppend(ref cards, ref val2); Log.Info("Succesfully added " + ((Object)voidEnemies[2].spawnCard).name + " to category " + categories[i].name); ref DirectorCard[] cards2 = ref categories[i].cards; val2 = voidEnemies[3]; ArrayUtils.ArrayAppend(ref cards2, ref val2); Log.Info("Succesfully added " + ((Object)voidEnemies[3].spawnCard).name + " to category " + categories[i].name); } else if (categories[i].name == "Minibosses") { ref DirectorCard[] cards3 = ref categories[i].cards; DirectorCard val2 = voidEnemies[0]; ArrayUtils.ArrayAppend(ref cards3, ref val2); Log.Info("Succesfully added " + ((Object)voidEnemies[0].spawnCard).name + " to category " + categories[i].name); } else if (categories[i].name == "Champions") { ref DirectorCard[] cards4 = ref categories[i].cards; DirectorCard val2 = voidEnemies[1]; ArrayUtils.ArrayAppend(ref cards4, ref val2); Log.Info("Succesfully added " + ((Object)voidEnemies[1].spawnCard).name + " to category " + categories[i].name); } Category val3 = categories[i]; float num = SumAllWeightsInCategory(val3); float num2 = categories[i].selectionWeight / num; if (!(num > 0f)) { continue; } DirectorCard[] cards5 = val3.cards; foreach (DirectorCard val4 in cards5) { if (val4.IsAvailable()) { float num3 = (float)val4.selectionWeight * num2; val.AddChoice(val4, num3); } } } return val; } public float SumAllWeightsInCategory(Category category) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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) float num = 0f; for (int i = 0; i < category.cards.Length; i++) { if (category.cards[i] != null && category.cards[i].IsAvailable()) { num += (float)category.cards[i].selectionWeight; } } return num; } public void CreateVoidEnemiesSpawnCard(int basicCost, int eliteCost, int championCost) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown voidEnemies = new List(); List list = new List(); CharacterSpawnCard val = Addressables.LoadAssetAsync((object)"RoR2/DLC1/VoidJailer/cscVoidJailer.asset").WaitForCompletion(); CharacterSpawnCard val2 = Addressables.LoadAssetAsync((object)"RoR2/DLC1/VoidMegaCrab/cscVoidMegaCrab.asset").WaitForCompletion(); CharacterSpawnCard val3 = Addressables.LoadAssetAsync((object)"RoR2/Base/Nullifier/cscNullifier.asset").WaitForCompletion(); CharacterSpawnCard val4 = Addressables.LoadAssetAsync((object)"RoR2/DLC1/VoidBarnacle/cscVoidBarnacle.asset").WaitForCompletion(); CharacterSpawnCard val5 = Object.Instantiate(val); CharacterSpawnCard val6 = Object.Instantiate(val2); CharacterSpawnCard val7 = Object.Instantiate(val3); CharacterSpawnCard val8 = Object.Instantiate(val4); ((SpawnCard)val5).directorCreditCost = eliteCost; ((SpawnCard)val6).directorCreditCost = championCost; ((SpawnCard)val7).directorCreditCost = eliteCost; ((SpawnCard)val8).directorCreditCost = basicCost; list.Add(val5); list.Add(val6); list.Add(val7); list.Add(val8); foreach (CharacterSpawnCard item2 in list) { DirectorCard item = new DirectorCard { spawnCard = (SpawnCard)(object)item2, selectionWeight = stack, minimumStageCompletions = 0 }; voidEnemies.Add(item); } } } } namespace SamplePlugin.StageModifiers.BossRewardModifiers { public class AurelioniteModifier : StageModifier { public override void OnEnd() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown Log.Info("Aurelionite on end"); BossGroup.DropRewards -= new Manipulator(BossGroup_DropRewards); } public override void OnStart() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown Log.Info("Aurelionite on start"); BossGroup.DropRewards += new Manipulator(BossGroup_DropRewards); } private void BossGroup_DropRewards(ILContext il) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown PickupDropTable halcyoniteDropTableTier2 = Addressables.LoadAssetAsync((object)"RoR2/DLC2/dtShrineHalcyoniteTier2.asset").WaitForCompletion(); PickupDropTable halcyoniteDropTableTier3 = Addressables.LoadAssetAsync((object)"RoR2/DLC2/dtShrineHalcyoniteTier3.asset").WaitForCompletion(); GameObject rewardPickupPrefab = Addressables.LoadAssetAsync((object)"RoR2/DLC2/FragmentPotentialPickup.prefab").WaitForCompletion(); int choiceAmount = 3; int num = StageModifierDirector.instance.CheckPlayersHaveFalseSonHeart(); if (num > 1) { choiceAmount += num - 1; } ILCursor val = new ILCursor(il); if (!val.TryGotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, typeof(PickupDropletController), "CreatePickupDroplet") })) { return; } val.Remove(); val.EmitDelegate>((Action)delegate(UniquePickup origPickup, Vector3 position, Vector3 vector) { //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) bool flag = StageModifierDirector.instance.IsModifierActive("DroneBossGreen"); bool flag2 = StageModifierDirector.instance.IsModifierActive("DroneBossRed"); bool flag3 = StageModifierDirector.instance.IsModifierActive("BossYellowItem"); bool flag4 = StageModifierDirector.instance.IsModifierActive("BossRedItem"); CreatePickupInfo val3; CreatePickupInfo val4; if (flag || flag2) { Log.Info("BossGroup_DropRewards: Dropping drone reward"); List list = new List(); List list2 = new List(); if (flag) { list2 = Run.instance.availableTier2DroneList; list2.Remove(DroneDefs.EquipmentDrone.droneIndex); } else { list2 = Run.instance.availableTier3DroneList; } foreach (DroneIndex item in list2) { PickupIndex val2 = PickupCatalog.FindPickupIndex(item); bool flag5 = true; list.Add(new UniquePickup(PickupCatalog.FindPickupIndex(item))); } Util.ShuffleList(list); val3 = default(CreatePickupInfo); ((CreatePickupInfo)(ref val3)).pickup = new UniquePickup(PickupCatalog.FindPickupIndex((ItemTier)0)); val3.pickerOptions = PickupPickerController.GenerateOptionsFromList>(list.Take(choiceAmount).ToList()); val3.rotation = Quaternion.identity; val3.position = position; val3.prefabOverride = rewardPickupPrefab; val4 = val3; } else if (flag3 || flag4) { Log.Info("BossGroup_DropRewards: Dropping boss or red reward"); List list3 = new List(); List list4 = new List(); list4 = ((!flag3) ? Run.instance.availableTier3DropList : Run.instance.availableBossDropList); foreach (PickupIndex item2 in list4) { bool flag6 = true; list3.Add(new UniquePickup(item2)); } Util.ShuffleList(list3); val3 = default(CreatePickupInfo); ((CreatePickupInfo)(ref val3)).pickup = new UniquePickup(PickupCatalog.FindPickupIndex((ItemTier)0)); val3.pickerOptions = PickupPickerController.GenerateOptionsFromList>(list3.Take(choiceAmount).ToList()); val3.rotation = Quaternion.identity; val3.position = position; val3.prefabOverride = rewardPickupPrefab; val4 = val3; } else { val3 = default(CreatePickupInfo); ((CreatePickupInfo)(ref val3)).pickup = new UniquePickup(PickupCatalog.FindPickupIndex((ItemTier)0)); val3.pickerOptions = PickupPickerController.GenerateOptionsFromDropTablePlusForcedStorm(choiceAmount, halcyoniteDropTableTier3, halcyoniteDropTableTier2, Run.instance.stageRng); val3.rotation = Quaternion.identity; val3.position = position; val3.prefabOverride = rewardPickupPrefab; val4 = val3; } PickupDropletController.CreatePickupDroplet(val4, position, vector); Log.Info("Created pickup"); }); } } public class BossRedItemModifier : StageModifier { public override void OnEnd() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown Log.Info("BossRedItem on end"); BossGroup.DropRewards -= new Manipulator(BossGroup_DropRewards); } public override void OnStart() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown Log.Info("BossRedItem on start"); BossGroup.DropRewards += new Manipulator(BossGroup_DropRewards); } private void BossGroup_DropRewards(ILContext il) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown if (StageModifierDirector.instance.IsModifierActive("Aurelionite")) { return; } ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, typeof(PickupDropletController), "CreatePickupDroplet") })) { val.Remove(); val.EmitDelegate>((Action)delegate(UniquePickup origPickup, Vector3 position, Vector3 vector) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) PickupIndex pickupIndex = Run.instance.stageRng.NextElementUniform(Run.instance.availableTier3DropList); UniquePickup pickup = new UniquePickup { pickupIndex = pickupIndex }; CreatePickupInfo val2 = default(CreatePickupInfo); ((CreatePickupInfo)(ref val2)).pickup = pickup; val2.rotation = Quaternion.identity; val2.position = position; CreatePickupInfo val3 = val2; PickupDropletController.CreatePickupDroplet(val3, position, vector); Log.Info("Created pickup"); }); } } } public class BossYellowItemModifier : StageModifier { public override void OnEnd() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown BossGroup.DropRewards -= new Manipulator(BossGroup_DropRewards); Log.Info("BossYellowItem on end"); } public override void OnStart() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown BossGroup.DropRewards += new Manipulator(BossGroup_DropRewards); Log.Info("BossYellowItem on start"); } private void BossGroup_DropRewards(ILContext il) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) if (StageModifierDirector.instance.IsModifierActive("Aurelionite")) { return; } ILCursor val = new ILCursor(il); if (1 == 0 || !val.TryGotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, typeof(PickupDropletController), "CreatePickupDroplet") })) { return; } val.Remove(); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)delegate(UniquePickup origPickup, Vector3 position, Vector3 vector, BossGroup self) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) UniquePickup pickup = origPickup; bool flag = self.bossDropTables != null && self.bossDropTables.Count > 0; bool flag2 = self.bossDrops != null && self.bossDrops.Count > 0; if (flag) { PickupDropTable val2 = self.rng.NextElementUniform(self.bossDropTables); Log.Info($"Boss has dropTable:{val2}"); if ((Object)(object)val2 != (Object)null) { pickup = val2.GeneratePickup(self.rng); } } else if (flag2) { Log.Info($"Boss has bossDrops:{self.bossDrops}"); ((UniquePickup)(ref pickup))..ctor(self.rng.NextElementUniform(self.bossDrops).pickupIndex); } else { Log.Info("Boss is group of enemies"); if (Object.op_Implicit((Object)(object)Run.instance) && Run.instance.availableBossDropList.Count > 0) { PickupIndex val3 = Run.instance.stageRng.NextElementUniform(Run.instance.availableBossDropList); ((UniquePickup)(ref pickup))..ctor(val3); } } CreatePickupInfo val4 = default(CreatePickupInfo); ((CreatePickupInfo)(ref val4)).pickup = pickup; val4.rotation = Quaternion.identity; val4.position = position; CreatePickupInfo val5 = val4; PickupDropletController.CreatePickupDroplet(val5, position, vector); }); } } public class DroneBossModifier : StageModifier { public bool dropLegendary = false; public bool isAurelioniteActive = false; public DroneBossModifier(bool dropLegendary = false) { this.dropLegendary = dropLegendary; } public override void OnEnd() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown BossGroup.DropRewards -= new Manipulator(DropDroneReward); Log.Info("BossDroneReward on end"); } public override void OnStart() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown BossGroup.DropRewards += new Manipulator(DropDroneReward); Log.Info("BossItemModifier on start"); } private void DropDroneReward(ILContext il) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) if (StageModifierDirector.instance.IsModifierActive("Aurelionite")) { return; } ILCursor val = new ILCursor(il); if (1 == 0 || !val.TryGotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, typeof(PickupDropletController), "CreatePickupDroplet") })) { return; } val.Remove(); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)delegate(UniquePickup origPickup, Vector3 position, Vector3 vector, BossGroup self) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) UniquePickup pickup = origPickup; DroneIndex val2; if (dropLegendary) { val2 = Run.instance.stageRng.NextElementUniform(Run.instance.availableTier3DroneList); } else { List availableTier2DroneList = Run.instance.availableTier2DroneList; availableTier2DroneList.Remove(DroneDefs.EquipmentDrone.droneIndex); val2 = Run.instance.stageRng.NextElementUniform(availableTier2DroneList); } PickupIndex val3 = PickupCatalog.FindPickupIndex(val2); bool flag = false; ((UniquePickup)(ref pickup))..ctor(val3); CreatePickupInfo val4 = default(CreatePickupInfo); ((CreatePickupInfo)(ref val4)).pickup = pickup; val4.rotation = Quaternion.identity; val4.position = position; CreatePickupInfo val5 = val4; PickupDropletController.CreatePickupDroplet(val5, position, vector); }); } } } namespace RiskOfRoutes { public class AssetManager { public static AssetBundle bundle; public static GameObject routePortalPrefab; public static GameObject iconBubblePrefab; public static GameObject chefPrefab; public static GameObject popoutPrefab; public static GameObject popoutChoicePrefab; public static GameObject falseSonHeartPrefab; public static Sprite falseSonHeartIcon; public static Texture2D droneSymbolTexture; public static Texture2D rewardSymbolTexture; public static Texture2D aurelioniteSymbolTexture; public static InteractableSpawnCard tier1Printer; public static InteractableSpawnCard tier2Printer; public static InteractableSpawnCard tier3Printer; public static InteractableSpawnCard bossPrinter; public static InteractableSpawnCard wanderingChefSpawnCard; public static TMP_FontAsset bomb; public static Sprite placeholderIcon; public static Sprite expansionIcon; public static Sprite modIcon; public static Sprite lockedIcon; public static Sprite mysteryEnabled; public static Sprite mysteryDisabled; public static ObjectScaleCurve pingCurve; public static Animator progressBarAnimator; public static void Initialize(AssetBundle assetBundle) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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_0097: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) bundle = assetBundle; routePortalPrefab = CreateRoutePortalPrefab(); iconBubblePrefab = CreateIconBubblePrefab(); chefPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/DLC3/MealPrep/MealPrep.prefab").WaitForCompletion(), "mealPrep"); popoutPrefab = CreatePopoutPrefab(); popoutChoicePrefab = CreatePopoutChoicePrefab(); droneSymbolTexture = bundle.LoadAsset("teleporterDrone"); rewardSymbolTexture = bundle.LoadAsset("teleporterReward"); aurelioniteSymbolTexture = bundle.LoadAsset("teleporterAurelionite"); tier1Printer = Addressables.LoadAssetAsync((object)"RoR2/Base/Duplicator/iscDuplicator.asset").WaitForCompletion(); tier2Printer = Addressables.LoadAssetAsync((object)"RoR2/Base/DuplicatorLarge/iscDuplicatorLarge.asset").WaitForCompletion(); tier3Printer = Addressables.LoadAssetAsync((object)"RoR2/Base/DuplicatorMilitary/iscDuplicatorMilitary.asset").WaitForCompletion(); bossPrinter = Addressables.LoadAssetAsync((object)"RoR2/Base/DuplicatorWild/iscDuplicatorWild.asset").WaitForCompletion(); CreateChefSpawnCard(); mysteryEnabled = bundle.LoadAsset("texArtifactMysteryEnabled"); mysteryDisabled = bundle.LoadAsset("texArtifactMysteryDisabled"); falseSonHeartPrefab = bundle.LoadAsset("PickupFalseSonHeart"); Material val = Addressables.LoadAssetAsync((object)"RoR2/DLC2/FalseSon/matFalseSon.mat").WaitForCompletion(); Transform val2 = falseSonHeartPrefab.transform.Find("mdlFalseSonHeart"); MeshRenderer component = ((Component)val2).gameObject.GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)val != (Object)null) { ((Renderer)component).material = val; } falseSonHeartIcon = bundle.LoadAsset("falseSonHeartIcon"); bomb = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/Fonts/Bombardier/tmpBombDropShadow.asset").WaitForCompletion(); placeholderIcon = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/MiscIcons/texMysteryIcon.png").WaitForCompletion(); expansionIcon = bundle.LoadAsset("routesExpansionIcon"); modIcon = bundle.LoadAsset("modIcon"); lockedIcon = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/MiscIcons/texUnlockIcon.png").WaitForCompletion(); GameObject val3 = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/PingIndicator.prefab").WaitForCompletion(); PingIndicator component2 = val3.GetComponent(); pingCurve = component2.pingObjectScaleCurve; CheckAssetsLoaded(); } private static GameObject CreateRoutePortalPrefab() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) GameObject val = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/PortalShop/PortalShop.prefab").WaitForCompletion(), "RoutePortal"); Object.Destroy((Object)(object)val.GetComponent()); Object.Destroy((Object)(object)val.GetComponent()); ObjectScaleCurve componentInChildren = val.GetComponentInChildren(); float num = 1f; float num2 = 1f; ((Object)val).name = "RoutePortal"; val.transform.localScale = new Vector3(num, num2, num); Transform val2 = val.transform.Find("PortalCenter"); if ((Object)(object)val2 != (Object)null) { Transform val3 = val2.Find("Point Light"); if ((Object)(object)val3 != (Object)null) { Light component = ((Component)val3).GetComponent(); if ((Object)(object)component != (Object)null) { component.intensity = 2f; } else { Log.Error("Not ifound lighthh"); } } else { Log.Info("Not found poitn lignt"); } } else { Log.Info("Not found center"); } Renderer[] componentsInChildren = val.GetComponentsInChildren(); RoutePortalManager routePortalManager = val.AddComponent(); Texture2D val4 = null; Texture2D val5 = null; if (RiskOfRoutes.usePortalTypeColors.Value) { val4 = bundle.LoadAsset("bwCenter"); val5 = bundle.LoadAsset("bwEdge"); } else { val4 = bundle.LoadAsset("darkerBlueEdge"); val5 = bundle.LoadAsset("darkerBlueCenter"); } Renderer[] array = componentsInChildren; foreach (Renderer val6 in array) { if (((Object)val6.material).name.Contains("Center") && !RiskOfRoutes.usePortalMaterial.Value) { val6.material.SetTexture("_RemapTex", (Texture)(object)val5); } } GenericInteraction val7 = val.AddComponent(); SceneExitController sceneExitController = val.AddComponent(); GenericDisplayNameProvider val8 = val.AddComponent(); GenericInspectInfoProvider val9 = val.AddComponent(); routePortalManager.genericInteraction = val7; routePortalManager.sceneExitController = sceneExitController; val7.contextToken = Language.GetString("ENTER_ROUTE_PORTAL"); return val; } public static GameObject CreateIconBubblePrefab() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) GameObject val = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/bazaar/SeerStation.prefab").WaitForCompletion(), "seer"); Transform val2 = val.transform.Find("Model").Find("DisplayPivot"); Transform val3 = val2.Find("PortalActiveDisplay"); if (Object.op_Implicit((Object)(object)val3)) { GameObject val4 = new GameObject("IconBubblePrefab"); Object.DontDestroyOnLoad((Object)(object)val4); val4.SetActive(false); val3.SetParent(val4.transform); ((Component)val3).transform.localPosition = new Vector3(0f, 0f, 0f); ((Component)val3).transform.localRotation = Quaternion.Euler(0f, 180f, 0f); ((Component)val3).transform.localScale = new Vector3(0.25f, 0.25f, 0.25f); Transform val5 = ((Component)val3).transform.Find("Point Light"); Light component = ((Component)val5).GetComponent(); component.intensity = 1f; Renderer[] componentsInChildren = ((Component)val3).GetComponentsInChildren(); Renderer[] array = componentsInChildren; foreach (Renderer val6 in array) { if (((Object)val6).name == "Portal") { Material val7 = val6.materials[0]; val7.SetTexture("_Cloud1Tex", (Texture)null); val7.SetTexture("_Cloud2Tex", (Texture)null); val7.SetFloat("_Boost", 1f); val7.SetFloat("_AlphaBoost", 1f); val7.SetFloat("_DistortionStrength", 0f); val7.SetTextureScale("_MainTex", new Vector2(1.75f, 1.75f)); val7.SetTextureOffset("_MainTex", new Vector2(-0.4f, -0.4f)); val6.materials = (Material[])(object)new Material[2] { val7, val7 }; } } Object.DestroyImmediate((Object)(object)val); return val4; } return val; } public static GameObject CreatePopoutPrefab() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/UI/CharacterSelectUI.prefab").WaitForCompletion(); Transform val2 = val.transform.Find("SafeArea/RightHandPanel/PopoutPanelContainer/PopoutPanelPrefab"); GameObject gameObject = ((Component)val2).gameObject; GameObject val3 = PrefabAPI.InstantiateClone(gameObject, "routesPopout"); HGPopoutPanel component = val3.GetComponent(); RoutesPopoutController routesPopoutController = val3.AddComponent(); routesPopoutController.container = component.popoutPanelContentContainer; routesPopoutController.title = component.popoutPanelTitleText; routesPopoutController.subtitle = component.popoutPanelSubtitleText; Object.DestroyImmediate((Object)(object)component); Transform val4 = val3.transform.Find("Canvas/Main/DynamicText"); if ((Object)(object)val4 != (Object)null) { Object.DestroyImmediate((Object)(object)((Component)val4).gameObject); } val3.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f); RectTransform component2 = val3.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.anchorMin = new Vector2(0.3f, 0.3f); component2.anchorMax = new Vector2(0.64f, 0.7f); component2.pivot = new Vector2(0.5f, 0.5f); ((Transform)component2).localPosition = Vector3.zero; ((Transform)component2).localScale = Vector3.one; } Transform val5 = val3.transform.Find("Canvas/Main/RandomButtonContainer"); Transform val6 = ((Component)val5).transform.Find("RandomButton"); Object.DestroyImmediate((Object)(object)((Component)val6).gameObject); HorizontalLayoutGroup val7 = ((Component)val5).gameObject.AddComponent(); ((HorizontalOrVerticalLayoutGroup)val7).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)val7).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)val7).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)val7).childForceExpandHeight = true; GameObject val8 = Addressables.LoadAssetAsync((object)"RoR2/Base/UI/GenericMenuButton.prefab").WaitForCompletion(); GameObject val9 = Object.Instantiate(val8, val5); LanguageTextMeshController component3 = val9.GetComponent(); component3.token = "Default"; HGTextMeshProUGUI component4 = ((Component)val9.transform.Find("ButtonText")).GetComponent(); ((TMP_Text)component4).m_textAlignment = (TextAlignmentOptions)514; routesPopoutController.defaultButton = val9; GameObject val10 = Object.Instantiate(val8, val5); LanguageTextMeshController component5 = val10.GetComponent(); component5.token = "All"; HGTextMeshProUGUI component6 = ((Component)val10.transform.Find("ButtonText")).GetComponent(); ((TMP_Text)component6).m_textAlignment = (TextAlignmentOptions)514; routesPopoutController.allButton = val10; GameObject val11 = Object.Instantiate(val8, val5); LanguageTextMeshController component7 = val11.GetComponent(); component7.token = "None"; HGTextMeshProUGUI component8 = ((Component)val11.transform.Find("ButtonText")).GetComponent(); ((TMP_Text)component8).m_textAlignment = (TextAlignmentOptions)514; routesPopoutController.noneButton = val11; return val3; } public static GameObject CreatePopoutChoicePrefab() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/UI/CharacterSelectUI.prefab").WaitForCompletion(); Transform val2 = val.transform.Find("SafeArea/RightHandPanel/RuleVerticalLayout/RuleBookViewerVertical/RuleChoicePrefab"); GameObject gameObject = ((Component)val2).gameObject; Transform val3 = gameObject.transform.Find("VoteLabel"); Transform val4 = gameObject.transform.Find("ButtonSelectionHighlight, Checkbox"); GameObject val5 = PrefabAPI.InstantiateClone(gameObject, "popoutChoiceRoutes"); Transform val6 = val5.transform.Find("ButtonSelectionHighlight, Checkbox"); Transform val7 = val5.transform.Find("ButtonSelectionHighlight, Disable"); Transform val8 = val5.transform.Find("ButtonSelectionHighlight, Locked"); Transform val9 = val5.transform.Find("VoteLabel"); List list = new List(); Color color = default(Color); for (int i = 0; i < 2; i++) { ((Color)(ref color))..ctor(0.61f, 0.9f, 0.38f, 1f); if (i == 1) { ((Color)(ref color))..ctor(1f, 0.48f, 0.48f); } for (int j = 1; j <= 3; j++) { Transform val10 = Object.Instantiate(val4, val5.transform); Transform val11 = ((Component)val10).transform.Find("Highlight"); Image component = ((Component)val11).gameObject.GetComponent(); ((Graphic)component).color = color; Transform val12 = ((Component)val10).transform.Find("Checkbox/CheckboxImage"); Image component2 = ((Component)val12).GetComponent(); ((Graphic)component2).color = color; ((Object)val10).name = string.Format("{0}_Tier{1}", (i == 1) ? "Negative" : "Positive", j); Transform val13 = Object.Instantiate(val3, ((Component)val10).transform); HGTextMeshProUGUI component3 = ((Component)val13).GetComponent(); ((Graphic)component3).color = color; ((TMP_Text)component3).text = $"Tier {j}"; ((TMP_Text)component3).alignment = (TextAlignmentOptions)260; ((TMP_Text)component3).m_textAlignment = (TextAlignmentOptions)260; list.Add(((Component)val10).gameObject); } } Transform val14 = Object.Instantiate(val4, val5.transform); list.Add(((Component)val14).gameObject); Object.DestroyImmediate((Object)(object)((Component)val6).gameObject); Object.DestroyImmediate((Object)(object)((Component)val7).gameObject); Object.DestroyImmediate((Object)(object)((Component)val8).gameObject); Object.DestroyImmediate((Object)(object)((Component)val9).gameObject); RuleChoiceController component4 = val5.GetComponent(); PopoutChoiceController popoutChoiceController = val5.AddComponent(); popoutChoiceController.hgButton = component4.hgButton; popoutChoiceController.image = component4.image; popoutChoiceController.tooltipProvider = component4.tooltipProvider; popoutChoiceController.checkboxStates = list.ToArray(); if ((Object)(object)popoutChoiceController != (Object)null) { popoutChoiceController.hgButton = component4.hgButton; } MPEventSystemLocator component5 = val5.GetComponent(); if ((Object)(object)component4 != (Object)null) { Object.DestroyImmediate((Object)(object)component4); } return val5; } private static void CreateChefSpawnCard() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_008d: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_045a: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_04b8: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) Log.Info("Trying to create CHEF"); InteractableSpawnCard val = ScriptableObject.CreateInstance(); GameObject val2 = Addressables.LoadAssetAsync((object)"RoR2/Base/bazaar/Bazaar_LunarTable.prefab").WaitForCompletion(); GameObject val3 = chefPrefab; GameObject val4 = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/FlatHealth/DisplaySteakFlat.prefab").WaitForCompletion(), "steak1"); GameObject val5 = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/FlatHealth/DisplaySteakFlat.prefab").WaitForCompletion(), "steak2"); GameObject val6 = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/FlatHealth/DisplaySteakFlat.prefab").WaitForCompletion(), "steak3"); GameObject val7 = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/Seed/PickupSeed.prefab").WaitForCompletion(), "seed"); GameObject val8 = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/DLC2/Chef/meshChefCleaverGhost1.FBX").WaitForCompletion(), "cleaverGhost"); GameObject val9 = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/DLC2/lemuriantemple/Assets/LTWok.prefab").WaitForCompletion(), "wok"); val4.transform.SetParent(val3.transform, false); val5.transform.SetParent(val3.transform, false); val6.transform.SetParent(val3.transform, false); val7.transform.SetParent(val3.transform, false); val8.transform.SetParent(val3.transform, false); val9.transform.SetParent(val3.transform, false); val2.transform.SetParent(val3.transform, false); val4.transform.localPosition = default(Vector3); val4.transform.rotation = Quaternion.Euler(default(Vector3)); val4.transform.localScale = default(Vector3); val4.transform.localPosition = new Vector3(0.806f, -0.061f, 1.474f); val4.transform.localRotation = Quaternion.Euler(272.0293f, 356.7472f, 66.6001f); val4.transform.localScale = new Vector3(0.4f, 0.4f, 0.4f); val5.transform.localPosition = new Vector3(-0.522f, -0.061f, 2.164f); val5.transform.localRotation = Quaternion.Euler(272.0291f, 245.6929f, 66.6f); val5.transform.localScale = new Vector3(0.4f, 0.4f, 0.4f); val6.transform.localPosition = new Vector3(-0.492f, 0.088f, 2.209f); val6.transform.localRotation = Quaternion.Euler(274.538f, 270.5f, 90.0001f); val6.transform.localScale = new Vector3(0.4f, 0.4f, 0.4f); val7.transform.localPosition = new Vector3(0.366f, -0.162f, 1.872f); val7.transform.localRotation = Quaternion.Euler(48.0785f, 327.5262f, 319.4f); val7.transform.localScale = new Vector3(0.1043f, 0.1043f, 0.1043f); val8.transform.localPosition = new Vector3(0.922f, -0.7f, -0.01f); val8.transform.localRotation = Quaternion.Euler(0f, 205.2114f, 127.0116f); val8.transform.localScale = new Vector3(1f, 1f, 1f); val9.transform.localPosition = new Vector3(-0.28f, 0.7f, -1.79f); val9.transform.localRotation = Quaternion.Euler(270f, 302.2861f, 0f); val9.transform.localScale = new Vector3(3.1129f, 3.1129f, 3.1129f); val2.transform.localPosition = new Vector3(-0.289f, -1.256f, 0.01f); val2.transform.localRotation = Quaternion.Euler(270f, 90f, 0f); val2.transform.localScale = new Vector3(0.9041f, 0.9041f, 0.9041f); Material material = Addressables.LoadAssetAsync((object)"RoR2/DLC2/Chef/matChef_Cleaver.mat").WaitForCompletion(); Renderer componentInChildren = val8.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.material = material; } ((SpawnCard)val).prefab = chefPrefab; ((SpawnCard)val).directorCreditCost = 0; ((SpawnCard)val).sendOverNetwork = true; ((SpawnCard)val).hullSize = (HullClassification)0; val.orientToFloor = true; ((SpawnCard)val).nodeGraphType = (GraphType)0; wanderingChefSpawnCard = val; } public static InteractableSpawnCard CreateRoutePortalSpawnCard(SceneDef destination) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected I4, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) RoutePortalManager component = routePortalPrefab.GetComponent(); component.NetworkdestinationSceneIndex = (int)destination.sceneDefIndex; InteractableSpawnCard val = ScriptableObject.CreateInstance(); ((Object)val).name = "iscRoutePortal"; ((SpawnCard)val).prefab = routePortalPrefab; ((SpawnCard)val).sendOverNetwork = true; ((SpawnCard)val).hullSize = (HullClassification)0; ((SpawnCard)val).nodeGraphType = (GraphType)0; ((SpawnCard)val).requiredFlags = (NodeFlags)0; ((SpawnCard)val).forbiddenFlags = (NodeFlags)16; ((SpawnCard)val).directorCreditCost = 0; ((SpawnCard)val).occupyPosition = true; val.orientToFloor = false; val.skipSpawnWhenSacrificeArtifactEnabled = false; return val; } public static void CheckAssetsLoaded() { bool flag = false; if ((Object)(object)bundle == (Object)null) { flag = true; Log.Warning("CheckAssetsLoaded Failed to load bundle"); } if ((Object)(object)routePortalPrefab == (Object)null) { flag = true; Log.Warning("CheckAssetsLoaded Failed to load routePortalPrefab"); } if ((Object)(object)iconBubblePrefab == (Object)null) { flag = true; Log.Warning("CheckAssetsLoaded Failed to load iconBubblePrefab"); } if ((Object)(object)chefPrefab == (Object)null) { flag = true; Log.Warning("CheckAssetsLoaded Failed to load chefPrefab"); } if ((Object)(object)droneSymbolTexture == (Object)null) { flag = true; Log.Warning("CheckAssetsLoaded Failed to load droneSymbolTexture"); } if ((Object)(object)rewardSymbolTexture == (Object)null) { flag = true; Log.Warning("CheckAssetsLoaded Failed to load rewardSymbolTexture"); } if ((Object)(object)aurelioniteSymbolTexture == (Object)null) { flag = true; Log.Warning("CheckAssetsLoaded Failed to load aurelioniteSymbolTexture"); } if ((Object)(object)tier1Printer == (Object)null) { flag = true; Log.Warning("CheckAssetsLoaded Failed to load tier1Printer"); } if ((Object)(object)tier2Printer == (Object)null) { flag = true; Log.Warning("CheckAssetsLoaded Failed to load tier2Printer"); } if ((Object)(object)tier3Printer == (Object)null) { flag = true; Log.Warning("CheckAssetsLoaded Failed to load tier3Printer"); } if ((Object)(object)bossPrinter == (Object)null) { flag = true; Log.Warning("CheckAssetsLoaded Failed to load bossPrinter"); } if ((Object)(object)wanderingChefSpawnCard == (Object)null) { flag = true; Log.Warning("CheckAssetsLoaded Failed to load wanderingChefSpawnCard"); } if ((Object)(object)bomb == (Object)null) { flag = true; Log.Warning("CheckAssetsLoaded Failed to load bomb"); } if ((Object)(object)placeholderIcon == (Object)null) { flag = true; Log.Warning("CheckAssetsLoaded Failed to load placeholderIcon"); } if ((Object)(object)pingCurve == (Object)null) { flag = true; Log.Warning("CheckAssetsLoaded Failed to load pingCurve"); } if (flag) { Log.Error("CheckAssetsLoaded: One or more assets failed to load"); } else { Log.Info("CheckAssetsLoaded: All assets loaded"); } } } public class DefInfo { public string name; public string nameToken; public string descriptionToken; public Sprite sprite; public Color tooltipColor; public ModifierTier tier = ModifierTier.Tier1; public bool isNegative = false; public DefInfo() { } public DefInfo(ItemDef def) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) name = ((Object)def).name; nameToken = def.nameToken; descriptionToken = def.descriptionToken; sprite = def.pickupIconSprite; tooltipColor = Color32.op_Implicit(ColorCatalog.GetColor(def.darkColorIndex)); } public DefInfo(ArtifactDef def) { //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_0053: Unknown result type (might be due to invalid IL or missing references) name = def.cachedName; nameToken = def.nameToken; descriptionToken = def.descriptionToken; sprite = def.smallIconSelectedSprite; tooltipColor = Color32.op_Implicit(ColorCatalog.GetColor((ColorIndex)24)); } public DefInfo(ModifierDef def) { //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_0053: Unknown result type (might be due to invalid IL or missing references) name = def.name; nameToken = def.nameToken; descriptionToken = def.descriptionToken; sprite = def.spriteIcon; tooltipColor = Color32.op_Implicit(ColorCatalog.GetColor((ColorIndex)29)); tier = def.tier; isNegative = def.isNegative; } } internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } public class ModifierHologramController : MonoBehaviour { private GameObject droneIcon; private GameObject rewardIcon; private GameObject aurelioniteIcon; public Texture2D droneTex; public Texture2D rewardTex; public Texture2D aurelioniteTex; public Color uncommon = new Color(12f / 85f, 0.7490196f, 0f, 1f); public Color legendary = new Color(1f, 0.21960784f, 10f / 51f, 1f); public Color boss = new Color(1f, 47f / 51f, 0.19215687f, 1f); public Color aurelionite = new Color(1f, 48f / 85f, 0f, 1f); public Color mountain = new Color(0.23921569f, 44f / 51f, 1f, 1f); private void Start() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) Transform val = ((Component)this).transform.Find("TeleporterBaseMesh/HologramPivot/ShrineBossIndicator"); if (!((Object)(object)val == (Object)null)) { GameObject prefab = Addressables.LoadAssetAsync((object)"RoR2/Base/ShrineBoss/ShrineBossSymbol.prefab").WaitForCompletion(); droneIcon = CreateIcon(prefab, val, droneTex, "Hologram_Drone"); rewardIcon = CreateIcon(prefab, val, rewardTex, "Hologram_Reward"); aurelioniteIcon = CreateIcon(prefab, val, aurelioniteTex, "Hologram_Aurelionite"); RefreshHologramIcons(); RiskOfRoutes.hologramsAreColored.SettingChanged += OnConfigChanged; } } private void OnDestroy() { RiskOfRoutes.hologramsAreColored.SettingChanged -= OnConfigChanged; } private void OnConfigChanged(object sender, EventArgs e) { Log.Info("Config changed, refreshing hologram icons"); RefreshHologramIcons(); } public void RefreshHologramIcons() { if ((Object)(object)StageModifierDirector.instance != (Object)null && (Object)(object)TeleporterInteraction.instance != (Object)null) { bool flag = StageModifierDirector.instance.IsModifierActive("Aurelionite"); bool flag2 = StageModifierDirector.instance.IsModifierActive("DroneBossGreen"); bool flag3 = StageModifierDirector.instance.IsModifierActive("DroneBossRed"); bool flag4 = StageModifierDirector.instance.IsModifierActive("BossYellowItem"); bool flag5 = StageModifierDirector.instance.IsModifierActive("BossRedItem"); if (flag) { SetAurelioniteIconActive(active: true); } if (flag2) { SetDroneIconActive(active: true); } if (flag3) { SetDroneIconActive(active: true, isLegendary: true); } if (flag4) { SetRewardIconActive(active: true); } if (flag5) { SetRewardIconActive(active: true, isLegendary: true); } } } private GameObject CreateIcon(GameObject prefab, Transform parent, Texture2D texture, string iconName) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(iconName); val.transform.SetParent(parent, false); RectTransform val2 = val.AddComponent(); val2.sizeDelta = new Vector2(1f, 1f); ((Transform)val2).localScale = Vector3.one; GameObject val3 = Object.Instantiate(prefab, val.transform, false); ((Object)val3).name = iconName + "_Visual"; MeshRenderer component = val3.GetComponent(); if ((Object)(object)component != (Object)null) { ((Renderer)component).material.SetTexture("_MainTex", (Texture)(object)texture); } val.SetActive(false); return val; } public void SetDroneIconActive(bool active, bool isLegendary = false) { //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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) if ((Object)(object)droneIcon == (Object)null) { return; } Transform val = droneIcon.transform.Find("Hologram_Drone_Visual"); if ((Object)(object)val == (Object)null) { return; } Log.Info($"drone Icon is null {(Object)(object)droneIcon == (Object)null} || {(Object)(object)val == (Object)null}"); MeshRenderer component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { if (RiskOfRoutes.hologramsAreColored.Value) { if (isLegendary) { ((Renderer)component).material.SetColor("_TintColor", legendary); } else { ((Renderer)component).material.SetColor("_TintColor", uncommon); } } else { ((Renderer)component).material.SetColor("_TintColor", mountain); } } droneIcon.SetActive(active); } public void SetRewardIconActive(bool active, bool isLegendary = false) { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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) if ((Object)(object)rewardIcon == (Object)null) { return; } Transform val = rewardIcon.transform.Find("Hologram_Reward_Visual"); if ((Object)(object)val == (Object)null) { return; } MeshRenderer component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { if (RiskOfRoutes.hologramsAreColored.Value) { if (isLegendary) { ((Renderer)component).material.SetColor("_TintColor", legendary); } else { ((Renderer)component).material.SetColor("_TintColor", boss); } } else { ((Renderer)component).material.SetColor("_TintColor", mountain); } } rewardIcon.SetActive(active); } public void SetAurelioniteIconActive(bool active) { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)aurelioniteIcon == (Object)null) { return; } Transform val = aurelioniteIcon.transform.Find("Hologram_Aurelionite_Visual"); if ((Object)(object)val == (Object)null) { return; } MeshRenderer component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { if (RiskOfRoutes.hologramsAreColored.Value) { ((Renderer)component).material.SetColor("_TintColor", aurelionite); } else { ((Renderer)component).material.SetColor("_TintColor", mountain); } } aurelioniteIcon.SetActive(active); } } internal class MyNetworkComponent : NetworkBehaviour { private static MyNetworkComponent _instance; private static int kTargetRpcTargetLog; private void Awake() { _instance = this; Log.Info("T MyNetworkComponesnt spawned on: " + (NetworkServer.active ? "Server" : "Client")); } public static void Invoke(NetworkUser user, string msg) { _instance.CallTargetLog(((NetworkBehaviour)user).connectionToClient, msg); } [TargetRpc] private void TargetLog(NetworkConnection target, string msg) { Log.Info(msg); } private void UNetVersion() { } protected static void InvokeRpcTargetLog(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"TargetRPC TargetLog called on server."); } else { ((MyNetworkComponent)(object)obj).TargetLog(ClientScene.readyConnection, reader.ReadString()); } } public void CallTargetLog(NetworkConnection target, string msg) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"TargetRPC Function TargetLog called on client."); return; } if (target is ULocalConnectionToServer) { Debug.LogError((object)"TargetRPC Function TargetLog called on connection to server"); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kTargetRpcTargetLog); val.Write(((Component)this).GetComponent().netId); val.Write(msg); ((NetworkBehaviour)this).SendTargetRPCInternal(target, val, 0, "TargetLog"); } static MyNetworkComponent() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown kTargetRpcTargetLog = 458293422; NetworkBehaviour.RegisterRpcDelegate(typeof(MyNetworkComponent), kTargetRpcTargetLog, new CmdDelegate(InvokeRpcTargetLog)); NetworkCRC.RegisterBehaviour("MyNetworkComponent", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { bool result = default(bool); return result; } public override void OnDeserialize(NetworkReader reader, bool initialState) { } } public class MysteryArtifact { [CompilerGenerated] private static class <>O { public static hook_RebuildModel <0>__PickupDisplay_RebuildModel; public static hook_GetDisplayName <1>__GenericPickupController_GetDisplayName; public static hook_GetInspectInfoProvider <2>__GenericPickupController_GetInspectInfoProvider; public static hook_Start <3>__ShopTerminalBehavior_Start; public static hook_Update <4>__PickupDisplay_Update; } public static ArtifactDef Mystery = ScriptableObject.CreateInstance(); public static void InitializeArtifact() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Expected O, but got Unknown //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Expected O, but got Unknown Mystery.nameToken = "ARTIFACT_MYSTERY_NAME"; Mystery.descriptionToken = "ARTIFACT_MYSTERY_DESCRIPTION"; Mystery.smallIconDeselectedSprite = AssetManager.mysteryDisabled; Mystery.smallIconSelectedSprite = AssetManager.mysteryEnabled; Mystery.cachedName = "Mystery"; ContentAddition.AddArtifactDef(Mystery); object obj = <>O.<0>__PickupDisplay_RebuildModel; if (obj == null) { hook_RebuildModel val = PickupDisplay_RebuildModel; <>O.<0>__PickupDisplay_RebuildModel = val; obj = (object)val; } PickupDisplay.RebuildModel += (hook_RebuildModel)obj; object obj2 = <>O.<1>__GenericPickupController_GetDisplayName; if (obj2 == null) { hook_GetDisplayName val2 = GenericPickupController_GetDisplayName; <>O.<1>__GenericPickupController_GetDisplayName = val2; obj2 = (object)val2; } GenericPickupController.GetDisplayName += (hook_GetDisplayName)obj2; object obj3 = <>O.<2>__GenericPickupController_GetInspectInfoProvider; if (obj3 == null) { hook_GetInspectInfoProvider val3 = GenericPickupController_GetInspectInfoProvider; <>O.<2>__GenericPickupController_GetInspectInfoProvider = val3; obj3 = (object)val3; } GenericPickupController.GetInspectInfoProvider += (hook_GetInspectInfoProvider)obj3; object obj4 = <>O.<3>__ShopTerminalBehavior_Start; if (obj4 == null) { hook_Start val4 = ShopTerminalBehavior_Start; <>O.<3>__ShopTerminalBehavior_Start = val4; obj4 = (object)val4; } ShopTerminalBehavior.Start += (hook_Start)obj4; object obj5 = <>O.<4>__PickupDisplay_Update; if (obj5 == null) { hook_Update val5 = PickupDisplay_Update; <>O.<4>__PickupDisplay_Update = val5; obj5 = (object)val5; } PickupDisplay.Update += (hook_Update)obj5; } private static void PickupDisplay_Update(orig_Update orig, PickupDisplay self) { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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) orig.Invoke(self); if ((Object)(object)RunArtifactManager.instance != (Object)null && RunArtifactManager.instance.IsArtifactEnabled(Mystery) && self.hidden && Object.op_Implicit((Object)(object)self.modelObject)) { ShopTerminalBehavior componentInParent = ((Component)self).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null && ((Object)componentInParent).name.Contains("Duplicator")) { Transform transform = self.modelObject.transform; transform.localPosition += Vector3.up * 1f; } else { Transform transform2 = self.modelObject.transform; transform2.localPosition += Vector3.up * 0.1f; } } } private static void ShopTerminalBehavior_Start(orig_Start orig, ShopTerminalBehavior self) { if (RunArtifactManager.instance.IsArtifactEnabled(Mystery)) { self.hidden = true; } orig.Invoke(self); } private static IInspectInfoProvider GenericPickupController_GetInspectInfoProvider(orig_GetInspectInfoProvider orig, GenericPickupController self) { if (RunArtifactManager.instance.IsArtifactEnabled(Mystery)) { return null; } return orig.Invoke(self); } private static string GenericPickupController_GetDisplayName(orig_GetDisplayName orig, GenericPickupController self) { if (RunArtifactManager.instance.IsArtifactEnabled(Mystery)) { return "???"; } return orig.Invoke(self); } private static void PickupDisplay_RebuildModel(orig_RebuildModel orig, PickupDisplay self, GameObject modelObjectOverride) { if (RunArtifactManager.instance.IsArtifactEnabled(Mystery)) { self.hidden = true; } orig.Invoke(self, modelObjectOverride); } } public class RoutePortalManager : NetworkBehaviour { public GenericInteraction genericInteraction; public PurchaseInteraction purchaseInteraction; public SceneExitController sceneExitController; public bool isObjectiveNode = false; [SyncVar] public bool isUsingModifiers = false; [SyncVar(hook = "OnOvalChanged")] public bool isOval = false; [SyncVar(hook = "OnTypeChanged")] public int portalType; [SyncVar] public bool isSeerStation = false; [SyncVar] public bool isUsingSceneExit = false; public SyncListString stageModifiers = new SyncListString(); [SyncVar] public Vector2 nodeSync = new Vector2(-1f, -1f); private RouteMap.RouteNode _routeNode; [SyncVar] public int destinationSceneIndex; public bool isDirty = true; public bool usePositiveNegativeColors; public bool usePortalMaterial; public bool usePortalColor; private static int kListstageModifiers; public RouteMap.RouteNode routeNode { get { return _routeNode; } set { //IL_0045: 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) _routeNode = value; if (routeNode != null) { NetworknodeSync = new Vector2((float)_routeNode.x, (float)_routeNode.y); } else { NetworknodeSync = new Vector2(-1f, -1f); } } } public bool NetworkisUsingModifiers { get { return isUsingModifiers; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref isUsingModifiers, 1u); } } public bool NetworkisOval { get { return isOval; } [param: In] set { ref bool reference = ref isOval; if (NetworkServer.localClientActive && !((NetworkBehaviour)this).syncVarHookGuard) { ((NetworkBehaviour)this).syncVarHookGuard = true; OnOvalChanged(value); ((NetworkBehaviour)this).syncVarHookGuard = false; } ((NetworkBehaviour)this).SetSyncVar(value, ref reference, 2u); } } public int NetworkportalType { get { return portalType; } [param: In] set { ref int reference = ref portalType; if (NetworkServer.localClientActive && !((NetworkBehaviour)this).syncVarHookGuard) { ((NetworkBehaviour)this).syncVarHookGuard = true; OnTypeChanged(value); ((NetworkBehaviour)this).syncVarHookGuard = false; } ((NetworkBehaviour)this).SetSyncVar(value, ref reference, 4u); } } public bool NetworkisSeerStation { get { return isSeerStation; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref isSeerStation, 8u); } } public bool NetworkisUsingSceneExit { get { return isUsingSceneExit; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref isUsingSceneExit, 16u); } } public Vector2 NetworknodeSync { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return nodeSync; } [param: In] set { //IL_0001: Unknown result type (might be due to invalid IL or missing references) ((NetworkBehaviour)this).SetSyncVar(value, ref nodeSync, 64u); } } public int NetworkdestinationSceneIndex { get { return destinationSceneIndex; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref destinationSceneIndex, 128u); } } public void Awake() { genericInteraction = ((Component)this).GetComponent(); sceneExitController = ((Component)this).GetComponent(); purchaseInteraction = ((Component)this).GetComponent(); ((SyncList)(object)stageModifiers).InitializeBehaviour((NetworkBehaviour)(object)this, kListstageModifiers); } public void Start() { RiskOfRoutes.usePortalTypeColors.SettingChanged += OnConfigChanged; RiskOfRoutes.usePositiveNegativeColors.SettingChanged += OnConfigChanged; RiskOfRoutes.usePortalMaterial.SettingChanged += OnConfigChanged; if (isSeerStation) { if (Object.op_Implicit((Object)(object)purchaseInteraction)) { ((UnityEvent)(object)purchaseInteraction.onPurchase).AddListener((UnityAction)OnSeerActivation); } else { Log.Error("Error with seer purchase interaction"); } return; } if ((Object)(object)genericInteraction != (Object)null) { ((UnityEvent)(object)genericInteraction.onActivation).AddListener((UnityAction)OnPortalActivation); } if (isUsingSceneExit) { if ((Object)(object)sceneExitController != (Object)null) { sceneExitController.useRunNextStageScene = true; } else { Log.Error("Something went wrong for sceneExitController for: " + ((Object)((Component)this).gameObject).name); } } } public void OnDestroy() { RiskOfRoutes.usePortalTypeColors.SettingChanged -= OnConfigChanged; RiskOfRoutes.usePositiveNegativeColors.SettingChanged -= OnConfigChanged; RiskOfRoutes.usePortalMaterial.SettingChanged -= OnConfigChanged; if ((Object)(object)genericInteraction != (Object)null) { ((UnityEvent)(object)genericInteraction.onActivation).RemoveListener((UnityAction)OnPortalActivation); } if ((Object)(object)purchaseInteraction != (Object)null) { ((UnityEvent)(object)purchaseInteraction.onPurchase).RemoveListener((UnityAction)OnSeerActivation); } } private void OnConfigChanged(object sender, EventArgs e) { isDirty = true; } protected virtual void Update() { if (isDirty) { UpdateBubbles(); UpdatePortalMaterials(); isDirty = false; } } public override void OnStartClient() { ((NetworkBehaviour)this).OnStartClient(); Log.Info("Called method onStartClient"); SyncListString obj = stageModifiers; ((SyncList)(object)obj).Callback = (SyncListChanged)(object)Delegate.Remove((Delegate?)(object)((SyncList)(object)obj).Callback, (Delegate?)(object)new SyncListChanged(OnModifiersChanged)); SyncListString obj2 = stageModifiers; ((SyncList)(object)obj2).Callback = (SyncListChanged)(object)Delegate.Combine((Delegate?)(object)((SyncList)(object)obj2).Callback, (Delegate?)(object)new SyncListChanged(OnModifiersChanged)); if (((Behaviour)this).enabled && ((SyncList)(object)stageModifiers).Count > 0) { UpdateBubbles(); } } private void OnModifiersChanged(Operation op, int itemIndex) { UpdateBubbles(); } private void OnOvalChanged(bool value) { NetworkisOval = value; if (((Behaviour)this).enabled && ((SyncList)(object)stageModifiers).Count > 0) { UpdateBubbles(); } } private void OnTypeChanged(int value) { NetworkportalType = value; UpdatePortalMaterials(); } public void UpdateBubbles() { if (isSeerStation) { return; } Transform val = ((Component)this).transform.Find("PortalCenter"); if ((Object)(object)val == (Object)null) { Log.Error("Portal center is null"); return; } for (int num = val.childCount - 1; num >= 0; num--) { Transform child = val.GetChild(num); if (((Object)child).name.Contains("Bubble")) { Renderer[] componentsInChildren = ((Component)child).GetComponentsInChildren(true); Renderer[] array = componentsInChildren; foreach (Renderer val2 in array) { Material[] materials = val2.materials; foreach (Material val3 in materials) { if ((Object)(object)val3 != (Object)null) { Object.Destroy((Object)(object)val3); } } } Object.Destroy((Object)(object)((Component)child).gameObject); } } AttachBubblesToPortal(); } public void UpdatePortalMaterials() { //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) if (!((Object)this).name.Contains("Route")) { return; } GameObject gameObject = ((Component)this).gameObject; Transform val = gameObject.transform.Find("PortalCenter"); if ((Object)(object)val == (Object)null) { Log.Error("Portal center is null"); } Transform val2 = ((Component)val).transform.Find("Donut"); Transform val3 = ((Component)val).transform.Find("Quad"); Renderer component = ((Component)val2).GetComponent(); Renderer component2 = ((Component)val3).GetComponent(); Texture2D val4 = null; Texture2D val5 = null; if (RiskOfRoutes.usePortalTypeColors.Value) { val4 = AssetManager.bundle.LoadAsset("bwCenter"); val5 = AssetManager.bundle.LoadAsset("bwEdge"); } else { val4 = AssetManager.bundle.LoadAsset("darkerBlueEdge"); val5 = AssetManager.bundle.LoadAsset("darkerBlueCenter"); } List routeNodesSynced = StageModifierDirector.instance.routeNodesSynced; if (routeNodesSynced == null) { Log.Error("UpdatePortalMaterials: Map is null, couldnt get portal type to update material"); return; } Renderer[] array = (Renderer[])(object)new Renderer[2] { component, component2 }; foreach (Renderer val6 in array) { if (((Object)val6.material).name.Contains("Center")) { if (RiskOfRoutes.usePortalMaterial.Value) { Material portalMaterial = SceneCatalog.GetSceneDef((SceneIndex)destinationSceneIndex).portalMaterial; if ((Object)(object)portalMaterial == (Object)null) { Log.Error("UpdatePortalMaterials: Couldnt set scene material because mat is null"); break; } val6.material = portalMaterial; continue; } val6.material.SetTexture("_RemapTex", (Texture)(object)val5); if (portalType == 0) { Log.Error("UpdatePortalMaterials: Couldnt set color for portal because route node is null"); break; } if (RiskOfRoutes.usePortalTypeColors.Value) { val6.material.SetColor("_TintColor", GetPortalTypeColor((RoutePortalType)portalType) * new Color(1f, 1f, 1f, 1.2f)); } else { val6.material.SetColor("_TintColor", Color.white); } } else if (((Object)val6.material).name.Contains("Edge")) { val6.material.SetTexture("_RemapTex", (Texture)(object)val4); if (portalType == 0) { Log.Error("UpdatePortalMaterials: Couldnt set color for portal because route node is null"); break; } if (RiskOfRoutes.usePortalTypeColors.Value) { val6.material.SetColor("_TintColor", GetPortalTypeColor((RoutePortalType)portalType)); } else { val6.material.SetColor("_TintColor", Color.white); } } } } private Color GetPortalTypeColor(RoutePortalType type) { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_008d: 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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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) return (Color)(type switch { RoutePortalType.Combat => GetHDRColor(191, 77, 0, 1.4f), RoutePortalType.Utility => GetHDRColor(22, 0, 191, 2f), RoutePortalType.Heal => GetHDRColor(34, 191, 0, 1.5f), RoutePortalType.ChefType => GetHDRColor(121, 191, 10, 1.5f), RoutePortalType.Rare => GetHDRColor(191, 8, 0, 2f), RoutePortalType.DroneType => GetHDRColor(27, 66, 191, 2f), _ => GetHDRColor(10, 64, 191, 1f), }); } private Color GetHDRColor(int r, int g, int b, float intensity) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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) float num = Mathf.Pow(2f, intensity); return new Color((float)r / 255f * num, (float)g / 255f * num, (float)b / 255f * num, 1f); } private void AttachBubblesToPortal() { //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) if (isSeerStation) { return; } float num = 1f; float num2 = 1f; if (isOval) { num = 0.7f; num2 = 1.26f; } float num3 = 60f; float num4 = 90f; float num5 = 0f; float num6 = 5f; Color val7 = default(Color); for (int i = 0; i < ((SyncList)(object)stageModifiers).Count; i++) { if ((Object)(object)AssetManager.iconBubblePrefab == (Object)null) { Log.Warning("AttachBubblesToPortal: Bubble prefab is missing"); AssetManager.iconBubblePrefab = AssetManager.CreateIconBubblePrefab(); } GameObject val = Object.Instantiate(AssetManager.CreateIconBubblePrefab()); val.SetActive(true); val.transform.SetParent(((Component)((Component)this).transform.Find("PortalCenter")).transform, false); val.transform.localScale = new Vector3(1f / num, 1f / num2, 1f / num); val.transform.localRotation = Quaternion.identity; float num7 = 20f; num5 = (180f - num3) / 2f; num4 = 90f - num5; float num8 = num7 * (float)i * (MathF.PI / 180f); float num9 = 0f - Mathf.Cos(num8) * num6 / 1f; float num10 = Mathf.Sin(num8) * num6 / 1f; val.transform.localPosition = new Vector3(num9, num10, 0f); Transform val2 = val.transform.Find("PortalActiveDisplay"); Transform val3 = val2.Find("Portal"); Transform val4 = val2.Find("Donut"); Transform val5 = val2.Find("PortalEdges"); if ((Object)(object)val3 != (Object)null) { val3.localScale = new Vector3(5f, 5f, 5f); Renderer component = ((Component)val3).GetComponent(); Material material = component.material; material.SetTexture("_Cloud1Tex", (Texture)null); material.SetTexture("_Cloud2Tex", (Texture)null); material.SetFloat("_Boost", 1f); material.SetFloat("_AlphaBoost", 1f); material.SetFloat("_DistortionStrength", 0f); material.SetTextureScale("_MainTex", new Vector2(1f, 1f)); material.SetTextureOffset("_MainTex", new Vector2(0f, 0f)); Texture2D val6 = null; if (((SyncList)(object)stageModifiers)[i] != "") { string[] array = ((SyncList)(object)stageModifiers)[i].Split('='); string name = array[0]; ModifierDef modifierDef = StageModifierCatalog.FindModifier(name); if (modifierDef != null && (Object)(object)modifierDef.spriteIcon != (Object)null) { val6 = ((!(modifierDef.name != "Doppelganger")) ? ModUIManager.GetHostSprite().texture : modifierDef.spriteIcon.texture); } else { Log.Info("Uing placehdolde"); val6 = AssetManager.placeholderIcon.texture; } } else { val6 = AssetManager.placeholderIcon.texture; } material.SetTexture("_MainTex", (Texture)(object)val6); component.materials = (Material[])(object)new Material[2] { material, material }; } if (!Object.op_Implicit((Object)(object)val5) || !((Object)(object)val4 != (Object)null) || !RiskOfRoutes.usePositiveNegativeColors.Value) { continue; } ((Color)(ref val7))..ctor(12f / 85f, 0.7490196f, 0f, 1f); Color val8 = new Color(1f, 0f, 0f, 1f) * 2.8f; Renderer component2 = ((Component)val4).GetComponent(); Renderer component3 = ((Component)val5).GetComponent(); Material val9 = component2.materials[0]; Material val10 = component3.materials[0]; string[] array2 = ((SyncList)(object)stageModifiers)[i].Split('='); string text = array2[0]; if (text != "") { ModifierDef modifierDef2 = StageModifierCatalog.FindModifier(text); if (modifierDef2 != null) { val9.SetColor("_TintColor", modifierDef2.isNegative ? val8 : val7); val10.SetColor("_TintColor", modifierDef2.isNegative ? val8 : val7); } } } } private Texture2D SpriteToTexture(Sprite sprite) { return null; } public void OnPortalActivation(Interactor interactor) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Invalid comparison between Unknown and I4 //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) if (!Run.instance.IsExpansionEnabled(RoutesExpansion.routesExpansion) || !NetworkServer.active) { return; } if ((Object)(object)genericInteraction != (Object)null) { genericInteraction.interactability = (Interactability)0; } if (stageModifiers != null && ((SyncList)(object)stageModifiers).Count > 0) { StageModifierDirector.instance.reservedModifiers.Clear(); StageModifierDirector.instance.bannedModifiersRun.Clear(); foreach (string item in (SyncList)(object)stageModifiers) { string[] array = item.Split('='); StageModifierDirector.instance.reservedModifiers.Add(new ModifierSync { name = array[0], stack = int.Parse(array[1]), isArtifact = bool.Parse(array[2]) }); StageModifierDirector.instance.bannedModifiersStage.Add(array[0]); } } if ((Object)(object)genericInteraction != (Object)null) { ((Behaviour)genericInteraction).enabled = false; } if (routeNode != null) { StageModifierDirector.instance.currentNode = routeNode; StageModifierDirector.instance.NetworkcurrentNodeSync = nodeSync; if (isUsingSceneExit) { SceneDef sceneDef = SceneCatalog.GetSceneDef((SceneIndex)destinationSceneIndex); if ((Object)(object)sceneDef != (Object)null && (int)sceneDef.sceneType == 1) { Run.instance.nextStageScene = sceneDef; } foreach (SceneExitController instances in InstanceTracker.GetInstancesList()) { instances.destinationScene = sceneDef; instances.useRunNextStageScene = false; } sceneExitController.Begin(); } } else { Log.Info("OnPortalActivation: Interacting with vanilla portal"); RoutePortalManager component = StageModifierDirector.activePortalInstances[0].GetComponent(); if ((Object)(object)component != (Object)null) { StageModifierDirector.instance.currentNode = component.routeNode; StageModifierDirector.instance.NetworkcurrentNodeSync = component.nodeSync; } } if ((Object)(object)sceneExitController != (Object)null && routeNode != null) { Log.Info(SceneCatalog.GetSceneDef(sceneExitController.destinationScene.sceneDefIndex).cachedName ?? ""); if (SceneCatalog.GetSceneDef(sceneExitController.destinationScene.sceneDefIndex).cachedName == "bazaar") { routeNode.shopVisited = true; } if (SceneCatalog.GetSceneDef(sceneExitController.destinationScene.sceneDefIndex).cachedName == "goldshores") { routeNode.goldshoresVisited = true; } if (SceneCatalog.GetSceneDef(sceneExitController.destinationScene.sceneDefIndex).cachedName == "arena") { routeNode.voidFieldsVisited = true; } } } public void OnSeerActivation(Interactor interactor) { //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Invalid comparison between Unknown and I4 if (!NetworkServer.active || stageModifiers == null || ((SyncList)(object)stageModifiers).Count <= 0) { return; } StageModifierDirector.instance.reservedModifiers.Clear(); foreach (string item in (SyncList)(object)stageModifiers) { string[] array = item.Split('='); StageModifierDirector.instance.reservedModifiers.Add(new ModifierSync { name = array[0], stack = int.Parse(array[1]), isArtifact = bool.Parse(array[2]) }); } SceneDef sceneDef = SceneCatalog.GetSceneDef((SceneIndex)destinationSceneIndex); if ((Object)(object)sceneDef != (Object)null && (int)sceneDef.sceneType == 1) { Run.instance.nextStageScene = sceneDef; } Log.Info("OnSeerActivation: Seer got modifiers"); } private void UNetVersion() { } protected static void InvokeSyncListstageModifiers(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"SyncList stageModifiers called on server."); } else { ((SyncList)(object)((RoutePortalManager)(object)obj).stageModifiers).HandleMsg(reader); } } static RoutePortalManager() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown kListstageModifiers = 1176189144; NetworkBehaviour.RegisterSyncListDelegate(typeof(RoutePortalManager), kListstageModifiers, new CmdDelegate(InvokeSyncListstageModifiers)); NetworkCRC.RegisterBehaviour("RoutePortalManager", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) if (forceAll) { writer.Write(isUsingModifiers); writer.Write(isOval); writer.WritePackedUInt32((uint)portalType); writer.Write(isSeerStation); writer.Write(isUsingSceneExit); SyncListString.WriteInstance(writer, stageModifiers); writer.Write(nodeSync); writer.WritePackedUInt32((uint)destinationSceneIndex); return true; } bool flag = false; if ((((NetworkBehaviour)this).syncVarDirtyBits & 1) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(isUsingModifiers); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 2) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(isOval); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 4) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.WritePackedUInt32((uint)portalType); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 8) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(isSeerStation); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x10) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(isUsingSceneExit); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x20) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } SyncListString.WriteInstance(writer, stageModifiers); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x40) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(nodeSync); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 0x80) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.WritePackedUInt32((uint)destinationSceneIndex); } if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); } return flag; } public override void OnDeserialize(NetworkReader reader, bool initialState) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) if (initialState) { isUsingModifiers = reader.ReadBoolean(); isOval = reader.ReadBoolean(); portalType = (int)reader.ReadPackedUInt32(); isSeerStation = reader.ReadBoolean(); isUsingSceneExit = reader.ReadBoolean(); SyncListString.ReadReference(reader, stageModifiers); nodeSync = reader.ReadVector2(); destinationSceneIndex = (int)reader.ReadPackedUInt32(); return; } int num = (int)reader.ReadPackedUInt32(); if ((num & 1) != 0) { isUsingModifiers = reader.ReadBoolean(); } if ((num & 2) != 0) { OnOvalChanged(reader.ReadBoolean()); } if ((num & 4) != 0) { OnTypeChanged((int)reader.ReadPackedUInt32()); } if ((num & 8) != 0) { isSeerStation = reader.ReadBoolean(); } if ((num & 0x10) != 0) { isUsingSceneExit = reader.ReadBoolean(); } if ((num & 0x20) != 0) { SyncListString.ReadReference(reader, stageModifiers); } if ((num & 0x40) != 0) { nodeSync = reader.ReadVector2(); } if ((num & 0x80) != 0) { destinationSceneIndex = (int)reader.ReadPackedUInt32(); } } } public class RoutesExpansion { [CompilerGenerated] private static class <>O { public static Action <0>__TeleporterEventSpawnRoutePortals; public static hook_OnInteractionBegin <1>__TeleporterGetRoutePortal; public static hook_TrySpawnObject <2>__OnVanillaPortalSpawn; public static hook_Start <3>__ReplaceBazaarExits; public static hook_OnStartServer <4>__ReplaceArenaExitPortal; public static hook_SetRunNextStageToTarget <5>__UpdateShopExitDestination; public static Action <6>__TeleporterInteraction_onTeleporterChargedGlobal; } public static ExpansionDef routesExpansion = ScriptableObject.CreateInstance(); public static void InitializeExpansion(GameObject networkedObj) { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown //IL_00a5: 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_00b0: Expected O, but got Unknown //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Expected O, but got Unknown //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Expected O, but got Unknown routesExpansion.nameToken = "EXPANSION_ROUTES_NAME"; routesExpansion.descriptionToken = "EXPANSION_ROUTES_DESCRIPTION"; routesExpansion.iconSprite = AssetManager.expansionIcon; routesExpansion.disabledIconSprite = AssetManager.lockedIcon; routesExpansion.runBehaviorPrefab = networkedObj; ContentAddition.AddExpansionDef(routesExpansion); TeleporterInteraction.onTeleporterChargedGlobal += TeleporterEventSpawnRoutePortals; object obj = <>O.<1>__TeleporterGetRoutePortal; if (obj == null) { hook_OnInteractionBegin val = TeleporterGetRoutePortal; <>O.<1>__TeleporterGetRoutePortal = val; obj = (object)val; } TeleporterInteraction.OnInteractionBegin += (hook_OnInteractionBegin)obj; object obj2 = <>O.<2>__OnVanillaPortalSpawn; if (obj2 == null) { hook_TrySpawnObject val2 = OnVanillaPortalSpawn; <>O.<2>__OnVanillaPortalSpawn = val2; obj2 = (object)val2; } DirectorCore.TrySpawnObject += (hook_TrySpawnObject)obj2; object obj3 = <>O.<3>__ReplaceBazaarExits; if (obj3 == null) { hook_Start val3 = ReplaceBazaarExits; <>O.<3>__ReplaceBazaarExits = val3; obj3 = (object)val3; } BazaarController.Start += (hook_Start)obj3; object obj4 = <>O.<4>__ReplaceArenaExitPortal; if (obj4 == null) { hook_OnStartServer val4 = ReplaceArenaExitPortal; <>O.<4>__ReplaceArenaExitPortal = val4; obj4 = (object)val4; } ArenaMissionController.OnStartServer += (hook_OnStartServer)obj4; object obj5 = <>O.<5>__UpdateShopExitDestination; if (obj5 == null) { hook_SetRunNextStageToTarget val5 = UpdateShopExitDestination; <>O.<5>__UpdateShopExitDestination = val5; obj5 = (object)val5; } SeerStationController.SetRunNextStageToTarget += (hook_SetRunNextStageToTarget)obj5; TeleporterInteraction.onTeleporterChargedGlobal += TeleporterInteraction_onTeleporterChargedGlobal; AddRouteManagersToPortalPrefabs(); AddHologramControllerToTeleporter(); } private static void ReplaceArenaExitPortal(orig_OnStartServer orig, ArenaMissionController self) { orig.Invoke(self); GameObject val = null; SceneExitController[] array = Object.FindObjectsOfType(true); SceneExitController[] array2 = array; foreach (SceneExitController val2 in array2) { if (((Object)((Component)val2).gameObject).name.Contains("Arena")) { val = ((Component)val2).gameObject; Log.Info("ReplaceBazaarExits: Found arena portal with name " + ((Object)((Component)val2).gameObject).name); } if ((Object)(object)val != (Object)null) { break; } } ReplaceArenaPortal(val, isExitFromArena: true); } private static void AddRouteManagersToPortalPrefabs() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) GameObject item = Addressables.LoadAssetAsync((object)"RoR2/Base/PortalShop/PortalShop.prefab").WaitForCompletion(); GameObject item2 = Addressables.LoadAssetAsync((object)"RoR2/Base/PortalGoldshores/PortalGoldshores.prefab").WaitForCompletion(); GameObject item3 = Addressables.LoadAssetAsync((object)"RoR2/DLC2/PortalColossus.prefab").WaitForCompletion(); GameObject item4 = Addressables.LoadAssetAsync((object)"RoR2/Base/PortalArena/PortalArena.prefab").WaitForCompletion(); GameObject item5 = Addressables.LoadAssetAsync((object)"RoR2/DLC3/HardwareProgPortal.prefab").WaitForCompletion(); GameObject item6 = Addressables.LoadAssetAsync((object)"RoR2/DLC3/HardwareProgPortal_Haunt.prefab").WaitForCompletion(); GameObject item7 = Addressables.LoadAssetAsync((object)"RoR2/DLC2/PM DestinationPortal.prefab").WaitForCompletion(); GameObject item8 = Addressables.LoadAssetAsync((object)"RoR2/Base/bazaar/SeerStation.prefab").WaitForCompletion(); GameObject item9 = Addressables.LoadAssetAsync((object)"RoR2/Base/Teleporters/Teleporter1.prefab").WaitForCompletion(); GameObject item10 = Addressables.LoadAssetAsync((object)"RoR2/Base/Teleporters/LunarTeleporter Variant.prefab").WaitForCompletion(); List list = new List { item, item3, item2, item4, item5, item6, item7, item8, item9, item10 }; foreach (GameObject item11 in list) { Log.Info("AddRouteManagersToPortalPrefabs: Adding route portal manager to portal " + ((Object)item11).name); RoutePortalManager component = item11.GetComponent(); if ((Object)(object)component == (Object)null) { item11.AddComponent(); } Log.Info("AddRouteManagersToPortalPrefabs: Added route portal manager to " + ((Object)item11).name + " prefab"); } } private static void AddHologramControllerToTeleporter() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_0031: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/Teleporters/Teleporter1.prefab").WaitForCompletion(); GameObject val2 = Addressables.LoadAssetAsync((object)"RoR2/Base/Teleporters/LunarTeleporter Variant.prefab").WaitForCompletion(); GameObject val3 = Addressables.LoadAssetAsync((object)"RoR2/DLC3/conduitcanyon/Teleporter_ConduitCanyon_Variant.prefab").WaitForCompletion(); if ((Object)(object)val != (Object)null) { ModifierHologramController modifierHologramController = val.AddComponent(); modifierHologramController.droneTex = AssetManager.droneSymbolTexture; modifierHologramController.rewardTex = AssetManager.rewardSymbolTexture; modifierHologramController.aurelioniteTex = AssetManager.aurelioniteSymbolTexture; } if ((Object)(object)val2 != (Object)null) { ModifierHologramController modifierHologramController2 = val2.AddComponent(); modifierHologramController2.droneTex = AssetManager.droneSymbolTexture; modifierHologramController2.rewardTex = AssetManager.rewardSymbolTexture; modifierHologramController2.aurelioniteTex = AssetManager.aurelioniteSymbolTexture; } if ((Object)(object)val3 != (Object)null) { ModifierHologramController modifierHologramController3 = val3.AddComponent(); modifierHologramController3.droneTex = AssetManager.droneSymbolTexture; modifierHologramController3.rewardTex = AssetManager.rewardSymbolTexture; modifierHologramController3.aurelioniteTex = AssetManager.aurelioniteSymbolTexture; } } private static void TeleporterGetRoutePortal(orig_OnInteractionBegin orig, TeleporterInteraction self, Interactor activator) { orig.Invoke(self, activator); if (!Run.instance.IsExpansionEnabled(routesExpansion) || !self.isCharged) { return; } if (Stage.instance.sceneDef.baseSceneName == "conduitcanyon") { Log.Info("TeleporterGetRoutePortal: Creating node to Solus Wing stage"); RouteMap.RouteNode currentNode = StageModifierDirector.instance.routeMap.CreateHardwareNode(StageModifierDirector.instance.currentNode); StageModifierDirector.instance.currentNode = currentNode; } else { Log.Info("TeleporterGetRoutePortal: Trying to get node and modifiers from random portal"); StageModifierDirector.instance.GetRouteNodeFromRandomPortal(); if (RiskOfRoutes.teleporterUseRandomMods.Value) { StageModifierDirector.instance.GetModifiersFromRandomPortal(); } } RoutePortalManager component = ((Component)self).gameObject.GetComponent(); if (!((Object)(object)component == (Object)null)) { component.OnPortalActivation(activator); } } private static void UpdateShopExitDestination(orig_SetRunNextStageToTarget orig, SeerStationController self) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Expected I4, but got Unknown //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Invalid comparison between Unknown and I4 orig.Invoke(self); if (!Run.instance.IsExpansionEnabled(routesExpansion) || !NetworkServer.active) { return; } Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name != "bazaar") { return; } SceneIndex val = (SceneIndex)self.targetSceneDefIndex; GameObject val2 = null; SceneExitController val3 = null; SceneExitController[] array = Object.FindObjectsOfType(true); SceneExitController[] array2 = array; foreach (SceneExitController val4 in array2) { if (((Object)((Component)val4).gameObject).name.Contains("Shop")) { val2 = ((Component)val4).gameObject; val3 = val4; val3.useRunNextStageScene = true; Log.Info("UpdateShopExitDestination: Found shop portal with name " + ((Object)((Component)val4).gameObject).name); break; } } if (!Object.op_Implicit((Object)(object)val2)) { Log.Error("UpdateShopExitDestination: Could not find shopportal on bazaar scene"); return; } if (!Object.op_Implicit((Object)(object)val2.GetComponent())) { Log.Error("UpdateShopExitDestination: Shop portal doesn't have manager"); return; } RoutePortalManager component = ((Component)self).gameObject.GetComponent(); RoutePortalManager component2 = val2.GetComponent(); int destinationSceneIndex = component2.destinationSceneIndex; component2.NetworkdestinationSceneIndex = (int)val; if (Object.op_Implicit((Object)(object)component)) { ((SyncList)(object)component2.stageModifiers).Clear(); foreach (string item in (SyncList)(object)component.stageModifiers) { ((SyncList)(object)component2.stageModifiers).Add(item); } } else { Log.Warning("UpdateShopExitDestination: Seer doensn't have route portal manager, getting random mods for shop portal"); StageModifierDirector.instance.GetNextStageModifiers(val2); } SceneDef sceneDef = SceneCatalog.GetSceneDef(val); if (SceneHelper.IsSceneColossus(sceneDef.sceneDefIndex)) { component2.routeNode = component.routeNode; } else if ((int)sceneDef.sceneType == 2) { Log.Info("UpdateShopExitDestination:Seer scene is intermission, disabling portal mods"); component2.NetworkisUsingModifiers = false; } Log.Info(string.Format("{0}: Updated exit destination:{1}->{2}", "UpdateShopExitDestination", destinationSceneIndex, component2.destinationSceneIndex)); } private static void ReplaceBazaarExits(orig_Start orig, BazaarController self) { //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!Run.instance.IsExpansionEnabled(routesExpansion) || !NetworkServer.active) { return; } GameObject val = null; GameObject val2 = null; SceneExitController[] array = Object.FindObjectsOfType(true); SceneExitController[] array2 = array; foreach (SceneExitController val3 in array2) { if (((Object)((Component)val3).gameObject).name.Contains("Shop")) { val = ((Component)val3).gameObject; Log.Info("ReplaceBazaarExits:Found shop portal with name " + ((Object)((Component)val3).gameObject).name); } if (((Object)((Component)val3).gameObject).name.Contains("Arena")) { val2 = ((Component)val3).gameObject; Log.Info("ReplaceBazaarExits:Found arena portal with name " + ((Object)((Component)val3).gameObject).name); } if ((Object)(object)val2 != (Object)null && (Object)(object)val != (Object)null) { break; } } ReplaceShopPortal(val, out var portalSceneExit); ReplaceArenaPortal(val2); if ((Object)(object)portalSceneExit == (Object)null || self.seerStations == null) { if ((Object)(object)portalSceneExit == (Object)null) { Log.Error("ReplaceBazaarExits: Portal's sceneExitController is missing, couldn't set seer's destination"); } if (self.seerStations == null) { Log.Error("ReplaceBazaarExits: SeerStations are missing for some reason"); } return; } List list = new List(); SeerStationController[] seerStations = self.seerStations; foreach (SeerStationController val4 in seerStations) { if (!((Object)(object)val4 == (Object)null)) { GameObject gameObject = ((Component)val4).gameObject; Vector3 position = gameObject.transform.position; Quaternion rotation = gameObject.transform.rotation; int targetSceneDefIndex = val4.targetSceneDefIndex; NetworkServer.Destroy(gameObject); GameObject val5 = Addressables.LoadAssetAsync((object)"RoR2/Base/bazaar/SeerStation.prefab").WaitForCompletion(); GameObject val6 = Object.Instantiate(val5, position, rotation); SeerStationController component = val6.GetComponent(); if ((Object)(object)component == (Object)null) { Log.Error("ReplaceBazaarExits: Seer station controller is missing"); return; } component.targetSceneDefIndex = targetSceneDefIndex; component.explicitTargetSceneExitController = portalSceneExit; RoutePortalManager component2 = val6.GetComponent(); if ((Object)(object)component2 == (Object)null) { Log.Error("ReplaceBazaarExits: Seer station prefab missing RoutePortalManager"); return; } component2.NetworkisSeerStation = true; component2.NetworkdestinationSceneIndex = targetSceneDefIndex; if (SceneHelper.IsSceneColossus((SceneIndex)targetSceneDefIndex)) { component2.routeNode = StageModifierDirector.instance.routeMap.CreateColossusNode(StageModifierDirector.instance.currentNode, currentLayer: true); } else { component2.routeNode = StageModifierDirector.instance.currentNode; } if (!SceneHelper.IsSceneIntermission((SceneIndex)targetSceneDefIndex)) { component2.NetworkisUsingModifiers = true; StageModifierDirector.instance.GetNextStageModifiers(val6); } else { component2.NetworkisUsingModifiers = false; } ((Behaviour)component2).enabled = true; NetworkServer.Spawn(val6); list.Add(component); Log.Info("ReplaceBazaarExits: SeerStation was replaced"); } } self.seerStations = list.ToArray(); } private static void ReplaceShopPortal(GameObject shopPortalObject, out SceneExitController portalSceneExit) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected I4, but got Unknown if ((Object)(object)shopPortalObject == (Object)null) { Log.Error("ReplaceShopPortal:Shop portal was not found"); portalSceneExit = null; return; } Vector3 position = shopPortalObject.transform.position; Quaternion rotation = shopPortalObject.transform.rotation; NetworkServer.Destroy(shopPortalObject); GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/PortalShop/PortalShop.prefab").WaitForCompletion(); GameObject val2 = Object.Instantiate(val, position, rotation); RoutePortalManager component = val2.GetComponent(); if ((Object)(object)component == (Object)null) { Log.Error("ReplaceShopPortal: Shop portal doesn't have manager"); portalSceneExit = null; return; } component.NetworkdestinationSceneIndex = (int)Run.instance.nextStageScene.sceneDefIndex; component.NetworkisOval = true; component.NetworkisUsingModifiers = true; component.NetworkisUsingSceneExit = true; component.routeNode = StageModifierDirector.instance.currentNode; ((Behaviour)component).enabled = true; StageModifierDirector.instance.GetNextStageModifiers(val2); Log.Info("ReplaceShopPortal: Shop portal was replaced"); NetworkServer.Spawn(val2); Log.Info("ReplaceShopPortal: Shop portal spawned on network"); portalSceneExit = val2.GetComponent(); } private static void ReplaceArenaPortal(GameObject arenaPortalObject, bool isExitFromArena = false) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected I4, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected I4, but got Unknown if ((Object)(object)arenaPortalObject == (Object)null) { Log.Error("ReplaceArenaPortal:Arena portal was not found"); return; } Vector3 position = arenaPortalObject.transform.position; Quaternion rotation = arenaPortalObject.transform.rotation; NetworkServer.Destroy(arenaPortalObject); GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/PortalArena/PortalArena.prefab").WaitForCompletion(); GameObject val2 = Object.Instantiate(val, position, rotation); RoutePortalManager component = val2.GetComponent(); if ((Object)(object)component == (Object)null) { Log.Error("ReplaceArenaPortal: Arena portal doesn't have manager"); return; } SceneExitController component2 = val2.GetComponent(); SceneDef destinationScene = component2.destinationScene; if (!isExitFromArena) { component.NetworkdestinationSceneIndex = (int)SceneCatalog.FindSceneIndex("arena"); } component.NetworkdestinationSceneIndex = (int)destinationScene.sceneDefIndex; component.NetworkisOval = true; component.NetworkisUsingSceneExit = !isExitFromArena; component.routeNode = StageModifierDirector.instance.currentNode; component.NetworkisUsingModifiers = isExitFromArena; if (component.isUsingModifiers) { StageModifierDirector.instance.GetNextStageModifiers(val2); } ((Behaviour)component).enabled = true; Log.Info("ReplaceArenaPortal: Arena portal was replaced"); NetworkServer.Spawn(val2); Log.Info("ReplaceArenaPortal: Arena portal spawned on network"); } private static GameObject OnVanillaPortalSpawn(orig_TrySpawnObject orig, DirectorCore self, DirectorSpawnRequest directorSpawnRequest) { //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Invalid comparison between Unknown and I4 //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Expected I4, but got Unknown //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04ae: Expected I4, but got Unknown //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_045d: Expected I4, but got Unknown //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Expected I4, but got Unknown GameObject val = orig.Invoke(self, directorSpawnRequest); if (!NetworkServer.active) { return val; } if (!Run.instance.IsExpansionEnabled(routesExpansion)) { return val; } if ((Object)(object)val == (Object)null) { return val; } if ((Object)(object)directorSpawnRequest.spawnCard == (Object)null || ((Object)directorSpawnRequest.spawnCard).name == null) { return val; } string name = ((Object)directorSpawnRequest.spawnCard).name; if (!name.Contains("Portal")) { return val; } SceneDef sceneDefForCurrentScene = SceneCatalog.GetSceneDefForCurrentScene(); Log.Info("OnVanillaPortalSpawn: Director spawned " + name + " portal"); RoutePortalManager component = val.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { Log.Error("OnVanillaPortalSpawn: RoutePortalManager is missing for portal " + name); return val; } switch (name) { case "iscRoutePortal": return val; case "iscColossusPortal": { component.NetworkdestinationSceneIndex = SceneHelper.GetGreenPortalSceneIndex(); component.NetworkisOval = true; component.NetworkisUsingModifiers = Stage.instance.sceneDef.stageOrder != 3; RouteMap.RouteNode routeNode2 = null; if ((Object)(object)sceneDefForCurrentScene != (Object)null && (int)sceneDefForCurrentScene.sceneType == 2) { Log.Info("OnVanillaPortalSpawn:Spawned colossus portal from intermission scene"); routeNode2 = StageModifierDirector.instance.routeMap.CreateColossusNode(StageModifierDirector.instance.currentNode, currentLayer: true); } else { Log.Info("OnVanillaPortalSpawn:Spawned colossus portal from default scene"); routeNode2 = StageModifierDirector.instance.routeMap.CreateColossusNode(StageModifierDirector.instance.currentNode); } if (routeNode2 != null) { component.routeNode = routeNode2; } Log.Info("OnVanillaPortalSpawn: Succesfuly set node to colossus"); break; } case "iscGoldshoresPortal": { component.NetworkisOval = true; Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name != "goldshores") { Log.Info("OnVanillaPortalSpawn: Spawned portal leading to goldshores"); component.NetworkisUsingModifiers = false; component.routeNode = StageModifierDirector.instance.GetAvailableNodes()[0]; } else { Log.Info("OnVanillaPortalSpawn: Spawned portal leading from goldshores"); component.NetworkdestinationSceneIndex = (int)Run.instance.nextStageScene.sceneDefIndex; component.NetworkisUsingModifiers = true; component.NetworkisUsingSceneExit = false; component.routeNode = StageModifierDirector.instance.currentNode; } break; } case "iscShopPortal": { component.NetworkisOval = true; SceneExitController component2 = val.GetComponent(); if (Object.op_Implicit((Object)(object)component2) && !component2.useRunNextStageScene) { Log.Info("OnVanillaPortalSpawn: Spawned portal leading to shop"); List availableNodes = StageModifierDirector.instance.GetAvailableNodes(); if (availableNodes == null || availableNodes.Count == 0) { Log.Info("node zero"); component.routeNode = StageModifierDirector.instance.routeMap.root; } else { component.routeNode = StageModifierDirector.instance.GetAvailableNodes()[0]; } component.NetworkisUsingSceneExit = false; } break; } default: if (!(name == "iscHardwareProgPortal_Haunt")) { if (name == "iscDestinationPortal") { component.NetworkisOval = true; component.NetworkisUsingModifiers = true; component.routeNode = StageModifierDirector.instance.GetAvailableNodes()[0]; component.NetworkdestinationSceneIndex = (int)Run.instance.nextStageScene.sceneDefIndex; } else { ((Behaviour)component).enabled = false; Log.Info("Else for " + name); component.NetworkisOval = false; component.NetworkisUsingModifiers = false; component.routeNode = StageModifierDirector.instance.currentNode; component.NetworkdestinationSceneIndex = (int)Run.instance.nextStageScene.sceneDefIndex; } break; } goto case "iscHardwareProgPortal"; case "iscHardwareProgPortal": { component.NetworkisOval = false; if (Stage.instance.sceneDef.stageOrder != 3) { if (name == "iscHardwareProgPortal_Haunt") { Log.Info("OnVanillaPortalSpawn: Spawned portal leading to Solus Wing"); } else { Log.Error("OnVanillaPortalSpawn: For some reason it's incorrect spawn card"); } component.NetworkisUsingModifiers = false; } else { component.NetworkdestinationSceneIndex = (int)SceneCatalog.FindSceneIndex("conduitcanyon"); component.NetworkisUsingModifiers = true; } RouteMap.RouteNode routeNode = StageModifierDirector.instance.routeMap.CreateHardwareNode(StageModifierDirector.instance.currentNode); component.routeNode = routeNode; break; } } if (component.isUsingModifiers) { StageModifierDirector.instance.GetNextStageModifiers(val); } ((Behaviour)component).enabled = true; return val; } private static void TeleporterInteraction_onTeleporterChargedGlobal(TeleporterInteraction obj) { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected I4, but got Unknown GameObject gameObject = ((Component)obj).gameObject; Log.Info($"for teleporter Director placed obj {gameObject}"); if (!((Object)(object)gameObject == (Object)null) && ((Object)gameObject).name.Contains("LunarTeleporter")) { RoutePortalManager component = gameObject.GetComponent(); if ((Object)(object)component == (Object)null) { Log.Error($"Teleporter {gameObject} has no route portal manager"); return; } component.NetworkisOval = false; component.isObjectiveNode = true; component.NetworkisUsingModifiers = Run.instance.loopClearCount >= 0; component.routeNode = StageModifierDirector.instance.currentNode; component.NetworkdestinationSceneIndex = (int)SceneCatalog.nameToIndex["moon2"]; component.NetworkisUsingSceneExit = false; StageModifierDirector.instance.GetNextStageModifiers(gameObject); } } public static void SpawnRoutePortals(Vector3 position) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Expected O, but got Unknown //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Expected O, but got Unknown //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Expected O, but got Unknown //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) if (!Run.instance.IsExpansionEnabled(routesExpansion)) { Log.Error("SpawnRoutePortals: Method spawning route portals was called, but expansion is disabled"); return; } WeightedSelection nextStagesScenesList = SceneHelper.GetNextStagesScenesList(); if (nextStagesScenesList.Count == 0) { Log.Error("SpawnRoutePortals: No stages available next"); return; } List availableNodes = StageModifierDirector.instance.GetAvailableNodes(); WeightedSelection val = new WeightedSelection(8); for (int i = 0; i < nextStagesScenesList.Count; i++) { ChoiceInfo choice = nextStagesScenesList.GetChoice(i); val.AddChoice(choice.value, choice.weight); } for (int j = 0; j < availableNodes.Count; j++) { Log.Info(string.Format("{0}: Nodes count - {1}:{2}", "SpawnRoutePortals", availableNodes.Count, j)); if (val.Count == 0) { Log.Error("SpawnRoutePortals: No stages available next"); break; } RouteMap.RouteNode routeNode = availableNodes[j]; SceneDef val2 = new SceneDef(); if (RiskOfRoutes.useUniqueDestinations.Value) { int num = val.EvaluateToChoiceIndex(Run.instance.stageRng.nextNormalizedFloat); val2 = val.GetChoice(num).value; val.RemoveChoice(num); } else { int num2 = val.EvaluateToChoiceIndex(Run.instance.stageRng.nextNormalizedFloat); val2 = val.GetChoice(num2).value; } SpawnCard val3 = (SpawnCard)(object)AssetManager.CreateRoutePortalSpawnCard(val2); if ((Object)(object)val3 == (Object)null) { Log.Error("SpawnRoutePortals: RoutePortal spawncard is null"); break; } DirectorSpawnRequest val4 = new DirectorSpawnRequest(val3, new DirectorPlacementRule { minDistance = 10f, maxDistance = 40f, placementMode = (PlacementMode)1, position = position }, Run.instance.stageRng); GameObject val5 = DirectorCore.instance.TrySpawnObject(val4); if ((Object)(object)val5 == (Object)null) { break; } RoutePortalManager component = val5.GetComponent(); ((Behaviour)component).enabled = true; if (routeNode == null) { Log.Warning("SpawnRoutePortals: Child route node is null, skipping"); continue; } component.routeNode = routeNode; component.NetworkportalType = (int)routeNode.portalType; Log.Info($"MG route node:{component.routeNode.portalType}:{component.routeNode.x},{component.routeNode.y}"); component.NetworkisUsingModifiers = true; component.NetworkisUsingSceneExit = true; StageModifierDirector.instance.GetNextStageModifiers(val5); Vector3 val6 = position - val5.transform.position; val6.y = 0f; if (val6 != Vector3.zero) { val5.transform.rotation = Quaternion.LookRotation(val6); } Vector3 right = val5.transform.right; StageModifierDirector.instance.AddRoutePortalInstance(val5); } } private static void TeleporterEventSpawnRoutePortals(TeleporterInteraction interaction) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) if (Run.instance.IsExpansionEnabled(routesExpansion)) { SpawnRoutePortals(((Component)interaction).transform.position); } } } public class SoulCostController { [CompilerGenerated] private static class <>O { public static hook_BuildCostStringStyled <0>__AppendSoulPrice; public static StatHookEventHandler <1>__AppendHPBarCurse; } public static void Initialize() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown object obj = <>O.<0>__AppendSoulPrice; if (obj == null) { hook_BuildCostStringStyled val = AppendSoulPrice; <>O.<0>__AppendSoulPrice = val; obj = (object)val; } CostTypeDef.BuildCostStringStyled += (hook_BuildCostStringStyled)obj; object obj2 = <>O.<1>__AppendHPBarCurse; if (obj2 == null) { StatHookEventHandler val2 = AppendHPBarCurse; <>O.<1>__AppendHPBarCurse = val2; obj2 = (object)val2; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj2; } private static void AppendSoulPrice(orig_BuildCostStringStyled orig, CostTypeDef self, int cost, StringBuilder stringBuilder, bool forWorldDisplay, bool includeColor) { orig.Invoke(self, cost, stringBuilder, forWorldDisplay, includeColor); if (Object.op_Implicit((Object)(object)StageModifierDirector.instance) && StageModifierDirector.instance.IsModifierActive("SoulCost")) { int cursePerStack = StageModifierDirector.instance.cursePerStack; if (self == CostTypeCatalog.GetCostTypeDef((CostTypeIndex)1)) { stringBuilder.AppendLine(string.Format(" + {0}% {1}", 3 + (cursePerStack - 1), Language.GetString("SOUL"))); } } } private static void AppendHPBarCurse(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)StageModifierDirector.instance) && StageModifierDirector.instance.IsModifierActive("SoulCost") && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountPermanent = sender.inventory.GetItemCountPermanent(ModItemsManager.soulCostCurse); if (itemCountPermanent > 0) { int cursePerStack = StageModifierDirector.instance.cursePerStack; float num = 0.03f + (float)(cursePerStack - 1) * Mathf.Max((float)(RiskOfRoutes.soulCostStackPercent.Value / 100), 0.25f); float num2 = (float)itemCountPermanent * num; float num3 = Mathf.Min(0.99f, num2); float num4 = 1f - num3; args.baseCurseAdd += 1f / num4 - 1f; } } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("burboni4.RiskOfRoutes", "RiskOfRoutes", "1.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class RiskOfRoutes : BaseUnityPlugin { public enum MapOrientation { Vertical, Horizontal } public enum ItemPoolOptions { Default, VanillaEntire, Entire, None } public enum CleanestHUDOptions { BottomCenter, BottomRight } public const string PluginGUID = "burboni4.RiskOfRoutes"; public const string PluginAuthor = "burboni4"; public const string PluginName = "RiskOfRoutes"; public const string PluginVersion = "1.1.0"; public static ConfigEntry routeMapWidth; public static ConfigEntry showIntermissionNodes; public static ConfigEntry tier1Artifacts; public static ConfigEntry tier2Artifacts; public static ConfigEntry tier3Artifacts; public static ConfigEntry allowMysteryArtifact; public static ConfigEntry allowChaosArtifact; public static ConfigEntry allowCommandArtifact; public static ConfigEntry allowDeathArtifact; public static ConfigEntry allowDelusionArtifact; public static ConfigEntry allowDevotionArtifact; public static ConfigEntry allowDissonanceArtifact; public static ConfigEntry allowEnigmaArtifact; public static ConfigEntry allowEvolutionArtifact; public static ConfigEntry allowFrailtyArtifact; public static ConfigEntry allowGlassArtifact; public static ConfigEntry allowHonorArtifact; public static ConfigEntry allowKinArtifact; public static ConfigEntry allowMetamorphosisArtifact; public static ConfigEntry allowRebirthArtifact; public static ConfigEntry allowSacrificeArtifact; public static ConfigEntry allowSoulArtifact; public static ConfigEntry allowSpiteArtifact; public static ConfigEntry allowSwarmsArtifact; public static ConfigEntry allowVengeanceArtifact; public static ConfigEntry soulCostCurseShared; public static ConfigEntry droneStackPercent; public static ConfigEntry doppelStackTime; public static ConfigEntry elitesStackPercent; public static ConfigEntry lunarStackPercent; public static ConfigEntry voidStackPercent; public static ConfigEntry soulCostStackPercent; public static ConfigEntry tier2ElitesStackPercent; public static ConfigEntry printerItemPool; public static ConfigEntry enemyItemPool; public static ConfigEntry canAppearWithAIBlacklisted; public static ConfigEntry enemyItemsModifierCanStack; public static ConfigEntry enemyItemsAllowBoss; public static ConfigEntry enemyItemsAllowVoid; public static ConfigEntry commonDefaultStack; public static ConfigEntry uncommonDefaultStack; public static ConfigEntry legendaryDefaultStack; public static ConfigEntry bossDefaultStack; public static ConfigEntry commonExtraRange; public static ConfigEntry uncommonExtraRange; public static ConfigEntry legendaryExtraRange; public static ConfigEntry bossExtraRange; public static ConfigEntry chanceForExtra; public static ConfigEntry lunarItemPool; public static ConfigEntry tier1LunarItems; public static ConfigEntry tier2LunarItems; public static ConfigEntry tier3LunarItems; public static ConfigEntry lunarTurnToPearl; public static ConfigEntry allowDebug; public static ConfigEntry enableFalseSonReward; public static GameObject networkedInventoryPrefab; internal static GameObject CentralNetworkObject; private static GameObject _centralNetworkObjectSpawned; public static HashSet bannedModifierDefs = new HashSet(); public static HashSet bannedArtifactDefs = new HashSet(); public static HashSet bannedPrinterItems = new HashSet(); public static HashSet bannedEnemyItems = new HashSet(); public static HashSet bannedLunarDefs = new HashSet(); public static HashSet moddedArtifactsInfo = new HashSet(); public static HashSet moddedLunarsInfo = new HashSet(); public static ConfigEntry bannedModifierConfig; public static ConfigEntry bannedArtifactConfig; public static ConfigEntry bannedPrinterConfig; public static ConfigEntry bannedEnemyConfig; public static ConfigEntry bannedLunarConfig; public static ConfigEntry moddedArtifactsConfig; public static ConfigEntry moddedLunarsConfig; public static ConfigEntry useUniqueDestinations { get; set; } public static ConfigEntry teleporterUseRandomMods { get; set; } public static ConfigEntry modifiersCanBeBanned { get; set; } public static ConfigEntry punishmentTimeMinutes { get; set; } public static ConfigEntry negativeStackPunishment { get; set; } public static ConfigEntry cleanestHudCompat { get; set; } public static ConfigEntry usePortalMaterial { get; set; } public static ConfigEntry usePositiveNegativeColors { get; set; } public static ConfigEntry usePortalTypeColors { get; set; } public static ConfigEntry showPortalDestination { get; set; } public static ConfigEntry routeMapSize { get; set; } public static ConfigEntry routeMapIconSize { get; set; } public static ConfigEntry routePanelShowsOnlyNames { get; set; } public static ConfigEntry punishmentBarOrientation { get; set; } public static ConfigEntry cleanestHudOption { get; set; } public static ConfigEntry hologramsAreColored { get; set; } public static ConfigEntry punishmentBarColor { get; set; } public void Awake() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown BindConfig(); Log.Init(((BaseUnityPlugin)this).Logger); GameObject val = new GameObject("tmpGo"); val.AddComponent(); CentralNetworkObject = PrefabAPI.InstantiateClone(val, "somethingUnique", false); CentralNetworkObject.AddComponent(); CentralNetworkObject.AddComponent(); PrefabAPI.RegisterNetworkPrefab(CentralNetworkObject); networkedInventoryPrefab = PrefabAPI.InstantiateClone(val, "monsterInventory", false); networkedInventoryPrefab.AddComponent(); networkedInventoryPrefab.AddComponent(); networkedInventoryPrefab.AddComponent(); PrefabAPI.RegisterNetworkPrefab(networkedInventoryPrefab); Object.Destroy((Object)(object)val); string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "riskofroutes"); AssetBundle bundle = AssetBundle.LoadFromFile(text); AssetManager.Initialize(bundle); ModUIManager.Initialize(); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate { if (CleanestHudCompat.enabled) { Log.Info("Cleanest hud enabled"); CleanestHudCompat.Hooks(); } else { Log.Info("NOt enabled"); } StageModifierCatalog.Init(bundle); }); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(PopulateLists)); MysteryArtifact.InitializeArtifact(); RoutesExpansion.InitializeExpansion(CentralNetworkObject); SoulCostController.Initialize(); Sprite modIcon = AssetManager.modIcon; ModSettingsManager.SetModIcon(modIcon); ModSettingsManager.SetModDescription("Risk Of Routes. Mod that adds routing system and run map to the game."); ModItemsManager.InitializeItems(); } private void PopulateLists() { //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Invalid comparison between Unknown and I4 //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Invalid comparison between Unknown and I4 //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Invalid comparison between Unknown and I4 //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) List list = (from s in bannedModifierConfig.Value.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries) select s.Trim()).ToList(); foreach (string item in list) { Log.Info("\t" + item); if (StageModifierCatalog.FindModifier(item) != null) { bannedModifierDefs.Add(item); } } List list2 = (from s in bannedArtifactConfig.Value.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries) select s.Trim()).ToList(); foreach (string item2 in list2) { Log.Info("\t" + item2); if ((Object)(object)ArtifactCatalog.FindArtifactDef(item2) != (Object)null) { bannedArtifactDefs.Add(item2); } } List list3 = (from s in bannedPrinterConfig.Value.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries) select s.Trim()).ToList(); foreach (string item3 in list3) { Log.Info("\t" + item3); if ((int)ItemCatalog.FindItemIndex(item3) != -1) { bannedPrinterItems.Add(item3); } else { Log.Warning("Couldnt find the def by " + item3); } } List list4 = (from s in bannedEnemyConfig.Value.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries) select s.Trim()).ToList(); foreach (string item4 in list4) { if ((int)ItemCatalog.FindItemIndex(item4) != -1) { bannedEnemyItems.Add(item4); } } List list5 = (from s in bannedLunarConfig.Value.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries) select s.Trim()).ToList(); foreach (string item5 in list5) { if ((int)ItemCatalog.FindItemIndex(item5) != -1) { bannedLunarDefs.Add(item5); } } Log.Info("Content manager"); Enumerator enumerator6 = ContentManager.allLoadedContentPacks.GetEnumerator(); try { while (enumerator6.MoveNext()) { ReadOnlyContentPack current6 = enumerator6.Current; Log.Info("\t" + ((ReadOnlyContentPack)(ref current6)).identifier); } } finally { ((IDisposable)enumerator6/*cast due to .constrained prefix*/).Dispose(); } List list6 = (from s in moddedArtifactsConfig.Value.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries) select s.Trim()).ToList(); foreach (string item6 in list6) { string[] array = item6.Split('='); if (array.Length >= 3) { moddedArtifactsInfo.Add(new DefInfo { name = array[0], isNegative = (array[1] == "-"), tier = (ModifierTier)int.Parse(array[2]) }); } } List list7 = (from s in moddedLunarsConfig.Value.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries) select s.Trim()).ToList(); foreach (string item7 in list7) { string[] array2 = item7.Split('='); if (array2.Length >= 3) { moddedLunarsInfo.Add(new DefInfo { name = array2[0], isNegative = (array2[1] == "-"), tier = (ModifierTier)int.Parse(array2[2]) }); } } } private void BindConfig() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Expected O, but got Unknown //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Expected O, but got Unknown //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Expected O, but got Unknown //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Expected O, but got Unknown //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Expected O, but got Unknown //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Expected O, but got Unknown //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Expected O, but got Unknown //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Expected O, but got Unknown //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Expected O, but got Unknown //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Expected O, but got Unknown //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Expected O, but got Unknown //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Expected O, but got Unknown //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Expected O, but got Unknown //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Expected O, but got Unknown //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Expected O, but got Unknown //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Expected O, but got Unknown //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Expected O, but got Unknown //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Expected O, but got Unknown //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Expected O, but got Unknown //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Expected O, but got Unknown //IL_0488: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Expected O, but got Unknown //IL_04b9: Unknown result type (might be due to invalid IL or missing references) //IL_04c3: Expected O, but got Unknown //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Expected O, but got Unknown //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_0523: Expected O, but got Unknown //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Expected O, but got Unknown //IL_0544: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Expected O, but got Unknown //IL_056a: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Expected O, but got Unknown //IL_056f: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Expected O, but got Unknown //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_059f: Expected O, but got Unknown //IL_059a: Unknown result type (might be due to invalid IL or missing references) //IL_05a4: Expected O, but got Unknown //IL_05c0: Unknown result type (might be due to invalid IL or missing references) //IL_05ca: Expected O, but got Unknown //IL_05c5: Unknown result type (might be due to invalid IL or missing references) //IL_05cf: Expected O, but got Unknown //IL_05eb: Unknown result type (might be due to invalid IL or missing references) //IL_05f5: Expected O, but got Unknown //IL_05f0: Unknown result type (might be due to invalid IL or missing references) //IL_05fa: Expected O, but got Unknown //IL_0616: Unknown result type (might be due to invalid IL or missing references) //IL_0620: Expected O, but got Unknown //IL_061b: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Expected O, but got Unknown //IL_0641: Unknown result type (might be due to invalid IL or missing references) //IL_064b: Expected O, but got Unknown //IL_0646: Unknown result type (might be due to invalid IL or missing references) //IL_0650: Expected O, but got Unknown //IL_066c: Unknown result type (might be due to invalid IL or missing references) //IL_0676: Expected O, but got Unknown //IL_0671: Unknown result type (might be due to invalid IL or missing references) //IL_067b: Expected O, but got Unknown //IL_0697: Unknown result type (might be due to invalid IL or missing references) //IL_06a1: Expected O, but got Unknown //IL_069c: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Expected O, but got Unknown //IL_06c2: Unknown result type (might be due to invalid IL or missing references) //IL_06cc: Expected O, but got Unknown //IL_06c7: Unknown result type (might be due to invalid IL or missing references) //IL_06d1: Expected O, but got Unknown //IL_06ed: Unknown result type (might be due to invalid IL or missing references) //IL_06f7: Expected O, but got Unknown //IL_06f2: Unknown result type (might be due to invalid IL or missing references) //IL_06fc: Expected O, but got Unknown //IL_0722: Unknown result type (might be due to invalid IL or missing references) //IL_072c: Expected O, but got Unknown //IL_0752: Unknown result type (might be due to invalid IL or missing references) //IL_075c: Expected O, but got Unknown //IL_0782: Unknown result type (might be due to invalid IL or missing references) //IL_078c: Expected O, but got Unknown //IL_07b2: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Expected O, but got Unknown //IL_07e2: Unknown result type (might be due to invalid IL or missing references) //IL_07ec: Expected O, but got Unknown //IL_0812: Unknown result type (might be due to invalid IL or missing references) //IL_081c: Expected O, but got Unknown //IL_0842: Unknown result type (might be due to invalid IL or missing references) //IL_084c: Expected O, but got Unknown //IL_0872: Unknown result type (might be due to invalid IL or missing references) //IL_087c: Expected O, but got Unknown //IL_08a2: Unknown result type (might be due to invalid IL or missing references) //IL_08ac: Expected O, but got Unknown //IL_08d2: Unknown result type (might be due to invalid IL or missing references) //IL_08dc: Expected O, but got Unknown //IL_08f8: Unknown result type (might be due to invalid IL or missing references) //IL_0902: Expected O, but got Unknown //IL_08fd: Unknown result type (might be due to invalid IL or missing references) //IL_0907: Expected O, but got Unknown //IL_0923: Unknown result type (might be due to invalid IL or missing references) //IL_092d: Expected O, but got Unknown //IL_0928: Unknown result type (might be due to invalid IL or missing references) //IL_0932: Expected O, but got Unknown //IL_0958: Unknown result type (might be due to invalid IL or missing references) //IL_0962: Expected O, but got Unknown //IL_0988: Unknown result type (might be due to invalid IL or missing references) //IL_0992: Expected O, but got Unknown //IL_0a94: Unknown result type (might be due to invalid IL or missing references) //IL_0a9e: Expected O, but got Unknown //IL_0aa4: Unknown result type (might be due to invalid IL or missing references) //IL_0aae: Expected O, but got Unknown //IL_0ab4: Unknown result type (might be due to invalid IL or missing references) //IL_0abe: Expected O, but got Unknown //IL_0ac4: Unknown result type (might be due to invalid IL or missing references) //IL_0ace: Expected O, but got Unknown //IL_0ad4: Unknown result type (might be due to invalid IL or missing references) //IL_0ade: Expected O, but got Unknown //IL_0ae4: Unknown result type (might be due to invalid IL or missing references) //IL_0aee: Expected O, but got Unknown //IL_0af4: Unknown result type (might be due to invalid IL or missing references) //IL_0afe: Expected O, but got Unknown useUniqueDestinations = ((BaseUnityPlugin)this).Config.Bind("General", "Unique Destinations", true, "Makes each route portal have unique scene as destination, otherwise they might repeat."); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(useUniqueDestinations)); teleporterUseRandomMods = ((BaseUnityPlugin)this).Config.Bind("General", "Teleporter Use Random mods", true, "Makes the teleporter use random modifiers of spawned route portals after interacting with it, set false if you want it to not have any stage modifiers."); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(teleporterUseRandomMods)); modifiersCanBeBanned = ((BaseUnityPlugin)this).Config.Bind("General", "Modifiers Can Be Banned", true, "Prevents some of the stage modifiers appearing on the next stage, if they were active on the current stage."); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(modifiersCanBeBanned)); routeMapWidth = ((BaseUnityPlugin)this).Config.Bind("General", "Route Map Width", 4, "Width of the map created at the start of each loop."); ModSettingsManager.AddOption((BaseOption)new IntSliderOption(routeMapWidth, new IntSliderConfig { min = 3, max = 5 })); negativeStackPunishment = ((BaseUnityPlugin)this).Config.Bind("General", "Time Spent Punishment", true, "Adds one negative stack per punishment. Punishment is given by spending too much time on current stage, by default it's 8 minutes."); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(negativeStackPunishment)); punishmentTimeMinutes = ((BaseUnityPlugin)this).Config.Bind("General", "Punishment Time", 8, "Adds one negative stack per punishment, punishment is given by spending too much time on current stage, by default it's 8 minutes."); ModSettingsManager.AddOption((BaseOption)new IntSliderOption(punishmentTimeMinutes, new IntSliderConfig { min = 1, max = 20 })); usePositiveNegativeColors = ((BaseUnityPlugin)this).Config.Bind("Visual", "Use Positive/Negative colors", true, "Makes bubbles on portals red and green, otherwise they are just blue."); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(usePositiveNegativeColors)); usePortalTypeColors = ((BaseUnityPlugin)this).Config.Bind("Visual", "Portal Color Type", true, "Portal color is changed according to its node type, otherwise they are just blue."); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(usePortalTypeColors)); routeMapSize = ((BaseUnityPlugin)this).Config.Bind("Visual", "Route Map Panel Size", 95, "Size of Route Map panel in percents."); ModSettingsManager.AddOption((BaseOption)new IntSliderOption(routeMapSize)); routeMapIconSize = ((BaseUnityPlugin)this).Config.Bind("Visual", "Route Map Icons Size", 100, "Size of icons on Route Map panel."); ModSettingsManager.AddOption((BaseOption)new IntSliderOption(routeMapIconSize)); showIntermissionNodes = ((BaseUnityPlugin)this).Config.Bind("Visual", "Show Intermission Nodes", true, "Shows nodes for intermission stages."); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(showIntermissionNodes)); routePanelShowsOnlyNames = ((BaseUnityPlugin)this).Config.Bind("Visual", "Route Panel Shows Only Names", false, "Makes route portal panel show only names of modifiers. Use if descriptions seem too cluttered."); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(routePanelShowsOnlyNames)); punishmentBarOrientation = ((BaseUnityPlugin)this).Config.Bind("Visual", "Punishment Bar Orientation", MapOrientation.Vertical, "Orientation of punishment bar."); ModSettingsManager.AddOption((BaseOption)new ChoiceOption((ConfigEntryBase)(object)punishmentBarOrientation)); punishmentBarColor = ((BaseUnityPlugin)this).Config.Bind("Visual", "Punishment Bar Color", Color.red, "Color of punishment bar."); ModSettingsManager.AddOption((BaseOption)new ColorOption(punishmentBarColor)); hologramsAreColored = ((BaseUnityPlugin)this).Config.Bind("Visual", "Holograms Are Colored", true, "Makes teleporter holograms colored according to active modifiers, otherwise they are just blue."); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(hologramsAreColored)); cleanestHudCompat = ((BaseUnityPlugin)this).Config.Bind("Visual", "Cleanest HUD Compat", true, "Disable if you encounter any bugs with CleanestHUD mod"); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(cleanestHudCompat)); cleanestHudOption = ((BaseUnityPlugin)this).Config.Bind("Visual", "CleanestHUD Position", CleanestHUDOptions.BottomCenter, "Position of route map with CleanestHUD mod."); ModSettingsManager.AddOption((BaseOption)new ChoiceOption((ConfigEntryBase)(object)cleanestHudOption)); usePortalMaterial = ((BaseUnityPlugin)this).Config.Bind("Visual", "WIP Use Scene Material", false, "[WIP] Sets destination scene portrait as a portal texture."); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(usePortalMaterial)); droneStackPercent = ((BaseUnityPlugin)this).Config.Bind("Modifier Options", "Drone Increase", 33, "Percent per stack of initial scene director budget, used only to spawn additional drones. By default it's 33%."); ModSettingsManager.AddOption((BaseOption)new IntFieldOption(droneStackPercent)); elitesStackPercent = ((BaseUnityPlugin)this).Config.Bind("Modifier Options", "Elite Increase", 33, "Percent of elite discount for director. By default it's 33%."); ModSettingsManager.AddOption((BaseOption)new IntFieldOption(elitesStackPercent)); doppelStackTime = ((BaseUnityPlugin)this).Config.Bind("Modifier Options", "Doppelganger Decrease", 30, "Cooldown reduction with one stack in seconds. By default it's 30s."); ModSettingsManager.AddOption((BaseOption)new IntFieldOption(doppelStackTime)); lunarStackPercent = ((BaseUnityPlugin)this).Config.Bind("Modifier Options", "Lunar Enemies Discount", 15, "Discount on lunar enemies in percents for more than one stack. By default it's 15%."); ModSettingsManager.AddOption((BaseOption)new IntFieldOption(lunarStackPercent)); voidStackPercent = ((BaseUnityPlugin)this).Config.Bind("Modifier Options", "Void Enemies Discount", 15, "Discount on void enemies in percents for more than one stack. By default it's 15%."); ModSettingsManager.AddOption((BaseOption)new IntFieldOption(voidStackPercent)); tier2ElitesStackPercent = ((BaseUnityPlugin)this).Config.Bind("Modifier Options", "Post-Loop Elites Increase", 15, "Discount on tier2 elites in percents for more than one stack. By default it's 15%."); ModSettingsManager.AddOption((BaseOption)new IntFieldOption(tier2ElitesStackPercent)); soulCostStackPercent = ((BaseUnityPlugin)this).Config.Bind("Modifier Options", "Soul Cost Increase", 2, "Percents added to hp curse for stack. By default it's 2%."); ModSettingsManager.AddOption((BaseOption)new IntFieldOption(soulCostStackPercent)); soulCostCurseShared = ((BaseUnityPlugin)this).Config.Bind("Modifier Options", "Soul Cost Curse Shared", false, "Soul Cost curse is shared between all players."); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(soulCostCurseShared)); ModSettingsManager.AddOption((BaseOption)new GenericButtonOption("Toggle White Printer Items", "Printer Items", "Use it if you want to ban items from appearing in printer item modifier, by default all registered items are used", "Open Menu", (UnityAction)delegate { OpenPopoutMenu("whitePrinterItems", "Printer Items", "Toggle White Items"); })); ModSettingsManager.AddOption((BaseOption)new GenericButtonOption("Toggle Green Printer Items", "Printer Items", "Use it if you want to ban items from appearing in printer item modifier, by default all registered items are used", "Open Menu", (UnityAction)delegate { OpenPopoutMenu("greenPrinterItems", "Printer Items", "Toggle Green Items"); })); ModSettingsManager.AddOption((BaseOption)new GenericButtonOption("Toggle Stage Modifiers", "StageModifier Toggle", "Use it if you want to ban certain stage modifiers from appearing", "Open Menu", (UnityAction)delegate { OpenPopoutMenu("stageModifiersGeneral", "Stage Modifiers", "Toggle Stage Modifiers"); })); ModSettingsManager.AddOption((BaseOption)new GenericButtonOption("Toggle Artifact Modifiers", "Artifact Toggle", "Configure what vanilla artifacts are available as ArtifactModifier", "Open Menu", (UnityAction)delegate { OpenPopoutMenu("vanillaArtifacts", "Vanilla Artifacts", "Toggle Artifacts"); })); ModSettingsManager.AddOption((BaseOption)new GenericButtonOption("Configure Modded Artifacts", "Artifact Toggle", "Configure what modded artifacts are available as ArtifactModifier. You can also choose their tier and if they are positive or negative. Positive artifact modifier appears on the 'Rare' node", "Open Menu", (UnityAction)delegate { OpenPopoutMenu("moddedArtifacts", "Modded artifacts", "Configure their type, tier and pos/negative"); })); ModSettingsManager.AddOption((BaseOption)new GenericButtonOption("Toggle White Enemy Items", "Enemy Items", "Configure stuff in here", "Open menu", (UnityAction)delegate { OpenPopoutMenu("enemyWhiteItems", "Enemy White Items", "Toggle enemy white items"); })); ModSettingsManager.AddOption((BaseOption)new GenericButtonOption("Toggle Green Enemy Items", "Enemy Items", "Configure stuff in here", "Open menu", (UnityAction)delegate { OpenPopoutMenu("enemyGreenItems", "Enemy Green Items", "Toggle enemy green items"); })); ModSettingsManager.AddOption((BaseOption)new GenericButtonOption("Toggle Red Enemy Items", "Enemy Items", "Configure stuff in here", "Open menu", (UnityAction)delegate { OpenPopoutMenu("enemyRedItems", "Enemy Red Items", "Toggle enemy red items"); })); ModSettingsManager.AddOption((BaseOption)new GenericButtonOption("Toggle Yellow Items", "Enemy Items", "Configure stuff in here", "Open Menu", (UnityAction)delegate { OpenPopoutMenu("enemyYellowItems", "Enemy Yellow Items", "Toggle enemy yellow items"); })); ModSettingsManager.AddOption((BaseOption)new GenericButtonOption("Toggle Void Items", "Enemy Items", "Configure stuff in here", "Open Menu", (UnityAction)delegate { OpenPopoutMenu("enemyVoidItems", "Enemy Void Items", "Toggle enemy void items"); })); ModSettingsManager.AddOption((BaseOption)new GenericButtonOption("Toggle AIBlacklisted Items", "Enemy Items", "Configure stuff in here", "Open Menu", (UnityAction)delegate { OpenPopoutMenu("enemyBlacklistedItems", "Enemy AIBlacklisted", "Toggle AIBlacklisted"); })); commonDefaultStack = ((BaseUnityPlugin)this).Config.Bind("Enemy Items", "Common Default Stack", 5, "Default amount per stack."); ModSettingsManager.AddOption((BaseOption)new IntFieldOption(commonDefaultStack)); uncommonDefaultStack = ((BaseUnityPlugin)this).Config.Bind("Enemy Items", "Uncommon Default Stack", 3, "Default amount per stack."); ModSettingsManager.AddOption((BaseOption)new IntFieldOption(uncommonDefaultStack)); legendaryDefaultStack = ((BaseUnityPlugin)this).Config.Bind("Enemy Items", "Legendary Default Stack", 1, "Default amount per stack."); ModSettingsManager.AddOption((BaseOption)new IntFieldOption(legendaryDefaultStack)); bossDefaultStack = ((BaseUnityPlugin)this).Config.Bind("Enemy Items", "Boss Default Stack", 1, "Default amount per stack."); ModSettingsManager.AddOption((BaseOption)new IntFieldOption(bossDefaultStack)); chanceForExtra = ((BaseUnityPlugin)this).Config.Bind("Enemy Items", "Chance For Extra", 0, "Chance for enemy items to have extra stacks."); ModSettingsManager.AddOption((BaseOption)new IntSliderOption(chanceForExtra)); commonExtraRange = ((BaseUnityPlugin)this).Config.Bind("Enemy Items", "Common Extra Range", 3, "Amount of item stacks added as extra."); ModSettingsManager.AddOption((BaseOption)new IntFieldOption(commonExtraRange)); uncommonExtraRange = ((BaseUnityPlugin)this).Config.Bind("Enemy Items", "Uncommon Extra Range", 2, "Amount of item stacks added as extra."); ModSettingsManager.AddOption((BaseOption)new IntFieldOption(uncommonExtraRange)); legendaryExtraRange = ((BaseUnityPlugin)this).Config.Bind("Enemy Items", "Legendary Extra Range", 1, "Amount of item stacks added as extra."); ModSettingsManager.AddOption((BaseOption)new IntFieldOption(legendaryExtraRange)); bossExtraRange = ((BaseUnityPlugin)this).Config.Bind("Enemy Items", "Boss Extra Range", 1, "Amount of item stacks added as extra."); ModSettingsManager.AddOption((BaseOption)new IntFieldOption(bossExtraRange)); lunarTurnToPearl = ((BaseUnityPlugin)this).Config.Bind("Lunar Items", "Purify At The End", true, "By default the lunar item given by the modifier is turned into a pearl at the end of the stage."); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(lunarTurnToPearl)); ModSettingsManager.AddOption((BaseOption)new GenericButtonOption("Toggle Lunar Items", "Lunar Items", "Configure what vanilla lunar items are available as modifier", "Open Menu", (UnityAction)delegate { OpenPopoutMenu("vanillaLunar", "Vanilla Artifacts", "Use to ban"); })); ModSettingsManager.AddOption((BaseOption)new GenericButtonOption("Configure Modded Lunars", "Lunar Items", "Configure what modded lunar items are available as ArtifactModifier. You can also choose their tier.", "Open Menu", (UnityAction)delegate { OpenPopoutMenu("moddedLunar", "Modded artifacts", "Configure their type, tier and pos/negative"); })); allowDebug = ((BaseUnityPlugin)this).Config.Bind("Debugging", "Enable debugging", false, "For debugging purposes."); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(allowDebug)); enableFalseSonReward = ((BaseUnityPlugin)this).Config.Bind("Debugging", "Enable reward", false, "WIP False Son now drops new item. False Son's Heart applies Aurelinite Modifier on every stage."); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(enableFalseSonReward)); bannedModifierConfig = ((BaseUnityPlugin)this).Config.Bind("Debugging", "BannedModifierConfig", "", "Banned modifier defs separated by comma."); bannedArtifactConfig = ((BaseUnityPlugin)this).Config.Bind("Debugging", "BannedArtifactConfig", "Command, Delusion, Devotion, MixEnemy, Enigma, MonsterTeamGainsItems, Glass, SingleMonsterType, RandomSurvivorOnRespawn, Rebirth, ShadowClone, Prestige", "Banned modifier defs separated by comma."); bannedPrinterConfig = ((BaseUnityPlugin)this).Config.Bind("Debugging", "BannedPrinterConfig", "", "Banned modifier defs separated by comma."); bannedEnemyConfig = ((BaseUnityPlugin)this).Config.Bind("Debugging", "BannedEnemyConfig", "BearVoid, BleedOnHitVoid, ChainLightningVoid, CloverVoid, CritGlassesVoid, ElementalRingVoid, EquipmentMagazineVoid, ExplodeOnDeathVoid, ExtraLifeVoid, MissileVoid, MushroomVoid, SlowOnHitVoid, VoidMegaCrabItem, ArtifactKey, BeetleGland, BleedOnHitAndExplode, FireballsOnHit, Knurl, LightningStrikeOnHit, MinorConstructOnKill, NovaOnLowHealth, ParentEgg, Pearl, PowerPyramid, RoboBallBuddy, ShinyPearl, ShockDamageAura, SiphonOnLowHealth, SprintWisp, TitanGoldDuringTP, AlienHead, ArmorReductionOnHit, BarrierOnOverHeal, Behemoth, BoostAllStats, BounceNearby, CaptainDefenseMatrix, Clover, CritDamage, ExtraLife, GhostOnKill, Icicle, ImmuneToDebuff, IncreaseHealing, LaserTurbine, MeteorAttackOnHighDamage, MoreMissile, NovaOnHeal, PermanentDebuffOnHit, Plant, RandomEquipmentTrigger, SharedSuffering, StunAndPierce, UtilitySkillMagazine", "Banned modifier defs separated by comma."); bannedLunarConfig = ((BaseUnityPlugin)this).Config.Bind("Debugging", "BannedLunarConfig", "LunarTrinket, LunarSun, LunarSpecialReplacement, RandomlyLunar, AutoCastEquipment, LunarSecondaryReplacement, OnLevelUpFreeUnlock, RandomDamageZone, TransferDebuffOnHit, LunarPrimaryReplacement", "Banned modifier defs separated by comma."); moddedArtifactsConfig = ((BaseUnityPlugin)this).Config.Bind("Debugging", "ModdedArtifactConfing", "", "Banned modifier defs separated by comma."); moddedLunarsConfig = ((BaseUnityPlugin)this).Config.Bind("Debugging", "ModdedLunarConfig", "", "Banned modifier defs separated by comma."); ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(bannedModifierConfig)); ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(bannedArtifactConfig)); ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(bannedPrinterConfig)); ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(bannedEnemyConfig)); ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(bannedLunarConfig)); ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(moddedArtifactsConfig)); ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(moddedLunarsConfig)); } private void OpenPopoutMenu(string type, string title, string desc, bool checkboxShowInfo = false) { //IL_073d: Unknown result type (might be due to invalid IL or missing references) GameObject globalCanvas = ModUIManager.globalCanvas; if ((Object)(object)globalCanvas == (Object)null) { Log.Warning("Global canvas is null, cant attach panel"); return; } GameObject val = null; Transform val2 = globalCanvas.transform.Find(type); if ((Object)(object)val2 == (Object)null) { Log.Info("Creatring for the first time - " + type); val = Object.Instantiate(AssetManager.CreatePopoutPrefab(), globalCanvas.transform, false); val.SetActive(true); } else { val = ((Component)val2).gameObject; } RoutesPopoutController component = val.GetComponent(); if ((Object)(object)component == (Object)null) { Log.Error("HGPopout panel is nuull"); return; } component.title.token = title; component.subtitle.token = desc; component.checkboxShowInfo = checkboxShowInfo; RectTransform container = component.container; HashSet banList = new HashSet(); ConfigEntry configString = bannedPrinterConfig; HashSet moddedList = new HashSet(); ConfigEntry moddedConfig = bannedPrinterConfig; HashSet hashSet = new HashSet(); if (type == "whitePrinterItems") { foreach (ItemDef item in StageModifierCatalog.printerRegisteredDefs.Where((ItemDef def) => (int)def.tier == 0)) { hashSet.Add(new DefInfo(item)); } banList = bannedPrinterItems; configString = bannedPrinterConfig; component.cycleOption = PopoutCycleOption.Default; } if (type == "greenPrinterItems") { foreach (ItemDef item2 in StageModifierCatalog.printerRegisteredDefs.Where((ItemDef def) => (int)def.tier == 1)) { hashSet.Add(new DefInfo(item2)); } banList = bannedPrinterItems; configString = bannedPrinterConfig; component.cycleOption = PopoutCycleOption.Default; } if (type == "enemyWhiteItems") { foreach (ItemDef item3 in StageModifierCatalog.enemyRegisteredDefs.Where((ItemDef def) => (int)def.tier == 0 && def.DoesNotContainTag((ItemTag)4))) { hashSet.Add(new DefInfo(item3)); } banList = bannedEnemyItems; configString = bannedEnemyConfig; component.cycleOption = PopoutCycleOption.Default; } if (type == "enemyGreenItems") { foreach (ItemDef item4 in StageModifierCatalog.enemyRegisteredDefs.Where((ItemDef def) => (int)def.tier == 1 && def.DoesNotContainTag((ItemTag)4))) { hashSet.Add(new DefInfo(item4)); } banList = bannedEnemyItems; configString = bannedEnemyConfig; component.cycleOption = PopoutCycleOption.Default; } if (type == "enemyRedItems") { foreach (ItemDef item5 in StageModifierCatalog.enemyRegisteredDefs.Where((ItemDef def) => (int)def.tier == 2 && def.DoesNotContainTag((ItemTag)4))) { hashSet.Add(new DefInfo(item5)); } banList = bannedEnemyItems; configString = bannedEnemyConfig; component.cycleOption = PopoutCycleOption.Default; } if (type == "enemyYellowItems") { foreach (ItemDef item6 in StageModifierCatalog.enemyRegisteredDefs.Where((ItemDef def) => (int)def.tier == 4 && def.DoesNotContainTag((ItemTag)4))) { hashSet.Add(new DefInfo(item6)); } banList = bannedEnemyItems; configString = bannedEnemyConfig; component.cycleOption = PopoutCycleOption.Default; } if (type == "enemyVoidItems") { foreach (ItemDef item7 in StageModifierCatalog.enemyRegisteredDefs.Where((ItemDef def) => ((int)def.tier == 6 || (int)def.tier == 7 || (int)def.tier == 8 || (int)def.tier == 9) && def.DoesNotContainTag((ItemTag)4))) { hashSet.Add(new DefInfo(item7)); } banList = bannedEnemyItems; configString = bannedEnemyConfig; component.cycleOption = PopoutCycleOption.Default; } if (type == "enemyBlacklistedItems") { foreach (ItemDef item8 in StageModifierCatalog.enemyRegisteredDefs.Where((ItemDef def) => def.ContainsTag((ItemTag)4))) { hashSet.Add(new DefInfo(item8)); } banList = bannedEnemyItems; configString = bannedEnemyConfig; component.cycleOption = PopoutCycleOption.Default; } if (type == "stageModifiersGeneral") { foreach (ModifierDef allGeneralDef in StageModifierCatalog.AllGeneralDefs) { hashSet.Add(new DefInfo(allGeneralDef)); } banList = bannedModifierDefs; configString = bannedModifierConfig; component.cycleOption = PopoutCycleOption.Default; } if (type == "vanillaArtifacts") { foreach (string key in StageModifierCatalog.artifactTiers.Keys) { DefInfo defInfo = new DefInfo(ArtifactCatalog.FindArtifactDef(key)); ModifierInfo modifierInfo = StageModifierCatalog.artifactTiers[key]; defInfo.tier = (ModifierTier)modifierInfo.tier; defInfo.isNegative = modifierInfo.isNegative; hashSet.Add(defInfo); } banList = bannedArtifactDefs; configString = bannedArtifactConfig; component.cycleOption = PopoutCycleOption.Default; component.checkboxShowInfo = true; component.defaultBanList = StageModifierCatalog.artifactDefaultBanList; } if (type == "moddedArtifacts") { ArtifactDef[] artifactDefs = ArtifactCatalog.artifactDefs; foreach (ArtifactDef val3 in artifactDefs) { if (!Enumerable.Contains(StageModifierCatalog.artifactTiers.Keys, val3.cachedName)) { hashSet.Add(new DefInfo(val3)); } } banList = bannedArtifactDefs; configString = bannedArtifactConfig; component.cycleOption = PopoutCycleOption.All; moddedList = moddedArtifactsInfo; moddedConfig = moddedArtifactsConfig; } if (type == "vanillaLunar") { foreach (string key2 in StageModifierCatalog.lunarItemTiers.Keys) { DefInfo defInfo2 = new DefInfo(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex(key2))); ModifierInfo modifierInfo2 = StageModifierCatalog.lunarItemTiers[key2]; defInfo2.tier = (ModifierTier)modifierInfo2.tier; defInfo2.isNegative = modifierInfo2.isNegative; hashSet.Add(defInfo2); } banList = bannedLunarDefs; configString = bannedLunarConfig; component.moddedList = moddedLunarsInfo; component.cycleOption = PopoutCycleOption.Default; component.checkboxShowInfo = true; component.defaultBanList = StageModifierCatalog.lunarDefaultBanList; } if (type == "moddedLunar") { foreach (ItemDef lunarRegisteredDef in StageModifierCatalog.lunarRegisteredDefs) { if (!Enumerable.Contains(StageModifierCatalog.lunarItemTiers.Keys, ((Object)lunarRegisteredDef).name)) { hashSet.Add(new DefInfo(lunarRegisteredDef)); } } banList = bannedLunarDefs; configString = bannedLunarConfig; component.moddedList = moddedLunarsInfo; component.cycleOption = PopoutCycleOption.Negative; moddedList = moddedLunarsInfo; moddedConfig = moddedLunarsConfig; } component.defList = hashSet; component.banList = banList; component.configString = configString; component.moddedList = moddedList; component.moddedConfig = moddedConfig; component.Populate(); } private static void AddToStats(orig_SetDisplayData orig, GameEndReportPanelController self, DisplayData newDisplayData) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, newDisplayData); GameObject gameObject = ((Component)self).gameObject; Transform val = ((Component)self).transform.Find("SafeArea (JUICED)/BodyArea/StatsAndChatArea/StatsContainer/Stats Body/ScrollView/Viewport/Content"); if ((Object)(object)val != (Object)null) { Log.Info("Found it"); } ModUIManager.routeMapPanel.transform.SetParent(val, false); Log.Info("Found it set"); } private void Update() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) if (allowDebug.Value && NetworkServer.active) { if (Input.GetKeyDown((KeyCode)283)) { Transform transform = PlayerCharacterMasterController.instances[0].master.GetBodyObject().transform; RoutesExpansion.SpawnRoutePortals(transform.position); } if (Input.GetKeyDown((KeyCode)284)) { UnityHotReload.LoadNewAssemblyVersion(typeof(RiskOfRoutes).Assembly, "C:/Users/vit/AppData/Roaming/r2modmanPlus-local/RiskOfRain2/profiles/TEstling/BepInEx/plugins/RiskOfRoutes.dll"); Log.Info("Done"); } if (Input.GetKeyDown((KeyCode)285)) { Transform transform2 = PlayerCharacterMasterController.instances[0].master.GetBodyObject().transform; Log.Info($"Player pressed F2. Spawning our custom item at coordinates {transform2.position}"); PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(ModItemsManager.falseSonBless.itemIndex), transform2.position, transform2.forward * 20f); } } } } } namespace RiskOfRoutes.UI { public class ModUIManager : MonoBehaviour { [CompilerGenerated] private static class <>O { public static hook_Awake <0>__HUD_Awake; public static hook_Refresh <1>__AddIconsToArtifactDisplay; } public static GameObject routePortalPanel; public static GameObject routeMapPanel; public static GameObject globalCanvas; public ContextManager contextManager; private RoutePortalManager lastViewedManager = null; private Vector2 lastViewedNodeCoords = new Vector2(-1f, -1f); private int lastViewedMapState = -1; public static event Action OnRoutePortalPanelUpdated; public static void Initialize() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) object obj = <>O.<0>__HUD_Awake; if (obj == null) { hook_Awake val = HUD_Awake; <>O.<0>__HUD_Awake = val; obj = (object)val; } HUD.Awake += (hook_Awake)obj; object obj2 = <>O.<1>__AddIconsToArtifactDisplay; if (obj2 == null) { hook_Refresh val2 = AddIconsToArtifactDisplay; <>O.<1>__AddIconsToArtifactDisplay = val2; obj2 = (object)val2; } CurrentRunArtifactDisplayDataDriver.Refresh += (hook_Refresh)obj2; if ((Object)(object)globalCanvas == (Object)null) { Log.Warning("Canvas is null creating new one"); globalCanvas = new GameObject("RoutesMenuCanvas"); Object.DontDestroyOnLoad((Object)(object)globalCanvas); Canvas val3 = globalCanvas.AddComponent(); val3.renderMode = (RenderMode)0; val3.sortingOrder = 10; CanvasScaler val4 = globalCanvas.AddComponent(); val4.uiScaleMode = (ScaleMode)1; val4.referenceResolution = new Vector2(1920f, 1080f); } } private static void HUD_Awake(orig_Awake orig, HUD self) { orig.Invoke(self); if (!Run.instance.IsExpansionEnabled(RoutesExpansion.routesExpansion)) { Log.Warning("HUD_Awake: Expansion is disabled, map ui is not attached"); return; } ModUIManager modUIManager = ((Component)self).gameObject.AddComponent(); Transform val = ((Component)self).transform.Find("MainContainer/MainUIArea/SpringCanvas/RightCluster/ContextNotification"); if ((Object)(object)val != (Object)null) { ContextManager component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { modUIManager.contextManager = component; } else { Log.Error("HUD_Awake: Couldnt get contextManager"); } } if ((Object)(object)routePortalPanel != (Object)null) { Object.Destroy((Object)(object)routePortalPanel); } if ((Object)(object)routeMapPanel != (Object)null) { Object.Destroy((Object)(object)routeMapPanel); } SetupRoutePortalPanel(); SetupRouteMapPanel(); if ((Object)(object)routePortalPanel != (Object)null) { routePortalPanel.transform.SetParent(self.mainContainer.transform, false); } else { Log.Error("Route portal panel is null"); } if ((Object)(object)routeMapPanel != (Object)null) { CanvasGroup component2 = routeMapPanel.GetComponent(); routeMapPanel.SetActive(false); UIJuice component3 = self.scoreboardPanel.GetComponent(); UIJuice val2 = routeMapPanel.AddComponent(); RouteMapUI component4 = routeMapPanel.GetComponent(); if ((Object)(object)component3 != (Object)null) { val2.transitionDuration = 0.2f; val2.panningMagnitude = component3.panningMagnitude; val2.panningRect = component4.mainContainer; val2.canvasGroup = component2; } routeMapPanel.transform.SetParent(self.mainContainer.transform, false); } routePortalPanel.SetActive(false); } private static void AddMapToStats(orig_SetDisplayData orig, GameEndReportPanelController self, DisplayData newDisplayData) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Expected O, but got Unknown //IL_0107: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, newDisplayData); GameObject gameObject = ((Component)self).gameObject; Transform val = ((Component)self).transform.Find("SafeArea (JUICED)/BodyArea/StatsAndChatArea/StatsContainer/Stats Body/ScrollView/Viewport/Content"); if ((Object)(object)val != (Object)null) { Log.Info("Found it"); } GameObject val2 = AssetManager.bundle.LoadAsset("RouteMapPanel"); if ((Object)(object)val2 == (Object)null) { Log.Error("SetupRouteMapPanel: Couldn't load RouteMapPanel"); return; } GameObject val3 = Object.Instantiate(val2); RouteMapUI component = val3.GetComponent(); if ((Object)(object)StageModifierDirector.instance != (Object)null) { component.DrawMap(StageModifierDirector.instance.currentNodeSync); } else { Log.Error("it is null cant draw"); } val3.transform.SetParent(val); LayoutElement val4 = val3.AddComponent(); val4.preferredHeight = 300f; TranslucentImage val5 = val3.AddComponent(); Shader val6 = Shader.Find("UI/TranslucentImage"); ((Graphic)val5).material = new Material(val6); ((Graphic)val5).color = new Color(0f, 0f, 0f, 0.7f); ((Component)component.barImageHorizontal).gameObject.AddComponent(); ((Component)component.barImageVertical).gameObject.AddComponent(); GameObject[] array = (GameObject[])(object)new GameObject[2] { component.labelHorizontal, component.labelVertical }; foreach (GameObject val7 in array) { if ((Object)(object)val7 == (Object)null) { Log.Error("SetupRouteMapPanel: No label found"); return; } val7.gameObject.AddComponent(); } val3.SetActive(true); } private static void AddIconsToArtifactDisplay(orig_Refresh orig, CurrentRunArtifactDisplayDataDriver self) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) RunEnabledArtifacts enumerator = RunArtifactManager.enabledArtifactsEnumerable.GetEnumerator(); if (((RunEnabledArtifacts)(ref enumerator)).MoveNext()) { orig.Invoke(self); } if (!Object.op_Implicit((Object)(object)self.artifactDisplayPanelController) || !Object.op_Implicit((Object)(object)self.artifactDisplayPanelController.iconContainer)) { return; } if ((Object)(object)StageModifierDirector.instance == (Object)null || ((SyncListStruct)StageModifierDirector.instance.modifiersSynced).Count == 0) { orig.Invoke(self); return; } self.dirty = false; AddCustomIcon(self.artifactDisplayPanelController); if (!self.artifactDisplayPanelController.panelObject.activeSelf) { self.artifactDisplayPanelController.panelObject.SetActive(true); } } private static void AddCustomIcon(ArtifactDisplayPanelController controller) { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Expected O, but got Unknown //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) foreach (ModifierSync item in (SyncList)(object)StageModifierDirector.instance.modifiersSynced) { if (item.isArtifact || item.name.EndsWith("_EnemyItem")) { continue; } ModifierDef modifierDef = StageModifierCatalog.FindModifier(item.name); if (modifierDef == null) { continue; } string name = item.name; Transform iconContainer = (Transform)(object)controller.iconContainer; if (!Object.op_Implicit((Object)(object)iconContainer.Find(name))) { GameObject val = new GameObject(name); val.transform.SetParent(iconContainer, false); Image val2 = val.AddComponent(); if (modifierDef.name != "Doppelganger") { val2.sprite = (((Object)(object)modifierDef.spriteIcon != (Object)null) ? modifierDef.spriteIcon : AssetManager.placeholderIcon); } else { val2.sprite = GetHostSprite(); ((Graphic)val2).color = new Color(0.6392157f, 0.23921569f, 41f / 51f, 1f); } LayoutElement val3 = val.AddComponent(); val3.preferredHeight = 32f; val3.preferredWidth = 32f; val3.flexibleHeight = 0f; val3.flexibleWidth = 0f; RectTransform component = val.GetComponent(); component.sizeDelta = new Vector2(32f, 32f); AddStackTextToImage(item.stack, val2); TooltipProvider val4 = val.AddComponent(); ModifierDef modifierDef2 = StageModifierCatalog.FindModifier(item.name); val4.titleToken = Language.GetString(modifierDef2.nameToken); val4.bodyToken = StageModifierCatalog.GetModifierDescriptionFormatted(item, modifierDef2); val4.titleColor = new Color(82f / 85f, 0.3529412f, 0.22745098f); if (Object.op_Implicit((Object)(object)controller.panelObject) && !controller.panelObject.activeSelf) { controller.panelObject.SetActive(true); } } } } public static void AddStackTextToImage(int modStack, Image img) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("StackText"); val.transform.SetParent(((Component)img).transform, false); HGTextMeshProUGUI val2 = val.AddComponent(); RectTransform component = ((Component)val2).GetComponent(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.sizeDelta = Vector2.zero; ((TMP_Text)val2).font = AssetManager.bomb; ((TMP_Text)val2).fontSize = 12f; ((TMP_Text)val2).alignment = (TextAlignmentOptions)260; if (modStack > 1) { ((TMP_Text)val2).text = $"x{modStack}"; } } public static void AddIconToImage(string spritePath, Image img) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("StackText"); val.transform.SetParent(((Component)img).transform, false); Image val2 = val.AddComponent(); val2.sprite = Items.Pearl.pickupIconSprite; RectTransform component = ((Component)val2).GetComponent(); component.anchorMin = new Vector2(0.5f, 0.5f); component.anchorMax = Vector2.one; component.sizeDelta = Vector2.zero; } private static void SetupRoutePortalPanel() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) GameObject val = AssetManager.bundle.LoadAsset("RoutePortalPortraitPanel"); if ((Object)(object)val == (Object)null) { Log.Error("What?"); } TranslucentImage val2 = val.AddComponent(); Shader val3 = Shader.Find("UI/TranslucentImage"); ((Graphic)val2).material = new Material(val3); ((Graphic)val2).color = new Color(0f, 0f, 0f, 0.7f); TextMeshProUGUI componentInChildren = val.GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { Log.Error("No text meshprougui"); } if ((Object)(object)componentInChildren == (Object)null) { Log.Error("Not found"); } ((TMP_Text)componentInChildren).text = "Placeholder"; ((TMP_Text)componentInChildren).font = AssetManager.bomb; routePortalPanel = Object.Instantiate(val); } private static void SetupRouteMapPanel() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) GameObject val = AssetManager.bundle.LoadAsset("RouteMapPanel"); if ((Object)(object)val == (Object)null) { Log.Error("SetupRouteMapPanel: Couldn't load RouteMapPanel"); return; } routeMapPanel = Object.Instantiate(val); TranslucentImage val2 = routeMapPanel.AddComponent(); Shader val3 = Shader.Find("UI/TranslucentImage"); ((Graphic)val2).material = new Material(val3); ((Graphic)val2).color = new Color(0f, 0f, 0f, 0.7f); RouteMapUI component = routeMapPanel.GetComponent(); ((Component)component.barImageHorizontal).gameObject.AddComponent(); ((Component)component.barImageVertical).gameObject.AddComponent(); GameObject[] array = (GameObject[])(object)new GameObject[2] { component.labelHorizontal, component.labelVertical }; foreach (GameObject val4 in array) { if ((Object)(object)val4 == (Object)null) { Log.Error("SetupRouteMapPanel: No label found"); break; } val4.gameObject.AddComponent(); } } private void RoutePortalPanelUpdateText(GameObject routePortalPanel, RoutePortalManager mg) { //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Expected O, but got Unknown //IL_039b: Unknown result type (might be due to invalid IL or missing references) Log.Info("Huy"); TextMeshProUGUI[] componentsInChildren = routePortalPanel.GetComponentsInChildren(); TextMeshProUGUI val = null; TextMeshProUGUI[] array = componentsInChildren; foreach (TextMeshProUGUI val2 in array) { if (((Object)val2).name == "BodyLabel") { val = val2; break; } } Log.Info("2"); RawImage[] componentsInChildren2 = routePortalPanel.GetComponentsInChildren(); RawImage val3 = null; RawImage[] array2 = componentsInChildren2; foreach (RawImage val4 in array2) { if (((Object)val4).name == "ActualImage") { val3 = val4; break; } } Log.Info("3"); if ((Object)(object)val == (Object)null || (Object)(object)val3 == (Object)null) { Log.Error("SMTH"); return; } Log.Info("4"); if (mg.destinationSceneIndex != -1) { SceneDef sceneDef = SceneCatalog.GetSceneDef((SceneIndex)mg.destinationSceneIndex); if ((Object)(object)sceneDef != (Object)null && (Object)(object)sceneDef.portalMaterial != (Object)null) { Log.Info("Changin"); val3.texture = sceneDef.portalMaterial.mainTexture; } else if ((Object)(object)sceneDef == (Object)null) { Log.Error("sceneDef is null"); } else { Log.Error("portalMaterial is null"); } } else { Log.Error("Destination scene index is none"); } string text = "" + Language.GetString("POSITIVE") + "\n"; string text2 = "" + Language.GetString("NEGATIVE") + "\n"; bool flag = false; bool flag2 = false; Log.Info("Imagae was replaced"); GridLayoutGroup componentInChildren = routePortalPanel.GetComponentInChildren(); for (int num = ((Component)componentInChildren).transform.childCount - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)((Component)((Component)componentInChildren).transform.GetChild(num)).gameObject); } routePortalPanel.gameObject.SetActive(true); foreach (string item in (SyncList)(object)mg.stageModifiers) { string[] array3 = item.Split('='); if (array3.Length < 2) { continue; } string name = array3[0]; int num2 = int.Parse(array3[1]); ModifierDef modifierDef = StageModifierCatalog.FindModifier(name); if (modifierDef != null) { ModifierSync mod = new ModifierSync { name = name, stack = num2 }; string text3 = ""; text3 = ((!RiskOfRoutes.routePanelShowsOnlyNames.Value) ? ("- " + StageModifierCatalog.GetModifierDescriptionFormatted(mod, modifierDef)) : ("- " + StageModifierCatalog.GetModifierNameFormatted(mod, modifierDef))); if (!modifierDef.isNegative) { text = text + text3 + "\n"; flag = true; } else { text2 = text2 + text3 + "\n"; flag2 = true; } GameObject val5 = new GameObject("ModifierIcon"); Image val6 = val5.AddComponent(); if (modifierDef.name != "Doppelganger") { val6.sprite = (((Object)(object)modifierDef.spriteIcon != (Object)null) ? modifierDef.spriteIcon : AssetManager.placeholderIcon); } else { val6.sprite = GetHostSprite(); ((Graphic)val6).color = new Color(0.4f, 0.15f, 0.5f, 1f); } ((Component)val6).transform.SetParent(((Component)componentInChildren).transform, false); val5.AddComponent(); LayoutElement component = val5.GetComponent(); component.minWidth = 16f; component.minHeight = 16f; component.preferredWidth = 64f; component.preferredHeight = 64f; AddStackTextToImage(num2, val6); } } string text4 = ""; ((TMP_Text)val).text = text4 + (flag ? text : "") + (flag2 ? text2 : ""); ModUIManager.OnRoutePortalPanelUpdated?.Invoke(routePortalPanel, mg); } public static Sprite GetHostSprite() { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) if (CharacterMaster.instancesList != null && CharacterMaster.instancesList.Count > 0) { CharacterBody body = CharacterMaster.instancesList[0].GetBody(); if ((Object)(object)body != (Object)null && (Object)(object)body.portraitIcon != (Object)null) { Texture portraitIcon = body.portraitIcon; Texture2D val = (Texture2D)(object)((portraitIcon is Texture2D) ? portraitIcon : null); if ((Object)(object)val != (Object)null) { return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); } } } return AssetManager.placeholderIcon; } private void Update() { //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)routePortalPanel == (Object)null || (Object)(object)routeMapPanel == (Object)null || !Object.op_Implicit((Object)(object)Run.instance) || !Run.instance.IsExpansionEnabled(RoutesExpansion.routesExpansion)) { return; } LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser(); if (firstLocalUser == null || !((Object)(object)firstLocalUser.cachedBody != (Object)null)) { return; } bool flag = firstLocalUser.inputPlayer != null && firstLocalUser.inputPlayer.GetButton("info"); bool flag2 = false; RoutePortalManager routePortalManager = null; InteractionDriver component = ((Component)firstLocalUser.cachedBody).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.currentInteractable != (Object)null) { routePortalManager = component.currentInteractable.GetComponentInChildren(); if (!Object.op_Implicit((Object)(object)routePortalManager)) { routePortalManager = component.currentInteractable.GetComponentInParent(); } if ((Object)(object)routePortalManager != (Object)null && routePortalManager.isUsingModifiers) { flag2 = true; } } if (flag2) { if ((Object)(object)lastViewedManager != (Object)(object)routePortalManager) { lastViewedManager = routePortalManager; RoutePortalPanelUpdateText(routePortalPanel, routePortalManager); if (((SyncList)(object)routePortalManager.stageModifiers).Count <= 0) { } } if (!routePortalPanel.activeSelf) { routePortalPanel.SetActive(true); } } else { if (routePortalPanel.activeSelf) { routePortalPanel.SetActive(false); } lastViewedManager = null; } bool flag3 = lastViewedMapState != StageModifierDirector.instance.mapState; bool flag4 = flag || flag2 || flag3; ContextManager val = contextManager; if (flag4) { Vector2 val2 = (flag2 ? routePortalManager.nodeSync : StageModifierDirector.instance.currentNodeSync); bool isObjective = flag2 && routePortalManager.isObjectiveNode; RouteMapUI component2 = routeMapPanel.GetComponent(); if (StageModifierDirector.instance.punishmentTime != -1f) { component2.DrawBar(); } if (val2 != lastViewedNodeCoords || !routeMapPanel.activeSelf || flag3) { component2.DrawMap(val2, isObjective); lastViewedNodeCoords = val2; lastViewedMapState = StageModifierDirector.instance.mapState; } if (!routeMapPanel.activeSelf) { routeMapPanel.SetActive(true); UIJuice component3 = routeMapPanel.GetComponent(); if ((Object)(object)component3 != (Object)null) { component3.TransitionPanFromTop(); component3.TransitionAlphaFadeIn(); } } if ((Object)(object)val != (Object)null && (Object)(object)val.contextDisplay != (Object)null && CleanestHudCompat.enabled) { Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(-250f, 60f, 0f); if (val.contextDisplay.transform.localPosition != val3) { val.contextDisplay.transform.localPosition = val3; } } } else if (routeMapPanel.activeSelf) { routeMapPanel.SetActive(false); lastViewedNodeCoords = new Vector2(-1f, -1f); if ((Object)(object)val != (Object)null && (Object)(object)val.contextDisplay != (Object)null) { Vector3 val4 = default(Vector3); ((Vector3)(ref val4))..ctor(172.8f, 0f, 0f); if (val.contextDisplay.transform.localPosition != val4) { val.contextDisplay.transform.localPosition = val4; } } } else if ((Object)(object)val != (Object)null && (Object)(object)val.contextDisplay != (Object)null) { Vector3 val5 = default(Vector3); ((Vector3)(ref val5))..ctor(172.8f, 0f, 0f); if (val.contextDisplay.transform.localPosition != val5) { val.contextDisplay.transform.localPosition = val5; } } } } public class PopoutChoiceController : MonoBehaviour { public HGButton hgButton; public Image image; public TooltipProvider tooltipProvider; public GameObject[] checkboxStates; private CheckboxState _currentIndex; public GameObject[] usedStates; public PopoutCycleOption cycleOption; public ModifierTier tier; public bool isNegative; public string defName; public CheckboxState currentIndex { get { return _currentIndex; } set { UpdateState(value); } } public void UpdateState(CheckboxState newState) { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) if (_currentIndex != CheckboxState.DefaultDisabled) { GameObject val = checkboxStates[(int)_currentIndex]; if ((Object)(object)val != (Object)null) { val.SetActive(false); } } _currentIndex = newState; if (newState != CheckboxState.DefaultDisabled) { GameObject val2 = checkboxStates[(int)_currentIndex]; val2.SetActive(true); } if ((Object)(object)image != (Object)null) { ((Graphic)image).color = (Color)((_currentIndex == CheckboxState.DefaultDisabled) ? new Color(0.3f, 0.3f, 0.3f) : Color.white); } switch (newState) { case CheckboxState.Positive_Tier1: tier = ModifierTier.Tier1; isNegative = false; break; case CheckboxState.Positive_Tier2: tier = ModifierTier.Tier2; isNegative = false; break; case CheckboxState.Positive_Tier3: tier = ModifierTier.Tier3; isNegative = false; break; case CheckboxState.Negative_Tier1: tier = ModifierTier.Tier1; isNegative = true; break; case CheckboxState.Negative_Tier2: tier = ModifierTier.Tier2; isNegative = true; break; case CheckboxState.Negative_Tier3: tier = ModifierTier.Tier3; isNegative = true; break; } } public static CheckboxState GetState(int tier, bool isNegative) { if (isNegative) { switch (tier) { case 1: return CheckboxState.Negative_Tier1; case 2: return CheckboxState.Negative_Tier2; case 3: return CheckboxState.Negative_Tier3; } } else { switch (tier) { case 1: return CheckboxState.Positive_Tier1; case 2: return CheckboxState.Positive_Tier2; case 3: return CheckboxState.Positive_Tier3; } } return CheckboxState.DefaultEnabled; } public CheckboxState GetEnabledState() { return GetState((int)tier, isNegative); } } public class ReportPanelUIController { } public class RouteMapUI : MonoBehaviour { private Dictionary MapNodes = new Dictionary(); public GameObject nodePrefab; public GameObject linePrefab; public RectTransform nodeContainer; public RectTransform mainContainer; public GameObject horizontalBars; public GameObject verticalBars; public Image barImageHorizontal; public Image barImageVertical; public GameObject labelHorizontal; public GameObject labelVertical; public bool isMapVertical; public bool isBarVertical; public Sprite empty; public Sprite drone; public Sprite chef; public Sprite item; public Sprite rare; public Sprite objective; public Sprite shop; public Sprite goldShores; public Sprite colossus; public Sprite hardware; public Sprite voidFields; public Sprite celestial; public Sprite falseSon; public Sprite lineImage; public Sprite starting; public Sprite solusWing; public Sprite heal; public Sprite combat; public Sprite utility; public static Vector3 CleanestHUDCenterPos = new Vector3(0f, -300f, 0f); public static Vector3 CleanestHUDBottomRightPos = new Vector3(580f, -480f, 0f); public static Vector3 DefaultPos = new Vector3(0f, -500f, 0f); public static Vector2 CleanestHudRectSize = new Vector2(-1300f, -900f); public static Vector2 DefaultRectSize = new Vector2(-1140f, -900f); public static event Action OnPunishmentBarDrawn; public static event Action OnRouteMapDrawn; public void DrawMap() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) DrawMap(new Vector2(-1f, -1f)); } public void DrawBar() { //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) isBarVertical = RiskOfRoutes.punishmentBarOrientation.Value == RiskOfRoutes.MapOrientation.Vertical; if (StageModifierDirector.instance.punishmentTime == -1f) { verticalBars.SetActive(false); horizontalBars.SetActive(false); return; } if (isBarVertical) { verticalBars.SetActive(true); horizontalBars.SetActive(false); } else { verticalBars.SetActive(false); horizontalBars.SetActive(true); } float fillAmount = (Run.instance.GetRunStopwatch() - StageModifierDirector.instance.stageEnterTime) / (StageModifierDirector.instance.punishmentTime * 60f) % 1f; int num = (int)((Run.instance.GetRunStopwatch() - StageModifierDirector.instance.stageEnterTime) / (StageModifierDirector.instance.punishmentTime * 60f)); barImageHorizontal.fillAmount = fillAmount; barImageVertical.fillAmount = fillAmount; ((Graphic)barImageHorizontal).color = RiskOfRoutes.punishmentBarColor.Value; ((Graphic)barImageVertical).color = RiskOfRoutes.punishmentBarColor.Value; Image[] array = (Image[])(object)new Image[2] { barImageHorizontal, barImageVertical }; foreach (Image val in array) { TooltipProvider component = ((Component)val).GetComponent(); if ((Object)(object)component == (Object)null) { Log.Error("DrawMap: No tooltip provider for bar images"); return; } component.titleToken = "PUNISHMENT_BAR_NAME"; component.bodyToken = Language.GetStringFormatted("PUNISHMENT_BAR_DESCRIPTION", new object[1] { (int)StageModifierDirector.instance.punishmentTime }); component.titleColor = RiskOfRoutes.punishmentBarColor.Value; } GameObject[] array2 = (GameObject[])(object)new GameObject[2] { labelHorizontal, labelVertical }; foreach (GameObject val2 in array2) { if ((Object)(object)val2 == (Object)null) { Log.Error("DrawMap: No label found"); return; } TooltipProvider component2 = val2.GetComponent(); if ((Object)(object)component2 == (Object)null) { Log.Error("DrawMap: No tooltip provider for punish label"); return; } component2.titleToken = Language.GetStringFormatted("PUNISHMENT_VALUE_NAME", new object[1] { num }); component2.bodyToken = "PUNISHMENT_VALUE_DESCRIPTION"; component2.titleColor = RiskOfRoutes.punishmentBarColor.Value; TextMeshProUGUI component3 = val2.GetComponent(); if ((Object)(object)component3 == (Object)null) { Log.Error("DrawMap: No text component found"); return; } if ((Object)(object)val2 == (Object)(object)labelVertical) { ((TMP_Text)component3).text = $"{num}"; continue; } ((TMP_Text)component3).text = Language.GetStringFormatted("PUNISHMENT_VALUE_NAME", new object[1] { num }); } RouteMapUI.OnPunishmentBarDrawn?.Invoke(((Component)this).gameObject); } public void DrawMap(Vector2 selectedNodeCoords, bool isObjective = false) { //IL_0007: 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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_06b7: Unknown result type (might be due to invalid IL or missing references) //IL_06be: Unknown result type (might be due to invalid IL or missing references) //IL_077b: Unknown result type (might be due to invalid IL or missing references) //IL_0782: Unknown result type (might be due to invalid IL or missing references) //IL_0540: Unknown result type (might be due to invalid IL or missing references) //IL_0557: Unknown result type (might be due to invalid IL or missing references) //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.localPosition = DefaultPos; DrawBar(); ClearContainer(); MapNodes.Clear(); int mapWidth = StageModifierDirector.instance.mapWidth; int mapHeight = StageModifierDirector.instance.mapHeight; bool isMoonVisited = StageModifierDirector.instance.isMoonVisited; bool flag = false; List routeNodesSynced = StageModifierDirector.instance.routeNodesSynced; if (routeNodesSynced == null || routeNodesSynced.Count == 0) { if (routeNodesSynced == null) { Log.Error("DrawMap: Map is null"); } if (routeNodesSynced.Count == 0) { Log.Error("DrawMap: Map is empty"); } return; } float num = (float)RiskOfRoutes.routeMapSize.Value / 100f; RectTransform component = ((Component)this).GetComponent(); ((Transform)component).localScale = new Vector3(num, num, 1f); float num2 = 42f * ((float)RiskOfRoutes.routeMapIconSize.Value / 100f); RouteNodeSync node = GetNode((int)selectedNodeCoords.x, (int)selectedNodeCoords.y, routeNodesSynced, mapHeight); Transform transform = new GameObject("Lines", new Type[1] { typeof(RectTransform) }).transform; transform.SetParent((Transform)(object)nodeContainer, false); Transform transform2 = new GameObject("Nodes", new Type[1] { typeof(RectTransform) }).transform; transform2.SetParent((Transform)(object)nodeContainer, false); ObjectScaleCurve pingCurve = AssetManager.pingCurve; GameObject val = Object.Instantiate(nodePrefab, transform2); RectTransform component2 = val.GetComponent(); List effectiveWidth = GetEffectiveWidth(node, mapWidth, mapHeight, routeNodesSynced); int count = effectiveWidth.Count; Rect rect = nodeContainer.rect; float width = ((Rect)(ref rect)).width; rect = nodeContainer.rect; float height = ((Rect)(ref rect)).height; float num3 = width / 20f; float num4 = height / 10f; float num5 = width - num3 * 2f; float num6 = height - num4 * 2f; float num7 = (isMapVertical ? (num5 / (float)(count - 1)) : (num5 / (float)mapHeight)); float num8 = (isMapVertical ? (num6 / (float)mapHeight) : (num6 / (float)(count - 1))); component2.anchorMin = new Vector2(0.5f, 0.5f); component2.anchorMax = new Vector2(0.5f, 0.5f); float num9 = (isMapVertical ? 0f : (num5 / 2f)); float num10 = (isMapVertical ? (num6 / 2f) : 0f); component2.anchoredPosition = new Vector2(num9, num10); component2.sizeDelta = new Vector2(75f, 75f); Image component3 = val.GetComponent(); component3.sprite = objective; if (isMoonVisited) { ((Graphic)component3).color = new Color(0.887f, 0.87f, 0.172f, 1f); } for (int i = 0; i < mapWidth + 1; i++) { int num11 = effectiveWidth.IndexOf(i); if (num11 == -1) { continue; } for (int j = 0; j < mapHeight; j++) { RouteNodeSync node2 = GetNode(i, j, routeNodesSynced, mapHeight); if (node2.portalType == RoutePortalType.FalseSon && node2.visited) { flag = true; } bool flag2 = node2.portalType == RoutePortalType.Colossus || node2.portalType == RoutePortalType.FalseSon || node2.portalType == RoutePortalType.Hardware || node2.portalType == RoutePortalType.SolusWing; if (node2.x == -1 || node2.y == -1 || (node2.portalType == RoutePortalType.None && j != 0) || (flag2 && !node2.visited && !node2.Equals(node))) { continue; } float num12; float num13; if (isMapVertical) { if (j == 0) { num12 = 0f; num13 = 0f - num6 / 2f; } else { num12 = 0f - num5 / 2f + (float)num11 * num7; num13 = 0f - num6 / 2f + (float)j * num8; } } else if (j == 0) { num12 = 0f - num5 / 2f; num13 = 0f; } else { num12 = 0f - num5 / 2f + (float)j * num7; num13 = 0f - num6 / 2f + (float)num11 * num8; } GameObject val2 = Object.Instantiate(nodePrefab, transform2); RectTransform component4 = val2.GetComponent(); if (node2.Equals(node) && (Object)(object)pingCurve != (Object)null && !isMoonVisited && isObjective) { ObjectScaleCurve val3 = val2.AddComponent(); val3.useOverallCurveOnly = pingCurve.useOverallCurveOnly; val3.overallCurve = pingCurve.overallCurve; val3.curveX = pingCurve.curveX; val3.curveY = pingCurve.curveY; val3.curveZ = pingCurve.curveZ; val3.timeMax = pingCurve.timeMax; ((Behaviour)val3).enabled = false; ((Behaviour)val3).enabled = true; } component4.anchorMin = new Vector2(0.5f, 0.5f); component4.anchorMax = new Vector2(0.5f, 0.5f); component4.anchoredPosition = new Vector2(num12, num13); component4.sizeDelta = new Vector2(num2, num2); bool visited = node2.visited || node2.Equals(node); SetIconAndTooltip(val2, GetNode(i, j, routeNodesSynced, mapHeight).portalType, i, j, visited); MapNodes.Add(node2, component4); } } if (isMoonVisited || isObjective) { ObjectScaleCurve val4 = val.AddComponent(); val4.useOverallCurveOnly = pingCurve.useOverallCurveOnly; val4.overallCurve = pingCurve.overallCurve; val4.curveX = pingCurve.curveX; val4.curveY = pingCurve.curveY; val4.curveZ = pingCurve.curveZ; val4.timeMax = pingCurve.timeMax; ((Behaviour)val4).enabled = false; ((Behaviour)val4).enabled = true; } foreach (KeyValuePair mapNode in MapNodes) { RouteNodeSync key = mapNode.Key; RectTransform value = mapNode.Value; if (key.y == mapHeight - 1) { DrawLine(value.anchoredPosition, component2.anchoredPosition, transform, key.visited && isMoonVisited); } foreach (RouteNodeSync child in GetChildren(key, routeNodesSynced, mapHeight, usePortalNode: true)) { if (((key.portalType != RoutePortalType.Colossus && key.portalType != RoutePortalType.FalseSon) || child.visited || child.Equals(node)) && !(key.portalType == RoutePortalType.Colossus && child.portalType != RoutePortalType.Colossus && child.portalType != RoutePortalType.FalseSon && flag) && MapNodes.TryGetValue(child, out var value2)) { DrawLine(value.anchoredPosition, value2.anchoredPosition, transform, child.visited && key.visited); if (RiskOfRoutes.showIntermissionNodes.Value && key.visited && child.visited) { DrawIntermissionNodes(transform2, value, child, value2); } } } } RouteMapUI.OnRouteMapDrawn?.Invoke(((Component)this).gameObject); } private void DrawIntermissionNodes(Transform nodesContainer, RectTransform startRect, RouteNodeSync childNode, RectTransform endRect) { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) List list = new List(); if (childNode.shopVisited) { list.Add(RoutePortalType.Shop); } if (childNode.goldshoresVisited) { list.Add(RoutePortalType.Goldshores); } if (childNode.voidFieldsVisited) { list.Add(RoutePortalType.Arena); } for (int i = 0; i < list.Count; i++) { RoutePortalType portalType = list[i]; float num = i + 1; float num2 = 1 + list.Count; GameObject val = Object.Instantiate(nodePrefab, nodesContainer); RectTransform component = val.GetComponent(); component.anchorMin = new Vector2(0.5f, 0.5f); component.anchorMax = new Vector2(0.5f, 0.5f); component.sizeDelta = new Vector2(36f, 36f); component.anchoredPosition = startRect.anchoredPosition * ((num2 - num) / num2) + endRect.anchoredPosition * (num / num2); SetIconAndTooltip(val, portalType, -1, -1, visited: true); } } private void DrawLine(Vector2 start, Vector2 end, Transform lineContainer, bool visited = false) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(linePrefab, lineContainer); RectTransform component = val.GetComponent(); Vector2 val2 = end - start; float magnitude = ((Vector2)(ref val2)).magnitude; float num = Mathf.Atan2(val2.y, val2.x) * 57.29578f; if (visited) { ((Graphic)val.GetComponent()).color = new Color(0.887f, 0.87f, 0.172f, 1f); } val.GetComponent().sprite = lineImage; component.sizeDelta = new Vector2(magnitude, 3f); component.anchoredPosition = start + val2 / 2f; ((Transform)component).localRotation = Quaternion.Euler(0f, 0f, num); } private void SetIconAndTooltip(GameObject routeNode, RoutePortalType portalType, int x = -1, int y = -1, bool visited = false) { //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) Sprite val = empty; switch (portalType) { case RoutePortalType.None: return; case RoutePortalType.Rare: val = rare; break; case RoutePortalType.ItemType: val = item; break; case RoutePortalType.DroneType: val = drone; break; case RoutePortalType.ChefType: val = chef; break; case RoutePortalType.Colossus: val = colossus; break; case RoutePortalType.Hardware: val = hardware; break; case RoutePortalType.SolusWing: val = solusWing; break; case RoutePortalType.Goldshores: val = goldShores; break; case RoutePortalType.Shop: val = shop; break; case RoutePortalType.Arena: val = voidFields; break; case RoutePortalType.FalseSon: val = falseSon; break; case RoutePortalType.Combat: val = combat; break; case RoutePortalType.Heal: val = heal; break; case RoutePortalType.Utility: val = utility; break; case RoutePortalType.Starting: val = starting; break; default: val = empty; break; } Image component = routeNode.GetComponent(); TooltipProvider val2 = routeNode.AddComponent(); string text = portalType.ToString().ToUpper(); val2.titleToken = "ROUTENODE_" + text + "_NAME"; val2.bodyToken = "ROUTENODE_" + text + "_DESCRIPTION"; val2.titleColor = new Color(82f / 85f, 0.3529412f, 0.22745098f); component.sprite = val; if (visited) { ((Graphic)component).color = new Color(0.887f, 0.87f, 0.172f, 1f); } } private void ClearContainer() { for (int num = ((Transform)nodeContainer).childCount - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)((Component)((Transform)nodeContainer).GetChild(num)).gameObject); } } public List GetEffectiveWidth(RouteNodeSync selectedNode, int width, int height, List map) { List list = new List(); int num = 0; for (int i = 0; i < width + 1; i++) { bool flag = false; for (int j = 0; j < height; j++) { RouteNodeSync node = GetNode(i, j, map, height); if (node.x != -1 && node.y != -1 && node.portalType != RoutePortalType.None && ((node.portalType != RoutePortalType.Colossus && node.portalType != RoutePortalType.FalseSon && node.portalType != RoutePortalType.Hardware && node.portalType != RoutePortalType.SolusWing) || node.visited || node.Equals(selectedNode))) { flag = true; break; } } if (flag) { list.Add(i); } } return list; } public List GetChildren(RouteNodeSync node, List map, int height, bool usePortalNode = false) { List list = new List(); if (node.leftX != -1 && node.leftY != -1) { list.Add(GetNode(node.leftX, node.leftY, map, height)); } if (node.frontX != -1 && node.frontY != -1) { list.Add(GetNode(node.frontX, node.frontY, map, height)); } if (node.rightX != -1 && node.rightY != -1) { list.Add(GetNode(node.rightX, node.rightY, map, height)); } if (usePortalNode && node.bonusX != -1 && node.bonusY != -1) { list.Add(GetNode(node.bonusX, node.bonusY, map, height)); } return list; } public RouteNodeSync GetNode(int x, int y, List map, int mapHeight) { int num = x * mapHeight + y; if (map != null && num >= 0 && num < map.Count) { return map[num]; } return default(RouteNodeSync); } } public enum CheckboxState { Positive_Tier1, Positive_Tier2, Positive_Tier3, Negative_Tier1, Negative_Tier2, Negative_Tier3, DefaultEnabled, DefaultDisabled } public enum PopoutCycleOption { Default, All, Positive, Negative } public class RoutesPopoutController : MonoBehaviour { public GameObject defaultButton; public GameObject allButton; public GameObject noneButton; public RectTransform container; public PopoutCycleOption cycleOption; public LanguageTextMeshController title; public LanguageTextMeshController subtitle; public HashSet defList; public HashSet banList; public HashSet defaultBanList; public HashSet moddedList; public ConfigEntry moddedConfig; public ConfigEntry configString; public bool checkboxShowInfo; public void Start() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown HGButton component = defaultButton.GetComponent(); ((UnityEvent)((Button)component).onClick).AddListener((UnityAction)delegate { Log.Info("CLicked on default button"); if (cycleOption == PopoutCycleOption.Default) { banList.Clear(); if (defaultBanList != null) { foreach (DefInfo def in defList) { if (defaultBanList.Contains(def.name)) { banList.Add(def.name); } } configString.Value = string.Join(", ", banList); } } else { moddedList.Clear(); moddedConfig.Value = UpdateModded(); } UpdateContainer(); }); HGButton component2 = allButton.GetComponent(); ((UnityEvent)((Button)component2).onClick).AddListener((UnityAction)delegate { Log.Info("CLicked on all button"); if (cycleOption == PopoutCycleOption.Default) { foreach (DefInfo def2 in defList) { banList.Remove(def2.name); } configString.Value = string.Join(", ", banList); } else { moddedList.Clear(); foreach (DefInfo def3 in defList) { moddedList.Add(new DefInfo { name = def3.name, tier = ModifierTier.Tier1, isNegative = (cycleOption == PopoutCycleOption.Negative) }); banList.Remove(def3.name); } moddedConfig.Value = UpdateModded(); } UpdateContainer(); }); HGButton component3 = noneButton.GetComponent(); ((UnityEvent)((Button)component3).onClick).AddListener((UnityAction)delegate { Log.Info("Clicked on none button"); if (cycleOption == PopoutCycleOption.Default) { foreach (DefInfo def4 in defList) { banList.Remove(def4.name); } foreach (DefInfo def5 in defList) { banList.Add(def5.name); } configString.Value = string.Join(", ", banList); } else { moddedList.Clear(); moddedConfig.Value = UpdateModded(); } UpdateContainer(); }); } public void UpdateContainer() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown Log.Info("Updating container"); foreach (Transform item in ((Component)container).transform) { Transform val = item; PopoutChoiceController rc = ((Component)val).gameObject.GetComponent(); if ((Object)(object)rc == (Object)null) { continue; } if (cycleOption == PopoutCycleOption.Default) { if (checkboxShowInfo) { rc.currentIndex = (banList.Contains(rc.defName) ? CheckboxState.DefaultDisabled : rc.GetEnabledState()); } else { rc.currentIndex = (banList.Contains(rc.defName) ? CheckboxState.DefaultDisabled : CheckboxState.DefaultEnabled); } continue; } DefInfo defInfo = moddedList.FirstOrDefault((DefInfo info) => info.name == rc.defName); if (defInfo != null) { rc.currentIndex = PopoutChoiceController.GetState((int)defInfo.tier, defInfo.isNegative); } else { rc.currentIndex = CheckboxState.DefaultDisabled; } } } public string UpdateModded() { List list = new List(); foreach (DefInfo modded in moddedList) { string arg = (modded.isNegative ? "-" : "+"); int tier = (int)modded.tier; list.Add($"{modded.name}={arg}={tier}"); } return string.Join(",", list); } public void Populate() { //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Expected O, but got Unknown HashSet hashSet = defList; foreach (DefInfo def in hashSet) { if (def == null) { continue; } GameObject val = Object.Instantiate(AssetManager.CreatePopoutChoicePrefab(), (Transform)(object)container, false); val.SetActive(true); if ((Object)(object)val == (Object)null) { Log.Info("NO CHOICE"); } val.transform.SetParent((Transform)(object)container, true); PopoutChoiceController rc = val.GetComponent(); if ((Object)(object)rc == (Object)null || (Object)(object)rc.image == (Object)null) { break; } rc.defName = def.name; rc.tier = def.tier; rc.isNegative = def.isNegative; CheckboxState checkboxState = (checkboxShowInfo ? rc.GetEnabledState() : CheckboxState.DefaultEnabled); GameObject val2 = null; val2 = rc.checkboxStates[0]; Transform val3 = val2.transform.Find("Checkbox/CheckboxImage"); CheckboxState[] array = new CheckboxState[2] { CheckboxState.DefaultDisabled, checkboxState }; CheckboxState[] array2 = new CheckboxState[7] { CheckboxState.DefaultDisabled, CheckboxState.Positive_Tier1, CheckboxState.Positive_Tier2, CheckboxState.Positive_Tier3, CheckboxState.Negative_Tier1, CheckboxState.Negative_Tier2, CheckboxState.Negative_Tier3 }; CheckboxState[] array3 = new CheckboxState[4] { CheckboxState.DefaultDisabled, CheckboxState.Negative_Tier1, CheckboxState.Negative_Tier2, CheckboxState.Negative_Tier3 }; CheckboxState[] array4 = new CheckboxState[4] { CheckboxState.DefaultDisabled, CheckboxState.Positive_Tier1, CheckboxState.Positive_Tier2, CheckboxState.Positive_Tier3 }; if ((Object)(object)def.sprite != (Object)null) { rc.image.sprite = def.sprite; } else { rc.image.sprite = AssetManager.placeholderIcon; } if ((Object)(object)rc.tooltipProvider != (Object)null) { rc.tooltipProvider.titleToken = def.nameToken; rc.tooltipProvider.bodyToken = def.descriptionToken; rc.tooltipProvider.titleColor = def.tooltipColor; } if (!((Object)(object)rc.hgButton != (Object)null)) { continue; } ((UnityEventBase)((Button)rc.hgButton).onClick).RemoveAllListeners(); CheckboxState[] currentArray = new CheckboxState[0]; if (cycleOption == PopoutCycleOption.Default) { currentArray = array; } else if (cycleOption == PopoutCycleOption.Negative) { currentArray = array3; } else if (cycleOption == PopoutCycleOption.Positive) { currentArray = array4; } else if (cycleOption == PopoutCycleOption.All) { currentArray = array2; } else { currentArray = array; } if (cycleOption == PopoutCycleOption.Default) { rc.currentIndex = (banList.Contains(def.name) ? CheckboxState.DefaultDisabled : checkboxState); } else { DefInfo defInfo = moddedList.FirstOrDefault((DefInfo info) => info.name == def.name); if (defInfo != null) { rc.currentIndex = PopoutChoiceController.GetState((int)defInfo.tier, defInfo.isNegative); } else { rc.currentIndex = CheckboxState.DefaultDisabled; } } CheckboxState currentIndex = rc.currentIndex; int num = Array.IndexOf(currentArray, currentIndex); if (num == -1) { Log.Error($"option {currentIndex} is not present in array with values:"); CheckboxState[] array5 = currentArray; foreach (CheckboxState checkboxState2 in array5) { Log.Info($"\t{checkboxState2}"); } break; } ((UnityEvent)((Button)rc.hgButton).onClick).AddListener((UnityAction)delegate { int num3 = currentArray.Length; Log.Info($"Array length: {currentArray.Length}"); if (num3 != 0) { int num4 = Array.IndexOf(currentArray, rc.currentIndex); if (num4 == -1) { Log.Error("fwck"); } else { int num5 = (num4 + 1) % num3; CheckboxState currentIndex2 = currentArray[num5]; rc.currentIndex = currentIndex2; if (cycleOption == PopoutCycleOption.Default) { if (rc.currentIndex == CheckboxState.DefaultDisabled) { banList.Add(rc.defName); } else { banList.Remove(rc.defName); } configString.Value = string.Join(",", banList); Log.Info("Config got " + configString.Value); } else { moddedList.RemoveWhere((DefInfo info) => info.name == rc.defName); if (rc.currentIndex != CheckboxState.DefaultDisabled) { moddedList.Add(new DefInfo { name = rc.defName, isNegative = rc.isNegative, tier = rc.tier }); } moddedConfig.Value = UpdateModded(); Log.Info("Config got " + moddedConfig.Value); } } } }); } } } } namespace RiskOfRoutes.StageModifiers { public class ModifierDef { public string name; public ModifierTier tier; public int cost; public float weight; public Func isAvailable = () => true; public List conflictList = new List(); public int maxStack = -1; public Sprite spriteIcon; public string nameToken; public string descriptionToken; public bool isNegative = false; public bool isArtifact = false; public bool isStackable = false; public ModifierDef(string name, ModifierTier tier, float weight, bool isStackable, bool isNegative, string[] conflicts = null, int maxStack = -1) { this.name = name; this.tier = tier; this.weight = weight; this.isNegative = isNegative; this.isStackable = isStackable; if (conflicts != null) { foreach (string item in conflicts) { conflictList.Add(item); } } } public ModifierDef(string name, ModifierTier tier, float weight, Func isAvailable, bool isStackable, bool isNegative, string[] conflicts = null, int maxStack = -1) { this.name = name; this.tier = tier; this.weight = weight; this.isNegative = isNegative; this.isAvailable = isAvailable; this.isStackable = isStackable; if (conflicts != null) { foreach (string item in conflicts) { conflictList.Add(item); } } } } public enum ModifierTags { } public class ModifierInfo { public string name; public int tier; public bool isNegative; public bool isDefault; public ModifierInfo(string name, int tier, bool isNegative = true, bool isDefault = false) { this.name = name; this.tier = tier; this.isNegative = isNegative; this.isDefault = isDefault; } } public static class StageModifierCatalog { private static AssetBundle assetBundle; public static Dictionary AllDefs = new Dictionary(); public static readonly HashSet AllGeneralDefs = new HashSet(); public static List generalPositivePool = new List(); public static List generalNegativePool = new List(); public static List droneTypePool = new List(); public static List rarePool = new List(); public static List chefPool = new List(); public static List bossPool = new List(); public static List combatPool = new List(); public static List healPool = new List(); public static List utilityPool = new List(); public static List itemTypePool = new List(); public static List enemyItemPool = new List(); public static List lunarItemPool = new List(); public static List utilityItems = new List(); public static List healingItems = new List(); public static List damageItems = new List(); public static List foodRelatedItems = new List(); public static HashSet printerRegisteredDefs = new HashSet(); public static HashSet enemyRegisteredDefs = new HashSet(); public static HashSet lunarRegisteredDefs = new HashSet(); public static HashSet printerDefaultBanList = new HashSet(); public static HashSet enemyDefaultBanList = new HashSet(); public static HashSet lunarDefaultBanList = new HashSet(); public static HashSet artifactDefaultBanList = new HashSet(); public static Dictionary RunDefs = new Dictionary(); public static HashSet additionalDefs = new HashSet(); public static readonly Dictionary lunarItemTiers = new Dictionary { { "LunarTrinket", new ModifierInfo("LunarTrinket", 1) }, { "GoldOnHit", new ModifierInfo("GoldOnHit", 2, isNegative: true, isDefault: true) }, { "RepeatHeal", new ModifierInfo("RepeatHeal", 1, isNegative: true, isDefault: true) }, { "MonstersOnShrineUse", new ModifierInfo("MonstersOnShrineUse", 1, isNegative: true, isDefault: true) }, { "LunarSun", new ModifierInfo("LunarSun", 3) }, { "LunarSpecialReplacement", new ModifierInfo("LunarSpecialReplacement", 3) }, { "RandomlyLunar", new ModifierInfo("RandomlyLunar", 1) }, { "FocusConvergence", new ModifierInfo("FocusConvergence", 1, isNegative: true, isDefault: true) }, { "AutoCastEquipment", new ModifierInfo("AutoCastEquipment", 1) }, { "LunarSecondaryReplacement", new ModifierInfo("LunarSecondaryReplacement", 3) }, { "HalfAttackSpeedHalfCooldowns", new ModifierInfo("HalfAttackSpeedHalfCooldowns", 3, isNegative: true, isDefault: true) }, { "OnLevelUpFreeUnlock", new ModifierInfo("OnLevelUpFreeUnlock", 3) }, { "RandomDamageZone", new ModifierInfo("RandomDamageZone", 1) }, { "TransferDebuffOnHit", new ModifierInfo("TransferDebuffOnHit", 1) }, { "LunarBadLuck", new ModifierInfo("LunarBadLuck", 3, isNegative: true, isDefault: true) }, { "LunarDagger", new ModifierInfo("LunarDagger", 3, isNegative: true, isDefault: true) }, { "HalfSpeedDoubleHealth", new ModifierInfo("HalfSpeedDoubleHealth", 3, isNegative: true, isDefault: true) }, { "LunarUtilityReplacement", new ModifierInfo("LunarUtilityReplacement", 3, isNegative: true, isDefault: true) }, { "ShieldOnly", new ModifierInfo("ShieldOnly", 3, isNegative: true, isDefault: true) }, { "LunarPrimaryReplacement", new ModifierInfo("LunarPrimaryReplacement", 3) } }; public static readonly Dictionary artifactTiers = new Dictionary { { "Mystery", new ModifierInfo("Mystery", 2, isNegative: true, isDefault: true) }, { "FriendlyFire", new ModifierInfo("FriendlyFire", 1, isNegative: true, isDefault: true) }, { "Command", new ModifierInfo("Command", 3, isNegative: false) }, { "Delusion", new ModifierInfo("Delusion", 3, isNegative: false) }, { "Devotion", new ModifierInfo("Devotion", 2) }, { "MixEnemy", new ModifierInfo("MixEnemy", 2) }, { "Enigma", new ModifierInfo("Enigma", 3) }, { "MonsterTeamGainsItems", new ModifierInfo("MonsterTeamGainsItems", 1) }, { "WeakAssKnees", new ModifierInfo("WeakAssKnees", 1, isNegative: true, isDefault: true) }, { "Glass", new ModifierInfo("Glass", 3) }, { "EliteOnly", new ModifierInfo("EliteOnly", 3, isNegative: true, isDefault: true) }, { "SingleMonsterType", new ModifierInfo("SingleMonsterType", 2) }, { "RandomSurvivorOnRespawn", new ModifierInfo("RandomSurvivorOnRespawn", 3) }, { "Rebirth", new ModifierInfo("Rebirth", 1, isNegative: false) }, { "Sacrifice", new ModifierInfo("Sacrifice", 3, isNegative: true, isDefault: true) }, { "WispOnDeath", new ModifierInfo("WispOnDeath", 1, isNegative: true, isDefault: true) }, { "Bomb", new ModifierInfo("Bomb", 1, isNegative: true, isDefault: true) }, { "Swarms", new ModifierInfo("Swarms", 1, isNegative: true, isDefault: true) }, { "ShadowClone", new ModifierInfo("ShadowClone", 1) }, { "TeamDeath", new ModifierInfo("TeamDeath", 2, isNegative: true, isDefault: true) }, { "Prestige", new ModifierInfo("Prestige", 1) } }; public static void Init(AssetBundle bundle) { //IL_085d: Unknown result type (might be due to invalid IL or missing references) //IL_0863: Invalid comparison between Unknown and I4 //IL_087a: Unknown result type (might be due to invalid IL or missing references) //IL_0882: Unknown result type (might be due to invalid IL or missing references) //IL_0888: Invalid comparison between Unknown and I4 //IL_08a5: Unknown result type (might be due to invalid IL or missing references) //IL_08ad: Unknown result type (might be due to invalid IL or missing references) //IL_08b3: Invalid comparison between Unknown and I4 //IL_08b6: Unknown result type (might be due to invalid IL or missing references) //IL_08bc: Invalid comparison between Unknown and I4 //IL_08ff: Unknown result type (might be due to invalid IL or missing references) //IL_0905: Invalid comparison between Unknown and I4 //IL_08bf: Unknown result type (might be due to invalid IL or missing references) //IL_08c5: Invalid comparison between Unknown and I4 //IL_08c8: Unknown result type (might be due to invalid IL or missing references) //IL_08ce: Invalid comparison between Unknown and I4 //IL_08d1: Unknown result type (might be due to invalid IL or missing references) //IL_08d7: Invalid comparison between Unknown and I4 //IL_08da: Unknown result type (might be due to invalid IL or missing references) //IL_08e0: Invalid comparison between Unknown and I4 //IL_08e3: Unknown result type (might be due to invalid IL or missing references) //IL_08ea: Invalid comparison between Unknown and I4 assetBundle = bundle; AllDefs.Clear(); generalPositivePool.Clear(); generalNegativePool.Clear(); itemTypePool.Clear(); enemyItemPool.Clear(); lunarItemPool.Clear(); rarePool.Clear(); droneTypePool.Clear(); chefPool.Clear(); combatPool.Clear(); healPool.Clear(); utilityPool.Clear(); generalPositivePool.AddRange(new string[0]); generalNegativePool.AddRange(new string[8] { "Doppelganger", "SoulCost", "VoidEnemies", "MoreElites", "LunarEnemies", "PowerfulElites", "OnlyFlying", "EnemyItemModifier" }); itemTypePool.AddRange(new string[2] { "YellowPrinter", "RedPrinter" }); combatPool.AddRange(new string[3] { "YellowPrinter_Damage", "RedPrinter_Damage", "DamagePrinterModifier" }); healPool.AddRange(new string[3] { "YellowPrinter_Healing", "RedPrinter_Healing", "HealingPrinterModifier" }); utilityPool.AddRange(new string[3] { "YellowPrinter_Utility", "RedPrinter_Utility", "UtilityPrinterModifier" }); droneTypePool.AddRange(new string[4] { "DroneBossGreen", "DroneBossRed", "UpgradeDrones", "MoreDrones" }); rarePool.AddRange(new string[2] { "BossRedItem", "BossYellowItem" }); chefPool.AddRange(new string[3] { "RedPrinter_FoodRelated", "YellowPrinter_FoodRelated", "FoodRelatedPrinterModifier" }); Register(new ModifierDef("EnemyItemModifier", ModifierTier.Tier1, 1f, isStackable: true, isNegative: true), "enemyItemModifierIcon", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("DamagePrinterModifier", ModifierTier.Tier1, 1f, isStackable: true, isNegative: false), "printerItemModifierIcon", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("HealingPrinterModifier", ModifierTier.Tier1, 1f, isStackable: true, isNegative: false), "printerItemModifierIcon", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("UtilityPrinterModifier", ModifierTier.Tier1, 1f, isStackable: true, isNegative: false), "printerItemModifierIcon", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("FoodRelatedPrinterModifier", ModifierTier.Tier1, 1f, isStackable: true, isNegative: false), "printerItemModifierIcon", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("Aurelionite", ModifierTier.Tier3, 1f, isStackable: false, isNegative: false), "texBuffAurelioniteBlessingIcon", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("BossRedItem", ModifierTier.Tier3, 1f, isStackable: false, isNegative: false, new string[2] { "BossYellowItem", "DroneBossGreen" }), "redBossItem", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("BossYellowItem", ModifierTier.Tier3, 1f, isStackable: false, isNegative: false, new string[2] { "BossRedItem", "DroneBossGreen" }), "yellowBossItem", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("DroneBossGreen", ModifierTier.Tier1, 1f, isStackable: false, isNegative: false, new string[1] { "DroneBossRed" }), "uncommonDroneReward", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("DroneBossRed", ModifierTier.Tier3, 1f, isStackable: false, isNegative: false, new string[1] { "DroneBossGreen" }), "legendaryDroneReward", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("MoreElites", ModifierTier.Tier1, 1f, isStackable: true, isNegative: true), "moreElitesIcon", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("MoreDrones", ModifierTier.Tier1, 1f, isStackable: true, isNegative: false), "texMoreDronesModifier", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("UpgradeDrones", ModifierTier.Tier3, 1f, isStackable: true, isNegative: false), "RoR2/DLC3/UI/texUIdroneupgradeIcon.png", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("LunarEnemies", ModifierTier.Tier3, 1f, isStackable: true, isNegative: true), "RoR2/DLC1/GameModes/InfiniteTowerRun/ITAssets/texITWaveLunarIcon.png", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("VoidEnemies", ModifierTier.Tier3, 1f, isStackable: true, isNegative: true), "RoR2/DLC1/GameModes/InfiniteTowerRun/ITAssets/texITWaveVoidIcon.png", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("YellowPrinter", ModifierTier.Tier1, 1f, () => StageModifierDirector.instance?.CheckPlayersYellowItem() ?? false, isStackable: true, isNegative: false), "yellowPrinter", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("RedPrinter", ModifierTier.Tier1, 1f, () => StageModifierDirector.instance?.CheckPlayersRedItem() ?? false, isStackable: true, isNegative: false), "redPrinter", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("YellowPrinter_Damage", ModifierTier.Tier1, 1f, () => StageModifierDirector.instance?.CheckPlayersYellowItem() ?? false, isStackable: true, isNegative: false), "yellowPrinterDamage", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("YellowPrinter_Healing", ModifierTier.Tier1, 1f, () => StageModifierDirector.instance?.CheckPlayersYellowItem() ?? false, isStackable: true, isNegative: false), "yellowPrinterHeal", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("YellowPrinter_Utility", ModifierTier.Tier1, 1f, () => StageModifierDirector.instance?.CheckPlayersYellowItem() ?? false, isStackable: true, isNegative: false), "yellowPrinterUtility", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("YellowPrinter_FoodRelated", ModifierTier.Tier1, 1f, () => StageModifierDirector.instance?.CheckPlayersYellowItem() ?? false, isStackable: true, isNegative: false), "yellowPrinterFood", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("RedPrinter_Damage", ModifierTier.Tier1, 1f, () => StageModifierDirector.instance?.CheckPlayersRedItem() ?? false, isStackable: true, isNegative: false), "redPrinterDamage", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("RedPrinter_Healing", ModifierTier.Tier1, 1f, () => StageModifierDirector.instance?.CheckPlayersRedItem() ?? false, isStackable: true, isNegative: false), "redPrinterHealing", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("RedPrinter_Utility", ModifierTier.Tier1, 1f, () => StageModifierDirector.instance?.CheckPlayersRedItem() ?? false, isStackable: true, isNegative: false), "redPrinterUtility", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("RedPrinter_FoodRelated", ModifierTier.Tier1, 1f, () => StageModifierDirector.instance?.CheckPlayersRedItem() ?? false, isStackable: true, isNegative: false), "redPrinterFood", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("OnlyFlying", ModifierTier.Tier2, 1f, isStackable: false, isNegative: true), "onlyFlying", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("PowerfulElites", ModifierTier.Tier3, 1f, isStackable: true, isNegative: true), "tier2ElitesIcon", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("Repair", ModifierTier.Tier3, 1f, () => StageModifierDirector.instance?.CheckRepairAvailable() ?? false, isStackable: false, isNegative: false), "repair", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("WanderingChef", ModifierTier.Tier3, 1f, isStackable: false, isNegative: false), "RoR2/DLC3/MealPrep/texMealPrepIcon.png", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("Mountain", ModifierTier.Tier1, 1f, () => StageModifierDirector.instance?.CheckMountainShrine() ?? false, isStackable: false, isNegative: false), "mountIcon", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("SoulCost", ModifierTier.Tier3, 1f, isStackable: true, isNegative: true), "RoR2/DLC2/texBuffSoulCostIcon.png", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("Doppelganger", ModifierTier.Tier2, 1f, isStackable: true, isNegative: true), "texAurelioniteIcon", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("BossAspectModifier", ModifierTier.Tier3, 1f, isStackable: true, isNegative: true), "repair", isArtifact: false, isItem: false, isGeneral: true); Register(new ModifierDef("BossSwarmModifier", ModifierTier.Tier3, 1f, isStackable: true, isNegative: true), "repair", isArtifact: false, isItem: false, isGeneral: true); ItemDef[] itemDefs = ItemCatalog.itemDefs; foreach (ItemDef val in itemDefs) { if (!val.hidden && (int)val.tier != 5 && !val.ContainsTag((ItemTag)10)) { if (((int)val.tier == 0 || (int)val.tier == 1) && val.DoesNotContainTag((ItemTag)15)) { TryRegPrinter(val); } if ((int)val.tier == 0 || (int)val.tier == 1 || (int)val.tier == 2 || (int)val.tier == 4 || (int)val.tier == 6 || (int)val.tier == 7 || (int)val.tier == 8 || (int)val.tier == 9) { TryRegEnemy(val); } if ((int)val.tier == 3) { TryRegLunar(val); } } } ArtifactDef[] artifactDefs = ArtifactCatalog.artifactDefs; foreach (ArtifactDef artDef in artifactDefs) { TryRegArtifact(artDef); } CreateDefaultBanLists(); } public static void CreateDefaultBanLists() { string[] array = new string[0]; foreach (KeyValuePair lunarItemTier in lunarItemTiers) { if (!lunarItemTier.Value.isDefault) { lunarDefaultBanList.Add(lunarItemTier.Key); } } foreach (KeyValuePair artifactTier in artifactTiers) { if (!artifactTier.Value.isDefault) { artifactDefaultBanList.Add(artifactTier.Key); } } } public static void CreateRunPools() { List list = new List(); List list2 = new List(); string[] array = RiskOfRoutes.moddedLunarsConfig.Value.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries); string[] array2 = array; foreach (string text in array2) { string[] array3 = text.Split("="); if (array3.Length >= 3) { string name = array3[0]; bool isNegative = array3[1] == "-"; int tier = int.Parse(array3[2]); list.Add(new DefInfo { name = name, isNegative = isNegative, tier = (ModifierTier)tier }); } } string[] array4 = RiskOfRoutes.moddedArtifactsConfig.Value.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries); string[] array5 = array4; foreach (string text2 in array5) { string[] array6 = text2.Split("="); if (array6.Length >= 3) { string name2 = array6[0]; bool isNegative2 = array6[1] == "-"; int tier2 = int.Parse(array6[2]); list2.Add(new DefInfo { name = name2, isNegative = isNegative2, tier = (ModifierTier)tier2 }); } } RunDefs.Clear(); generalNegativePool.Clear(); generalNegativePool.AddRange(new string[8] { "Doppelganger", "SoulCost", "VoidEnemies", "MoreElites", "LunarEnemies", "PowerfulElites", "OnlyFlying", "EnemyItemModifier" }); rarePool.Clear(); rarePool.AddRange(new string[2] { "BossRedItem", "BossYellowItem" }); foreach (KeyValuePair allDef in AllDefs) { string defName = allDef.Key; ModifierDef value = allDef.Value; DefInfo defInfo = list2.FirstOrDefault((DefInfo defInfo3) => defInfo3.name == defName); DefInfo defInfo2 = list.FirstOrDefault((DefInfo defInfo3) => defInfo3.name + "_LunarItem" == defName); ModifierDef modifierDef = value; if (defInfo != null) { modifierDef = new ModifierDef(defName, defInfo.tier, value.weight, isStackable: false, defInfo.isNegative) { spriteIcon = value.spriteIcon, isArtifact = value.isArtifact, nameToken = value.nameToken, descriptionToken = value.descriptionToken, conflictList = value.conflictList }; } else if (defInfo2 != null) { modifierDef = new ModifierDef(defName, defInfo2.tier, value.weight, isStackable: false, defInfo2.isNegative) { spriteIcon = value.spriteIcon, isArtifact = value.isArtifact, nameToken = value.nameToken, descriptionToken = value.descriptionToken, conflictList = value.conflictList }; } RunDefs.Add(defName, modifierDef); bool flag = defName.EndsWith("_LunarItem"); bool isArtifact = modifierDef.isArtifact; if (!(isArtifact || flag)) { continue; } if (modifierDef.isNegative) { if (!generalNegativePool.Contains(defName)) { generalNegativePool.Add(defName); } } else if (!rarePool.Contains(defName)) { rarePool.Add(defName); } } } public static void Register(ModifierDef def, string iconAddress, bool isArtifact = false, bool isItem = false, bool isGeneral = false) { if (AllDefs.ContainsKey(def.name)) { if (AllDefs[def.name].tier == def.tier) { Log.Warning("Trying to register modifier " + def.name + " that already exists and has the same tier, check config"); return; } Log.Warning("Trying to register modifier " + def.name + " that already exists with the different tier"); AllDefs.Remove(def.name); } def.spriteIcon = LoadSprite(iconAddress, isArtifact, isItem); def.isArtifact = isArtifact; AllDefs.Add(def.name, def); if (isGeneral) { AllGeneralDefs.Add(def); } string text = ""; string text2 = ""; if (isArtifact) { ArtifactDef val = ArtifactCatalog.FindArtifactDef(def.name); if ((Object)(object)val != (Object)null) { text = val.nameToken; text2 = (((Object)(object)val == (Object)(object)Artifacts.TeamDeath) ? "ARTIFACT_DEATH_DESCRIPTION_SHORT" : val.descriptionToken); def.nameToken = text; def.descriptionToken = text2; } else { Log.Error("StageModifierCatalog: Init - Something went wrong for artifact:" + def.name); text = "MODIFIER_" + def.name.ToUpper() + "_NAME"; text2 = "MODIFIER_" + def.name.ToUpper() + "_DESCRIPTION"; def.nameToken = text; def.descriptionToken = text2; } } if (!isItem && !isArtifact) { text = "MODIFIER_" + def.name.ToUpper() + "_NAME"; text2 = "MODIFIER_" + def.name.ToUpper() + "_DESCRIPTION"; def.nameToken = text; def.descriptionToken = text2; } } public static void TryRegPrinter(ItemDef itemDef) { if ((Object)(object)itemDef == (Object)null) { Log.Warning("TryRegPrinter: Tried registering printer item but def is null, check config"); return; } string text = ((Object)itemDef).name + "_Printer"; ModifierDef modifierDef = new ModifierDef(text, ModifierTier.Tier1, 1f, isStackable: false, isNegative: false); modifierDef.nameToken = itemDef.nameToken; modifierDef.descriptionToken = itemDef.descriptionToken; Register(modifierDef, ((Object)itemDef).name, isArtifact: false, isItem: true); printerRegisteredDefs.Add(itemDef); if (!itemTypePool.Contains(text)) { itemTypePool.Add(text); } if (itemDef.tags.Contains((ItemTag)1) && !damageItems.Contains(text)) { damageItems.Add(text); } else if (itemDef.tags.Contains((ItemTag)2) && !healingItems.Contains(text)) { healingItems.Add(text); } else if (itemDef.tags.Contains((ItemTag)3) && !utilityItems.Contains(text)) { utilityItems.Add(text); } if (itemDef.tags.Contains((ItemTag)28) && !foodRelatedItems.Contains(text)) { foodRelatedItems.Add(text); } if (!itemTypePool.Contains(text)) { itemTypePool.Add(text); } } public static void TryRegEnemy(ItemDef itemDef) { if ((Object)(object)itemDef == (Object)null) { Log.Warning("TryRegEnemy: Tried registering enemy item but def is null, check config"); return; } string text = ((Object)itemDef).name + "_EnemyItem"; ModifierDef modifierDef = new ModifierDef(text, ModifierTier.Tier1, 1f, isStackable: true, isNegative: true); modifierDef.nameToken = itemDef.nameToken; modifierDef.descriptionToken = itemDef.descriptionToken; if (AllDefs.TryGetValue(text, out var value)) { value.isStackable = true; } Register(modifierDef, ((Object)itemDef).name, isArtifact: false, isItem: true); enemyRegisteredDefs.Add(itemDef); if (!enemyItemPool.Contains(text)) { enemyItemPool.Add(text); } } public static void TryRegLunar(ItemDef itemDef) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Invalid comparison between Unknown and I4 bool flag = false; if ((Object)(object)itemDef == (Object)null) { Log.Warning("TryRegLunar: Tried registering lunar item but def is null, check config"); return; } if ((int)itemDef.tier != 3) { Log.Warning("TryRegLunar: Tried registering non-lunar item " + ((Object)itemDef).name + " as LunarItemModifier, check config"); return; } string name = ((Object)itemDef).name + "_LunarItem"; ModifierDef modifierDef = null; if (lunarItemTiers.TryGetValue(((Object)itemDef).name, out var value)) { modifierDef = new ModifierDef(name, (ModifierTier)value.tier, 1f, isStackable: false, isNegative: true); } else { modifierDef = new ModifierDef(name, ModifierTier.Tier1, 1f, isStackable: false, isNegative: true); flag = true; } modifierDef.nameToken = itemDef.nameToken; modifierDef.descriptionToken = itemDef.descriptionToken; Register(modifierDef, ((Object)itemDef).name, isArtifact: false, isItem: true); lunarRegisteredDefs.Add(itemDef); if (flag) { additionalDefs.Add(((Object)itemDef).name); } } public static void TryRegArtifact(ArtifactDef artDef) { bool flag = false; string name = artDef.cachedName; ModifierDef modifierDef = null; Func isAvailable = ((name == "TeamDeath") ? ((Func)(() => StageModifierDirector.instance?.CheckArtifactOfDeathAvailable() ?? false)) : ((Func)(() => StageModifierDirector.instance?.CheckArtifactAvailable(name) ?? false))); if (artifactTiers.TryGetValue(artDef.cachedName, out var value)) { modifierDef = new ModifierDef(artDef.cachedName, (ModifierTier)value.tier, 1f, isAvailable, isStackable: false, value.isNegative); } else { modifierDef = new ModifierDef(artDef.cachedName, ModifierTier.Tier3, 1f, isAvailable, isStackable: false, isNegative: true); flag = true; } modifierDef.nameToken = artDef.nameToken; modifierDef.descriptionToken = artDef.descriptionToken; modifierDef.isArtifact = true; Register(modifierDef, name, isArtifact: true); if (flag) { additionalDefs.Add(artDef.cachedName); } } public static ModifierDef FindModifier(string name) { if (RunDefs.Keys.Count == 0) { Log.Error("Run defs are empty"); return null; } if (RunDefs.TryGetValue(name, out var value)) { return value; } Log.Warning("FindModifier: Missing the host modifier with name " + name); return null; } public static StageModifier StageModifierFromDef(string def, int stack = 1) { //IL_0a0e: Unknown result type (might be due to invalid IL or missing references) //IL_0a13: Unknown result type (might be due to invalid IL or missing references) //IL_0a15: Unknown result type (might be due to invalid IL or missing references) //IL_0a18: Invalid comparison between Unknown and I4 //IL_0a74: Unknown result type (might be due to invalid IL or missing references) //IL_0a79: Unknown result type (might be due to invalid IL or missing references) //IL_0a7b: Unknown result type (might be due to invalid IL or missing references) //IL_0a7e: Invalid comparison between Unknown and I4 //IL_0adb: Unknown result type (might be due to invalid IL or missing references) //IL_0ae0: Unknown result type (might be due to invalid IL or missing references) //IL_0ae2: Unknown result type (might be due to invalid IL or missing references) //IL_0ae5: Invalid comparison between Unknown and I4 switch (def) { case "Aurelionite": return new AurelioniteModifier(); case "BossRedItem": return new BossRedItemModifier(); case "BossYellowItem": return new BossYellowItemModifier(); case "DroneBossGreen": return new DroneBossModifier(); case "DroneBossRed": return new DroneBossModifier(dropLegendary: true); case "MoreElites": return new MoreElitesModifier(stack); case "MoreDrones": return new MoreDronesModifier(stack); case "LunarEnemies": return new LunarEnemiesModifier(stack); case "VoidEnemies": return new VoidEnemiesModifier(stack); case "YellowPrinter": return new YellowPrinterModifier(stack, (ItemTag)0); case "YellowPrinter_Damage": return new YellowPrinterModifier(stack, (ItemTag)1); case "YellowPrinter_Healing": return new YellowPrinterModifier(stack, (ItemTag)2); case "YellowPrinter_Utility": return new YellowPrinterModifier(stack, (ItemTag)3); case "YellowPrinter_FoodRelated": return new YellowPrinterModifier(stack, (ItemTag)28); case "RedPrinter": return new RedPrinterModifier(stack, (ItemTag)0); case "RedPrinter_Damage": return new RedPrinterModifier(stack, (ItemTag)1); case "RedPrinter_Healing": return new RedPrinterModifier(stack, (ItemTag)2); case "RedPrinter_Utility": return new RedPrinterModifier(stack, (ItemTag)3); case "RedPrinter_FoodRelated": return new RedPrinterModifier(stack, (ItemTag)28); case "OnlyFlying": return new OnlyFlyingEnemiesModifier(); case "PowerfulElites": return new Tier2ElitesEarlierModifier(stack); case "Repair": return new RepairConsumedItemsModifier(); case "WanderingChef": return new WanderingChefModifier(); case "Mountain": return new SaveMountainEffectModifier(stack); case "SoulCost": return new SoulCostModifier(stack); case "Doppelganger": return new DoppelgangerModifier(stack); case "UpgradeDrones": return new UpgradeDronesModifier(stack); case "BossAspectModifier": return new BossAspectModifier(); case "BossSwarmModifier": return new BossSwarmModifier(); case "FriendlyFire": return new ArtifactModifier(Artifacts.FriendlyFire); case "Command": return new ArtifactModifier(Artifacts.Command); case "Delusion": return new ArtifactModifier(Artifacts.Delusion); case "Devotion": return new ArtifactModifier(Artifacts.Devotion); case "MixEnemy": return new ArtifactModifier(Artifacts.MixEnemy); case "Enigma": return new ArtifactModifier(Artifacts.Enigma); case "MonsterTeamGainsItems": return new ArtifactModifier(Artifacts.MonsterTeamGainsItems); case "WeakAssKnees": return new ArtifactModifier(Artifacts.WeakAssKnees); case "Glass": return new ArtifactModifier(Artifacts.Glass); case "EliteOnly": return new ArtifactModifier(Artifacts.EliteOnly); case "SingleMonsterType": return new ArtifactModifier(Artifacts.SingleMonsterType); case "RandomSurvivorOnRespawn": return new ArtifactModifier(Artifacts.RandomSurvivorOnRespawn); case "Rebirth": return new ArtifactModifier(Artifacts.Rebirth); case "Sacrifice": return new ArtifactModifier(Artifacts.Sacrifice); case "WispOnDeath": return new ArtifactModifier(Artifacts.WispOnDeath); case "Bomb": return new ArtifactModifier(Artifacts.Bomb); case "Swarms": return new ArtifactModifier(Artifacts.Swarms); case "ShadowClone": return new ArtifactModifier(Artifacts.ShadowClone); case "TeamDeath": return new ArtifactModifier(Artifacts.TeamDeath); case "Mystery": return new ArtifactModifier(MysteryArtifact.Mystery); default: { if (def.Contains("_Printer")) { string text = def[..def.LastIndexOf('_')]; ItemIndex val = ItemCatalog.FindItemIndex(text); if ((int)val == -1) { Log.Error("Could not find item by the name " + text); return null; } return new PrinterItemModifier(text); } if (def.Contains("_EnemyItem")) { string text2 = def[..def.LastIndexOf('_')]; ItemIndex val2 = ItemCatalog.FindItemIndex(text2); if ((int)val2 == -1) { Log.Error("Could not find item by the name " + text2); return null; } return new EnemyItemsModifier(text2, stack); } if (def.Contains("_LunarItem")) { string text3 = def[..def.LastIndexOf('_')]; ItemIndex val3 = ItemCatalog.FindItemIndex(text3); if ((int)val3 == -1) { Log.Error("Could not find lunar item by the name " + text3); return null; } return new LunarItemsModifier(text3); } ArtifactDef val4 = ArtifactCatalog.FindArtifactDef(def); if ((Object)(object)val4 != (Object)null) { return new ArtifactModifier(val4); } Log.Error("Could not find artifact by the name " + def); return null; } } } private static Sprite LoadSprite(string address, bool isArtifact, bool isItem) { //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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Invalid comparison between Unknown and I4 //IL_006c: Unknown result type (might be due to invalid IL or missing references) if (address.Contains("RoR2/")) { return Addressables.LoadAssetAsync((object)address).WaitForCompletion(); } if (isArtifact) { ArtifactDef val = ArtifactCatalog.FindArtifactDef(address); return ((Object)(object)val != (Object)null) ? val.smallIconSelectedSprite : AssetManager.placeholderIcon; } if (isItem) { ItemIndex val2 = ItemCatalog.FindItemIndex(address); if ((int)val2 != -1) { return ItemCatalog.GetItemDef(val2).pickupIconSprite; } } if ((Object)(object)assetBundle != (Object)null && assetBundle.Contains(address)) { return assetBundle.LoadAsset(address); } Log.Warning("Not found sprite for " + address); return AssetManager.placeholderIcon; } public static bool isPortalTypeAvailable(RoutePortalType type) { return true; } public static string GetModifierNameFormatted(ModifierSync mod, ModifierDef def) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Expected I4, but got Unknown string text = ((mod.stack > 1) ? $" - x{mod.stack}" : ""); if (def.name.Contains("_Printer") || def.name.Contains("_EnemyItem") || def.name.Contains("_LunarItem")) { int length = def.name.LastIndexOf('_'); string text2 = def.name.Substring(0, length); ItemIndex val = ItemCatalog.FindItemIndex(text2); ItemDef itemDef = ItemCatalog.GetItemDef(val); string text3 = text2; if ((Object)(object)itemDef != (Object)null) { string text4 = Language.GetString(itemDef.nameToken); string text5 = "FFFFFF"; ItemTier tier = itemDef.tier; ItemTier val2 = tier; text5 = (int)val2 switch { 0 => ColorCatalog.GetColorHexString((ColorIndex)1), 1 => ColorCatalog.GetColorHexString((ColorIndex)2), 2 => ColorCatalog.GetColorHexString((ColorIndex)3), 4 => ColorCatalog.GetColorHexString((ColorIndex)13), 3 => ColorCatalog.GetColorHexString((ColorIndex)4), 6 => ColorCatalog.GetColorHexString((ColorIndex)25), 7 => ColorCatalog.GetColorHexString((ColorIndex)25), 8 => ColorCatalog.GetColorHexString((ColorIndex)25), 9 => ColorCatalog.GetColorHexString((ColorIndex)25), _ => "FFFFFF", }; text3 = "" + text4 + ""; } if (def.name.Contains("_Printer")) { return Language.GetStringFormatted("PRINTER_ITEMS_MODIFIER_NAME", new object[1] { text3 }); } if (def.name.Contains("_EnemyItem")) { if ((Object)(object)itemDef != (Object)null) { int itemStack = EnemyItemsModifier.GetItemStack(itemDef, mod.stack); return Language.GetStringFormatted("ENEMY_ITEMS_MODIFIER_NAME", new object[2] { text3, itemStack }); } return Language.GetStringFormatted("ENEMY_ITEMS_MODIFIER_NAME", new object[2] { text3, mod.stack }); } if (def.name.Contains("_LunarItem")) { return Language.GetStringFormatted("LUNAR_ITEMS_MODIFIER_NAME", new object[1] { text3 }); } } return Language.GetString(def.nameToken) + text; } public static string GetModifierDescriptionFormatted(ModifierSync mod, ModifierDef def) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Expected I4, but got Unknown string text = ((mod.stack > 1) ? $" - x{mod.stack}" : ""); if (def.name.Contains("_Printer") || def.name.Contains("_EnemyItem") || def.name.Contains("_LunarItem")) { int length = def.name.LastIndexOf('_'); string text2 = def.name.Substring(0, length); ItemIndex val = ItemCatalog.FindItemIndex(text2); ItemDef itemDef = ItemCatalog.GetItemDef(val); string text3 = text2; if ((Object)(object)itemDef != (Object)null) { string text4 = Language.GetString(itemDef.nameToken); string text5 = "FFFFFF"; ItemTier tier = itemDef.tier; ItemTier val2 = tier; text5 = (int)val2 switch { 0 => ColorCatalog.GetColorHexString((ColorIndex)1), 1 => ColorCatalog.GetColorHexString((ColorIndex)2), 2 => ColorCatalog.GetColorHexString((ColorIndex)3), 4 => ColorCatalog.GetColorHexString((ColorIndex)13), 3 => ColorCatalog.GetColorHexString((ColorIndex)4), 6 => ColorCatalog.GetColorHexString((ColorIndex)25), 7 => ColorCatalog.GetColorHexString((ColorIndex)25), 8 => ColorCatalog.GetColorHexString((ColorIndex)25), 9 => ColorCatalog.GetColorHexString((ColorIndex)25), _ => "FFFFFF", }; text3 = "" + text4 + ""; } if (def.name.Contains("_Printer")) { return Language.GetStringFormatted("PRINTER_ITEMS_MODIFIER_DESCRIPTION", new object[1] { text3 }); } if (def.name.Contains("_EnemyItem")) { if ((Object)(object)itemDef != (Object)null) { int itemStack = EnemyItemsModifier.GetItemStack(itemDef, mod.stack); return Language.GetStringFormatted("ENEMY_ITEMS_MODIFIER_DESCRIPTION", new object[2] { text3, itemStack }); } return Language.GetStringFormatted("ENEMY_ITEMS_MODIFIER_DESCRIPTION", new object[2] { text3, mod.stack }); } if (def.name.Contains("_LunarItem")) { if (StageModifierDirector.instance.purifyLunarItemModifier) { return Language.GetStringFormatted("LUNAR_ITEMS_MODIFIER_DESCRIPTION_PURIFY", new object[1] { text3 }); } return Language.GetStringFormatted("LUNAR_ITEMS_MODIFIER_DESCRIPTION_DEFAULT", new object[1] { text3 }); } } else { if (def.isArtifact) { return "" + Language.GetStringFormatted(def.descriptionToken, Array.Empty()) + ""; } if (def.name == "Doppelganger") { string cooldownString = DoppelgangerModifier.GetCooldownString(mod.stack); return Language.GetStringFormatted("MODIFIER_DOPPELGANGER_DESCRIPTION", new object[1] { cooldownString }); } } return Language.GetString(def.descriptionToken) + text; } public static List GetPool(RoutePortalType routePortalType, bool isNegative = false, bool isItemPool = false) { if (isNegative) { if (isItemPool) { return enemyItemPool; } if (routePortalType == RoutePortalType.MoonTeleporter || routePortalType == RoutePortalType.FalseSon) { return bossPool; } return generalNegativePool; } return routePortalType switch { RoutePortalType.ItemType => itemTypePool, RoutePortalType.DroneType => droneTypePool, RoutePortalType.Rare => rarePool, RoutePortalType.Combat => combatPool, RoutePortalType.Heal => healPool, RoutePortalType.Utility => utilityPool, RoutePortalType.ChefType => chefPool, RoutePortalType.Colossus => GetRandomPool(), RoutePortalType.FalseSon => bossPool, RoutePortalType.MoonTeleporter => bossPool, _ => itemTypePool, }; } public static List GetRandomPool() { List[] array = new List[5] { droneTypePool, rarePool, combatPool, healPool, utilityPool }; List list = Run.instance.stageRng.NextElementUniform>(array); Log.Info("GetRandomPool: For collosus got random pool with " + list[0]); return list; } public static ModifierDef SelectModifier(HashSet banned, RoutePortalType portalType, ModifierTier tier, List typePool) { if (typePool.Count == 0) { Log.Warning(string.Format("{0}: Couldnt get pool for portal type - {1}", "SelectModifier", portalType)); } else { Log.Info(string.Format("{0}: {1} - Got pool with {2} modifiers", "SelectModifier", portalType, typePool.Count)); } WeightedSelection val = new WeightedSelection(8); foreach (string item in typePool) { if (!banned.Contains(item)) { ModifierDef modifierDef = FindModifier(item); if (modifierDef == null) { Log.Error("SelectModifier: Returning null for name " + item); } else if (modifierDef.isAvailable() && (modifierDef.tier == tier || (modifierDef.tier < tier && modifierDef.isStackable))) { val.AddChoice(modifierDef, modifierDef.weight); } } } if (val.Count > 0) { return val.Evaluate(Run.instance.stageRng.nextNormalizedFloat); } Log.Warning(string.Format("{0}: Selection is empty for Type: {1}, Tier: {2}, banlist:", "SelectModifier", portalType, tier)); foreach (string item2 in banned) { Log.Warning("\t" + item2); } return null; } } } namespace RiskOfRoutes.StageModifiers.SceneModifiers { public class SoulCostModifier : StageModifier { public float curseAdd = 0f; public SoulCostModifier(int stack) { base.stack = stack; } public override void OnEnd() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown PurchaseInteraction.Awake -= new hook_Awake(PurchaseInteraction_Awake); foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { if (Object.op_Implicit((Object)(object)instance.master) && Object.op_Implicit((Object)(object)instance.master.GetBody())) { instance.master.inventory.RemoveItem(ModItemsManager.soulCostCurse, 1); } } } public override void OnStart() { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown curseAdd = 0.03f + (float)(stack - 1) * Mathf.Max((float)(RiskOfRoutes.soulCostStackPercent.Value / 100), 0.25f); if (NetworkServer.active && Object.op_Implicit((Object)(object)StageModifierDirector.instance)) { StageModifierDirector.instance.NetworkcursePerStack = stack; StageModifierDirector.instance.NetworksyncedBaseCurse = 0f; } Log.Info($"SoulCost stack - {stack}"); Log.Info($"CurseAdd - {curseAdd}"); PurchaseInteraction.Awake += new hook_Awake(PurchaseInteraction_Awake); } private void PurchaseInteraction_Awake(orig_Awake orig, PurchaseInteraction self) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 orig.Invoke(self); if ((int)self.costType == 1 && self.cost > 0) { ((UnityEvent)(object)self.onPurchase).AddListener((UnityAction)PlayerPurchase); } } private void PlayerPurchase(Interactor interactor) { if (!NetworkServer.active) { return; } if (RiskOfRoutes.soulCostCurseShared.Value) { foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { if (Object.op_Implicit((Object)(object)instance.master) && Object.op_Implicit((Object)(object)instance.master.GetBody())) { instance.master.inventory.GiveItem(ModItemsManager.soulCostCurse, 1); } } return; } CharacterBody component = ((Component)interactor).GetComponent(); if (!((Object)(object)component == (Object)null)) { component.inventory.GiveItem(ModItemsManager.soulCostCurse, 1); } } } } namespace RiskOfRoutes.StageModifiers.OtherModifiers { public class LunarItemsModifier : StageModifier { private ItemDef lunarItem; public LunarItemsModifier(string internalName) { lunarItem = PrinterItemModifier.stringToItemDef(internalName); } public LunarItemsModifier(ItemDef item) { lunarItem = item; } public override void OnEnd() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown if ((Object)(object)lunarItem == (Object)null || (Object)(object)Run.instance == (Object)null || PlayerCharacterMasterController.instances == null || CharacterMaster.readOnlyInstancesList.Count == 0) { Log.Error("Lunar item is null"); return; } ItemIcon.SetItemIndex_ItemIndex_int_float -= new hook_SetItemIndex_ItemIndex_int_float(ChangeLunarIcon); ReadOnlyCollection instances = PlayerCharacterMasterController.instances; foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList) { if (!((Object)(object)readOnlyInstances.playerCharacterMasterController != (Object)null) || !((Object)(object)readOnlyInstances.inventory != (Object)null)) { continue; } ItemDef val = ((Run.instance.stageRng.nextNormalizedFloat > 0.2f) ? Items.Pearl : Items.ShinyPearl); if (readOnlyInstances.inventory.GetItemCountEffective(lunarItem) > 0) { readOnlyInstances.inventory.RemoveItemPermanent(lunarItem, 1); if (StageModifierDirector.instance.purifyLunarItemModifier) { readOnlyInstances.inventory.GiveItemPermanent(val, 1); Log.Info("LunarItemModifier Gave player " + readOnlyInstances.playerCharacterMasterController.GetDisplayName() + " a " + ((Object)val).name); } } } } public override void OnStart() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown if ((Object)(object)lunarItem == (Object)null) { Log.Error("Lunar item is null"); return; } ItemIcon.SetItemIndex_ItemIndex_int_float += new hook_SetItemIndex_ItemIndex_int_float(ChangeLunarIcon); foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList) { if ((Object)(object)readOnlyInstances.playerCharacterMasterController != (Object)null && (Object)(object)readOnlyInstances.inventory != (Object)null) { readOnlyInstances.inventory.GiveItemPermanent(lunarItem, 1); } } } private void ChangeLunarIcon(orig_SetItemIndex_ItemIndex_int_float orig, ItemIcon self, ItemIndex newItemIndex, int newItemCount, float newDurationPercent) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, newItemIndex, newItemCount, newDurationPercent); if (newItemIndex == lunarItem.itemIndex) { ((Graphic)self.image).color = new Color(0.3f, 0.3f, 0.3f, 1f); } else { ((Graphic)self.image).color = Color.white; } } } public class SaveMountainEffectModifier : StageModifier { public SaveMountainEffectModifier(int stack) { base.stack = stack; } public override void OnEnd() { Log.Info("SaveMountain on end"); Stage.onServerStageBegin -= Stage_onServerStageBegin; } public override void OnStart() { Log.Info("SaveMountain on start"); Stage.onServerStageBegin += Stage_onServerStageBegin; } private void Stage_onServerStageBegin(Stage obj) { TeleporterInteraction.instance.SetShrineStack(stack); } } public class UpgradeDronesModifier : StageModifier { public UpgradeDronesModifier(int stack) { base.stack = stack; } public override void OnEnd() { Log.Info("Droen upgrade end"); } public override void OnStart() { Log.Info("UpgradeDrones on start"); for (int i = 0; i < stack; i++) { UpgradePlayerDrones(); } } private void UpgradePlayerDrones() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList) { if ((Object)(object)readOnlyInstances == (Object)null) { continue; } CharacterBody body = readOnlyInstances.GetBody(); MinionGroup val = MinionGroup.FindGroup(((NetworkBehaviour)readOnlyInstances).netId); if (val == null) { continue; } MinionOwnership[] members = val.members; if (members == null || members.Length == 0) { continue; } MinionOwnership[] array = members; foreach (MinionOwnership val2 in array) { if (Object.op_Implicit((Object)(object)val2)) { CharacterMaster component = ((Component)val2).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory)) { component.inventory.GiveItemPermanent(Items.DroneUpgradeHidden, stack); } } } } } } } namespace RiskOfRoutes.StageModifiers.CombatModifiers { public class BossAspectModifier : StageModifier { public List tier1EliteAspects = new List { Equipment.AffixRed.equipmentIndex, Equipment.AffixRed.equipmentIndex, Equipment.AffixRed.equipmentIndex, Equipment.AffixRed.equipmentIndex, Equipment.AffixRed.equipmentIndex }; public List tier2EliteAspects = new List { Equipment.AffixRed.equipmentIndex }; public List tier3EliteAspects = new List { Equipment.AffixRed.equipmentIndex }; public override void OnEnd() { Log.Info("Boss aspect on end"); SpawnCard.onSpawnedServerGlobal -= OnSpawnCardOnSpawnedServerGlobal; } public override void OnStart() { Log.Info("Boss aspect on start"); SpawnCard.onSpawnedServerGlobal += OnSpawnCardOnSpawnedServerGlobal; } private void OnSpawnCardOnSpawnedServerGlobal(SpawnResult result) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) if (!result.success || !Object.op_Implicit((Object)/*isinst with value type is only supported in some contexts*/) || result.spawnRequest.teamIndexOverride == (TeamIndex?)1) { return; } CharacterMaster component = result.spawnedInstance.gameObject.GetComponent(); if (!((Object)(object)component == (Object)null)) { CharacterBody body = component.GetBody(); if (!((Object)(object)body == (Object)null) && body.isBoss) { Log.Info("Boss spawned:" + ((Object)body).name); component.inventory.SetEquipmentIndex(Equipment.AffixRed.equipmentIndex, true); } } } } public class BossSwarmModifier : StageModifier { public int spawnCount = 10; private static bool inSpawn; public override void OnEnd() { Log.Info("Boss swarm on end"); SpawnCard.onSpawnedServerGlobal -= OnSpawnCardOnSpawnedServerGlobal; } public override void OnStart() { Log.Info("Boss swarm on start"); SpawnCard.onSpawnedServerGlobal += OnSpawnCardOnSpawnedServerGlobal; } private void OnSpawnCardOnSpawnedServerGlobal(SpawnResult result) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) if (!result.success || !Object.op_Implicit((Object)/*isinst with value type is only supported in some contexts*/) || result.spawnRequest.teamIndexOverride == (TeamIndex?)1) { return; } CharacterMaster component = result.spawnedInstance.gameObject.GetComponent(); if ((Object)(object)component == (Object)null) { return; } CharacterBody body = component.GetBody(); if ((Object)(object)body == (Object)null || !body.isBoss) { return; } Log.Info("Boss spawned:" + ((Object)body).name); component.inventory.GiveItemPermanent(Items.CutHp, spawnCount / 2); if (inSpawn) { return; } for (int i = 1; i < spawnCount; i++) { inSpawn = true; try { DirectorCore.instance.TrySpawnObject(result.spawnRequest); } catch (Exception ex) { Debug.LogError((object)ex); } inSpawn = false; } } } public class DoppelgangerModifier : StageModifier { private float coolDown = 0f; private static float defaultTime = 240f; public DoppelgangerModifier(int stack) { base.stack = stack; } public override void OnEnd() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown Run.FixedUpdate -= new hook_FixedUpdate(Run_FixedUpdate); } public override void OnStart() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown coolDown = Run.instance.GetRunStopwatch() + defaultTime; Run.FixedUpdate += new hook_FixedUpdate(Run_FixedUpdate); } private void Run_FixedUpdate(orig_FixedUpdate orig, Run self) { orig.Invoke(self); if (NetworkServer.active && !self.isGameOverServer && self.fixedTime > coolDown) { Log.Info("Here doppel"); PerformInvasion(); coolDown = self.fixedTime + Mathf.Max(defaultTime - (float)(RiskOfRoutes.doppelStackTime.Value * (stack - 1)), 60f); } } public static string GetCooldownString(int stack) { float num = Mathf.Max(defaultTime - (float)(StageModifierDirector.instance.doppelStackTime * (stack - 1)), 60f); int num2 = Mathf.RoundToInt(num); int num3 = num2 / 60; int num4 = num2 % 60; if (num4 > 0) { return Language.GetStringFormatted("DOPPELGANGER_TIME", new object[2] { num3, num4 }); } return Language.GetStringFormatted("DOPPELGANGER_TIME_MINUTE", new object[1] { num3 }); } private void PerformInvasion() { ReadOnlyCollection instances = PlayerCharacterMasterController.instances; Log.Info(instances.Count); foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { if (Object.op_Implicit((Object)(object)instance) && Object.op_Implicit((Object)(object)instance.master) && !instance.master.IsDeadAndOutOfLivesServer()) { CreateDoppelganger(instance.master, Run.instance.stageRng); } } } private static void CreateDoppelganger(CharacterMaster srcCharacterMaster, Xoroshiro128Plus rng) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown SpawnCard val = (SpawnCard)(object)FromMaster(srcCharacterMaster); if (!Object.op_Implicit((Object)(object)val)) { Log.Error("CreateDoppelganger: No doppelganger spawn card"); return; } Transform spawnOnTarget; MonsterSpawnDistance val2; if (Object.op_Implicit((Object)(object)TeleporterInteraction.instance)) { spawnOnTarget = ((Component)TeleporterInteraction.instance).transform; val2 = (MonsterSpawnDistance)1; } else { spawnOnTarget = srcCharacterMaster.GetBody().coreTransform; val2 = (MonsterSpawnDistance)1; } DirectorPlacementRule val3 = new DirectorPlacementRule { spawnOnTarget = spawnOnTarget, placementMode = (PlacementMode)3 }; DirectorCore.GetMonsterSpawnDistance(val2, ref val3.minDistance, ref val3.maxDistance); DirectorSpawnRequest val4 = new DirectorSpawnRequest(val, val3, rng); val4.teamIndexOverride = (TeamIndex)2; val4.ignoreTeamMemberLimit = true; CombatSquad combatSquad = null; val4.onSpawnedServer = (Action)Delegate.Combine(val4.onSpawnedServer, (Action)delegate(SpawnResult result) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)combatSquad)) { combatSquad = Object.Instantiate(LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/Encounters/ShadowCloneEncounter")).GetComponent(); } combatSquad.AddMember(result.spawnedInstance.GetComponent()); }); DirectorCore.instance.TrySpawnObject(val4); Object.Destroy((Object)(object)val); } public static DoppelgangerSpawnCard FromMaster(CharacterMaster srcCharacterMaster) { if (!Object.op_Implicit((Object)(object)srcCharacterMaster) || !Object.op_Implicit((Object)(object)srcCharacterMaster.GetBody())) { Log.Error("Here"); return null; } DoppelgangerSpawnCard val = ScriptableObject.CreateInstance(); MasterCopySpawnCard.CopyDataFromMaster((MasterCopySpawnCard)(object)val, srcCharacterMaster, true, true); ((MasterCopySpawnCard)val).GiveItem(Items.InvadingDoppelganger, 1); ((MasterCopySpawnCard)val).onPreSpawnSetup = OnPreSpawnSetup; return val; void OnPreSpawnSetup(CharacterMaster spawnedMaster) { BaseAI ai = ((Component)spawnedMaster).GetComponent(); CharacterBody srcBody = srcCharacterMaster.GetBody(); ai.onBodyDiscovered += SetEnemyToOriginator; void SetEnemyToOriginator(CharacterBody body) { ai.currentEnemy.gameObject = ((Component)srcBody).gameObject; ai.onBodyDiscovered -= SetEnemyToOriginator; } } } } } namespace RiskOfRoutes.ModSupport { internal class CleanestHudCompat { private static bool? _enabled; public static bool enabled { get { if (!_enabled.HasValue) { _enabled = Chainloader.PluginInfos.ContainsKey("LordVGames.CleanestHud"); bool? flag = _enabled; Log.Info("IS IS ENBALBESD: " + flag); } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void Hooks() { RouteMapUI.OnRouteMapDrawn += RouteMapUI_OnRouteMapDrawn; RouteMapUI.OnPunishmentBarDrawn += RouteMapUI_OnPunishmentBarDrawn; ModUIManager.OnRoutePortalPanelUpdated += ModUIManager_OnRoutePortalPanelUpdated; } private static void ModUIManager_OnRoutePortalPanelUpdated(GameObject routePortalPanel, RoutePortalManager mg) { //IL_001d: 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_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) if (enabled && RiskOfRoutes.cleanestHudCompat.Value) { Color survivorColor = HudColor.SurvivorColor; switch (mg.routeNode.portalType) { case RoutePortalType.Combat: ((Color)(ref survivorColor))..ctor(0.7490196f, 0.3019608f, 0f, 1f); break; case RoutePortalType.Utility: ((Color)(ref survivorColor))..ctor(0.08627451f, 0f, 0.7490196f, 1f); break; case RoutePortalType.Heal: ((Color)(ref survivorColor))..ctor(2f / 15f, 0.7490196f, 0f, 1f); break; case RoutePortalType.ChefType: ((Color)(ref survivorColor))..ctor(0.4745098f, 0.7490196f, 2f / 51f, 1f); break; case RoutePortalType.Rare: ((Color)(ref survivorColor))..ctor(0.7490196f, 0.03137255f, 0f, 1f); break; case RoutePortalType.DroneType: ((Color)(ref survivorColor))..ctor(9f / 85f, 22f / 85f, 0.7490196f, 1f); break; default: ((Color)(ref survivorColor))..ctor(2f / 51f, 0.2509804f, 0.7490196f, 1f); break; } Log.Info("ПогнаооФж"); GameObject gameObject = ((Component)routePortalPanel.transform.Find("Outline")).gameObject; GameObject val = null; Image val2 = null; SkillIcon[] skillIcons = Main.MyHud.skillIcons; foreach (SkillIcon val3 in skillIcons) { val = val3.isReadyPanelObject; val2 = val.GetComponent(); } gameObject.GetComponent().sprite = val2.sprite; ((Graphic)gameObject.GetComponent()).color = survivorColor; GameObject gameObject2 = ((Component)routePortalPanel.transform.Find("PortraitRect/Outline")).gameObject; gameObject2.GetComponent().sprite = val2.sprite; ((Graphic)gameObject2.GetComponent()).color = survivorColor; GameObject gameObject3 = ((Component)routePortalPanel.transform.Find("PortraitRect")).gameObject; ((Graphic)gameObject3.GetComponent()).color = new Color(0.102f, 0.0118f, 0.102f, 0.576f); GameObject gameObject4 = ((Component)routePortalPanel.transform.Find("BodyRect (1)")).gameObject; ((Graphic)gameObject4.GetComponent()).color = new Color(0.102f, 0.0118f, 0.102f, 0.576f); } } private static void RouteMapUI_OnPunishmentBarDrawn(GameObject obj) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (enabled && RiskOfRoutes.cleanestHudCompat.Value) { RouteMapUI component = obj.GetComponent(); if (!((Object)(object)component == (Object)null)) { Color survivorColor = HudColor.SurvivorColor; ((Graphic)component.barImageHorizontal).color = survivorColor; ((Graphic)component.barImageVertical).color = survivorColor; } } } private static void RouteMapUI_OnRouteMapDrawn(GameObject routeMap) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Unknown result type (might be due to invalid IL or missing references) //IL_04a1: Unknown result type (might be due to invalid IL or missing references) if (!enabled || !RiskOfRoutes.cleanestHudCompat.Value) { return; } Log.Info($"Survivor color: {HudColor.SurvivorColor}"); RouteMapUI component = routeMap.GetComponent(); if ((Object)(object)component == (Object)null) { return; } routeMap.transform.localPosition = ((RiskOfRoutes.cleanestHudOption.Value == RiskOfRoutes.CleanestHUDOptions.BottomCenter) ? RouteMapUI.CleanestHUDCenterPos : RouteMapUI.CleanestHUDBottomRightPos); routeMap.transform.localEulerAngles = ((RiskOfRoutes.cleanestHudOption.Value == RiskOfRoutes.CleanestHUDOptions.BottomCenter) ? new Vector3(0f, 0f, 0f) : new Vector3(0f, 6f, 0f)); RectTransform component2 = routeMap.GetComponent(); component2.sizeDelta = RouteMapUI.CleanestHudRectSize; Log.Info("Got it"); Color survivorColor = HudColor.SurvivorColor; RectTransform nodeContainer = component.nodeContainer; Image component3 = ((Component)nodeContainer).GetComponent(); if ((Object)(object)component3 != (Object)null) { ((Graphic)component3).color = new Color(0.102f, 0.0118f, 0.102f, 0.576f); } else { Log.Error("Container BG Image is null"); } GameObject val = null; Image val2 = null; SkillIcon[] skillIcons = Main.MyHud.skillIcons; foreach (SkillIcon val3 in skillIcons) { val = val3.isReadyPanelObject; val2 = val.GetComponent(); } GameObject gameObject = ((Component)((Transform)component.mainContainer).Find("Outline")).gameObject; Image component4 = gameObject.GetComponent(); Log.Info("Outline image: " + ((Object)component4).name + ", cleanest hud outline: " + ((Object)val2).name); component4.sprite = val2.sprite; ((Graphic)component4).color = survivorColor; GameObject horizontalBars = component.horizontalBars; Transform val4 = horizontalBars.transform.Find("HorizontalBarContainer/Outline"); Transform val5 = horizontalBars.transform.Find("HorizontalBarContainer/LabelRect"); if ((Object)(object)val4 != (Object)null) { Image component5 = ((Component)val4).GetComponent(); if ((Object)(object)component5 != (Object)null) { component5.sprite = val2.sprite; ((Graphic)component5).color = survivorColor; } } if ((Object)(object)val5 != (Object)null) { Image component6 = ((Component)val5).GetComponent(); if ((Object)(object)component6 != (Object)null) { ((Graphic)component6).color = new Color(0.102f, 0.0118f, 0.102f, 0.576f); } } Transform val6 = horizontalBars.transform.Find("HorizontalLabelContainer/Outline"); Transform val7 = horizontalBars.transform.Find("HorizontalLabelContainer/LabelRect"); if ((Object)(object)val6 != (Object)null) { Image component7 = ((Component)val6).GetComponent(); if ((Object)(object)component7 != (Object)null) { component7.sprite = val2.sprite; ((Graphic)component7).color = survivorColor; } } if ((Object)(object)val7 != (Object)null) { Image component8 = ((Component)val7).GetComponent(); if ((Object)(object)component8 != (Object)null) { ((Graphic)component8).color = new Color(0.102f, 0.0118f, 0.102f, 0.576f); } } GameObject verticalBars = component.verticalBars; if (!((Object)(object)verticalBars != (Object)null)) { return; } Transform val8 = verticalBars.transform.Find("VerticalLabelContainer/Outline"); Transform val9 = verticalBars.transform.Find("VerticalLabelContainer/LabelRect"); if ((Object)(object)val8 != (Object)null) { Image component9 = ((Component)val8).GetComponent(); if ((Object)(object)component9 != (Object)null) { component9.sprite = val2.sprite; ((Graphic)component9).color = survivorColor; } } if ((Object)(object)val9 != (Object)null) { Image component10 = ((Component)val9).GetComponent(); if ((Object)(object)component10 != (Object)null) { ((Graphic)component10).color = new Color(0.102f, 0.0118f, 0.102f, 0.576f); } } Transform val10 = verticalBars.transform.Find("VerticalBarContainer/Outline"); Transform val11 = verticalBars.transform.Find("VerticalBarContainer/LabelRect"); if ((Object)(object)val10 != (Object)null) { Image component11 = ((Component)val10).GetComponent(); if ((Object)(object)component11 != (Object)null) { component11.sprite = val2.sprite; ((Graphic)component11).color = survivorColor; } } if ((Object)(object)val11 != (Object)null) { Image component12 = ((Component)val11).GetComponent(); if ((Object)(object)component12 != (Object)null) { ((Graphic)component12).color = new Color(0.102f, 0.0118f, 0.102f, 0.576f); } } } } } namespace RiskOfRoutes.Items { public class ModItemsManager { [CompilerGenerated] private static class <>O { public static hook_GiveColossusItem <0>__DropBless; } public static ItemDef soulCostCurse; public static ItemDef falseSonBless; public static void InitializeItems() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Expected O, but got Unknown //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Expected O, but got Unknown //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Expected O, but got Unknown soulCostCurse = ScriptableObject.CreateInstance(); ((Object)soulCostCurse).name = "SOULCOSTCURSE_NAME"; soulCostCurse.nameToken = "SOULCOSTCURSE_NAME"; soulCostCurse.pickupToken = "SOULCOSTCURSE_PICKUP"; soulCostCurse.descriptionToken = "SOULCOSTCURSE_DESC"; soulCostCurse.loreToken = "SOULCOSTCURSE_LORE"; soulCostCurse.hidden = true; ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null); ItemAPI.Add(new CustomItem(soulCostCurse, val)); falseSonBless = ScriptableObject.CreateInstance(); ((Object)falseSonBless).name = "FALSESONBLESS_NAME"; falseSonBless.nameToken = "FALSESONBLESS_NAME"; falseSonBless.pickupToken = "FALSESONBLESS_PICKUP"; falseSonBless.descriptionToken = "FALSESONBLESS_DESC"; falseSonBless.loreToken = "FALSESONBLESS_LORE"; falseSonBless.pickupIconSprite = AssetManager.falseSonHeartIcon; falseSonBless.pickupModelPrefab = AssetManager.falseSonHeartPrefab; ItemDef obj = falseSonBless; ItemTag[] array = new ItemTag[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); obj.tags = (ItemTag[])(object)array; falseSonBless._itemTierDef = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/BossTierDef.asset").WaitForCompletion(); falseSonBless.hidden = false; ItemDisplayRuleDict val2 = new ItemDisplayRuleDict((ItemDisplayRule[])null); ItemAPI.Add(new CustomItem(falseSonBless, val2)); object obj2 = <>O.<0>__DropBless; if (obj2 == null) { hook_GiveColossusItem val3 = DropBless; <>O.<0>__DropBless = val3; obj2 = (object)val3; } SkyJumpDeathState.GiveColossusItem += (hook_GiveColossusItem)obj2; } private static void DropBless(orig_GiveColossusItem orig, SkyJumpDeathState self) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) Log.Info("Dropping false son reward 1"); orig.Invoke(self); if (NetworkServer.active && RiskOfRoutes.enableFalseSonReward.Value) { Log.Info("Dropping false son reward"); float num = 180f; Vector3 val = Quaternion.AngleAxis((float)Random.Range(0, 360), Vector3.up) * (Vector3.up * 40f + Vector3.forward * 5f); Quaternion val2 = Quaternion.AngleAxis(num, Vector3.up); Vector3 val3 = self.cachedDeathPosition + self.rewardOffset; CreatePickupInfo val4 = default(CreatePickupInfo); ((CreatePickupInfo)(ref val4)).pickupIndex = PickupCatalog.FindPickupIndex(falseSonBless.itemIndex); val4.rotation = Quaternion.identity; PickupDropletController.CreatePickupDroplet(val4, val3, val); } } } } namespace RiskOfRoutes.Helpers { public class CommandHelper : MonoBehaviour { [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGetModdedConfig(ConCommandArgs args) { Log.Info("Config artifact defs"); foreach (DefInfo item in RiskOfRoutes.moddedArtifactsInfo) { Log.Info($"\tDef: {item.name} - Tier:{item.tier} - isNegative:{item.isNegative}"); } Log.Info("Config lunar defs"); foreach (DefInfo item2 in RiskOfRoutes.moddedLunarsInfo) { Log.Info($"\tDef: {item2.name} - Tier:{item2.tier} - isNegative:{item2.isNegative}"); } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCArtifactsAvailable(ConCommandArgs args) { if ((Object)(object)StageModifierDirector.instance == (Object)null) { return; } Log.Info("Artifacts available"); ArtifactDef[] artifactDefs = ArtifactCatalog.artifactDefs; foreach (ArtifactDef val in artifactDefs) { string cachedName = val.cachedName; bool flag = StageModifierDirector.instance.bannedModifiersRun.Contains(cachedName); if (StageModifierCatalog.RunDefs.TryGetValue(cachedName, out var value)) { string text = (flag ? "Banned" : "Available"); string text2 = (value.isNegative ? "Negative" : "Positive"); Log.Info($"{text} {cachedName} - Tier: {value.tier} - Type: {text2}"); } else { Log.Warning("Not registered " + cachedName); } } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCLunarsAvailable(ConCommandArgs args) { if ((Object)(object)StageModifierDirector.instance == (Object)null) { return; } Log.Info("Lunars available"); foreach (ItemDef lunarRegisteredDef in StageModifierCatalog.lunarRegisteredDefs) { string text = ((Object)lunarRegisteredDef).name + "_LunarItem"; bool flag = StageModifierDirector.instance.bannedModifiersRun.Contains(text); if (StageModifierCatalog.RunDefs.TryGetValue(text, out var value)) { string text2 = (flag ? "Banned" : "Available"); string text3 = (value.isNegative ? "Negative" : "Positive"); Log.Info($"{text2} {text} - Tier: {value.tier} - Type: {text3}"); } else { Log.Warning("Not registered " + text); } } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCRunPools(ConCommandArgs args) { if ((Object)(object)StageModifierDirector.instance == (Object)null) { return; } Log.Info("active general negative pool:"); foreach (string item in StageModifierCatalog.generalNegativePool) { if (!StageModifierDirector.instance.bannedModifiersRun.Contains(item) && StageModifierCatalog.RunDefs.TryGetValue(item, out var value)) { Log.Info($"\t Tier:{value.tier} - {item}"); } } Log.Info("active rare pool:"); foreach (string item2 in StageModifierCatalog.rarePool) { if (!StageModifierDirector.instance.bannedModifiersRun.Contains(item2) && StageModifierCatalog.RunDefs.TryGetValue(item2, out var value2)) { Log.Info($"\t Tier:{value2.tier} - {item2}"); } } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGetNextStagesScenes(ConCommandArgs args) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) Log.Info("Next stages available:"); ChoiceInfo[] choices = SceneHelper.GetNextStagesScenesList().choices; for (int i = 0; i < choices.Length; i++) { ChoiceInfo val = choices[i]; Log.Info($"\t{val.value.cachedName}:weight - {val.weight}"); } Log.Info(Run.instance.nextStageScene.destinationsGroup); } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGetEnabledMods(ConCommandArgs args) { foreach (KeyValuePair pluginInfo in Chainloader.PluginInfos) { Log.Info($"Plugin: {pluginInfo.Key}, version: {pluginInfo.Value.Metadata.Version}"); } Log.Info("CLeanst: LordVGames.CleanestHud"); Log.Info(string.Format("Is it? {0}", Chainloader.PluginInfos.ContainsKey("LordVGames.CleanestHud"))); } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGetBannedStage(ConCommandArgs args) { Log.Info("Banned on stage: "); foreach (string item in StageModifierDirector.instance.bannedModifiersStage) { Log.Info("\t" + item); } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCAdvanceToNode(ConCommandArgs args) { if (!NetworkServer.active) { return; } int value = ((ConCommandArgs)(ref args)).TryGetArgInt(0).Value; StageModifierDirector.instance.punishCommandStack = value; Log.Info($"Set additional punish to {value}"); Log.Info("Banned on stage: "); foreach (string item in StageModifierDirector.instance.bannedModifiersStage) { Log.Info("\t" + item); } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCRollMap(ConCommandArgs args) { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) if (RiskOfRoutes.allowDebug.Value && NetworkServer.active) { int y = StageModifierDirector.instance.currentNode.y; Log.Info("Creating new route map"); RouteMap routeMap = StageModifierDirector.instance.routeMap; routeMap = new RouteMap(Run.instance.runRNG); RouteMap.RouteNode currentNode = StageModifierDirector.instance.currentNode; currentNode = routeMap.GetRandomNodeOnFloor(y, Run.instance.stageRng); currentNode.visited = true; Log.Info($"Current:{currentNode.x},{currentNode.y} that has {currentNode.GetPaths().Count} paths"); routeMap.isDirty = true; StageModifierDirector.instance.routeMap = routeMap; StageModifierDirector.instance.currentNode = currentNode; StageModifierDirector.instance.NetworkcurrentNodeSync = new Vector2((float)currentNode.x, (float)currentNode.y); } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCAllModifierDefs(ConCommandArgs args) { Log.Info("All modifier defs"); foreach (KeyValuePair allDef in StageModifierCatalog.AllDefs) { bool flag = StageModifierCatalog.additionalDefs.Contains(allDef.Key); Log.Info($"\t name:{allDef.Key}, tier: {allDef.Value.tier}, isAdditional: {flag}"); } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCRunDefs(ConCommandArgs args) { Log.Info("All run defs"); foreach (KeyValuePair runDef in StageModifierCatalog.RunDefs) { bool flag = StageModifierCatalog.additionalDefs.Contains(runDef.Key); Log.Info($"\t name:{runDef.Key}, tier: {runDef.Value.tier}, isAdditional: {flag}"); } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGetBannedRun(ConCommandArgs args) { Log.Info("Banned in run: "); foreach (string item in StageModifierDirector.instance.bannedModifiersRun) { Log.Info("\t" + item); } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCBossAscpect(ConCommandArgs args) { } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGetConfigBanned(ConCommandArgs args) { Log.Info("Banned in config: "); string text = RiskOfRoutes.bannedModifierDefs.ToString(); Log.Info(text ?? ""); } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGetAvailablePrinters(ConCommandArgs args) { Log.Info("Printer items: "); Log.Info("\tUtility pool: "); foreach (string item in StageModifierCatalog.utilityPool) { Log.Info("\t\t" + item); } Log.Info("Heal pool: "); foreach (string item2 in StageModifierCatalog.healPool) { Log.Info("\t\t" + item2); } Log.Info("Damage pool: "); foreach (string item3 in StageModifierCatalog.combatPool) { Log.Info("\t\t" + item3); } Log.Info("Food-related pool: "); foreach (string item4 in StageModifierCatalog.chefPool) { Log.Info("\t\t" + item4); } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGetAvailableEnemyItems(ConCommandArgs args) { Log.Info("Enemy items: "); foreach (string item in StageModifierCatalog.generalNegativePool) { if (item.EndsWith("_EnemyItem")) { Log.Info("\t" + item); } } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGetAvailableLunarItems(ConCommandArgs args) { Log.Info("Lunar items: "); foreach (string item in StageModifierCatalog.generalNegativePool) { if (item.EndsWith("_LunarItem")) { Log.Info("\t" + item); } } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGetAvailableArtifacts(ConCommandArgs args) { Log.Info("general negative pool: "); foreach (string item in StageModifierCatalog.generalNegativePool.Where((string def) => !StageModifierDirector.instance.bannedModifiersRun.Contains(def))) { Log.Info("\t" + item); } Log.Info("rare pool: "); foreach (string item2 in StageModifierCatalog.rarePool.Where((string def) => !StageModifierDirector.instance.bannedModifiersRun.Contains(def))) { Log.Info("\t" + item2); } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGetAllArtifactDefs(ConCommandArgs args) { Log.Info("Artifacts defs: "); ArtifactDef[] artifactDefs = ArtifactCatalog.artifactDefs; foreach (ArtifactDef val in artifactDefs) { Log.Info("\t" + val.cachedName + " - " + val.nameToken); } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCReinit(ConCommandArgs args) { StageModifierCatalog.Init(AssetManager.bundle); ModItemsManager.InitializeItems(); } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGetNextGreenStage(ConCommandArgs args) { Log.Info($"Modul:{Stage.instance.sceneDef.stageOrder}"); } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGetDccs(ConCommandArgs args) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) Log.Info("Available enemies"); WeightedSelection monsterSelection = ClassicStageInfo.instance.monsterSelection; if (monsterSelection != null) { for (int i = 0; i < monsterSelection.Count; i++) { DirectorCard value = monsterSelection.GetChoice(i).value; Log.Info($"DirectorCard {((Object)value.spawnCard).name}, cost: {value.cost}, weight: {value.selectionWeight}"); } } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGetCurrentNode(ConCommandArgs args) { List routeNodesSynced = StageModifierDirector.instance.routeNodesSynced; if (routeNodesSynced.Count == 0) { Log.Error("none"); } foreach (RouteNodeSync item in routeNodesSynced) { Log.Info($"{item.x}.{item.y}:{item.portalType}-{item.visited}"); } RouteMap.RouteNode currentNode = StageModifierDirector.instance.currentNode; Log.Info($"Current node is {currentNode.x},{currentNode.y} with {currentNode.GetPaths().Count} children, visited {currentNode.visited}"); Log.Info("\tNext scene:" + Run.instance.nextStageScene.cachedName); Log.Info("\tCurr scene:" + Stage.instance.sceneDef.cachedName); Log.Info($"\tLoop clear count:{Run.instance.loopClearCount}"); Log.Info($"Child node: {currentNode.GetPaths()[0].x}.{currentNode.GetPaths()[0].y}: {currentNode.GetPaths()[0].portalType}"); } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGetElitesAvailable(ConCommandArgs args) { FieldInfo field = typeof(CombatDirector).GetField("eliteTiers", BindingFlags.Static | BindingFlags.NonPublic); if (!(field != null)) { return; } EliteTierDef[] array = (EliteTierDef[])field.GetValue(null); Log.Info($"Tier count{array.Length}"); for (int i = 0; i < array.Length; i++) { Log.Info($"Tier{i + 1}: {array[i].availableDefs.Count}"); foreach (EliteDef availableDef in array[i].availableDefs) { if ((Object)(object)availableDef != (Object)null) { Log.Info("\t " + ((Object)availableDef).name); } } } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGetItemDefs(ConCommandArgs args) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) Log.Info("Enemies can have"); foreach (ItemDef item in ((IEnumerable)(object)ItemCatalog.allItemDefs).Where((ItemDef def) => def.DoesNotContainTag((ItemTag)4))) { Log.Info($"\t{((Object)item).name}, {item.requiredExpansion}"); } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCSetPunish(ConCommandArgs args) { if (NetworkServer.active) { int value = ((ConCommandArgs)(ref args)).TryGetArgInt(0).Value; StageModifierDirector.instance.punishCommandStack = value; Log.Info($"Set additional punish to {value}"); } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void GetCoeff(ConCommandArgs args) { if (RiskOfRoutes.allowDebug.Value && NetworkServer.active && Object.op_Implicit((Object)(object)((ConCommandArgs)(ref args)).senderMaster)) { ((ConCommandArgs)(ref args)).senderMaster.GetBody().inventory.GiveItemPermanent(Items.AlienHead, 1); ((ConCommandArgs)(ref args)).senderMaster.GetBody().inventory.GiveItemPermanent(Items.Knurl, 1); ((ConCommandArgs)(ref args)).senderMaster.GetBody().inventory.GiveItemPermanent(Items.ExtraLifeConsumed, 1); Log.Info($"Red:{StageModifierDirector.instance.CheckPlayersRedItem()}, yellow:{StageModifierDirector.instance.CheckPlayersYellowItem()}"); } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGiveMoney(ConCommandArgs args) { if (RiskOfRoutes.allowDebug.Value && NetworkServer.active && Object.op_Implicit((Object)(object)((ConCommandArgs)(ref args)).senderMaster)) { ((ConCommandArgs)(ref args)).senderMaster.GiveMoney(1000u); ((ConCommandArgs)(ref args)).senderMaster.GiveMoneyWithOnLevelUpFreeUnlock(1000u); Log.Info("Gave 1000 gold to " + ((Object)((ConCommandArgs)(ref args)).senderMaster).name); } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCItemTags(ConCommandArgs args) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Invalid comparison between Unknown and I4 //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Invalid comparison between Unknown and I4 //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Invalid comparison between Unknown and I4 Log.Info("Items with damage tag"); Enumerator enumerator = ItemCatalog.allItemDefs.GetEnumerator(); try { while (enumerator.MoveNext()) { ItemDef current = enumerator.Current; if (current.tags.Contains((ItemTag)1) && ((int)current.tier == 0 || (int)current.tier == 1)) { Log.Info("\t" + ((Object)current).name + ":" + Language.GetString(current.nameToken)); } } } finally { ((IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose(); } Log.Info("Items with healing tag"); Enumerator enumerator2 = ItemCatalog.allItemDefs.GetEnumerator(); try { while (enumerator2.MoveNext()) { ItemDef current2 = enumerator2.Current; if (current2.tags.Contains((ItemTag)2) && ((int)current2.tier == 0 || (int)current2.tier == 1)) { Log.Info("\t" + ((Object)current2).name + ":" + Language.GetString(current2.nameToken)); } } } finally { ((IDisposable)enumerator2/*cast due to .constrained prefix*/).Dispose(); } Log.Info("Items with utility tag"); Enumerator enumerator3 = ItemCatalog.allItemDefs.GetEnumerator(); try { while (enumerator3.MoveNext()) { ItemDef current3 = enumerator3.Current; if (current3.tags.Contains((ItemTag)3) && ((int)current3.tier == 0 || (int)current3.tier == 1)) { Log.Info("\t" + ((Object)current3).name + ":" + Language.GetString(current3.nameToken)); } } } finally { ((IDisposable)enumerator3/*cast due to .constrained prefix*/).Dispose(); } Log.Info("Items with food-related tag"); Enumerator enumerator4 = ItemCatalog.allItemDefs.GetEnumerator(); try { while (enumerator4.MoveNext()) { ItemDef current4 = enumerator4.Current; if (current4.tags.Contains((ItemTag)28) && ((int)current4.tier == 0 || (int)current4.tier == 1)) { Log.Info("\t" + ((Object)current4).name + ":" + Language.GetString(current4.nameToken)); } } } finally { ((IDisposable)enumerator4/*cast due to .constrained prefix*/).Dispose(); } Log.Info("Items with ai_blacklist tag"); Enumerator enumerator5 = ItemCatalog.allItemDefs.GetEnumerator(); try { while (enumerator5.MoveNext()) { ItemDef current5 = enumerator5.Current; if (current5.tags.Contains((ItemTag)4)) { Log.Info("\t" + ((Object)current5).name + ":" + Language.GetString(current5.nameToken)); } } } finally { ((IDisposable)enumerator5/*cast due to .constrained prefix*/).Dispose(); } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGetActiveModifiers(ConCommandArgs args) { Log.Info("Getting synced modifiers"); if (!((Object)(object)StageModifierDirector.instance != (Object)null)) { return; } SyncListModifier modifiersSynced = StageModifierDirector.instance.modifiersSynced; if (modifiersSynced != null) { if (((SyncListStruct)modifiersSynced).Count > 0) { foreach (ModifierSync item in (SyncList)(object)modifiersSynced) { Log.Info($"{item.name}:{item.stack}"); } return; } Log.Info("There are no modifiers"); } else { Log.Error("Modifiers list is null"); } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGetSyncedData(ConCommandArgs args) { Log.Info("Getting synced modifiers"); if ((Object)(object)StageModifierDirector.instance != (Object)null) { Log.Info("Modifiers synced"); { foreach (ModifierSync item in (SyncList)(object)StageModifierDirector.instance.modifiersSynced) { Log.Info($"{item.name}:{item.stack}:{item.isArtifact}"); } return; } } Log.Info("StageModifierDirector is null"); } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCGetReservedModifiers(ConCommandArgs args) { if ((Object)(object)StageModifierDirector.instance != (Object)null) { List reservedModifiers = StageModifierDirector.instance.reservedModifiers; if (reservedModifiers != null) { if (reservedModifiers.Count > 0) { foreach (ModifierSync item in reservedModifiers) { Log.Info(item); } return; } Log.Info("There are no modifiers"); } else { Log.Error("Modifiers list is null"); } } else { Log.Error("It is null"); } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCTeleporterCharge(ConCommandArgs args) { //IL_00e3: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)TeleporterInteraction.instance) || !RiskOfRoutes.allowDebug.Value || !NetworkServer.active) { return; } TeleporterInteraction instance = TeleporterInteraction.instance; instance.holdoutZoneController.charge = 0.99f; if (!Object.op_Implicit((Object)(object)instance.bossGroup) || !Object.op_Implicit((Object)(object)instance.bossGroup.combatSquad)) { return; } List list = new List(instance.bossGroup.combatSquad.readOnlyMembersList); foreach (CharacterMaster item in list) { CharacterBody body = item.GetBody(); if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.healthComponent) && body.healthComponent.alive) { body.healthComponent.Suicide((GameObject)null, (GameObject)null, DamageTypeCombo.op_Implicit((DamageType)0)); } } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCSpawnGreenPortal(ConCommandArgs args) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown if (RiskOfRoutes.allowDebug.Value && NetworkServer.active) { CharacterBody body = ((ConCommandArgs)(ref args)).senderMaster.GetBody(); Vector3 position = body.transform.position + body.transform.forward * 5f; Quaternion val = Quaternion.LookRotation(-body.transform.forward); SpawnCard val2 = LegacyResourcesAPI.Load("SpawnCards/InteractableSpawnCard/iscColossusPortal"); if (!Object.op_Implicit((Object)(object)val2)) { val2 = Addressables.LoadAssetAsync((object)"RoR2/DLC2/PortalColossus/iscPortalColossus.asset").WaitForCompletion(); } if (Object.op_Implicit((Object)(object)val2)) { DirectorPlacementRule val3 = new DirectorPlacementRule { placementMode = (PlacementMode)0, position = position }; GameObject val4 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val2, val3, RoR2Application.rng)); } } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCSpawnMountainShrine(ConCommandArgs args) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown if (RiskOfRoutes.allowDebug.Value && NetworkServer.active) { CharacterBody body = ((ConCommandArgs)(ref args)).senderMaster.GetBody(); Vector3 position = body.transform.position + body.transform.forward * 5f; Quaternion val = Quaternion.LookRotation(-body.transform.forward); SpawnCard val2 = LegacyResourcesAPI.Load("SpawnCards/InteractableSpawnCard/iscColossusPortal"); val2 = Addressables.LoadAssetAsync((object)"RoR2/Base/ShrineBoss/iscShrineBoss.asset").WaitForCompletion(); if (Object.op_Implicit((Object)(object)val2)) { DirectorPlacementRule val3 = new DirectorPlacementRule { placementMode = (PlacementMode)0, position = position }; GameObject val4 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val2, val3, RoR2Application.rng)); Log.Info("Mount availalbe:" + StageModifierDirector.instance?.CheckMountainShrine()); } } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCSpawnShopPortal(ConCommandArgs args) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown if (RiskOfRoutes.allowDebug.Value && NetworkServer.active) { CharacterBody body = ((ConCommandArgs)(ref args)).senderMaster.GetBody(); Vector3 position = body.transform.position + body.transform.forward * 5f; Quaternion val = Quaternion.LookRotation(-body.transform.forward); SpawnCard val2 = LegacyResourcesAPI.Load("SpawnCards/InteractableSpawnCard/iscShopPortal"); if (!Object.op_Implicit((Object)(object)val2)) { val2 = Addressables.LoadAssetAsync((object)"RoR2/DLC2/PortalColossus/iscPortalColossus.asset").WaitForCompletion(); } if (Object.op_Implicit((Object)(object)val2)) { DirectorPlacementRule val3 = new DirectorPlacementRule { placementMode = (PlacementMode)0, position = position }; GameObject val4 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val2, val3, RoR2Application.rng)); } } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCSpawnVirtualPortal(ConCommandArgs args) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown if (RiskOfRoutes.allowDebug.Value && NetworkServer.active) { CharacterBody body = ((ConCommandArgs)(ref args)).senderMaster.GetBody(); Vector3 position = body.transform.position + body.transform.forward * 5f; Quaternion val = Quaternion.LookRotation(-body.transform.forward); SpawnCard val2 = LegacyResourcesAPI.Load("SpawnCards/InteractableSpawnCard/iscHardwareProgPortal_Haunt"); if (!Object.op_Implicit((Object)(object)val2)) { val2 = Addressables.LoadAssetAsync((object)"RoR2/DLC3/iscHardwareProgPortal_Haunt.asset").WaitForCompletion(); } if (Object.op_Implicit((Object)(object)val2)) { DirectorPlacementRule val3 = new DirectorPlacementRule { placementMode = (PlacementMode)0, position = position }; GameObject val4 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val2, val3, RoR2Application.rng)); } } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCSpawnGoldPortal(ConCommandArgs args) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown if (RiskOfRoutes.allowDebug.Value && NetworkServer.active) { CharacterBody body = ((ConCommandArgs)(ref args)).senderMaster.GetBody(); Vector3 position = body.transform.position + body.transform.forward * 5f; Quaternion val = Quaternion.LookRotation(-body.transform.forward); SpawnCard val2 = LegacyResourcesAPI.Load("SpawnCards/InteractableSpawnCard/iscGoldshoresPortal"); if (!Object.op_Implicit((Object)(object)val2)) { val2 = Addressables.LoadAssetAsync((object)"RoR2/DLC2/PortalColossus/iscPortalColossus.asset").WaitForCompletion(); } if (Object.op_Implicit((Object)(object)val2)) { DirectorPlacementRule val3 = new DirectorPlacementRule { placementMode = (PlacementMode)0, position = position }; GameObject val4 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val2, val3, RoR2Application.rng)); } } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void CCFindShopPortal(ConCommandArgs args) { GameObject val = GameObject.Find("Node"); if ((Object)(object)val == (Object)null) { Log.Error("Could not find it"); return; } Log.Info("Found it"); Component[] componentsInChildren = val.GetComponentsInChildren(); foreach (Component val2 in componentsInChildren) { Log.Info(((object)val2).GetType()); } SceneExitController component = val.GetComponent(); Log.Info(component.destinationScene); Log.Info(component.useRunNextStageScene); } } public static class DefHelper { public static HashSet vanillaItems; public static HashSet vanillaArtifacts; public static string[] vanillaPacks = new string[7] { "RoR2.BaseContent", "RoR2.Junk", "RoR2.DLC1", "RoR2.CU8", "RoR2.DLC2", "RoR2.DLC3", "burboni4.RiskOfRoutes" }; public static void Init() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) vanillaItems = new HashSet(); vanillaArtifacts = new HashSet(); Enumerator enumerator = ContentManager.allLoadedContentPacks.GetEnumerator(); try { while (enumerator.MoveNext()) { ReadOnlyContentPack current = enumerator.Current; if (!vanillaPacks.Contains(((ReadOnlyContentPack)(ref current)).identifier)) { continue; } AssetEnumerator enumerator2 = ((ReadOnlyContentPack)(ref current)).itemDefs.GetEnumerator(); try { while (enumerator2.MoveNext()) { ItemDef current2 = enumerator2.Current; if ((Object)(object)current2 != (Object)null) { vanillaItems.Add(current2); } } } finally { ((IDisposable)enumerator2/*cast due to .constrained prefix*/).Dispose(); } AssetEnumerator enumerator3 = ((ReadOnlyContentPack)(ref current)).artifactDefs.GetEnumerator(); try { while (enumerator3.MoveNext()) { ArtifactDef current3 = enumerator3.Current; if ((Object)(object)current3 != (Object)null) { vanillaArtifacts.Add(current3); } } } finally { ((IDisposable)enumerator3/*cast due to .constrained prefix*/).Dispose(); } } } finally { ((IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose(); } } public static bool IsModded(ItemDef def) { return !vanillaItems.Contains(def); } public static bool IsModded(ArtifactDef def) { return !vanillaArtifacts.Contains(def); } } public static class SceneHelper { public static bool IsSceneColossus(SceneIndex index, bool includeFalseSonScene = true) { //IL_0033: 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_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (includeFalseSonScene) { return index == SceneCatalog.FindSceneIndex("lemuriantemple") || index == SceneCatalog.FindSceneIndex("habitat") || index == SceneCatalog.FindSceneIndex("meridian"); } return index == SceneCatalog.FindSceneIndex("lemuriantemple") || index == SceneCatalog.FindSceneIndex("habitat"); } public static bool IsSceneIntermission(SceneIndex index) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Invalid comparison between Unknown and I4 SceneDef sceneDef = SceneCatalog.GetSceneDef(index); if ((Object)(object)sceneDef == (Object)null) { return false; } return (int)sceneDef.sceneType == 2; } public static int GetGreenPortalSceneIndex() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected I4, but got Unknown SceneIndex val = (SceneIndex)(-1); int stageOrder = Stage.instance.sceneDef.stageOrder; int num = Run.instance.nextStageScene.stageOrder; if (num != stageOrder + 1 && stageOrder <= 5) { num = stageOrder + 1; } Log.Info(stageOrder + " " + num); switch (num) { case 1: val = SceneCatalog.FindSceneIndex("lemuriantemple"); break; case 2: val = SceneCatalog.FindSceneIndex("lemurianTemple"); break; case 3: val = SceneCatalog.FindSceneIndex("habitat"); break; case 4: val = SceneCatalog.FindSceneIndex("meridian"); break; case 5: val = SceneCatalog.FindSceneIndex("lemuriantemple"); break; } Log.Info(string.Format("{0}: Selected scene for colossus portat - {1}", "GetGreenPortalSceneIndex", val)); return (int)val; } public static bool IsValidNextStage(SceneDef sceneDef) { SceneDef nextStageScene = Run.instance.nextStageScene; if ((Object)(object)nextStageScene != (Object)null && nextStageScene.baseSceneName == sceneDef.baseSceneName) { return false; } if (!sceneDef.hasAnyDestinations) { return false; } return sceneDef.validForRandomSelection; } public static WeightedSelection GetNextStagesScenesList() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Invalid comparison between Unknown and I4 //IL_00c0: Unknown result type (might be due to invalid IL or missing references) SceneDef nextStageScene = Run.instance.nextStageScene; WeightedSelection val = new WeightedSelection(8); if ((Object)(object)nextStageScene == (Object)null) { return val; } int stageOrder = nextStageScene.stageOrder; SceneCollection destinationsGroup = SceneCatalog.mostRecentSceneDef.destinationsGroup; Enumerator enumerator = destinationsGroup.sceneEntries.GetEnumerator(); try { while (enumerator.MoveNext()) { SceneEntry current = enumerator.Current; SceneDef sceneDef = current.sceneDef; if ((int)sceneDef.sceneType == 1 && Object.op_Implicit((Object)(object)sceneDef.mainTrack) && sceneDef.stageOrder == stageOrder && ((Object)(object)sceneDef.requiredExpansion == (Object)null || Run.instance.IsExpansionEnabled(sceneDef.requiredExpansion)) && Run.instance.CanPickStage(sceneDef)) { val.AddChoice(current.sceneDef, ((SceneEntry)(ref current)).weight); } } } finally { ((IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose(); } return val; } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace Unity { [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] public class GeneratedNetworkCode { public static void _ReadStructSyncListModifier_None(NetworkReader reader, SyncListModifier instance) { ushort num = reader.ReadUInt16(); ((SyncList)(object)instance).Clear(); for (ushort num2 = 0; num2 < num; num2++) { ((SyncListStruct)instance).AddInternal(instance.DeserializeItem(reader)); } } public static void _WriteStructSyncListModifier_None(NetworkWriter writer, SyncListModifier value) { ushort count = ((SyncListStruct)value).Count; writer.Write(count); for (ushort num = 0; num < count; num++) { value.SerializeItem(writer, ((SyncListStruct)value).GetItem((int)num)); } } public static void _ReadStructSyncListRouteNode_None(NetworkReader reader, SyncListRouteNode instance) { ushort num = reader.ReadUInt16(); ((SyncList)(object)instance).Clear(); for (ushort num2 = 0; num2 < num; num2++) { ((SyncListStruct)instance).AddInternal(instance.DeserializeItem(reader)); } } public static void _WriteStructSyncListRouteNode_None(NetworkWriter writer, SyncListRouteNode value) { ushort count = ((SyncListStruct)value).Count; writer.Write(count); for (ushort num = 0; num < count; num++) { value.SerializeItem(writer, ((SyncListStruct)value).GetItem((int)num)); } } public static RouteNodeSync _ReadRouteNodeSync_None(NetworkReader reader) { return new RouteNodeSync { portalType = (RoutePortalType)reader.ReadInt32(), x = (int)reader.ReadPackedUInt32(), y = (int)reader.ReadPackedUInt32(), frontX = (int)reader.ReadPackedUInt32(), frontY = (int)reader.ReadPackedUInt32(), leftX = (int)reader.ReadPackedUInt32(), leftY = (int)reader.ReadPackedUInt32(), rightX = (int)reader.ReadPackedUInt32(), rightY = (int)reader.ReadPackedUInt32(), bonusX = (int)reader.ReadPackedUInt32(), bonusY = (int)reader.ReadPackedUInt32(), visited = reader.ReadBoolean(), shopVisited = reader.ReadBoolean(), goldshoresVisited = reader.ReadBoolean(), voidFieldsVisited = reader.ReadBoolean() }; } public static RouteNodeSync[] _ReadArrayRouteNodeSync_None(NetworkReader reader) { int num = reader.ReadUInt16(); if (num == 0) { return new RouteNodeSync[0]; } RouteNodeSync[] array = new RouteNodeSync[num]; for (int i = 0; i < num; i++) { ref RouteNodeSync reference = ref array[i]; reference = _ReadRouteNodeSync_None(reader); } return array; } public static void _WriteRouteNodeSync_None(NetworkWriter writer, RouteNodeSync value) { writer.Write((int)value.portalType); writer.WritePackedUInt32((uint)value.x); writer.WritePackedUInt32((uint)value.y); writer.WritePackedUInt32((uint)value.frontX); writer.WritePackedUInt32((uint)value.frontY); writer.WritePackedUInt32((uint)value.leftX); writer.WritePackedUInt32((uint)value.leftY); writer.WritePackedUInt32((uint)value.rightX); writer.WritePackedUInt32((uint)value.rightY); writer.WritePackedUInt32((uint)value.bonusX); writer.WritePackedUInt32((uint)value.bonusY); writer.Write(value.visited); writer.Write(value.shopVisited); writer.Write(value.goldshoresVisited); writer.Write(value.voidFieldsVisited); } public static void _WriteArrayRouteNodeSync_None(NetworkWriter writer, RouteNodeSync[] value) { if (value == null) { writer.Write((ushort)0); return; } ushort num = (ushort)value.Length; writer.Write(num); for (ushort num2 = 0; num2 < value.Length; num2++) { _WriteRouteNodeSync_None(writer, value[num2]); } } } }