Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of SeekersPatcher v1.4.4
BepInEx/patchers/SeekersPatcher/SeekersPatcher.dll
Decompiled a month agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx.Logging; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using UnityEngine; [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("SeekersPatcher")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+be05b21007aadcea7b0b3e553ece9490bf4409ca")] [assembly: AssemblyProduct("SeekersPatcher")] [assembly: AssemblyTitle("SeekersPatcher")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 _SeekersPatcher { public static class _SeekersPatcher { internal static class Logger { private static readonly ManualLogSource logSource = Logger.CreateLogSource("SeekersPatcher"); public static void Info(object data) { logSource.LogInfo(data); } public static void Error(object data) { logSource.LogError(data); } public static void Warn(object data) { logSource.LogWarning(data); } public static void Fatal(object data) { logSource.LogFatal(data); } public static void Message(object data) { logSource.LogMessage(data); } public static void Debug(object data) { logSource.LogDebug(data); } } private const string RoR2 = "RoR2"; private const string RoR2UI = "RoR2.UI"; private const string RoR2Projectile = "RoR2.Projectile"; private const string RoR2Skills = "RoR2.Skills"; private static ModuleDefinition ror2; public static IEnumerable<string> TargetDLLs { get { yield return "RoR2.dll"; } } public static void Patch(AssemblyDefinition assemblyDef) { object obj; if (assemblyDef == null) { obj = null; } else { AssemblyNameDefinition name = assemblyDef.Name; obj = ((name != null) ? ((AssemblyNameReference)name).Name : null); } if (!((string?)obj != "RoR2")) { ror2 = assemblyDef.MainModule; PatchMissingFields(); PatchSuicide(); PatchProjectileFire(); PatchRemoveItem(); ror2 = null; } } private static void PatchMissingFields() { TypeDefinition type = ror2.GetType("RoR2.DLC2Content/Items"); TypeDefinition type2 = ror2.GetType("RoR2", "ItemDef"); AddField(type, (TypeReference)(object)type2, "NegateAttack", (FieldAttributes)22); AddField(type, (TypeReference)(object)type2, "LowerHealthHigherDamage", (FieldAttributes)22); AddField(type, (TypeReference)(object)type2, "GoldOnStageStart", (FieldAttributes)22); AddField(type, (TypeReference)(object)type2, "ResetChests", (FieldAttributes)22); TypeDefinition type3 = ror2.GetType("RoR2.DLC2Content/Buffs"); TypeDefinition type4 = ror2.GetType("RoR2", "BuffDef"); AddField(type3, (TypeReference)(object)type4, "LowerHealthHigherDamageBuff", (FieldAttributes)22); TypeDefinition type5 = ror2.GetType("RoR2", "BulletAttack"); TypeDefinition type6 = ror2.GetType("RoR2", "EffectData"); TypeDefinition type7 = ror2.GetType("RoR2.Projectile", "ProjectileImpactExplosion"); TypeReference fieldTypeRef = ror2.ImportReference(typeof(bool)); AddField(type5, (TypeReference)(object)type6, "_EffectData", (FieldAttributes)22); AddField(type5, fieldTypeRef, "_UsePools", (FieldAttributes)22); AddField(type7, fieldTypeRef, "explodeOnLifeTimeExpiration", (FieldAttributes)6); TypeDefinition type8 = ror2.GetType("RoR2", "PlayerCharacterMasterController"); AddField(type8, fieldTypeRef, "wasClaimed", (FieldAttributes)6); AddField(type8, fieldTypeRef, "jumpWasClaimed", (FieldAttributes)6); TypeDefinition type9 = ror2.GetType("RoR2", "Inventory"); TypeReference fieldTypeRef2 = ror2.ImportReference(typeof(int[])); AddField(type9, fieldTypeRef2, "itemStacks", (FieldAttributes)6); TypeDefinition type10 = ror2.GetType("RoR2.PickupPickerController/Option"); TypeDefinition type11 = ror2.GetType("RoR2", "PickupIndex"); AddField(type10, (TypeReference)(object)type11, "pickupIndex", (FieldAttributes)6); TypeDefinition type12 = ror2.GetType("RoR2", "ShopTerminalBehavior"); AddField(type12, (TypeReference)(object)type11, "pickupIndex", (FieldAttributes)6); TypeDefinition type13 = ror2.GetType("RoR2", "GenericPickupController"); AddField(type13, (TypeReference)(object)type11, "pickupIndex", (FieldAttributes)6); TypeDefinition type14 = ror2.GetType("RoR2", "CharacterModel"); TypeReference fieldTypeRef3 = ror2.ImportReference(typeof(int)); AddField(type14, fieldTypeRef3, "invisibilityCount", (FieldAttributes)6); TypeDefinition type15 = ror2.GetType("RoR2", "AimAnimator"); AddField(type15, fieldTypeRef, "UseTransformedAimVector", (FieldAttributes)6); static void AddField(TypeDefinition typeDef, TypeReference val, string fieldName, FieldAttributes attr) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown if (((IEnumerable<FieldDefinition>)typeDef.Fields).Any((FieldDefinition f) => ((MemberReference)f).Name == fieldName && ((MemberReference)((FieldReference)f).FieldType).Name == ((MemberReference)val).Name)) { Logger.Warn(fieldName + " already exists in " + ((MemberReference)typeDef).FullName); } else { typeDef.Fields.Add(new FieldDefinition(fieldName, attr, val)); Logger.Debug("Added " + ((MemberReference)((IEnumerable<FieldDefinition>)typeDef.Fields).Last()).FullName); } } } private static void PatchRemoveItem() { //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown //IL_00f2: 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_010c: 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_0128: Unknown result type (might be due to invalid IL or missing references) string name = "RemoveItem"; TypeDefinition type = ror2.GetType("RoR2", "ItemDef"); TypeDefinition type2 = ror2.GetType("RoR2", "Inventory"); TypeReference val = ror2.ImportReference(typeof(void)); TypeReference val2 = ror2.ImportReference(typeof(int)); FieldDefinition val3 = ((IEnumerable<FieldDefinition>)type.Fields).First((FieldDefinition x) => ((MemberReference)x).Name == "_itemIndex"); MethodDefinition val4 = ((IEnumerable<MethodDefinition>)type2.Methods).First((MethodDefinition m) => ((MemberReference)m).Name == name); MethodDefinition val5 = new MethodDefinition(name, (MethodAttributes)6, val); ((MethodReference)val5).Parameters.Add(new ParameterDefinition((TypeReference)(object)type)); ((MethodReference)val5).Parameters.Add(new ParameterDefinition(val2)); ILProcessor iLProcessor = val5.Body.GetILProcessor(); iLProcessor.Emit(OpCodes.Ldarg_0); iLProcessor.Emit(OpCodes.Ldarg_1); iLProcessor.Emit(OpCodes.Ldfld, (FieldReference)(object)val3); iLProcessor.Emit(OpCodes.Ldarg_2); iLProcessor.Emit(OpCodes.Callvirt, (MethodReference)(object)val4); type2.Methods.Add(val5); Logger.Debug(((MemberReference)val5).FullName); } private static void PatchSuicide() { //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Expected O, but got Unknown //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Expected O, but got Unknown //IL_014a: 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_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) string name = "Suicide"; TypeDefinition tdDamageType = ror2.GetType("RoR2", "DamageType"); TypeDefinition type = ror2.GetType("RoR2", "DamageTypeCombo"); TypeDefinition type2 = ror2.GetType("RoR2", "HealthComponent"); TypeReference val = ror2.ImportReference(typeof(GameObject)); TypeReference val2 = ror2.ImportReference(typeof(void)); if (((IEnumerable<MethodDefinition>)type2.Methods).Any((MethodDefinition m) => ((MemberReference)m).Name == name && ((MethodReference)m).HasParameters && ((MethodReference)m).Parameters.Count == 3 && ((MemberReference)((ParameterReference)((IEnumerable<ParameterDefinition>)((MethodReference)m).Parameters).Last()).ParameterType).Name == ((MemberReference)tdDamageType).Name)) { Logger.Warn(name + " exists, abort patch"); return; } MethodDefinition val3 = ((IEnumerable<MethodDefinition>)type2.Methods).First((MethodDefinition m) => ((MemberReference)m).Name == name); MethodDefinition val4 = ((IEnumerable<MethodDefinition>)type.Methods).First((MethodDefinition m) => ((MemberReference)m).Name == "op_Implicit" && ((MethodReference)m).HasParameters && ((MethodReference)m).Parameters.Count == 1 && ((MemberReference)((ParameterReference)((MethodReference)m).Parameters[0]).ParameterType).Name == ((MemberReference)tdDamageType).Name); MethodDefinition val5 = new MethodDefinition(name, (MethodAttributes)6, val2); ((MethodReference)val5).Parameters.Add(new ParameterDefinition(val)); ((MethodReference)val5).Parameters.Add(new ParameterDefinition(val)); ((MethodReference)val5).Parameters.Add(new ParameterDefinition((TypeReference)(object)tdDamageType)); ILProcessor iLProcessor = val5.Body.GetILProcessor(); iLProcessor.Emit(OpCodes.Ldarg_0); iLProcessor.Emit(OpCodes.Ldarg_1); iLProcessor.Emit(OpCodes.Ldarg_2); iLProcessor.Emit(OpCodes.Ldarg_3); iLProcessor.Emit(OpCodes.Call, (MethodReference)(object)val4); iLProcessor.Emit(OpCodes.Callvirt, (MethodReference)(object)val3); iLProcessor.Emit(OpCodes.Ret); type2.Methods.Add(val5); Logger.Debug(((MemberReference)val5).FullName); } private static void PatchProjectileFire() { //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Expected O, but got Unknown //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Expected O, but got Unknown //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Expected O, but got Unknown //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Expected O, but got Unknown //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Expected O, but got Unknown //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Expected O, but got Unknown //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Expected O, but got Unknown //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Expected O, but got Unknown //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Expected O, but got Unknown //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Expected O, but got Unknown //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) string name = "FireProjectile"; TypeDefinition type = ror2.GetType("RoR2.Projectile", "ProjectileManager"); TypeDefinition type2 = ror2.GetType("RoR2", "DamageColorIndex"); TypeReference val = ror2.ImportReference(typeof(Vector3)); TypeReference val2 = ror2.ImportReference(typeof(Quaternion)); TypeReference val3 = ror2.ImportReference(typeof(GameObject)); TypeReference val4 = ror2.ImportReference(typeof(void)); TypeReference val5 = ror2.ImportReference(typeof(float)); TypeReference val6 = ror2.ImportReference(typeof(bool)); if (((IEnumerable<MethodDefinition>)type.Methods).Any((MethodDefinition m) => ((MemberReference)m).Name == name && ((MethodReference)m).HasParameters && ((MethodReference)m).Parameters.Count == 10)) { Logger.Warn(name + " exists, abort patch"); return; } MethodDefinition val7 = ((IEnumerable<MethodDefinition>)type.Methods).First((MethodDefinition m) => ((MemberReference)m).Name == "FireProjectileWithoutDamageType"); MethodDefinition val8 = new MethodDefinition(name, (MethodAttributes)6, val4); ((MethodReference)val8).Parameters.Add(new ParameterDefinition(val3)); ((MethodReference)val8).Parameters.Add(new ParameterDefinition(val)); ((MethodReference)val8).Parameters.Add(new ParameterDefinition(val2)); ((MethodReference)val8).Parameters.Add(new ParameterDefinition(val3)); ((MethodReference)val8).Parameters.Add(new ParameterDefinition(val5)); ((MethodReference)val8).Parameters.Add(new ParameterDefinition(val5)); ((MethodReference)val8).Parameters.Add(new ParameterDefinition(val6)); ((MethodReference)val8).Parameters.Add(new ParameterDefinition((TypeReference)(object)type2)); ((MethodReference)val8).Parameters.Add(new ParameterDefinition(val3)); ((MethodReference)val8).Parameters.Add(new ParameterDefinition(val5)); ILProcessor iLProcessor = val8.Body.GetILProcessor(); iLProcessor.Emit(OpCodes.Ldarg_0); iLProcessor.Emit(OpCodes.Ldarg_1); iLProcessor.Emit(OpCodes.Ldarg_2); iLProcessor.Emit(OpCodes.Ldarg_3); iLProcessor.Emit(OpCodes.Ldarg, 4); iLProcessor.Emit(OpCodes.Ldarg, 5); iLProcessor.Emit(OpCodes.Ldarg, 6); iLProcessor.Emit(OpCodes.Ldarg, 7); iLProcessor.Emit(OpCodes.Ldarg, 8); iLProcessor.Emit(OpCodes.Ldarg, 9); iLProcessor.Emit(OpCodes.Ldarg, 10); iLProcessor.Emit(OpCodes.Callvirt, (MethodReference)(object)val7); iLProcessor.Emit(OpCodes.Ret); type.Methods.Add(val8); Logger.Debug(((MemberReference)val8).FullName); } } }
SeekersPatcherDLL.dll
Decompiled a month agousing System; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using RoR2; using RoR2BepInExPack.GameAssetPathsBetter; using UnityEngine.AddressableAssets; [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("SeekersPatcherDLL")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+be05b21007aadcea7b0b3e553ece9490bf4409ca")] [assembly: AssemblyProduct("SeekersPatcherDLL")] [assembly: AssemblyTitle("SeekersPatcherDLL")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 SeekersPatcherDLL { [BepInPlugin("___0pseudopulse.__SeekersPatcherDLL", "__SeekersPatcherDLL", "1.0.0")] public class _0Main : BaseUnityPlugin { [CompilerGenerated] private static class <>O { public static Manipulator <0>__InvisibilityGet; public static Manipulator <1>__InvisibilitySet; public static Action<Inventory> <2>__Inventory_onInventoryChangedGlobal; public static Action<Action<Inventory>, Inventory> <3>__AcquirePools; public static Action<Action<Inventory>, Inventory> <4>__ReleasePools; } public const string PluginGUID = "___0pseudopulse.__SeekersPatcherDLL"; public const string PluginAuthor = "___0pseudopulse"; public const string PluginName = "__SeekersPatcherDLL"; public const string PluginVersion = "1.0.0"; public static ManualLogSource ModLogger; private static FieldInfo oldStacksField; private void Awake() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //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_003b: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_0065: 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_0070: Expected O, but got Unknown //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: 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_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_020a: 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_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Expected O, but got Unknown //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Expected O, but got Unknown ModLogger = ((BaseUnityPlugin)this).Logger; MethodInfo methodInfo = AccessTools.PropertyGetter(typeof(CharacterModel), "invisibilityCount"); object obj = <>O.<0>__InvisibilityGet; if (obj == null) { Manipulator val = InvisibilityGet; <>O.<0>__InvisibilityGet = val; obj = (object)val; } ILHook val2 = new ILHook((MethodBase)methodInfo, (Manipulator)obj); MethodInfo methodInfo2 = AccessTools.PropertySetter(typeof(CharacterModel), "invisibilityCount"); object obj2 = <>O.<1>__InvisibilitySet; if (obj2 == null) { Manipulator val3 = InvisibilitySet; <>O.<1>__InvisibilitySet = val3; obj2 = (object)val3; } ILHook val4 = new ILHook((MethodBase)methodInfo2, (Manipulator)obj2); oldStacksField = typeof(Inventory).GetFields().FirstOrDefault((FieldInfo f) => f.Name == "itemStacks" && f.FieldType == typeof(int[])); if ((object)oldStacksField != null) { Inventory.onInventoryChangedGlobal += Inventory_onInventoryChangedGlobal; Hook val5 = new Hook((MethodBase)AccessTools.Method(typeof(Inventory), "AcquirePooledResources", (Type[])null, (Type[])null), (Delegate)new Action<Action<Inventory>, Inventory>(AcquirePools)); Hook val6 = new Hook((MethodBase)AccessTools.Method(typeof(Inventory), "ReleasePooledResources", (Type[])null, (Type[])null), (Delegate)new Action<Action<Inventory>, Inventory>(ReleasePools)); } else { ModLogger.LogError((object)"Failed to find Inventory.itemStacks field"); } typeof(Items).GetField("NegateAttack").SetValue(null, Addressables.LoadAssetAsync<ItemDef>((object)RoR2_DLC2_Items_SpeedBoostPickup.SpeedBoostPickup_asset).WaitForCompletion()); typeof(Items).GetField("GoldOnStageStart").SetValue(null, Addressables.LoadAssetAsync<ItemDef>((object)RoR2_DLC2_Items_BarrageOnBoss.BarrageOnBoss_asset).WaitForCompletion()); typeof(Items).GetField("ResetChests").SetValue(null, Addressables.LoadAssetAsync<ItemDef>((object)RoR2_DLC2_Items_ItemDropChanceOnKill.ItemDropChanceOnKill_asset).WaitForCompletion()); typeof(Items).GetField("LowerHealthHigherDamage").SetValue(null, Addressables.LoadAssetAsync<ItemDef>((object)RoR2_DLC2_Items_AttackSpeedPerNearbyAllyOrEnemy.AttackSpeedPerNearbyAllyOrEnemy_asset).WaitForCompletion()); typeof(Buffs).GetField("LowerHealthHigherDamageBuff").SetValue(null, Addressables.LoadAssetAsync<BuffDef>((object)RoR2_DLC2.bdAttackSpeedPerNearbyAllyOrEnemyBuff_asset).WaitForCompletion()); } private static void Inventory_onInventoryChangedGlobal(Inventory inventory) { if (oldStacksField.GetValue(inventory) is int[] array) { inventory.WriteItemStacks(array); } } private static void AcquirePools(Action<Inventory> orig, Inventory self) { orig(self); oldStacksField.SetValue(self, PerItemBufferPool.Request<int>()); } private static void ReleasePools(Action<Inventory> orig, Inventory self) { orig(self); int[] array = oldStacksField.GetValue(self) as int[]; if (array != null) { PerItemBufferPool.Return<int>(ref array); } } private static void InvisibilityGet(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); FieldReference val2 = default(FieldReference); if (!val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, ref val2) })) { ModLogger.LogError((object)"InvisibilityGet failed"); } else { val.Next.Operand = AccessTools.Field(typeof(CharacterModel), "invisibilityCount"); } } private static void InvisibilitySet(ILContext il) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) ILCursor[] array = null; FieldReference val = default(FieldReference); if (!new ILCursor(il).TryFindNext(ref array, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, ref val), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, ref val) })) { ModLogger.LogError((object)"InvisibilitySet failed"); return; } array[0].Next.Operand = AccessTools.Field(typeof(CharacterModel), "invisibilityCount"); array[1].Next.Operand = AccessTools.Field(typeof(CharacterModel), "invisibilityCount"); } } }