Some mods may be broken due to the recent Alloyed Collective update.
Decompiled source of Artifact of Potential v1.3.2
ArtifactOfPotential/ArtifactOfPotential.dll
Decompiled 4 hours agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using IL.RoR2; using IL.RoR2.Artifacts; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using On.RoR2; using R2API; using R2API.Utils; using RoR2; using RoR2.Artifacts; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ArtifactOfPotential")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+d69504d3479448465d150ad1ccb5a074316f22a4")] [assembly: AssemblyProduct("ArtifactOfPotential")] [assembly: AssemblyTitle("ArtifactOfPotential")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ArtifactOfPotential { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("zombieseatflesh7.ArtifactOfPotential", "ArtifactOfPotential", "1.3.2")] public class ArtifactOfPotential : BaseUnityPlugin { public const string PluginGUID = "zombieseatflesh7.ArtifactOfPotential"; public const string PluginAuthor = "zombieseatflesh7"; public const string PluginName = "ArtifactOfPotential"; public const string PluginVersion = "1.3.2"; public static PluginInfo PInfo { get; private set; } public void Awake() { Log.Init(((BaseUnityPlugin)this).Logger); PInfo = ((BaseUnityPlugin)this).Info; InitConfig(); Asset.Init(); PotentialArtifact.Init(); } private void InitConfig() { Settings.AnyTierMode = ((BaseUnityPlugin)this).Config.Bind<bool>("Any Tier Mode", "Any Tier Mode", false, "Similar to Simulacrum. An alternate mode where the options you choose from can be of different tiers, as long as that tier CAN be dropped. Affects: chests, shrines, etc. Ignores: multishops, lunar pods, boss events, etc. Synergizes with Eulogy Zero. Does not affect void items."); Settings.AnyTierModeChoiceCount = ((BaseUnityPlugin)this).Config.Bind<int>("Any Tier Mode", "Any Tier Mode - Choice Count", 3, "The number of choices you get from void potentials when \"Any Tier Mode\" is enabled. Does not affect void items."); Settings.AnyTierModeVoid = ((BaseUnityPlugin)this).Config.Bind<bool>("Any Tier Mode", "Any Tier Mode - Void", true, "Similar to Any Tier Mode, but only affects void items."); Settings.AnyTierModeVoidChoiceCount = ((BaseUnityPlugin)this).Config.Bind<int>("Any Tier Mode", "Any Tier Mode - Void - Choice Count", 3, "The number of choices you get from void tier void potentials when \"Any Tier Mode - Void\" is enabled. Only affects void items."); Settings.ChestsAffected = ((BaseUnityPlugin)this).Config.Bind<bool>("Item Sources Affected", "Chests", true, "Whether or not chests should drop void potentials."); Settings.ShrineOfChanceAffected = ((BaseUnityPlugin)this).Config.Bind<bool>("Item Sources Affected", "Shrines of chance", true, "Whether or not shrines of chance should drop void potentials."); Settings.HiddenMultishopsAffected = ((BaseUnityPlugin)this).Config.Bind<bool>("Item Sources Affected", "Mystery Multishops", true, "Whether or not mystery multishops should drop void potentials. Works even if the \"Multishops\" config is disabled."); Settings.MultishopsAffected = ((BaseUnityPlugin)this).Config.Bind<bool>("Item Sources Affected", "Multishops", false, "Whether or not multishops should drop void potentials. Includes mystery multishopsm even if that config is disabled"); Settings.ShopsAffected = ((BaseUnityPlugin)this).Config.Bind<bool>("Item Sources Affected", "Shops", false, "Whether or not shops should drop void potentials. This includes: The bazaar shop, printers, and cauldrons. This setting will change in the future."); Settings.BossAffected = ((BaseUnityPlugin)this).Config.Bind<bool>("Item Sources Affected", "Boss", true, "Whether or not bosses should drop void potentials. This includes: the teleporter event, Alloy Worship Unit, Aurelionite, and any other \"boss\" event."); Settings.SonorousWhispersAffected = ((BaseUnityPlugin)this).Config.Bind<bool>("Item Sources Affected", "Sonorous Whispers", true, "Whether or not Sonorous Whispers should drop void potentials."); Settings.SacrificeAffected = ((BaseUnityPlugin)this).Config.Bind<bool>("Item Sources Affected", "Artifact of Sacrifice", true, "Whether or not Artifact of Sacrifice should drop void potentials."); Settings.DoppelgangerChoiceCount = ((BaseUnityPlugin)this).Config.Bind<int>("Item Sources Affected", "Artifact of Vengance - Choice Count", 5, "The number of item choices you get when killing a doppelganger from Artifact of Vengeance. Item choices can be any tier, regardless of other settings. Set to 1 to disable void potentials from this artifact."); Settings.Tier1ChoiceCount = ((BaseUnityPlugin)this).Config.Bind<int>("Number of Options by Tier", "Common Options", 3, "The number of choices you get from common tier void potentials. Set to 1 to disable void potentials for this tier."); Settings.Tier2ChoiceCount = ((BaseUnityPlugin)this).Config.Bind<int>("Number of Options by Tier", "Uncommon Options", 3, "The number of choices you get from uncommon tier void potentials. Set to 1 to disable void potentials for this tier."); Settings.Tier3ChoiceCount = ((BaseUnityPlugin)this).Config.Bind<int>("Number of Options by Tier", "Legendary Options", 3, "The number of choices you get from legendary tier void potentials. Set to 1 to disable void potentials for this tier."); Settings.EquipmentChoiceCount = ((BaseUnityPlugin)this).Config.Bind<int>("Number of Options by Tier", "Equipment Options", 3, "The number of choices you get from Equipment tier void potentials. Set to 1 to disable void potentials for this tier."); Settings.BossChoiceCount = ((BaseUnityPlugin)this).Config.Bind<int>("Number of Options by Tier", "Boss Options", 1, "The number of choices you get from boss tier void potentials. Set to 1 to disable void potentials for this tier. Boss items are special, because they are based on the boss that is killed. Setting this value above 1 will allow you to get boss items that are hard to find normally, such as charged perforators or planulas."); Settings.LunarChoiceCount = ((BaseUnityPlugin)this).Config.Bind<int>("Number of Options by Tier", "Lunar Options", 3, "The number of choices you get from lunar tier void potentials. Set to 1 to disable void potentials for this tier."); Settings.Void1ChoiceCount = ((BaseUnityPlugin)this).Config.Bind<int>("Number of Options by Tier", "Common Void Options", 3, "The number of choices you get from common void tier void potentials. Set to 1 to disable void potentials for this tier."); Settings.Void2ChoiceCount = ((BaseUnityPlugin)this).Config.Bind<int>("Number of Options by Tier", "Uncommon Void Options", 3, "The number of choices you get from uncommon void tier void potentials. Set to 1 to disable void potentials for this tier."); Settings.Void3ChoiceCount = ((BaseUnityPlugin)this).Config.Bind<int>("Number of Options by Tier", "Legendary Void Options", 3, "The number of choices you get from legendary void tier void potentials. Set to 1 to disable void potentials for this tier."); Settings.VoidBossChoiceCount = ((BaseUnityPlugin)this).Config.Bind<int>("Number of Options by Tier", "Boss Void Options", 3, "The number of choices you get from boss void tier void potentials. Set to 1 to disable void potentials for this tier. This option is redundant as there is only one boss void item at the time of this mod versions upload."); } } public static class PotentialArtifact { [CompilerGenerated] private static class <>O { public static ArtifactStateChangeDelegate <0>__OnArtifactEnabled; public static ArtifactStateChangeDelegate <1>__OnArtifactDisabled; public static Manipulator <2>__ChestBehavior_BaseItemDrop; public static Manipulator <3>__ShrineChanceBehavior_AddShrineStack; public static Manipulator <4>__ShopTerminalBehavior_DropPickup; public static Manipulator <5>__BossGroup_DropRewards; public static Manipulator <6>__SacrificeArtifactManager_OnServerCharacterDeath; public static Manipulator <7>__DoppelgangerInvasionManager_OnCharacterDeathGlobal; public static Manipulator <8>__GlobalEventManager_OnCharacterDeath; public static hook_RebuildModel <9>__PickupDisplay_RebuildModel; public static hook_CreatePickup <10>__GenericPickupController_CreatePickup; } public static ArtifactDef Potential; public static GameObject voidPotentialPrefab = null; public static GameObject commandCubePrefab = null; public static GameObject currentModelObjectOverride = null; public static List<UniquePickup>[] bossDropsByTier = new List<UniquePickup>[12]; public static void Init() { //IL_007b: 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_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_00b4: 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_00bf: Expected O, but got Unknown //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_00e0: Expected O, but got Unknown Potential = ScriptableObject.CreateInstance<ArtifactDef>(); Potential.cachedName = "ArtifactOfPotential"; Potential.nameToken = "Artifact of Potential"; Potential.descriptionToken = "Most items become Void Potentials."; Potential.smallIconSelectedSprite = Asset.AssetBundle.LoadAsset<Sprite>("texArtifactPotentialEnabled.png"); Potential.smallIconDeselectedSprite = Asset.AssetBundle.LoadAsset<Sprite>("texArtifactPotentialDisabled.png"); ContentAddition.AddArtifactDef(Potential); voidPotentialPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/OptionPickup/OptionPickup.prefab").WaitForCompletion(); commandCubePrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Command/CommandCube.prefab").WaitForCompletion(); object obj = <>O.<0>__OnArtifactEnabled; if (obj == null) { ArtifactStateChangeDelegate val = OnArtifactEnabled; <>O.<0>__OnArtifactEnabled = val; obj = (object)val; } RunArtifactManager.onArtifactEnabledGlobal += (ArtifactStateChangeDelegate)obj; object obj2 = <>O.<1>__OnArtifactDisabled; if (obj2 == null) { ArtifactStateChangeDelegate val2 = OnArtifactDisabled; <>O.<1>__OnArtifactDisabled = val2; obj2 = (object)val2; } RunArtifactManager.onArtifactDisabledGlobal += (ArtifactStateChangeDelegate)obj2; } private static void OnArtifactEnabled(RunArtifactManager runArtifactManager, ArtifactDef artifactDef) { //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_004b: Expected O, but got Unknown //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_00bb: 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_00c6: 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 //IL_011d: 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_0128: Expected O, but got Unknown //IL_0151: 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_015c: Expected O, but got Unknown //IL_01a3: 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: Expected O, but got Unknown //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Expected O, but got Unknown //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_01cf: Expected O, but got Unknown if ((Object)(object)artifactDef != (Object)(object)Potential || !NetworkServer.active) { return; } if (Settings.ChestsAffected.Value) { object obj = <>O.<2>__ChestBehavior_BaseItemDrop; if (obj == null) { Manipulator val = ChestBehavior_BaseItemDrop; <>O.<2>__ChestBehavior_BaseItemDrop = val; obj = (object)val; } ChestBehavior.BaseItemDrop += (Manipulator)obj; } if (Settings.ShrineOfChanceAffected.Value) { object obj2 = <>O.<3>__ShrineChanceBehavior_AddShrineStack; if (obj2 == null) { Manipulator val2 = ShrineChanceBehavior_AddShrineStack; <>O.<3>__ShrineChanceBehavior_AddShrineStack = val2; obj2 = (object)val2; } ShrineChanceBehavior.AddShrineStack += (Manipulator)obj2; } if (Settings.HiddenMultishopsAffected.Value || Settings.MultishopsAffected.Value || Settings.ShopsAffected.Value) { object obj3 = <>O.<4>__ShopTerminalBehavior_DropPickup; if (obj3 == null) { Manipulator val3 = ShopTerminalBehavior_DropPickup; <>O.<4>__ShopTerminalBehavior_DropPickup = val3; obj3 = (object)val3; } ShopTerminalBehavior.DropPickup_bool += (Manipulator)obj3; } if (Settings.BossAffected.Value) { object obj4 = <>O.<5>__BossGroup_DropRewards; if (obj4 == null) { Manipulator val4 = BossGroup_DropRewards; <>O.<5>__BossGroup_DropRewards = val4; obj4 = (object)val4; } BossGroup.DropRewards += (Manipulator)obj4; } if (Settings.SacrificeAffected.Value) { object obj5 = <>O.<6>__SacrificeArtifactManager_OnServerCharacterDeath; if (obj5 == null) { Manipulator val5 = SacrificeArtifactManager_OnServerCharacterDeath; <>O.<6>__SacrificeArtifactManager_OnServerCharacterDeath = val5; obj5 = (object)val5; } SacrificeArtifactManager.OnServerCharacterDeath += (Manipulator)obj5; } if (Settings.DoppelgangerChoiceCount.Value > 1) { object obj6 = <>O.<7>__DoppelgangerInvasionManager_OnCharacterDeathGlobal; if (obj6 == null) { Manipulator val6 = DoppelgangerInvasionManager_OnCharacterDeathGlobal; <>O.<7>__DoppelgangerInvasionManager_OnCharacterDeathGlobal = val6; obj6 = (object)val6; } DoppelgangerInvasionManager.OnCharacterDeathGlobal += (Manipulator)obj6; } if (Settings.SonorousWhispersAffected.Value) { object obj7 = <>O.<8>__GlobalEventManager_OnCharacterDeath; if (obj7 == null) { Manipulator val7 = GlobalEventManager_OnCharacterDeath; <>O.<8>__GlobalEventManager_OnCharacterDeath = val7; obj7 = (object)val7; } GlobalEventManager.OnCharacterDeath += (Manipulator)obj7; } object obj8 = <>O.<9>__PickupDisplay_RebuildModel; if (obj8 == null) { hook_RebuildModel val8 = PickupDisplay_RebuildModel; <>O.<9>__PickupDisplay_RebuildModel = val8; obj8 = (object)val8; } PickupDisplay.RebuildModel += (hook_RebuildModel)obj8; object obj9 = <>O.<10>__GenericPickupController_CreatePickup; if (obj9 == null) { hook_CreatePickup val9 = GenericPickupController_CreatePickup; <>O.<10>__GenericPickupController_CreatePickup = val9; obj9 = (object)val9; } GenericPickupController.CreatePickup += (hook_CreatePickup)obj9; } private static void OnArtifactDisabled(RunArtifactManager runArtifactManager, ArtifactDef artifactDef) { //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_0030: Expected O, but got Unknown //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_0051: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //IL_0088: 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_0093: Expected O, but got Unknown //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_00b4: Expected O, but got Unknown //IL_00ca: 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_00d5: Expected O, but got Unknown //IL_00eb: 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_00f6: Expected O, but got Unknown //IL_010c: 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_0117: Expected O, but got Unknown //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Expected O, but got Unknown if (!((Object)(object)artifactDef != (Object)(object)Potential)) { object obj = <>O.<2>__ChestBehavior_BaseItemDrop; if (obj == null) { Manipulator val = ChestBehavior_BaseItemDrop; <>O.<2>__ChestBehavior_BaseItemDrop = val; obj = (object)val; } ChestBehavior.BaseItemDrop -= (Manipulator)obj; object obj2 = <>O.<3>__ShrineChanceBehavior_AddShrineStack; if (obj2 == null) { Manipulator val2 = ShrineChanceBehavior_AddShrineStack; <>O.<3>__ShrineChanceBehavior_AddShrineStack = val2; obj2 = (object)val2; } ShrineChanceBehavior.AddShrineStack -= (Manipulator)obj2; object obj3 = <>O.<4>__ShopTerminalBehavior_DropPickup; if (obj3 == null) { Manipulator val3 = ShopTerminalBehavior_DropPickup; <>O.<4>__ShopTerminalBehavior_DropPickup = val3; obj3 = (object)val3; } ShopTerminalBehavior.DropPickup_bool -= (Manipulator)obj3; object obj4 = <>O.<5>__BossGroup_DropRewards; if (obj4 == null) { Manipulator val4 = BossGroup_DropRewards; <>O.<5>__BossGroup_DropRewards = val4; obj4 = (object)val4; } BossGroup.DropRewards -= (Manipulator)obj4; object obj5 = <>O.<6>__SacrificeArtifactManager_OnServerCharacterDeath; if (obj5 == null) { Manipulator val5 = SacrificeArtifactManager_OnServerCharacterDeath; <>O.<6>__SacrificeArtifactManager_OnServerCharacterDeath = val5; obj5 = (object)val5; } SacrificeArtifactManager.OnServerCharacterDeath -= (Manipulator)obj5; object obj6 = <>O.<7>__DoppelgangerInvasionManager_OnCharacterDeathGlobal; if (obj6 == null) { Manipulator val6 = DoppelgangerInvasionManager_OnCharacterDeathGlobal; <>O.<7>__DoppelgangerInvasionManager_OnCharacterDeathGlobal = val6; obj6 = (object)val6; } DoppelgangerInvasionManager.OnCharacterDeathGlobal -= (Manipulator)obj6; object obj7 = <>O.<8>__GlobalEventManager_OnCharacterDeath; if (obj7 == null) { Manipulator val7 = GlobalEventManager_OnCharacterDeath; <>O.<8>__GlobalEventManager_OnCharacterDeath = val7; obj7 = (object)val7; } GlobalEventManager.OnCharacterDeath -= (Manipulator)obj7; object obj8 = <>O.<9>__PickupDisplay_RebuildModel; if (obj8 == null) { hook_RebuildModel val8 = PickupDisplay_RebuildModel; <>O.<9>__PickupDisplay_RebuildModel = val8; obj8 = (object)val8; } PickupDisplay.RebuildModel -= (hook_RebuildModel)obj8; object obj9 = <>O.<10>__GenericPickupController_CreatePickup; if (obj9 == null) { hook_CreatePickup val9 = GenericPickupController_CreatePickup; <>O.<10>__GenericPickupController_CreatePickup = val9; obj9 = (object)val9; } GenericPickupController.CreatePickup -= (hook_CreatePickup)obj9; } } private static void ChestBehavior_BaseItemDrop(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext(new Func<Instruction, bool>[1] { (Instruction i) => ILPatternMatchingExt.MatchCall<PickupDropletController>(i, "CreatePickupDroplet") }); val.Remove(); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Action<CreatePickupInfo, Vector3, Vector3, ChestBehavior>>((Action<CreatePickupInfo, Vector3, Vector3, ChestBehavior>)delegate(CreatePickupInfo pickupInfo, Vector3 position, Vector3 velocity, ChestBehavior chest) { //IL_0003: 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_0009: 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_0021: 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_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_0038: 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_003a: Unknown result type (might be due to invalid IL or missing references) CreatePickupInfo val2 = CreatePickupInfo_Basic(((CreatePickupInfo)(ref pickupInfo)).pickup, pickupInfo.position, chest.rng, chest.dropTable); val2.chest = chest; val2.artifactFlag = pickupInfo.artifactFlag; PickupDropletController.CreatePickupDroplet(val2, position, velocity); }); } private static void ShrineChanceBehavior_AddShrineStack(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext(new Func<Instruction, bool>[1] { (Instruction i) => ILPatternMatchingExt.MatchCall<PickupDropletController>(i, "CreatePickupDroplet") }); val.Remove(); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Action<UniquePickup, Vector3, Vector3, ShrineChanceBehavior>>((Action<UniquePickup, Vector3, Vector3, ShrineChanceBehavior>)delegate(UniquePickup pickup, Vector3 position, Vector3 velocity, ShrineChanceBehavior shrine) { //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_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_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) //IL_0019: Unknown result type (might be due to invalid IL or missing references) CreatePickupInfo val2 = CreatePickupInfo_Basic(pickup, position, shrine.rng, shrine.dropTable); PickupDropletController.CreatePickupDroplet(val2, position, velocity); }); } private static void ShopTerminalBehavior_DropPickup(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext(new Func<Instruction, bool>[1] { (Instruction i) => ILPatternMatchingExt.MatchCall<PickupDropletController>(i, "CreatePickupDroplet") }); val.Remove(); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Action<UniquePickup, Vector3, Vector3, bool, ShopTerminalBehavior>>((Action<UniquePickup, Vector3, Vector3, bool, ShopTerminalBehavior>)delegate(UniquePickup pickup, Vector3 position, Vector3 velocity, bool isDuplicated, ShopTerminalBehavior shop) { //IL_0003: 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_000c: 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_0018: 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_0026: 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) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_00c9: 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_00cb: 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_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) CreatePickupInfo val2 = default(CreatePickupInfo); val2.position = position; val2.rotation = Quaternion.identity; ((CreatePickupInfo)(ref val2)).pickup = pickup; CreatePickupInfo val3 = val2; if ((Object)(object)shop.serverMultiShopController != (Object)null && (Settings.MultishopsAffected.Value || (Settings.HiddenMultishopsAffected.Value && Reflection.GetFieldValue<bool>((object)shop, "hidden")))) { val3 = CreatePickupInfo_Random(((CreatePickupInfo)(ref val3)).pickup, position, shop.serverMultiShopController.rng); } else if ((Object)(object)shop.serverMultiShopController == (Object)null && Settings.ShopsAffected.Value) { val3 = CreatePickupInfo_Basic(((CreatePickupInfo)(ref val3)).pickup, position, shop.rng, shop.dropTable); } val3.duplicated = isDuplicated; PickupDropletController.CreatePickupDroplet(val3, position, velocity); }); } private static void BossGroup_DropRewards(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.EmitDelegate<Action>((Action)delegate { for (int j = 0; j < bossDropsByTier.Length; j++) { bossDropsByTier[j] = null; } }); val.GotoNext(new Func<Instruction, bool>[1] { (Instruction i) => ILPatternMatchingExt.MatchCall<PickupDropletController>(i, "CreatePickupDroplet") }); val.Remove(); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Action<UniquePickup, Vector3, Vector3, BossGroup>>((Action<UniquePickup, Vector3, Vector3, BossGroup>)delegate(UniquePickup pickup, Vector3 position, Vector3 velocity, BossGroup boss) { //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_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_0012: Unknown result type (might be due to invalid IL or missing references) CreatePickupInfo val2 = CreatePickupInfo_Boss(pickup, position, boss.rng); PickupDropletController.CreatePickupDroplet(val2, position, velocity); }); } private static void SacrificeArtifactManager_OnServerCharacterDeath(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); val.GotoNext(new Func<Instruction, bool>[1] { (Instruction i) => ILPatternMatchingExt.MatchCall<PickupDropletController>(i, "CreatePickupDroplet") }); val.Remove(); val.EmitDelegate<Action<UniquePickup, Vector3, Vector3>>((Action<UniquePickup, Vector3, Vector3>)delegate(UniquePickup pickup, Vector3 position, Vector3 velocity) { //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_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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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) CreatePickupInfo val2 = CreatePickupInfo_Basic(pickup, position, SacrificeArtifactManager.treasureRng, SacrificeArtifactManager.dropTable); PickupDropletController.CreatePickupDroplet(val2, position, velocity); }); } private static void DoppelgangerInvasionManager_OnCharacterDeathGlobal(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext(new Func<Instruction, bool>[1] { (Instruction i) => ILPatternMatchingExt.MatchCall<PickupDropletController>(i, "CreatePickupDroplet") }); val.Remove(); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Action<UniquePickup, Vector3, Vector3, DoppelgangerInvasionManager>>((Action<UniquePickup, Vector3, Vector3, DoppelgangerInvasionManager>)delegate(UniquePickup pickup, Vector3 position, Vector3 velocity, DoppelgangerInvasionManager doppel) { //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_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_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) //IL_0019: Unknown result type (might be due to invalid IL or missing references) CreatePickupInfo val2 = CreatePickupInfo_Doppelganger(pickup, position, doppel.treasureRng, doppel.dropTable); PickupDropletController.CreatePickupDroplet(val2, position, velocity); }); } private static void GlobalEventManager_OnCharacterDeath(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); val.GotoNext(new Func<Instruction, bool>[1] { (Instruction i) => ILPatternMatchingExt.MatchCall<PickupDropletController>(i, "CreatePickupDroplet") }); val.GotoNext(new Func<Instruction, bool>[1] { (Instruction i) => ILPatternMatchingExt.MatchCall<PickupDropletController>(i, "CreatePickupDroplet") }); val.Remove(); val.EmitDelegate<Action<UniquePickup, Vector3, Vector3>>((Action<UniquePickup, Vector3, Vector3>)delegate(UniquePickup pickup, Vector3 position, Vector3 velocity) { //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_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_0018: 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_001a: Unknown result type (might be due to invalid IL or missing references) CreatePickupInfo val3 = CreatePickupInfo_Basic(pickup, position, Run.instance.runRNG, CommonAssets.dtSonorousEchoPath); PickupDropletController.CreatePickupDroplet(val3, position, velocity); }); val.GotoNext(new Func<Instruction, bool>[1] { (Instruction i) => ILPatternMatchingExt.MatchCall<PickupDropletController>(i, "CreatePickupDroplet") }); val.Remove(); val.EmitDelegate<Action<UniquePickup, Vector3, Vector3>>((Action<UniquePickup, Vector3, Vector3>)delegate(UniquePickup pickup, Vector3 position, Vector3 velocity) { //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_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_0018: 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_001a: Unknown result type (might be due to invalid IL or missing references) CreatePickupInfo val2 = CreatePickupInfo_Basic(pickup, position, Run.instance.runRNG, CommonAssets.dtSonorousEchoPath); PickupDropletController.CreatePickupDroplet(val2, position, velocity); }); } private static CreatePickupInfo CreatePickupInfo_Random(UniquePickup pickup, Vector3 position, Xoroshiro128Plus rng) { //IL_000e: 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_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_0031: 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_0033: 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_0051: 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_006e: 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_009b: 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) Log.LogInfo("Creating pickup without drop table"); CreatePickupInfo val = default(CreatePickupInfo); val.position = position; val.rotation = Quaternion.identity; ((CreatePickupInfo)(ref val)).pickup = pickup; CreatePickupInfo result = val; int tier = GetTier(pickup); List<UniquePickup> list = new List<UniquePickup> { pickup }; list.AddRange(GetUniqueItemsOfSameTier(Settings.GetChoiceCountByTier(tier) - 1, pickup, rng)); if (list.Count == 1) { return result; } result.pickerOptions = PickupPickerController.GenerateOptionsFromList<List<UniquePickup>>(list); result.prefabOverride = ((list.Count > 3) ? commandCubePrefab : voidPotentialPrefab); return result; } private static CreatePickupInfo CreatePickupInfo_Basic(UniquePickup pickup, Vector3 position, Xoroshiro128Plus rng, PickupDropTable dropTable) { //IL_000e: 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_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_0031: 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_0034: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Expected O, but got Unknown //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017b: 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_009f: 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_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: 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_022f: 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_029c: 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) Log.LogInfo("Creating choice from basic drop table"); CreatePickupInfo val = default(CreatePickupInfo); val.position = position; val.rotation = Quaternion.identity; ((CreatePickupInfo)(ref val)).pickup = pickup; CreatePickupInfo result = val; int tier = GetTier(pickup); List<UniquePickup> list = new List<UniquePickup> { pickup }; int num = 0; if ((Settings.AnyTierMode.Value && tier <= 6) || (Settings.AnyTierModeVoid.Value && tier >= 7)) { WeightedSelection<UniquePickup> fieldValue = Reflection.GetFieldValue<WeightedSelection<UniquePickup>>((object)(BasicPickupDropTable)dropTable, "selector"); for (int i = 0; i < fieldValue.Count; i++) { if (fieldValue.GetChoice(i).value.pickupIndex == pickup.pickupIndex) { fieldValue.RemoveChoice(i); i--; } } num = Mathf.Min((tier <= 6) ? (Settings.AnyTierModeChoiceCount.Value - 1) : (Settings.AnyTierModeVoidChoiceCount.Value - 1), fieldValue.Count); if (num == 0) { return result; } List<UniquePickup> list2 = new List<UniquePickup>(num); dropTable.GenerateDistinctPickups(list2, num, rng, true); list.AddRange(list2); } else if (tier == 6) { list.AddRange(GetUniqueItemsOfSameTier(Settings.GetChoiceCountByTier(tier) - 1, pickup, rng)); if (list.Count - 1 == 0) { return result; } } else { dropTable.canDropBeReplaced = false; WeightedSelection<UniquePickup> fieldValue2 = Reflection.GetFieldValue<WeightedSelection<UniquePickup>>((object)(BasicPickupDropTable)dropTable, "selector"); for (int j = 0; j < fieldValue2.Count; j++) { if (GetTier(fieldValue2.GetChoice(j).value) != tier || fieldValue2.GetChoice(j).value.pickupIndex == pickup.pickupIndex) { fieldValue2.RemoveChoice(j); j--; } } num = Mathf.Min(Settings.GetChoiceCountByTier(tier) - 1, fieldValue2.Count); if (num == 0) { return result; } List<UniquePickup> list3 = new List<UniquePickup>(num); dropTable.GenerateDistinctPickups(list3, num, rng, true); list.AddRange(list3); dropTable.canDropBeReplaced = true; Reflection.InvokeMethod((object)dropTable, "Regenerate", new object[1] { Run.instance }); } result.pickerOptions = PickupPickerController.GenerateOptionsFromList<List<UniquePickup>>(list); result.prefabOverride = ((list.Count > 3) ? commandCubePrefab : voidPotentialPrefab); return result; } private static CreatePickupInfo CreatePickupInfo_Boss(UniquePickup pickup, Vector3 position, Xoroshiro128Plus rng) { //IL_000e: 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_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_0031: 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_0033: 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_005b: 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_00d5: 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) //IL_0130: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_012b: 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) Log.LogInfo("Creating pickup from boss drop table"); CreatePickupInfo val = default(CreatePickupInfo); val.position = position; val.rotation = Quaternion.identity; ((CreatePickupInfo)(ref val)).pickup = pickup; CreatePickupInfo result = val; int tier = GetTier(pickup); List<UniquePickup> list = new List<UniquePickup> { pickup }; if (tier == 6) { List<UniquePickup> uniqueItemsOfSameTier = GetUniqueItemsOfSameTier(Settings.GetChoiceCountByTier(tier) - 1, pickup, rng); if (uniqueItemsOfSameTier == null || uniqueItemsOfSameTier.Count == 0) { return result; } list.AddRange(uniqueItemsOfSameTier); } else { if (bossDropsByTier[tier - 1] == null) { bossDropsByTier[tier - 1] = GetUniqueItemsOfSameTier(Settings.GetChoiceCountByTier(tier) - 1, pickup, rng); } if (bossDropsByTier[tier - 1].Count == 0) { return result; } list.AddRange(bossDropsByTier[tier - 1]); } if (list.Count <= 1) { return result; } result.pickerOptions = PickupPickerController.GenerateOptionsFromList<List<UniquePickup>>(list); result.prefabOverride = ((list.Count > 3) ? commandCubePrefab : voidPotentialPrefab); return result; } private static CreatePickupInfo CreatePickupInfo_Doppelganger(UniquePickup pickup, Vector3 position, Xoroshiro128Plus rng, PickupDropTable dropTable) { //IL_000e: 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_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_0031: 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_003a: 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_0054: Expected O, but got Unknown //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_006d: 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_00c9: 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_0133: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) Log.LogInfo("Creating pickup from doppelganger drop table"); CreatePickupInfo val = default(CreatePickupInfo); val.position = position; val.rotation = Quaternion.identity; ((CreatePickupInfo)(ref val)).pickup = pickup; CreatePickupInfo result = val; List<UniquePickup> list = new List<UniquePickup> { pickup }; int num = 0; WeightedSelection<UniquePickup> fieldValue = Reflection.GetFieldValue<WeightedSelection<UniquePickup>>((object)(DoppelgangerDropTable)dropTable, "selector"); for (int i = 0; i < fieldValue.Count; i++) { if (fieldValue.GetChoice(i).value.pickupIndex == pickup.pickupIndex) { fieldValue.RemoveChoice(i); i--; } } num = Mathf.Min(Settings.DoppelgangerChoiceCount.Value - 1, fieldValue.Count); if (num == 0) { return result; } List<UniquePickup> list2 = new List<UniquePickup>(num); dropTable.GenerateDistinctPickups(list2, num, rng, true); list.AddRange(list2); Reflection.InvokeMethod((object)dropTable, "Regenerate", new object[1] { Run.instance }); result.pickerOptions = PickupPickerController.GenerateOptionsFromList<List<UniquePickup>>(list); result.prefabOverride = ((list.Count > 3) ? commandCubePrefab : voidPotentialPrefab); return result; } private static int GetTier(UniquePickup pickup) { //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_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_0012: 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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected I4, but got Unknown //IL_007c: 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) ItemTier itemTier = PickupCatalog.GetPickupDef(pickup.pickupIndex).itemTier; ItemTier val = itemTier; switch ((int)val) { case 0: return 1; case 1: return 2; case 2: return 3; case 4: return 5; case 3: return 6; case 6: return 7; case 7: return 8; case 8: return 9; case 9: return 10; case 10: return 11; case 11: return 12; default: if (PickupCatalog.GetPickupDef(pickup.pickupIndex).isLunar) { return 6; } return 4; } } private static List<UniquePickup> GetUniqueItemsOfSameTier(int num, UniquePickup pickup, Xoroshiro128Plus rng) { //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_0011: 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) List<PickupIndex> list = null; switch (GetTier(pickup)) { case 1: list = Run.instance.availableTier1DropList; break; case 2: list = Run.instance.availableTier2DropList; break; case 3: list = Run.instance.availableTier3DropList; break; case 4: list = Run.instance.availableEquipmentDropList; break; case 5: list = Run.instance.availableBossDropList; break; case 6: list = Run.instance.availableLunarCombinedDropList; break; case 7: list = Run.instance.availableVoidTier1DropList; break; case 8: list = Run.instance.availableVoidTier2DropList; break; case 9: list = Run.instance.availableVoidTier3DropList; break; case 10: list = Run.instance.availableVoidBossDropList; break; } WeightedSelection<PickupIndex> val = new WeightedSelection<PickupIndex>(8); for (int i = 0; i < list.Count; i++) { if (list[i] != pickup.pickupIndex) { val.AddChoice(list[i], 1f); } } return PickupDropTable.GenerateDistinctFromWeightedSelection<PickupIndex>(new List<PickupIndex>(num), num, rng, val).ConvertAll(delegate(PickupIndex pickupIndex) { //IL_0002: 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) UniquePickup result = default(UniquePickup); ((UniquePickup)(ref result))..ctor(pickupIndex); result.decayValue = pickup.decayValue; return result; }); } private static void PickupDisplay_RebuildModel(orig_RebuildModel orig, PickupDisplay self, GameObject modelObjectOverride) { if ((Object)(object)modelObjectOverride != (Object)null && (Object)(object)currentModelObjectOverride == (Object)null) { currentModelObjectOverride = modelObjectOverride; } else if ((Object)(object)currentModelObjectOverride != (Object)null) { modelObjectOverride = currentModelObjectOverride; } orig.Invoke(self, modelObjectOverride); if ((Object)(object)currentModelObjectOverride != (Object)null) { if (Object.op_Implicit((Object)(object)self.tier1ParticleEffect)) { self.tier1ParticleEffect.SetActive(false); } if (Object.op_Implicit((Object)(object)self.tier2ParticleEffect)) { self.tier2ParticleEffect.SetActive(false); } if (Object.op_Implicit((Object)(object)self.tier3ParticleEffect)) { self.tier3ParticleEffect.SetActive(false); } if (Object.op_Implicit((Object)(object)self.equipmentParticleEffect)) { self.equipmentParticleEffect.SetActive(false); } if (Object.op_Implicit((Object)(object)self.lunarParticleEffect)) { self.lunarParticleEffect.SetActive(false); } if (Object.op_Implicit((Object)(object)self.voidParticleEffect)) { self.voidParticleEffect.SetActive(false); } } } private static GenericPickupController GenericPickupController_CreatePickup(orig_CreatePickup orig, ref CreatePickupInfo createPickupInfo) { //IL_0034: 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_005b: 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) if ((Object)(object)createPickupInfo.prefabOverride == (Object)(object)commandCubePrefab) { Log.LogDebug("Prefab Overrid is CommandCube"); GameObject val = Object.Instantiate<GameObject>(createPickupInfo.prefabOverride ?? GenericPickupController.pickupPrefab, createPickupInfo.position, createPickupInfo.rotation); GenericPickupController component = val.GetComponent<GenericPickupController>(); if (Object.op_Implicit((Object)(object)component)) { component.Network_pickupState = ((CreatePickupInfo)(ref createPickupInfo)).pickup; component.chestGeneratedFrom = createPickupInfo.chest; } PickupIndexNetworker component2 = val.GetComponent<PickupIndexNetworker>(); if (Object.op_Implicit((Object)(object)component2)) { component2.NetworkpickupState = ((CreatePickupInfo)(ref createPickupInfo)).pickup; } PickupPickerController component3 = val.GetComponent<PickupPickerController>(); if (Object.op_Implicit((Object)(object)component3) && createPickupInfo.pickerOptions != null) { component3.SetOptionsServer(createPickupInfo.pickerOptions); } NetworkServer.Spawn(val); return component; } orig.Invoke(ref createPickupInfo); currentModelObjectOverride = null; return null; } } public static class Asset { public static AssetBundle AssetBundle; public const string bundleName = "aopassetbundle"; public static string AssetBundlePath => ArtifactOfPotential.PInfo.Location.Replace("ArtifactOfPotential.dll", "aopassetbundle"); public static void Init() { AssetBundle = AssetBundle.LoadFromFile(AssetBundlePath); if ((Object)(object)AssetBundle == (Object)null) { Log.LogInfo("Failed to load AssetBundle!"); } } } internal static class Log { internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void LogDebug(object data) { _logSource.LogDebug(data); } internal static void LogError(object data) { _logSource.LogError(data); } internal static void LogFatal(object data) { _logSource.LogFatal(data); } internal static void LogInfo(object data) { _logSource.LogInfo(data); } internal static void LogMessage(object data) { _logSource.LogMessage(data); } internal static void LogWarning(object data) { _logSource.LogWarning(data); } } public static class Settings { public static ConfigEntry<bool> AnyTierMode; public static ConfigEntry<int> AnyTierModeChoiceCount; public static ConfigEntry<bool> AnyTierModeVoid; public static ConfigEntry<int> AnyTierModeVoidChoiceCount; public static ConfigEntry<bool> ChestsAffected; public static ConfigEntry<bool> ShrineOfChanceAffected; public static ConfigEntry<bool> HiddenMultishopsAffected; public static ConfigEntry<bool> MultishopsAffected; public static ConfigEntry<bool> PrintersAffected; public static ConfigEntry<bool> ShopsAffected; public static ConfigEntry<bool> BossAffected; public static ConfigEntry<bool> SonorousWhispersAffected; public static ConfigEntry<bool> SacrificeAffected; public static ConfigEntry<int> DoppelgangerChoiceCount; public static ConfigEntry<int> Tier1ChoiceCount; public static ConfigEntry<int> Tier2ChoiceCount; public static ConfigEntry<int> Tier3ChoiceCount; public static ConfigEntry<int> EquipmentChoiceCount; public static ConfigEntry<int> BossChoiceCount; public static ConfigEntry<int> LunarChoiceCount; public static ConfigEntry<int> Void1ChoiceCount; public static ConfigEntry<int> Void2ChoiceCount; public static ConfigEntry<int> Void3ChoiceCount; public static ConfigEntry<int> VoidBossChoiceCount; public static int GetChoiceCountByTier(int tier) { return tier switch { 1 => Tier1ChoiceCount.Value, 2 => Tier2ChoiceCount.Value, 3 => Tier3ChoiceCount.Value, 4 => EquipmentChoiceCount.Value, 5 => BossChoiceCount.Value, 6 => LunarChoiceCount.Value, 7 => Void1ChoiceCount.Value, 8 => Void2ChoiceCount.Value, 9 => Void3ChoiceCount.Value, 10 => VoidBossChoiceCount.Value, _ => 1, }; } } }