Some mods may be broken due to the recent Alloyed Collective update.
Decompiled source of VoidtouchedRework v1.0.3
VoidtouchedRework.dll
Decompiled 6 months agousing System; 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.Logging; using IL.RoR2; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using On.RoR2; using RoR2; [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 = "")] [assembly: AssemblyCompany("VoidtouchedRework")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("VoidtouchedRework")] [assembly: AssemblyTitle("VoidtouchedRework")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace VoidtouchedRework; 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); } } [BepInPlugin("OakPrime.VoidtouchedRework", "VoidtouchedRework", "1.0.3")] public class VoidtouchedRework : BaseUnityPlugin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func<Instruction, bool> <>9__4_4; public static Func<Instruction, bool> <>9__4_5; public static Func<Instruction, bool> <>9__4_6; public static Action<CharacterBody, DamageInfo> <>9__4_7; public static Func<Instruction, bool> <>9__4_8; public static Func<Instruction, bool> <>9__4_9; public static Func<Instruction, bool> <>9__4_10; public static Func<Instruction, bool> <>9__4_11; public static Manipulator <>9__4_0; public static Func<Instruction, bool> <>9__4_12; public static Func<Instruction, bool> <>9__4_13; public static Manipulator <>9__4_1; public static hook_OnEnable <>9__4_2; public static hook_OnDisable <>9__4_3; internal void <Awake>b__4_0(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_008b: 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_0191: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int num3 = default(int); MethodReference val6 = default(MethodReference); ILLabel val5 = default(ILLabel); val.TryGotoNext(new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num3), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val6), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val5) }); val.Index += 3; val.Emit(OpCodes.Ldloc_1); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate<Action<CharacterBody, DamageInfo>>((Action<CharacterBody, DamageInfo>)delegate(CharacterBody victim, DamageInfo info) { CharacterBody component = info.attacker.GetComponent<CharacterBody>(); if (component.HasBuff(Buffs.EliteVoid) && Util.CheckRoll(info.procCoefficient * 100f, component.master)) { victim.AddTimedBuff(Buffs.NullifyStack, 8f); } }); int num2 = default(int); int num = default(int); FieldReference val4 = default(FieldReference); MethodReference val3 = default(MethodReference); val.TryGotoNext(new Func<Instruction, bool>[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, ref val4), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val3) }); val.Index += 9; ILLabel val2 = val.DefineLabel(); val2.Target = val.Next; val.Index -= 10; val.Emit(OpCodes.Br_S, (object)val2); val.Emit(OpCodes.Ldc_I4_0); } internal bool <Awake>b__4_4(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdloc(x, ref num); } internal bool <Awake>b__4_5(Instruction x) { MethodReference val = default(MethodReference); return ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val); } internal bool <Awake>b__4_6(Instruction x) { ILLabel val = default(ILLabel); return ILPatternMatchingExt.MatchBrfalse(x, ref val); } internal void <Awake>b__4_7(CharacterBody victim, DamageInfo info) { CharacterBody component = info.attacker.GetComponent<CharacterBody>(); if (component.HasBuff(Buffs.EliteVoid) && Util.CheckRoll(info.procCoefficient * 100f, component.master)) { victim.AddTimedBuff(Buffs.NullifyStack, 8f); } } internal bool <Awake>b__4_8(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdloc(x, ref num); } internal bool <Awake>b__4_9(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdloc(x, ref num); } internal bool <Awake>b__4_10(Instruction x) { FieldReference val = default(FieldReference); return ILPatternMatchingExt.MatchLdsfld(x, ref val); } internal bool <Awake>b__4_11(Instruction x) { MethodReference val = default(MethodReference); return ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val); } internal void <Awake>b__4_1(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel val2 = default(ILLabel); val.GotoNext(new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 2), (Instruction x) => ILPatternMatchingExt.MatchBge(x, ref val2) }); val.Remove(); val.Emit(OpCodes.Ldc_I4_1); } internal bool <Awake>b__4_12(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 2); } internal bool <Awake>b__4_13(Instruction x) { ILLabel val = default(ILLabel); return ILPatternMatchingExt.MatchBge(x, ref val); } internal void <Awake>b__4_2(orig_OnEnable orig, AffixVoidBehavior self) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (self == null) { return; } CharacterBody body = ((ItemBehavior)self).body; if (body != null) { Inventory inventory = body.inventory; if (inventory != null) { inventory.GiveItem(Items.BoostDamage.itemIndex, 3); } } } internal void <Awake>b__4_3(orig_OnDisable orig, AffixVoidBehavior self) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (self == null) { return; } CharacterBody body = ((ItemBehavior)self).body; if (body != null) { Inventory inventory = body.inventory; if (inventory != null) { inventory.RemoveItem(Items.BoostDamage.itemIndex, 3); } } } } public const string PluginGUID = "OakPrime.VoidtouchedRework"; public const string PluginAuthor = "OakPrime"; public const string PluginName = "VoidtouchedRework"; public const string PluginVersion = "1.0.3"; public void Awake() { //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_003e: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown Log.Init(((BaseUnityPlugin)this).Logger); try { ((BaseUnityPlugin)this).Logger.LogDebug((object)"test"); object obj = <>c.<>9__4_0; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_008b: 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_0191: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) ILCursor val7 = new ILCursor(il); int num3 = default(int); MethodReference val12 = default(MethodReference); ILLabel val11 = default(ILLabel); val7.TryGotoNext(new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num3), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val12), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val11) }); val7.Index += 3; val7.Emit(OpCodes.Ldloc_1); val7.Emit(OpCodes.Ldarg_1); val7.EmitDelegate<Action<CharacterBody, DamageInfo>>((Action<CharacterBody, DamageInfo>)delegate(CharacterBody victim, DamageInfo info) { CharacterBody component = info.attacker.GetComponent<CharacterBody>(); if (component.HasBuff(Buffs.EliteVoid) && Util.CheckRoll(info.procCoefficient * 100f, component.master)) { victim.AddTimedBuff(Buffs.NullifyStack, 8f); } }); int num2 = default(int); int num = default(int); FieldReference val10 = default(FieldReference); MethodReference val9 = default(MethodReference); val7.TryGotoNext(new Func<Instruction, bool>[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, ref val10), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val9) }); val7.Index += 9; ILLabel val8 = val7.DefineLabel(); val8.Target = val7.Next; val7.Index -= 10; val7.Emit(OpCodes.Br_S, (object)val8); val7.Emit(OpCodes.Ldc_I4_0); }; <>c.<>9__4_0 = val; obj = (object)val; } GlobalEventManager.ProcessHitEnemy += (Manipulator)obj; object obj2 = <>c.<>9__4_1; if (obj2 == null) { Manipulator val2 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) ILCursor val5 = new ILCursor(il); ILLabel val6 = default(ILLabel); val5.GotoNext(new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 2), (Instruction x) => ILPatternMatchingExt.MatchBge(x, ref val6) }); val5.Remove(); val5.Emit(OpCodes.Ldc_I4_1); }; <>c.<>9__4_1 = val2; obj2 = (object)val2; } CharacterBody.AddTimedBuff_BuffDef_float += (Manipulator)obj2; object obj3 = <>c.<>9__4_2; if (obj3 == null) { hook_OnEnable val3 = delegate(orig_OnEnable orig, AffixVoidBehavior self) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (self != null) { CharacterBody body2 = ((ItemBehavior)self).body; if (body2 != null) { Inventory inventory2 = body2.inventory; if (inventory2 != null) { inventory2.GiveItem(Items.BoostDamage.itemIndex, 3); } } } }; <>c.<>9__4_2 = val3; obj3 = (object)val3; } AffixVoidBehavior.OnEnable += (hook_OnEnable)obj3; object obj4 = <>c.<>9__4_3; if (obj4 == null) { hook_OnDisable val4 = delegate(orig_OnDisable orig, AffixVoidBehavior self) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (self != null) { CharacterBody body = ((ItemBehavior)self).body; if (body != null) { Inventory inventory = body.inventory; if (inventory != null) { inventory.RemoveItem(Items.BoostDamage.itemIndex, 3); } } } }; <>c.<>9__4_3 = val4; obj4 = (object)val4; } AffixVoidBehavior.OnDisable += (hook_OnDisable)obj4; } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } }