using 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+ff39ce29cd41463fee4b057490baa21ae2be3287")]
[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.1")]
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.1";
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 PickupIndex[][] bossDropsByTier = new PickupIndex[10][];
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 += (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 -= (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_0039: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction i) => ILPatternMatchingExt.MatchLdloc(i, 3)
});
val.Emit(OpCodes.Ldarg_0);
val.EmitDelegate<Func<CreatePickupInfo, ChestBehavior, CreatePickupInfo>>((Func<CreatePickupInfo, ChestBehavior, CreatePickupInfo>)delegate(CreatePickupInfo pickupInfo, 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_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_002a: 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_0035: 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)
CreatePickupInfo result = CreatePickupInfo_Basic(((CreatePickupInfo)(ref pickupInfo)).pickupIndex, pickupInfo.position, chest.rng, chest.dropTable);
result.chest = chest;
result.artifactFlag = pickupInfo.artifactFlag;
return result;
});
}
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<PickupIndex, Vector3, Vector3, ShrineChanceBehavior>>((Action<PickupIndex, Vector3, Vector3, ShrineChanceBehavior>)delegate(PickupIndex pickupIndex, 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(pickupIndex, 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<PickupIndex, Vector3, Vector3, ShopTerminalBehavior>>((Action<PickupIndex, Vector3, Vector3, ShopTerminalBehavior>)delegate(PickupIndex pickupIndex, Vector3 position, Vector3 velocity, 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_0068: 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_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_00b4: 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_00b6: 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_009f: 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)
CreatePickupInfo val2 = default(CreatePickupInfo);
val2.position = position;
val2.rotation = Quaternion.identity;
((CreatePickupInfo)(ref val2)).pickupIndex = pickupIndex;
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(pickupIndex, position, shop.serverMultiShopController.rng);
}
else if ((Object)(object)shop.serverMultiShopController == (Object)null && Settings.ShopsAffected.Value)
{
val3 = CreatePickupInfo_Basic(pickupIndex, position, shop.rng, shop.dropTable);
}
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<PickupIndex, Vector3, Vector3, BossGroup>>((Action<PickupIndex, Vector3, Vector3, BossGroup>)delegate(PickupIndex pickupIndex, 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(pickupIndex, 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<PickupIndex, Vector3, Vector3>>((Action<PickupIndex, Vector3, Vector3>)delegate(PickupIndex pickupIndex, 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(pickupIndex, 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<PickupIndex, Vector3, Vector3, DoppelgangerInvasionManager>>((Action<PickupIndex, Vector3, Vector3, DoppelgangerInvasionManager>)delegate(PickupIndex pickupIndex, 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(pickupIndex, 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<PickupIndex, Vector3, Vector3>>((Action<PickupIndex, Vector3, Vector3>)delegate(PickupIndex pickupIndex, 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(pickupIndex, 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<PickupIndex, Vector3, Vector3>>((Action<PickupIndex, Vector3, Vector3>)delegate(PickupIndex pickupIndex, 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(pickupIndex, position, Run.instance.runRNG, CommonAssets.dtSonorousEchoPath);
PickupDropletController.CreatePickupDroplet(val2, position, velocity);
});
}
private static CreatePickupInfo CreatePickupInfo_Random(PickupIndex pickupIndex, 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_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_0047: 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_0071: 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_0060: 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_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_00c5: 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)
Log.LogInfo("Creating pickup without drop table");
CreatePickupInfo val = default(CreatePickupInfo);
val.position = position;
val.rotation = Quaternion.identity;
((CreatePickupInfo)(ref val)).pickupIndex = pickupIndex;
CreatePickupInfo result = val;
int tier = GetTier(pickupIndex);
PickupIndex[] array = null;
PickupIndex[] array2 = null;
array2 = GetUniqueItemsOfSameTier(Settings.GetChoiceCountByTier(tier) - 1, pickupIndex, rng);
int num = array2.Length;
if (num == 0)
{
return result;
}
array = (PickupIndex[])(object)new PickupIndex[num + 1];
array[0] = pickupIndex;
for (int i = 0; i < num; i++)
{
array[i + 1] = array2[i];
}
result.pickerOptions = PickupPickerController.GenerateOptionsFromArray(array);
result.prefabOverride = ((array.Length > 3) ? commandCubePrefab : voidPotentialPrefab);
return result;
}
private static CreatePickupInfo CreatePickupInfo_Basic(PickupIndex pickupIndex, 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_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Expected O, but got Unknown
//IL_0178: Unknown result type (might be due to invalid IL or missing references)
//IL_0187: Expected O, but got Unknown
//IL_013e: 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_0158: 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_009b: 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_0198: 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)
//IL_024f: Unknown result type (might be due to invalid IL or missing references)
//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
//IL_01a9: 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_020e: Unknown result type (might be due to invalid IL or missing references)
//IL_020f: 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)
//IL_0267: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: 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_02a6: 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)).pickupIndex = pickupIndex;
CreatePickupInfo result = val;
int tier = GetTier(pickupIndex);
PickupIndex[] array = null;
PickupIndex[] array2 = null;
int num = 0;
if ((Settings.AnyTierMode.Value && tier <= 6) || (Settings.AnyTierModeVoid.Value && tier >= 7))
{
WeightedSelection<PickupIndex> fieldValue = Reflection.GetFieldValue<WeightedSelection<PickupIndex>>((object)(BasicPickupDropTable)dropTable, "selector");
for (int i = 0; i < fieldValue.Count; i++)
{
if (fieldValue.GetChoice(i).value == 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;
}
array = (PickupIndex[])(object)new PickupIndex[num + 1];
array2 = dropTable.GenerateUniqueDrops(num, rng);
}
else if (tier == 6)
{
array2 = GetUniqueItemsOfSameTier(Settings.GetChoiceCountByTier(tier) - 1, pickupIndex, rng);
num = array2.Length;
if (num == 0)
{
return result;
}
array = (PickupIndex[])(object)new PickupIndex[num + 1];
}
else
{
dropTable.canDropBeReplaced = false;
WeightedSelection<PickupIndex> fieldValue2 = Reflection.GetFieldValue<WeightedSelection<PickupIndex>>((object)(BasicPickupDropTable)dropTable, "selector");
for (int j = 0; j < fieldValue2.Count; j++)
{
if (GetTier(fieldValue2.GetChoice(j).value) != tier || fieldValue2.GetChoice(j).value == pickupIndex)
{
fieldValue2.RemoveChoice(j);
j--;
}
}
num = Mathf.Min(Settings.GetChoiceCountByTier(tier) - 1, fieldValue2.Count);
if (num == 0)
{
return result;
}
array = (PickupIndex[])(object)new PickupIndex[num + 1];
array2 = dropTable.GenerateUniqueDrops(num, rng);
dropTable.canDropBeReplaced = true;
Reflection.InvokeMethod((object)dropTable, "Regenerate", new object[1] { Run.instance });
}
array[0] = pickupIndex;
for (int k = 0; k < num; k++)
{
array[k + 1] = array2[k];
}
result.pickerOptions = PickupPickerController.GenerateOptionsFromArray(array);
result.prefabOverride = ((array.Length > 3) ? commandCubePrefab : voidPotentialPrefab);
return result;
}
private static CreatePickupInfo CreatePickupInfo_Boss(PickupIndex pickupIndex, 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_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_0052: 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_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0100: 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)
//IL_0087: 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_006f: 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_0137: Unknown result type (might be due to invalid IL or missing references)
//IL_013c: 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_00a1: 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)
Log.LogInfo("Creating pickup from boss drop table");
CreatePickupInfo val = default(CreatePickupInfo);
val.position = position;
val.rotation = Quaternion.identity;
((CreatePickupInfo)(ref val)).pickupIndex = pickupIndex;
CreatePickupInfo result = val;
int tier = GetTier(pickupIndex);
PickupIndex[] array = null;
int num = 0;
if (tier == 6)
{
PickupIndex[] uniqueItemsOfSameTier = GetUniqueItemsOfSameTier(Settings.GetChoiceCountByTier(tier) - 1, pickupIndex, rng);
if (uniqueItemsOfSameTier == null || uniqueItemsOfSameTier.Length == 0)
{
return result;
}
num = uniqueItemsOfSameTier.Length;
array = (PickupIndex[])(object)new PickupIndex[num + 1];
array[0] = pickupIndex;
for (int i = 0; i < num; i++)
{
array[i + 1] = uniqueItemsOfSameTier[i];
}
}
else
{
if (bossDropsByTier[tier - 1] == null)
{
bossDropsByTier[tier - 1] = GetUniqueItemsOfSameTier(Settings.GetChoiceCountByTier(tier) - 1, pickupIndex, rng);
}
if (bossDropsByTier[tier - 1].Length == 0)
{
return result;
}
num = bossDropsByTier[tier - 1].Length;
array = (PickupIndex[])(object)new PickupIndex[num + 1];
array[0] = pickupIndex;
for (int j = 0; j < num; j++)
{
array[j + 1] = bossDropsByTier[tier - 1][j];
}
}
result.pickerOptions = PickupPickerController.GenerateOptionsFromArray(array);
result.prefabOverride = ((array.Length > 3) ? commandCubePrefab : voidPotentialPrefab);
return result;
}
private static CreatePickupInfo CreatePickupInfo_Doppelganger(PickupIndex pickupIndex, 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_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Expected O, but got Unknown
//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_0060: 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_00f1: 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_014b: Unknown result type (might be due to invalid IL or missing references)
//IL_0104: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Unknown result type (might be due to invalid IL or missing references)
//IL_0146: Unknown result type (might be due to invalid IL or missing references)
//IL_0147: 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)).pickupIndex = pickupIndex;
CreatePickupInfo result = val;
PickupIndex[] array = null;
PickupIndex[] array2 = null;
int num = 0;
WeightedSelection<PickupIndex> fieldValue = Reflection.GetFieldValue<WeightedSelection<PickupIndex>>((object)(DoppelgangerDropTable)dropTable, "selector");
for (int i = 0; i < fieldValue.Count; i++)
{
if (fieldValue.GetChoice(i).value == pickupIndex)
{
fieldValue.RemoveChoice(i);
i--;
}
}
num = Mathf.Min(Settings.DoppelgangerChoiceCount.Value - 1, fieldValue.Count);
if (num == 0)
{
return result;
}
array = (PickupIndex[])(object)new PickupIndex[num + 1];
array2 = dropTable.GenerateUniqueDrops(num, rng);
Reflection.InvokeMethod((object)dropTable, "Regenerate", new object[1] { Run.instance });
array[0] = pickupIndex;
for (int j = 0; j < num; j++)
{
array[j + 1] = array2[j];
}
result.pickerOptions = PickupPickerController.GenerateOptionsFromArray(array);
result.prefabOverride = ((array.Length > 3) ? commandCubePrefab : voidPotentialPrefab);
return result;
}
private static int GetTier(PickupIndex pickupIndex)
{
//IL_0001: 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_000c: 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_000e: 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_003d: Expected I4, but got Unknown
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
ItemTier itemTier = PickupCatalog.GetPickupDef(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;
default:
if (PickupCatalog.GetPickupDef(pickupIndex).isLunar)
{
return 6;
}
return 4;
}
}
private static PickupIndex[] GetUniqueItemsOfSameTier(int num, PickupIndex pickupIndex, Xoroshiro128Plus rng)
{
//IL_0003: 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_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
List<PickupIndex> list = null;
switch (GetTier(pickupIndex))
{
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] != pickupIndex)
{
val.AddChoice(list[i], 1f);
}
}
return Reflection.InvokeMethod<PickupIndex[]>(typeof(PickupDropTable), "GenerateUniqueDropsFromWeightedSelection", new object[3] { num, rng, val });
}
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.NetworkpickupIndex = ((CreatePickupInfo)(ref createPickupInfo)).pickupIndex;
component.chestGeneratedFrom = createPickupInfo.chest;
}
PickupIndexNetworker component2 = val.GetComponent<PickupIndexNetworker>();
if (Object.op_Implicit((Object)(object)component2))
{
component2.NetworkpickupIndex = ((CreatePickupInfo)(ref createPickupInfo)).pickupIndex;
}
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,
};
}
}
}