using System; using System.Collections.Generic; using System.Collections.ObjectModel; 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.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.Commando.CommandoWeapon; using EntityStates.MeridianEvent; using EntityStates.Missions.BrotherEncounter; using EntityStates.SolusWing; using EntityStates.TeleporterHealNovaController; using HG.Reflection; using IL.EntityStates; using IL.EntityStates.TeleporterHealNovaController; using IL.RoR2; using IL.RoR2.Items; using IL.RoR2.Orbs; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using On.EntityStates.Commando.CommandoWeapon; using On.EntityStates.MeridianEvent; using On.EntityStates.Missions.BrotherEncounter; using On.EntityStates.SolusWing; using On.EntityStates.TeleporterHealNovaController; using On.RoR2; using R2API; using RoR2; using RoR2.Items; using RoR2.Orbs; using RoR2.Projectile; using UnityEngine; using UnityEngine.Networking; using VanillaItemTweaks.Boss; using VanillaItemTweaks.Common; using VanillaItemTweaks.Legendary; using VanillaItemTweaks.Lunar; using VanillaItemTweaks.Uncommon; using VanillaItemTweaks.Void; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("VanillaItemTweaks")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+fd40b5fd7d2f3448b9ed0dc55366b88a1359c94f")] [assembly: AssemblyProduct("VanillaItemTweaks")] [assembly: AssemblyTitle("VanillaItemTweaks")] [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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [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 VanillaItemTweaks { 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); } internal static void LogInstrNotFound(ILContext il) { LogError("GoToNext instructions not found at method: " + (object)il.Method); } } [BepInPlugin("OakPrime.VanillaItemTweaks", "VanillaItemTweaks", "1.2.0")] public class VanillaItemTweaks : BaseUnityPlugin { public const string PluginGUID = "OakPrime.VanillaItemTweaks"; public const string PluginAuthor = "OakPrime"; public const string PluginName = "VanillaItemTweaks"; public const string PluginVersion = "1.2.0"; public static ManualLogSource logger; public void Awake() { logger = ((BaseUnityPlugin)this).Logger; Log.Init(logger); try { Init(); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } private void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ConfigFile configFile = new ConfigFile(Paths.ConfigPath + "\\OakPrime.VanillaItemTweaks.cfg", true); BustlingFungusBuff.TryInit(configFile); WarbannerBuff.TryInit(configFile); MochaRework.TryInit(configFile); StickyBombBuff.TryInit(configFile); BoxOfDynamiteBuff.TryInit(configFile); DeathMarkChoice.TryInit(configFile); HuntersHarpoonChoice.TryInit(configFile); LeechingSeedBuff.TryInit(configFile); LeptonDaisyChoice.TryInit(configFile); RedWhipBuff.TryInit(configFile); OldGuillotineBuff.TryInit(configFile); RegeneratingScrapBuff.TryInit(configFile); SquidPolypBuff.TryInit(configFile); HappiestMaskRework.TryInit(configFile); LaserScopeBuff.TryInit(configFile); KnurlBuff.TryInit(configFile); PolyluteNerf.TryInit(configFile); GestureNerf.TryInit(configFile); TranscendenceNerf.TryInit(configFile); } } } namespace VanillaItemTweaks.Void { public static class PolyluteNerf { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__1_1; public static Func <>9__1_2; public static Func <>9__1_3; public static Func <>9__1_4; public static Func <>9__1_5; public static Func <>9__1_6; public static Manipulator <>9__1_0; internal void b__1_0(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); int num3 = default(int); int num2 = default(int); int num = default(int); val.TryGotoNext(new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num3), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "totalStrikes") }); val.Index += 4; val.EmitDelegate>((Func)((int totalStrikes) => totalStrikes * 2 / 3)); } internal bool b__1_1(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdloc(x, ref num); } internal bool b__1_2(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdcI4(x, ref num); } internal bool b__1_3(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdloc(x, ref num); } internal bool b__1_4(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool b__1_5(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, "totalStrikes"); } internal int b__1_6(int totalStrikes) { return totalStrikes * 2 / 3; } } public static void TryInit(ConfigFile configFile) { if (configFile.Bind("Polylute Nerf", "Enable Polylute Nerf", true, "Reduces Polylute strikes from 3 to 2.").Value) { Init(); } } public static void Init() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown try { object obj = <>c.<>9__1_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 ILCursor val2 = new ILCursor(il); int num3 = default(int); int num2 = default(int); int num = default(int); val2.TryGotoNext(new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num3), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "totalStrikes") }); val2.Index += 4; val2.EmitDelegate>((Func)((int totalStrikes) => totalStrikes * 2 / 3)); }; <>c.<>9__1_0 = val; obj = (object)val; } GlobalEventManager.ProcessHitEnemy += (Manipulator)obj; ReplaceText(); Log.LogInfo("Added Polylute Nerf"); } catch (Exception ex) { VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } private static void ReplaceText() { LanguageAPI.Add("ITEM_CHAINLIGHTNINGVOID_DESC", "25% chance to fire lightning for 60% TOTAL damage up to 2 (+2 per stack) times. Corrupts all Ukeleles."); } } } namespace VanillaItemTweaks.Uncommon { internal class BerzerkerPauldronRework { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__2_2; public static Func <>9__2_3; public static Action <>9__2_1; public static Manipulator <>9__2_0; internal void b__2_0(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); if (!val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 5), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 2) })) { Log.LogInstrNotFound(il); return; } val.EmitDelegate>((Action)delegate(HealthComponent healthComponent) { int num = (Object.op_Implicit((Object)(object)healthComponent.body.inventory) ? healthComponent.body.inventory.GetItemCountEffective(Items.WarCryOnMultiKill) : 0); }); } internal bool b__2_2(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 5); } internal bool b__2_3(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 2); } internal void b__2_1(HealthComponent healthComponent) { int num = (Object.op_Implicit((Object)(object)healthComponent.body.inventory) ? healthComponent.body.inventory.GetItemCountEffective(Items.WarCryOnMultiKill) : 0); } } private static float _damageCoeff; public static void TryInit(ConfigFile configFile) { bool value = configFile.Bind("Berzerker Pauldron Rework", "Enable Berzerker Pauldron Rework", true, "Changes guillotine execution threshold.").Value; _damageCoeff = configFile.Bind("Berzerker Pauldron Rework", "Berzerker Pauldron Damage", 240f, "Box of Dynamite Damage does X% damage (+X% per stack). Default: 240. Vanilla: 240 (+85 per stack).").Value / 100f; if (value) { Init(); } } public static void Init() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown try { object obj = <>c.<>9__2_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 ILCursor val2 = new ILCursor(il); if (!val2.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 5), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 2) })) { Log.LogInstrNotFound(il); } else { val2.EmitDelegate>((Action)delegate(HealthComponent healthComponent) { int num = (Object.op_Implicit((Object)(object)healthComponent.body.inventory) ? healthComponent.body.inventory.GetItemCountEffective(Items.WarCryOnMultiKill) : 0); }); } }; <>c.<>9__2_0 = val; obj = (object)val; } HealthComponent.TakeDamageProcess += (Manipulator)obj; UpdateText(); Log.LogInfo("Added Berzerker Pauldron Rework"); } catch (Exception ex) { Log.LogError(ex.Message + " - " + ex.StackTrace); } } private static void UpdateText() { LanguageAPI.Add("ITEM_DRONESDROPDYNAMITE_DESC", "Gain Lt. Droneboy. While in combat, your drones drop sticks of dynamite that detonate for " + _damageCoeff * 100f + "% (+" + _damageCoeff * 100f + "% per stack), stunning enemies. Recharges after 10 seconds."); } } internal class BoxOfDynamiteBuff { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__2_1; public static Func <>9__2_2; public static Manipulator <>9__2_0; internal void b__2_0(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); float num2 = default(float); float num = default(float); if (!val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num) })) { Log.LogInstrNotFound(il); return; } val.Next.Operand = _damageCoeff; int index = val.Index; val.Index = index + 1; val.Next.Operand = _damageCoeff; } internal bool b__2_1(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool b__2_2(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } } private static float _damageCoeff; public static void TryInit(ConfigFile configFile) { bool value = configFile.Bind("Box of Dynamite Buff", "Enable Box of Dynamite Buff", true, "Changes guillotine execution threshold.").Value; _damageCoeff = configFile.Bind("Box of Dynamite Buff", "Box of Dynamite Damage", 240f, "Box of Dynamite Damage does X% damage (+X% per stack). Default: 240. Vanilla: 240 (+85 per stack).").Value / 100f; if (value) { Init(); } } public static void Init() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown try { object obj = <>c.<>9__2_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 ILCursor val2 = new ILCursor(il); float num2 = default(float); float num = default(float); if (!val2.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num) })) { Log.LogInstrNotFound(il); } else { val2.Next.Operand = _damageCoeff; int index = val2.Index; val2.Index = index + 1; val2.Next.Operand = _damageCoeff; } }; <>c.<>9__2_0 = val; obj = (object)val; } DroneDynamiteBehaviour.FixedUpdate += (Manipulator)obj; UpdateText(); Log.LogInfo("Added Box of Dynamite Buff"); } catch (Exception ex) { Log.LogError(ex.Message + " - " + ex.StackTrace); } } private static void UpdateText() { LanguageAPI.Add("ITEM_DRONESDROPDYNAMITE_DESC", "Gain Lt. Droneboy. While in combat, your drones drop sticks of dynamite that detonate for " + _damageCoeff * 100f + "% (+" + _damageCoeff * 100f + "% per stack), stunning enemies. Recharges after 10 seconds."); } } internal class DeathMarkBehavior : MonoBehaviour { private float _timer = 0f; private float _slowBuildUpSeconds = 4f; private CharacterBody _victimBody; private int _deathMarkCount = 1; public void SetBuildUpSeconds(float buildupSeconds) { _slowBuildUpSeconds = buildupSeconds; } private void OnEnable() { Log.LogDebug("Death Mark Beh OnEnable entered"); _victimBody = ((Component)this).GetComponent(); } public void ApplyMark() { Log.LogDebug("AppliedMark"); _victimBody.AddTimedBuff(Buffs.DeathMark, DeathMarkRework._duration * (float)_deathMarkCount); _timer = 0f; } public void TryUpdateCount(int count) { if (count > _deathMarkCount) { _deathMarkCount = count; } } private bool IsSlowed() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) Log.LogDebug("Check slow"); HashSet hashSet = new HashSet { Buffs.Slow80.buffIndex, Buffs.Slow50.buffIndex, Buffs.Slow60.buffIndex, Buffs.Cripple.buffIndex, Buffs.BeetleJuice.buffIndex, Buffs.ClayGoo.buffIndex, Buffs.Weak.buffIndex }; foreach (TimedBuff timedBuff in _victimBody.timedBuffs) { if (hashSet.Contains(timedBuff.buffIndex)) { return true; } } return false; } private void FixedUpdate() { if (_victimBody.HasBuff(Buffs.Entangle)) { ApplyMark(); } else if (!_victimBody.HasBuff(Buffs.DeathMark) && IsSlowed()) { _timer += Time.deltaTime; if (_timer >= _slowBuildUpSeconds) { ApplyMark(); } } } } internal class DeathMarkChoice { public static void TryInit(ConfigFile configFile) { bool value = configFile.Bind("Death Mark Rework", "Enable Death Mark Rework", true, "Death Mark applies on all hard CC.").Value; float value2 = configFile.Bind("Death Mark Rework", "Death Mark Duration", 4f, "Death Mark lasts X (+X per stack) seconds.").Value; float value3 = configFile.Bind("Death Mark Rework", "Death Mark Buildup Duration", 4f, "Death Mark can also be applied by slowing target for X seconds.").Value; float damageMultiplier = configFile.Bind("Death Mark Rework", "Death Mark Damage Boost", 35f, "Death Mark increases damage to target by X%.").Value / 100f + 1f; bool value4 = configFile.Bind("Death Mark Buff", "Enable Death Mark Buff", false, "Reduces Death Mark debuffs required to 3 and reduces its damage multiplier to 1.35x.\nRework overrides buff.").Value; float damageMultiplier2 = configFile.Bind("Death Mark Buff", "Death Mark Damage Boost", 35f, "Death Mark increases damage to target by X%.").Value / 100f + 1f; int value5 = configFile.Bind("Death Mark Buff", "Death Mark Debuff Count", 3, "Death Mark requires X debuffs to activate.").Value; if (value) { DeathMarkRework.Init(value2, value3, damageMultiplier); } else if (value4) { DeathMarkFix.Init(damageMultiplier2, value5); } } } public static class DeathMarkFix { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__2_3; public static Func <>9__2_2; public static Manipulator <>9__2_0; public static Func <>9__2_4; public static Func <>9__2_5; public static Func <>9__2_6; public static Func <>9__2_7; public static Func <>9__2_8; public static Func <>9__2_9; public static Func <>9__2_10; public static Func <>9__2_11; public static Manipulator <>9__2_1; internal void b__2_0(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); if (!val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 4) })) { Log.LogInstrNotFound(il); return; } int index = val.Index; val.Index = index + 1; val.EmitDelegate>((Func)((int num) => _debuffCount)); } internal bool b__2_3(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 4); } internal int b__2_2(int num) { return _debuffCount; } internal void b__2_1(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); int num4 = default(int); int num3 = default(int); if (!val.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num4), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1.5f), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num3) })) { Log.LogInstrNotFound(il); return; } int num2 = default(int); int num = default(int); if (!val.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1.5f), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num) })) { Log.LogInstrNotFound(il); return; } int index = val.Index; val.Index = index + 1; val.Next.Operand = _damageMultiplier; } internal bool b__2_4(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdloc(x, ref num); } internal bool b__2_5(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 1.5f); } internal bool b__2_6(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool b__2_7(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchStloc(x, ref num); } internal bool b__2_8(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdloc(x, ref num); } internal bool b__2_9(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 1.5f); } internal bool b__2_10(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool b__2_11(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchStloc(x, ref num); } } public static float _damageMultiplier; public static int _debuffCount; public static void Init(float damageMultiplier, int debuffCount) { //IL_0022: 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_002d: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown _damageMultiplier = damageMultiplier; _debuffCount = debuffCount; try { object obj = <>c.<>9__2_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 ILCursor val4 = new ILCursor(il); if (!val4.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 4) })) { Log.LogInstrNotFound(il); } else { int index2 = val4.Index; val4.Index = index2 + 1; val4.EmitDelegate>((Func)((int num) => _debuffCount)); } }; <>c.<>9__2_0 = val; obj = (object)val; } GlobalEventManager.ProcDeathMark += (Manipulator)obj; object obj2 = <>c.<>9__2_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 ILCursor val3 = new ILCursor(il); int num5 = default(int); int num4 = default(int); int num3 = default(int); int num2 = default(int); if (!val3.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num5), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1.5f), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num4) })) { Log.LogInstrNotFound(il); } else if (!val3.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num3), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1.5f), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num2) })) { Log.LogInstrNotFound(il); } else { int index = val3.Index; val3.Index = index + 1; val3.Next.Operand = _damageMultiplier; } }; <>c.<>9__2_1 = val2; obj2 = (object)val2; } HealthComponent.TakeDamageProcess += (Manipulator)obj2; ReplaceText(); Log.LogInfo("Added Death Mark Buff"); } catch (Exception ex) { VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } private static void ReplaceText() { LanguageAPI.Add("ITEM_DEATHMARK_PICKUP", "Enemies with " + _debuffCount + " or more debuffs are marked for death, taking bonus damage."); LanguageAPI.Add("ITEM_DEATHMARK_DESC", "Enemies with " + _debuffCount + " or more debuffs are marked for death, increasing damage taken by " + (_damageMultiplier - 1f) * 100f + "% from all sources for 7 (+7 per stack) seconds."); } } public static class DeathMarkRework { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__3_5; public static Action <>9__3_4; public static Manipulator <>9__3_0; public static Func <>9__3_8; public static Func <>9__3_9; public static Func <>9__3_6; public static Func <>9__3_10; public static Func <>9__3_11; public static Func <>9__3_12; public static Func <>9__3_13; public static Action <>9__3_7; public static Manipulator <>9__3_1; public static Manipulator <>9__3_2; public static Func <>9__3_14; public static Func <>9__3_15; public static Func <>9__3_16; public static Func <>9__3_17; public static Func <>9__3_18; public static Func <>9__3_19; public static Func <>9__3_20; public static Func <>9__3_21; public static Manipulator <>9__3_3; internal void b__3_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_0048: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); string text = default(string); if (!val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, ref text) })) { Log.LogInstrNotFound(il); return; } val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Action)delegate(DamageReport dmgRep) { if (dmgRep.attackerMaster.inventory.GetItemCountEffective(Items.DeathMark) > 0) { dmgRep.victimBody.AddTimedBuff(Buffs.DeathMark, _duration); } }); } internal bool b__3_5(Instruction x) { string text = default(string); return ILPatternMatchingExt.MatchLdstr(x, ref text); } internal void b__3_4(DamageReport dmgRep) { if (dmgRep.attackerMaster.inventory.GetItemCountEffective(Items.DeathMark) > 0) { dmgRep.victimBody.AddTimedBuff(Buffs.DeathMark, _duration); } } internal void b__3_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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int num2 = default(int); if (!val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_inventory"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num2) })) { Log.LogInstrNotFound(il); return; } val.Emit(OpCodes.Ldarg_1); val.Emit(OpCodes.Ldarg_2); val.EmitDelegate>((Func)delegate(CharacterMaster master, DamageInfo dmgInfo, GameObject obj) { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) Log.LogDebug("Entered stungrenade delegate"); Inventory inventory = master.inventory; int itemCountEffective2 = inventory.GetItemCountEffective(Items.StunChanceOnHit); Log.LogDebug("inventory: " + ((object)inventory)?.ToString() + "; stunGrenades: " + itemCountEffective2); if (inventory.GetItemCountEffective(Items.DeathMark) > 0 && itemCountEffective2 > 0 && (Object)(object)obj.GetComponent() == (Object)null && Util.CheckRoll(Util.ConvertAmplificationPercentageIntoReductionPercentage(SetStateOnHurt.stunChanceOnHitBaseChancePercent * (float)itemCountEffective2 * dmgInfo.procCoefficient), master)) { Log.LogDebug("Doing fake stun grenade"); EffectManager.SimpleImpactEffect(LegacyResourcesAPI.Load("Prefabs/Effects/ImpactEffects/ImpactStunGrenade"), dmgInfo.position, -dmgInfo.force, true); obj.GetComponent().AddTimedBuff(Buffs.DeathMark, _duration); } return master; }); int num = default(int); ILLabel val2 = default(ILLabel); if (!val.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC2Content/Buffs", "EliteBeadCorruption"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.CharacterBody", "HasBuff"), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val2) })) { Log.LogInstrNotFound(il); return; } int index = val.Index; val.Index = index + 1; Log.LogDebug("index: " + val.Index); Log.LogDebug("next instr: " + (object)val.Next); val.Emit(OpCodes.Ldarg_1); val.Emit(OpCodes.Ldarg_2); val.EmitDelegate>((Action)delegate(DamageInfo dmgInfo, GameObject obj) { Log.LogDebug("Entered deathmark delegate"); CharacterBody component = obj.GetComponent(); int itemCountEffective = dmgInfo.attacker.GetComponent().inventory.GetItemCountEffective(Items.DeathMark); Log.LogDebug("count: " + itemCountEffective); if (itemCountEffective <= 0) { Log.LogDebug("no deathmarks"); } else { DeathMarkBehavior deathMarkBehavior = obj.GetComponent(); if ((Object)(object)deathMarkBehavior == (Object)null) { deathMarkBehavior = obj.AddComponent(); deathMarkBehavior.SetBuildUpSeconds(_slowBuildUpDuration); Log.LogDebug("Added deathMarkBehavior"); Log.LogDebug("Deathmark behavior parent disabled: " + obj.activeInHierarchy); } deathMarkBehavior.TryUpdateCount(itemCountEffective); if (IsHardCCDamageType(dmgInfo)) { deathMarkBehavior.ApplyMark(); } } }); } internal bool b__3_8(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_inventory"); } internal bool b__3_9(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchStloc(x, ref num); } internal CharacterMaster b__3_6(CharacterMaster master, DamageInfo dmgInfo, GameObject obj) { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) Log.LogDebug("Entered stungrenade delegate"); Inventory inventory = master.inventory; int itemCountEffective = inventory.GetItemCountEffective(Items.StunChanceOnHit); Log.LogDebug("inventory: " + ((object)inventory)?.ToString() + "; stunGrenades: " + itemCountEffective); if (inventory.GetItemCountEffective(Items.DeathMark) > 0 && itemCountEffective > 0 && (Object)(object)obj.GetComponent() == (Object)null && Util.CheckRoll(Util.ConvertAmplificationPercentageIntoReductionPercentage(SetStateOnHurt.stunChanceOnHitBaseChancePercent * (float)itemCountEffective * dmgInfo.procCoefficient), master)) { Log.LogDebug("Doing fake stun grenade"); EffectManager.SimpleImpactEffect(LegacyResourcesAPI.Load("Prefabs/Effects/ImpactEffects/ImpactStunGrenade"), dmgInfo.position, -dmgInfo.force, true); obj.GetComponent().AddTimedBuff(Buffs.DeathMark, _duration); } return master; } internal bool b__3_10(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdloc(x, ref num); } internal bool b__3_11(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC2Content/Buffs", "EliteBeadCorruption"); } internal bool b__3_12(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.CharacterBody", "HasBuff"); } internal bool b__3_13(Instruction x) { ILLabel val = default(ILLabel); return ILPatternMatchingExt.MatchBrfalse(x, ref val); } internal void b__3_7(DamageInfo dmgInfo, GameObject obj) { Log.LogDebug("Entered deathmark delegate"); CharacterBody component = obj.GetComponent(); int itemCountEffective = dmgInfo.attacker.GetComponent().inventory.GetItemCountEffective(Items.DeathMark); Log.LogDebug("count: " + itemCountEffective); if (itemCountEffective <= 0) { Log.LogDebug("no deathmarks"); return; } DeathMarkBehavior deathMarkBehavior = obj.GetComponent(); if ((Object)(object)deathMarkBehavior == (Object)null) { deathMarkBehavior = obj.AddComponent(); deathMarkBehavior.SetBuildUpSeconds(_slowBuildUpDuration); Log.LogDebug("Added deathMarkBehavior"); Log.LogDebug("Deathmark behavior parent disabled: " + obj.activeInHierarchy); } deathMarkBehavior.TryUpdateCount(itemCountEffective); if (IsHardCCDamageType(dmgInfo)) { deathMarkBehavior.ApplyMark(); } } internal void b__3_2(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0009: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.Emit(OpCodes.Ret); } internal void b__3_3(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); int num4 = default(int); int num3 = default(int); if (!val.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num4), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1.5f), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num3) })) { Log.LogInstrNotFound(il); return; } int num2 = default(int); int num = default(int); if (!val.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1.5f), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num) })) { Log.LogInstrNotFound(il); return; } int index = val.Index; val.Index = index + 1; Log.LogDebug("Dmark coeff: " + val.Next.Operand); val.Next.Operand = _damageMultiplier; Log.LogDebug("Dmark coeff updated: " + val.Next.Operand); } internal bool b__3_14(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdloc(x, ref num); } internal bool b__3_15(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 1.5f); } internal bool b__3_16(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool b__3_17(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchStloc(x, ref num); } internal bool b__3_18(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdloc(x, ref num); } internal bool b__3_19(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 1.5f); } internal bool b__3_20(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool b__3_21(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchStloc(x, ref num); } } public static float _duration; public static float _slowBuildUpDuration; public static float _damageMultiplier; public static void Init(float duration, float slowBulidUpDuration, float damageMultiplier) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown _duration = duration; _slowBuildUpDuration = slowBulidUpDuration; _damageMultiplier = damageMultiplier; try { object obj2 = <>c.<>9__3_0; if (obj2 == 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_0048: Unknown result type (might be due to invalid IL or missing references) ILCursor val9 = new ILCursor(il); string text = default(string); if (!val9.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, ref text) })) { Log.LogInstrNotFound(il); } else { val9.Emit(OpCodes.Ldarg_1); val9.EmitDelegate>((Action)delegate(DamageReport dmgRep) { if (dmgRep.attackerMaster.inventory.GetItemCountEffective(Items.DeathMark) > 0) { dmgRep.victimBody.AddTimedBuff(Buffs.DeathMark, _duration); } }); } }; <>c.<>9__3_0 = val; obj2 = (object)val; } SetStateOnHurt.OnTakeDamageServer += (Manipulator)obj2; object obj3 = <>c.<>9__3_1; if (obj3 == 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) ILCursor val7 = new ILCursor(il); int num6 = default(int); if (!val7.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_inventory"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num6) })) { Log.LogInstrNotFound(il); } else { val7.Emit(OpCodes.Ldarg_1); val7.Emit(OpCodes.Ldarg_2); val7.EmitDelegate>((Func)delegate(CharacterMaster master, DamageInfo dmgInfo, GameObject obj) { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) Log.LogDebug("Entered stungrenade delegate"); Inventory inventory = master.inventory; int itemCountEffective2 = inventory.GetItemCountEffective(Items.StunChanceOnHit); Log.LogDebug("inventory: " + ((object)inventory)?.ToString() + "; stunGrenades: " + itemCountEffective2); if (inventory.GetItemCountEffective(Items.DeathMark) > 0 && itemCountEffective2 > 0 && (Object)(object)obj.GetComponent() == (Object)null && Util.CheckRoll(Util.ConvertAmplificationPercentageIntoReductionPercentage(SetStateOnHurt.stunChanceOnHitBaseChancePercent * (float)itemCountEffective2 * dmgInfo.procCoefficient), master)) { Log.LogDebug("Doing fake stun grenade"); EffectManager.SimpleImpactEffect(LegacyResourcesAPI.Load("Prefabs/Effects/ImpactEffects/ImpactStunGrenade"), dmgInfo.position, -dmgInfo.force, true); obj.GetComponent().AddTimedBuff(Buffs.DeathMark, _duration); } return master; }); int num5 = default(int); ILLabel val8 = default(ILLabel); if (!val7.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num5), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC2Content/Buffs", "EliteBeadCorruption"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.CharacterBody", "HasBuff"), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val8) })) { Log.LogInstrNotFound(il); } else { int index2 = val7.Index; val7.Index = index2 + 1; Log.LogDebug("index: " + val7.Index); Log.LogDebug("next instr: " + (object)val7.Next); val7.Emit(OpCodes.Ldarg_1); val7.Emit(OpCodes.Ldarg_2); val7.EmitDelegate>((Action)delegate(DamageInfo dmgInfo, GameObject obj) { Log.LogDebug("Entered deathmark delegate"); CharacterBody component = obj.GetComponent(); int itemCountEffective = dmgInfo.attacker.GetComponent().inventory.GetItemCountEffective(Items.DeathMark); Log.LogDebug("count: " + itemCountEffective); if (itemCountEffective <= 0) { Log.LogDebug("no deathmarks"); } else { DeathMarkBehavior deathMarkBehavior = obj.GetComponent(); if ((Object)(object)deathMarkBehavior == (Object)null) { deathMarkBehavior = obj.AddComponent(); deathMarkBehavior.SetBuildUpSeconds(_slowBuildUpDuration); Log.LogDebug("Added deathMarkBehavior"); Log.LogDebug("Deathmark behavior parent disabled: " + obj.activeInHierarchy); } deathMarkBehavior.TryUpdateCount(itemCountEffective); if (IsHardCCDamageType(dmgInfo)) { deathMarkBehavior.ApplyMark(); } } }); } } }; <>c.<>9__3_1 = val2; obj3 = (object)val2; } GlobalEventManager.ProcessHitEnemy += (Manipulator)obj3; object obj4 = <>c.<>9__3_2; if (obj4 == null) { Manipulator val3 = 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_0009: Unknown result type (might be due to invalid IL or missing references) ILCursor val6 = new ILCursor(il); val6.Emit(OpCodes.Ret); }; <>c.<>9__3_2 = val3; obj4 = (object)val3; } GlobalEventManager.ProcDeathMark += (Manipulator)obj4; object obj5 = <>c.<>9__3_3; if (obj5 == null) { Manipulator val4 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val5 = new ILCursor(il); int num4 = default(int); int num3 = default(int); int num2 = default(int); int num = default(int); if (!val5.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num4), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1.5f), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num3) })) { Log.LogInstrNotFound(il); } else if (!val5.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1.5f), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num) })) { Log.LogInstrNotFound(il); } else { int index = val5.Index; val5.Index = index + 1; Log.LogDebug("Dmark coeff: " + val5.Next.Operand); val5.Next.Operand = _damageMultiplier; Log.LogDebug("Dmark coeff updated: " + val5.Next.Operand); } }; <>c.<>9__3_3 = val4; obj5 = (object)val4; } HealthComponent.TakeDamageProcess += (Manipulator)obj5; ReplaceText(); Log.LogInfo("Added Death Mark Rework"); } catch (Exception ex) { VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } private static bool IsHardCCDamageType(DamageInfo dmgInfo) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) return DamageTypeCombo.op_Implicit(dmgInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)50364704)) > DamageTypeCombo.op_Implicit(DamageTypeCombo.Generic); } private static void ReplaceText() { LanguageAPI.Add("ITEM_DEATHMARK_PICKUP", "Movement-impaired enemies are marked for death."); LanguageAPI.Add("ITEM_DEATHMARK_DESC", "Slowing enemies for " + _slowBuildUpDuration + " seconds applies Death Mark, increasing damage taken by " + (_damageMultiplier - 1f) * 100f + "% from all sources for " + _duration + " (+" + _duration + " per stack) seconds. Stuns apply Death Mark instantly."); } } internal class HuntersHarpoonBehavior : ItemBehavior { private const int HUNTERS_HARPOON_COOLDOWN = 3; private const float HUNTERS_HARPOON_DURATION = 3f; private float _timer = 0f; private void OnDisable() { base.body.ClearTimedBuffs(Buffs.KillMoveSpeed); } public void TryApplyMovespeed() { //IL_0083: 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_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Expected O, but got Unknown //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0175: 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_017c: 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_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) int num = Math.Clamp((int)Math.Truncate(_timer), 1, 3); Log.LogDebug("BuffCount: " + num); _timer = 0f; if (num <= 0) { return; } int buffCount = base.body.GetBuffCount(Buffs.KillMoveSpeed); if (num == buffCount) { for (int i = 0; i < base.body.timedBuffs.Count; i++) { TimedBuff val = base.body.timedBuffs[i]; if (val.buffIndex == Buffs.KillMoveSpeed.buffIndex) { val.timer = val.totalDuration; } } } else { if (num < buffCount) { return; } base.body.ClearTimedBuffs(Buffs.KillMoveSpeed); for (int j = 0; j < num; j++) { CharacterBody body = base.body; if (body != null) { body.AddTimedBuff(Buffs.KillMoveSpeed, 2f * (float)base.stack * (float)Math.Pow(0.75, j)); } } EffectData val2 = new EffectData(); val2.origin = base.body.corePosition; CharacterMotor characterMotor = base.body.characterMotor; bool flag = false; if (Object.op_Implicit((Object)(object)characterMotor)) { Vector3 moveDirection = characterMotor.moveDirection; if (moveDirection != Vector3.zero) { val2.rotation = Util.QuaternionSafeLookRotation(moveDirection); flag = true; } } if (!flag) { val2.rotation = base.body.transform.rotation; } EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/MoveSpeedOnKillActivate"), val2, true); } } private void FixedUpdate() { if (_timer < 3f) { _timer += Time.deltaTime; } } } internal class HuntersHarpoonBehavior1 : BaseItemBodyBehavior { public static bool _configEnabled; [ItemDefAssociation(useOnClient = false, useOnServer = true)] private static ItemDef GetItemDef() { return _configEnabled ? Items.MoveSpeedOnKill : null; } private void OnEnable() { if (!Object.op_Implicit((Object)(object)((BaseItemBodyBehavior)this).body)) { Log.LogDebug("NULL BODY"); return; } Log.LogDebug("Adding hook!"); ((BaseItemBodyBehavior)this).body.onSkillActivatedServer += OnSkillActivated; } private void OnDisable() { if (Object.op_Implicit((Object)(object)((BaseItemBodyBehavior)this).body)) { ((BaseItemBodyBehavior)this).body.onSkillActivatedServer -= OnSkillActivated; ((BaseItemBodyBehavior)this).body.ClearTimedBuffs(Buffs.KillMoveSpeed); } } public void TryApplyMovespeed() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) Log.LogDebug("Entered tryapplymovespeed"); ((BaseItemBodyBehavior)this).body.ClearTimedBuffs(Buffs.KillMoveSpeed); for (int i = 0; i < HuntersHarpoonRework1._buffStacks; i++) { CharacterBody body = ((BaseItemBodyBehavior)this).body; if (body != null) { body.AddTimedBuff(Buffs.KillMoveSpeed, HuntersHarpoonRework1._speedDuration * (float)base.stack * (float)Math.Pow(0.75, i)); } } EffectData val = new EffectData(); val.origin = ((BaseItemBodyBehavior)this).body.corePosition; CharacterMotor characterMotor = ((BaseItemBodyBehavior)this).body.characterMotor; bool flag = false; if (Object.op_Implicit((Object)(object)characterMotor)) { Vector3 moveDirection = characterMotor.moveDirection; if (moveDirection != Vector3.zero) { val.rotation = Util.QuaternionSafeLookRotation(moveDirection); flag = true; } } if (!flag) { val.rotation = ((BaseItemBodyBehavior)this).body.transform.rotation; } EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/MoveSpeedOnKillActivate"), val, true); } private void OnSkillActivated(GenericSkill skill) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) Log.LogDebug("Entered onskill hook!"); if (!NetworkServer.active) { Log.LogDebug("Not server!"); } else if (((BaseItemBodyBehavior)this).body.bodyIndex == SpecialCases.RailGunner()) { if ((Object)(object)((BaseItemBodyBehavior)this).body.skillLocator.primary != (Object)(object)skill || !((BaseItemBodyBehavior)this).body.canAddIncrasePrimaryDamage) { Log.LogDebug("Railgunner failed. primary: " + (object)((BaseItemBodyBehavior)this).body.skillLocator.primary == ((object)skill)?.ToString() + "; canaddincrase: " + ((BaseItemBodyBehavior)this).body.canAddIncrasePrimaryDamage); } else { TryApplyMovespeed(); } } else if ((!skill.skillDef.autoHandleLuminousShot && !((BaseItemBodyBehavior)this).body.canAddIncrasePrimaryDamage) || (Object)(object)((BaseItemBodyBehavior)this).body.skillLocator.secondary != (Object)(object)skill) { Log.LogDebug("Not railgunner. autoHandle: " + skill.skillDef.autoHandleLuminousShot + " primary: " + (object)((BaseItemBodyBehavior)this).body.skillLocator.primary == ((object)skill)?.ToString() + "; canaddincrase: " + ((BaseItemBodyBehavior)this).body.canAddIncrasePrimaryDamage); } else { TryApplyMovespeed(); } } } public static class HuntersHarpoonBuff { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__2_4; public static Func <>9__2_2; public static Func <>9__2_5; public static Func <>9__2_6; public static Action <>9__2_3; public static Manipulator <>9__2_0; public static Func <>9__2_8; public static Func <>9__2_9; public static Func <>9__2_7; public static Manipulator <>9__2_1; internal void b__2_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_00f0: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (!val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoveSpeedOnKill") })) { Log.LogInstrNotFound(il); return; } val.Index += 4; val.EmitDelegate>((Func)((int itemCount) => 0)); MethodReference val3 = default(MethodReference); if (!val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val3) })) { Log.LogInstrNotFound(il); return; } val.Index += 3; val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Action)delegate(DamageReport damageReport) { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) CharacterBody attackerBody = damageReport.attackerBody; int itemCountEffective = attackerBody.inventory.GetItemCountEffective(Items.MoveSpeedOnKill); if (itemCountEffective > 0) { int num = itemCountEffective - 1; int num2 = 5; float num3 = (float)(1.0 + (double)num * 0.5); attackerBody.ClearTimedBuffs(Buffs.KillMoveSpeed); for (int i = 0; i < _harpoonStacks; i++) { if (attackerBody != null) { attackerBody.AddTimedBuff(Buffs.KillMoveSpeed, _buffDuration * (float)itemCountEffective * (float)Math.Pow(0.75, i)); } } EffectData val2 = new EffectData(); val2.origin = attackerBody.corePosition; CharacterMotor characterMotor = attackerBody.characterMotor; bool flag = false; if (Object.op_Implicit((Object)(object)characterMotor)) { Vector3 moveDirection = characterMotor.moveDirection; if (moveDirection != Vector3.zero) { val2.rotation = Util.QuaternionSafeLookRotation(moveDirection); flag = true; } } if (!flag) { val2.rotation = attackerBody.transform.rotation; } EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/MoveSpeedOnKillActivate"), val2, true); } }); } internal bool b__2_4(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoveSpeedOnKill"); } internal int b__2_2(int itemCount) { return 0; } internal bool b__2_5(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 1); } internal bool b__2_6(Instruction x) { MethodReference val = default(MethodReference); return ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val); } internal void b__2_3(DamageReport damageReport) { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) CharacterBody attackerBody = damageReport.attackerBody; int itemCountEffective = attackerBody.inventory.GetItemCountEffective(Items.MoveSpeedOnKill); if (itemCountEffective <= 0) { return; } int num = itemCountEffective - 1; int num2 = 5; float num3 = (float)(1.0 + (double)num * 0.5); attackerBody.ClearTimedBuffs(Buffs.KillMoveSpeed); for (int i = 0; i < _harpoonStacks; i++) { if (attackerBody != null) { attackerBody.AddTimedBuff(Buffs.KillMoveSpeed, _buffDuration * (float)itemCountEffective * (float)Math.Pow(0.75, i)); } } EffectData val = new EffectData(); val.origin = attackerBody.corePosition; CharacterMotor characterMotor = attackerBody.characterMotor; bool flag = false; if (Object.op_Implicit((Object)(object)characterMotor)) { Vector3 moveDirection = characterMotor.moveDirection; if (moveDirection != Vector3.zero) { val.rotation = Util.QuaternionSafeLookRotation(moveDirection); flag = true; } } if (!flag) { val.rotation = attackerBody.transform.rotation; } EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/MoveSpeedOnKillActivate"), val, true); } internal void b__2_1(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); int num = default(int); if (!val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_inventory"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num) })) { Log.LogInstrNotFound(il); return; } val.EmitDelegate>((Func)delegate(CharacterMaster master) { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) Log.LogDebug("Harpoons: " + master.GetBody().inventory.GetItemCountEffective(Items.MoveSpeedOnKill) + "; Harp buffs: " + master.GetBody().GetBuffCount(Buffs.KillMoveSpeed)); if (master.inventory.GetItemCountEffective(Items.MoveSpeedOnKill) > 0) { Log.LogDebug("Beginning loop"); TimedBuff val2 = null; CharacterBody body = master.GetBody(); for (int i = 0; i < body.timedBuffs.Count; i++) { TimedBuff val3 = body.timedBuffs[i]; Log.LogDebug("BuffTimer: " + val3.timer); if (val3.buffIndex == Buffs.KillMoveSpeed.buffIndex && (val2 == null || val3.timer > val2.timer)) { val2 = val3; } } if (val2 != null && val2.timer < _buffDuration) { val2.timer = _buffDuration; } } return master; }); } internal bool b__2_8(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_inventory"); } internal bool b__2_9(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchStloc(x, ref num); } internal CharacterMaster b__2_7(CharacterMaster master) { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) Log.LogDebug("Harpoons: " + master.GetBody().inventory.GetItemCountEffective(Items.MoveSpeedOnKill) + "; Harp buffs: " + master.GetBody().GetBuffCount(Buffs.KillMoveSpeed)); if (master.inventory.GetItemCountEffective(Items.MoveSpeedOnKill) > 0) { Log.LogDebug("Beginning loop"); TimedBuff val = null; CharacterBody body = master.GetBody(); for (int i = 0; i < body.timedBuffs.Count; i++) { TimedBuff val2 = body.timedBuffs[i]; Log.LogDebug("BuffTimer: " + val2.timer); if (val2.buffIndex == Buffs.KillMoveSpeed.buffIndex && (val == null || val2.timer > val.timer)) { val = val2; } } if (val != null && val.timer < _buffDuration) { val.timer = _buffDuration; } } return master; } } private static int _harpoonStacks; private static float _buffDuration; public static void Init(int harpoonStacks, float buffDuration) { //IL_0022: 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_002d: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown _harpoonStacks = harpoonStacks; _buffDuration = buffDuration; try { object obj = <>c.<>9__2_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_00f0: Unknown result type (might be due to invalid IL or missing references) ILCursor val6 = new ILCursor(il); if (!val6.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoveSpeedOnKill") })) { Log.LogInstrNotFound(il); } else { val6.Index += 4; val6.EmitDelegate>((Func)((int itemCount) => 0)); MethodReference val8 = default(MethodReference); if (!val6.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val8) })) { Log.LogInstrNotFound(il); } else { val6.Index += 3; val6.Emit(OpCodes.Ldarg_1); val6.EmitDelegate>((Action)delegate(DamageReport damageReport) { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) CharacterBody attackerBody = damageReport.attackerBody; int itemCountEffective = attackerBody.inventory.GetItemCountEffective(Items.MoveSpeedOnKill); if (itemCountEffective > 0) { int num2 = itemCountEffective - 1; int num3 = 5; float num4 = (float)(1.0 + (double)num2 * 0.5); attackerBody.ClearTimedBuffs(Buffs.KillMoveSpeed); for (int j = 0; j < _harpoonStacks; j++) { if (attackerBody != null) { attackerBody.AddTimedBuff(Buffs.KillMoveSpeed, _buffDuration * (float)itemCountEffective * (float)Math.Pow(0.75, j)); } } EffectData val7 = new EffectData(); val7.origin = attackerBody.corePosition; CharacterMotor characterMotor = attackerBody.characterMotor; bool flag = false; if (Object.op_Implicit((Object)(object)characterMotor)) { Vector3 moveDirection = characterMotor.moveDirection; if (moveDirection != Vector3.zero) { val7.rotation = Util.QuaternionSafeLookRotation(moveDirection); flag = true; } } if (!flag) { val7.rotation = attackerBody.transform.rotation; } EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/MoveSpeedOnKillActivate"), val7, true); } }); } } }; <>c.<>9__2_0 = val; obj = (object)val; } GlobalEventManager.OnCharacterDeath += (Manipulator)obj; object obj2 = <>c.<>9__2_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 ILCursor val3 = new ILCursor(il); int num = default(int); if (!val3.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_inventory"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num) })) { Log.LogInstrNotFound(il); } else { val3.EmitDelegate>((Func)delegate(CharacterMaster master) { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) Log.LogDebug("Harpoons: " + master.GetBody().inventory.GetItemCountEffective(Items.MoveSpeedOnKill) + "; Harp buffs: " + master.GetBody().GetBuffCount(Buffs.KillMoveSpeed)); if (master.inventory.GetItemCountEffective(Items.MoveSpeedOnKill) > 0) { Log.LogDebug("Beginning loop"); TimedBuff val4 = null; CharacterBody body = master.GetBody(); for (int i = 0; i < body.timedBuffs.Count; i++) { TimedBuff val5 = body.timedBuffs[i]; Log.LogDebug("BuffTimer: " + val5.timer); if (val5.buffIndex == Buffs.KillMoveSpeed.buffIndex && (val4 == null || val5.timer > val4.timer)) { val4 = val5; } } if (val4 != null && val4.timer < _buffDuration) { val4.timer = _buffDuration; } } return master; }); } }; <>c.<>9__2_1 = val2; obj2 = (object)val2; } GlobalEventManager.ProcessHitEnemy += (Manipulator)obj2; UpdateText(); Log.LogInfo("Added Hunters Harpoon Buff"); } catch (Exception ex) { VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } private static void UpdateText() { LanguageAPI.Add("ITEM_MOVESPEEDONKILL_DESC", "Killing an enemy increases movement speed by " + _harpoonStacks * 25 + "% fading over " + _buffDuration + " (+" + _buffDuration + " per stack) seconds. Attacks refresh the move speed."); } } internal class HuntersHarpoonChoice { public static void TryInit(ConfigFile configFile) { bool value = configFile.Bind("Hunters Harpoon Rework", "Enable Hunters Harpoon Rework", true, "Hunters Harpoon now grants fading move speed on secondary use.").Value; int value2 = configFile.Bind("Hunters Harpoon Rework", "Hunters Harpoon Buff Stacks", 3, "Gain X * 25% fading movement speed upon casting secondary.").Value; float value3 = configFile.Bind("Hunters Harpoon Rework", "Hunters Harpoon Duration", 2f, "Hunters Harpoon buff lasts X seconds.").Value; bool value4 = configFile.Bind("Hunters Harpoon Buff", "Enable Hunters Harpoon Buff", false, "Harpoon speed is less intense, but lasts longer.\nRework overrides buff.").Value; float value5 = configFile.Bind("Hunters Harpoon Buff", "Hunters Harpoon Duration", 2f, "Hunters Harpoon buff lasts X seconds.").Value; int value6 = configFile.Bind("Hunters Harpoon Buff", "Hunters Harpoon Buff Stacks", 4, "Gain X * 25% fading movement speed upon kill.").Value; if (value) { HuntersHarpoonBehavior1._configEnabled = true; HuntersHarpoonRework1.Init(value2, value3); } else if (value4) { HuntersHarpoonBuff.Init(value6, value5); } } } public static class HuntersHarpoonRework { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__0_4; public static Func <>9__0_5; public static Func <>9__0_6; public static Func <>9__0_7; public static Func <>9__0_3; public static Manipulator <>9__0_0; public static Func <>9__0_8; public static Manipulator <>9__0_1; public static Func <>9__0_9; public static Func <>9__0_10; public static Func <>9__0_11; public static Manipulator <>9__0_2; internal void b__0_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_00b7: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int num2 = default(int); int num = default(int); if (!val.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_inventory"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetActiveEquipment") })) { int index = val.Index; val.Index = index + 1; } val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(CharacterBody body) { Log.LogDebug("Attempting to add behavior for hunter: " + (object)body); body.AddItemBehavior(body.inventory.GetItemCountEffective(Items.MoveSpeedOnKill)); Log.LogDebug("Behavior: " + (object)((Component)body).gameObject.GetComponent()); Log.LogDebug("Behaviormasterbodypath: " + (object)((Component)body.master.GetBody()).GetComponent()); return body; }); } internal bool b__0_4(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdarg(x, ref num); } internal bool b__0_5(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdarg(x, ref num); } internal bool b__0_6(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_inventory"); } internal bool b__0_7(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetActiveEquipment"); } internal CharacterBody b__0_3(CharacterBody body) { Log.LogDebug("Attempting to add behavior for hunter: " + (object)body); body.AddItemBehavior(body.inventory.GetItemCountEffective(Items.MoveSpeedOnKill)); Log.LogDebug("Behavior: " + (object)((Component)body).gameObject.GetComponent()); Log.LogDebug("Behaviormasterbodypath: " + (object)((Component)body.master.GetBody()).GetComponent()); return body; } internal void b__0_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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (!val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoveSpeedOnKill") })) { Log.LogInstrNotFound(il); return; } val.Index += 2; val.Emit(OpCodes.Ldc_I4_0); val.Emit(OpCodes.Mul); } internal bool b__0_8(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoveSpeedOnKill"); } internal void b__0_2(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int num = default(int); val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_inventory"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num) }); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Func)delegate(CharacterMaster master, DamageInfo dmgInfo) { Log.LogDebug("Entering Hunter Harp delegate"); HuntersHarpoonBehavior component = ((Component)master.GetBody()).GetComponent(); Log.LogDebug("Hunter harp behavior: " + (object)component); if ((Object)(object)component != (Object)null && ((DamageTypeCombo)(ref dmgInfo.damageType)).IsDamageSourceSkillBased) { component.TryApplyMovespeed(); } return master; }); } internal bool b__0_9(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_inventory"); } internal bool b__0_10(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchStloc(x, ref num); } internal CharacterMaster b__0_11(CharacterMaster master, DamageInfo dmgInfo) { Log.LogDebug("Entering Hunter Harp delegate"); HuntersHarpoonBehavior component = ((Component)master.GetBody()).GetComponent(); Log.LogDebug("Hunter harp behavior: " + (object)component); if ((Object)(object)component != (Object)null && ((DamageTypeCombo)(ref dmgInfo.damageType)).IsDamageSourceSkillBased) { component.TryApplyMovespeed(); } return master; } } public static void Init() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown try { object obj = <>c.<>9__0_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_00b7: Unknown result type (might be due to invalid IL or missing references) ILCursor val6 = new ILCursor(il); int num3 = default(int); int num2 = default(int); if (!val6.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num3), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_inventory"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetActiveEquipment") })) { int index = val6.Index; val6.Index = index + 1; } val6.Emit(OpCodes.Ldarg_0); val6.EmitDelegate>((Func)delegate(CharacterBody body) { Log.LogDebug("Attempting to add behavior for hunter: " + (object)body); body.AddItemBehavior(body.inventory.GetItemCountEffective(Items.MoveSpeedOnKill)); Log.LogDebug("Behavior: " + (object)((Component)body).gameObject.GetComponent()); Log.LogDebug("Behaviormasterbodypath: " + (object)((Component)body.master.GetBody()).GetComponent()); return body; }); }; <>c.<>9__0_0 = val; obj = (object)val; } CharacterBody.OnInventoryChanged += (Manipulator)obj; object obj2 = <>c.<>9__0_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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) ILCursor val5 = new ILCursor(il); if (!val5.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoveSpeedOnKill") })) { Log.LogInstrNotFound(il); } else { val5.Index += 2; val5.Emit(OpCodes.Ldc_I4_0); val5.Emit(OpCodes.Mul); } }; <>c.<>9__0_1 = val2; obj2 = (object)val2; } GlobalEventManager.OnCharacterDeath += (Manipulator)obj2; object obj3 = <>c.<>9__0_2; if (obj3 == null) { Manipulator val3 = 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_005a: Unknown result type (might be due to invalid IL or missing references) ILCursor val4 = new ILCursor(il); int num = default(int); val4.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_inventory"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num) }); val4.Emit(OpCodes.Ldarg_1); val4.EmitDelegate>((Func)delegate(CharacterMaster master, DamageInfo dmgInfo) { Log.LogDebug("Entering Hunter Harp delegate"); HuntersHarpoonBehavior component = ((Component)master.GetBody()).GetComponent(); Log.LogDebug("Hunter harp behavior: " + (object)component); if ((Object)(object)component != (Object)null && ((DamageTypeCombo)(ref dmgInfo.damageType)).IsDamageSourceSkillBased) { component.TryApplyMovespeed(); } return master; }); }; <>c.<>9__0_2 = val3; obj3 = (object)val3; } GlobalEventManager.ProcessHitEnemy += (Manipulator)obj3; UpdateText(); Log.LogInfo("Added Hunters Harpoon Rework"); } catch (Exception ex) { VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } private static void UpdateText() { LanguageAPI.Add("ITEM_MOVESPEEDONKILL_DESC", "Killing an enemy increases movement speed by 100% fading over 2 (+2 per stack) seconds."); } } public static class HuntersHarpoonRework1 { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__2_1; public static Manipulator <>9__2_0; internal void b__2_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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (!val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoveSpeedOnKill") })) { Log.LogInstrNotFound(il); return; } val.Index += 2; val.Emit(OpCodes.Ldc_I4_0); val.Emit(OpCodes.Mul); } internal bool b__2_1(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoveSpeedOnKill"); } } public static int _buffStacks; public static float _speedDuration; public static void Init(int buffStacks, float speedDuration) { //IL_0022: 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_002d: Expected O, but got Unknown _buffStacks = buffStacks; _speedDuration = speedDuration; try { object obj = <>c.<>9__2_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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) ILCursor val2 = new ILCursor(il); if (!val2.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoveSpeedOnKill") })) { Log.LogInstrNotFound(il); } else { val2.Index += 2; val2.Emit(OpCodes.Ldc_I4_0); val2.Emit(OpCodes.Mul); } }; <>c.<>9__2_0 = val; obj = (object)val; } GlobalEventManager.OnCharacterDeath += (Manipulator)obj; UpdateText(); Log.LogInfo("Added Hunters Harpoon Rework"); } catch (Exception ex) { VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } private static void UpdateText() { LanguageAPI.Add("ITEM_MOVESPEEDONKILL_DESC", "Using your secondary skill increases movement speed by " + _buffStacks * 25 + "% fading over " + _speedDuration + " (+" + _speedDuration + " per stack) seconds."); } } internal class IgnitionTankRework { private delegate int ItemCountIfBurningDel(int itemCount, ref InflictDotInfo dotInfo); [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__0_2; public static Func <>9__0_3; public static Manipulator <>9__0_0; public static Func <>9__0_4; public static Func <>9__0_5; public static Action <>9__0_6; public static Manipulator <>9__0_1; internal void b__0_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_006b: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int num = default(int); val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0) }); int index = val.Index; val.Index = index + 1; val.Emit(OpCodes.Ldarg_1); val.EmitDelegate((ItemCountIfBurningDel)ItemCountIfBurning); } internal bool b__0_2(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdloc(x, ref num); } internal bool b__0_3(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 0); } internal void b__0_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_0069: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel val2 = default(ILLabel); val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchAnd(x), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val2) }); val.Index += 2; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)delegate(GenericCharacterMain gcm) { int itemCountEffective = ((EntityState)gcm).characterBody.inventory.GetItemCountEffective(Items.StrengthenBurn); if (itemCountEffective > 0) { ProcIgniteOnJump(((EntityState)gcm).characterBody, itemCountEffective); } }); } internal bool b__0_4(Instruction x) { return ILPatternMatchingExt.MatchAnd(x); } internal bool b__0_5(Instruction x) { ILLabel val = default(ILLabel); return ILPatternMatchingExt.MatchBrfalse(x, ref val); } internal void b__0_6(GenericCharacterMain gcm) { int itemCountEffective = ((EntityState)gcm).characterBody.inventory.GetItemCountEffective(Items.StrengthenBurn); if (itemCountEffective > 0) { ProcIgniteOnJump(((EntityState)gcm).characterBody, itemCountEffective); } } } public static void Init() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown try { object obj = <>c.<>9__0_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_006b: Unknown result type (might be due to invalid IL or missing references) ILCursor val5 = new ILCursor(il); int num = default(int); val5.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0) }); int index = val5.Index; val5.Index = index + 1; val5.Emit(OpCodes.Ldarg_1); val5.EmitDelegate((ItemCountIfBurningDel)ItemCountIfBurning); }; <>c.<>9__0_0 = val; obj = (object)val; } StrengthenBurnUtils.CheckDotForUpgrade += (Manipulator)obj; object obj2 = <>c.<>9__0_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_0069: Unknown result type (might be due to invalid IL or missing references) ILCursor val3 = new ILCursor(il); ILLabel val4 = default(ILLabel); val3.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchAnd(x), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val4) }); val3.Index += 2; val3.Emit(OpCodes.Ldarg_0); val3.EmitDelegate>((Action)delegate(GenericCharacterMain gcm) { int itemCountEffective = ((EntityState)gcm).characterBody.inventory.GetItemCountEffective(Items.StrengthenBurn); if (itemCountEffective > 0) { ProcIgniteOnJump(((EntityState)gcm).characterBody, itemCountEffective); } }); }; <>c.<>9__0_1 = val2; obj2 = (object)val2; } GenericCharacterMain.ProcessJump_bool += (Manipulator)obj2; UpdateText(); Log.LogInfo("Added Ignition Tank Rework"); } catch (Exception ex) { VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } private static int ItemCountIfBurning(int itemCount, ref InflictDotInfo dotInfo) { return dotInfo.victimObject.GetComponent().HasBuff(Buffs.StrongerBurn) ? itemCount : 0; } private static void ProcIgniteOnJump(CharacterBody attackerBody, int ignitionTankCount) { //IL_000f: 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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) float num = 12f + attackerBody.radius; Vector3 corePosition = attackerBody.corePosition; GlobalEventManager.igniteOnKillSphereSearch.origin = corePosition; GlobalEventManager.igniteOnKillSphereSearch.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask; GlobalEventManager.igniteOnKillSphereSearch.radius = num; GlobalEventManager.igniteOnKillSphereSearch.RefreshCandidates(); GlobalEventManager.igniteOnKillSphereSearch.FilterCandidatesByHurtBoxTeam(TeamMask.GetUnprotectedTeams(attackerBody.teamComponent.teamIndex)); GlobalEventManager.igniteOnKillSphereSearch.FilterCandidatesByDistinctHurtBoxEntities(); GlobalEventManager.igniteOnKillSphereSearch.OrderCandidatesByDistance(); GlobalEventManager.igniteOnKillSphereSearch.GetHurtBoxes(GlobalEventManager.igniteOnKillHurtBoxBuffer); GlobalEventManager.igniteOnKillSphereSearch.ClearCandidates(); float num2 = 0.75f * attackerBody.damage; EffectManager.SpawnEffect(CommonAssets.igniteOnKillExplosionEffectPrefab, new EffectData { origin = corePosition, scale = num, rotation = new Quaternion(0f, 0f, 0f, 1f) }, true); for (int i = 0; i < GlobalEventManager.igniteOnKillHurtBoxBuffer.Count; i++) { HurtBox val = GlobalEventManager.igniteOnKillHurtBoxBuffer[i]; if (Object.op_Implicit((Object)(object)val.healthComponent)) { GameObject gameObject = ((Component)val.healthComponent).gameObject; UpgradeExistingBurns(gameObject, attackerBody); float num3 = 1 + ignitionTankCount * 3; InflictDotInfo val2 = default(InflictDotInfo); val2.victimObject = gameObject; val2.attackerObject = ((Component)attackerBody).gameObject; val2.totalDamage = num2 * num3; val2.dotIndex = (DotIndex)7; val2.damageMultiplier = num3; InflictDotInfo val3 = val2; DotController.InflictDot(ref val3); } } GlobalEventManager.igniteOnKillHurtBoxBuffer.Clear(); } private static void UpgradeExistingBurns(GameObject victim, CharacterBody attacker) { //IL_0069: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) DotController val = DotController.FindDotController(victim); int itemCountEffective = attacker.inventory.GetItemCountEffective(Items.StrengthenBurn); if (!Object.op_Implicit((Object)(object)val)) { return; } DotIndex[] source = (DotIndex[])(object)new DotIndex[2] { (DotIndex)1, (DotIndex)2 }; Log.LogInfo("Pre inflict info: "); for (int num = val.dotStackList.Count - 1; num >= 0; num--) { if (source.Contains(val.dotStackList[num].dotIndex)) { DotStack val2 = val.dotStackList[num]; float num2 = 1 + 3 * itemCountEffective; InflictDotInfo val3 = default(InflictDotInfo); val3.victimObject = victim; val3.attackerObject = ((Component)attacker).gameObject; val3.totalDamage = val2.damage / val2.dotDef.interval * val2.timer * num2; val3.dotIndex = (DotIndex)7; val3.damageMultiplier = num2; InflictDotInfo val4 = val3; string text = val2.damage.ToString(); float? totalDamage = val4.totalDamage; Log.LogInfo("Stack damage: " + text + ", totalDamage: " + totalDamage); Log.LogInfo("Burn upgraded at i = " + num + "with timer: " + val2.timer + " and duration: " + val2.totalDuration + " and new duration: " + val4.duration); DotController.InflictDot(ref val4); val.RemoveDotStackAtServer(num); } } Log.LogInfo("Total DOT recap: "); for (int num3 = val.dotStackList.Count - 1; num3 >= 0; num3--) { DotStack val5 = val.dotStackList[num3]; Log.LogInfo(((object)(DotIndex)(ref val5.dotIndex)).ToString() + " exists at i = " + num3 + "with timer: " + val5.timer + " and duration: " + val5.totalDuration); Log.LogInfo("Damage: " + val5.damage + "Total damage?: " + val5.damage / val5.dotDef.interval * val5.timer); } } private static void UpdateText() { LanguageAPI.Add("ITEM_STRENGTHENBURN_DESC", "Jumping near an enemy burns them for 150% damage. Victims take an additional 300% (+300% per stack) damage from burn effects. "); LanguageAPI.Add("ITEM_STRENGTHENBURN_PICKUP", "Jumping near an enemy burns them and causes them to take quadruple burn damage."); } } public class LeechingSeedBuff { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__2_1; public static Func <>9__2_2; public static Func <>9__2_3; public static Action <>9__2_4; public static Manipulator <>9__2_0; internal void b__2_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_007c: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int num3 = default(int); int num2 = default(int); val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num3), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "combinedHealth"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num2) }); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Action)delegate(DamageInfo damageInfo) { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) if (damageInfo != null && !((Object)(object)damageInfo.attacker == (Object)null)) { CharacterBody component = damageInfo.attacker.GetComponent(); CharacterMaster val2 = ((component != null) ? component.master : null); Inventory val3 = ((val2 != null) ? val2.inventory : null); if ((Object)(object)val3 != (Object)null && !((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)6)) { int itemCountEffective = val3.GetItemCountEffective(Items.Seed); if (itemCountEffective > 0) { HealthComponent val4 = ((component != null) ? ((Component)component).GetComponent() : null); if ((Object)(object)val4 != (Object)null && Object.op_Implicit((Object)(object)val4)) { ProcChainMask procChainMask = damageInfo.procChainMask; ((ProcChainMask)(ref procChainMask)).AddProc((ProcType)6); double num = val4.Heal((float)itemCountEffective * _extraHeal, procChainMask, true); } } } } }); } internal bool b__2_1(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdarg(x, ref num); } internal bool b__2_2(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "combinedHealth"); } internal bool b__2_3(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchStloc(x, ref num); } internal void b__2_4(DamageInfo damageInfo) { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) if (damageInfo == null || (Object)(object)damageInfo.attacker == (Object)null) { return; } CharacterBody component = damageInfo.attacker.GetComponent(); CharacterMaster val = ((component != null) ? component.master : null); Inventory val2 = ((val != null) ? val.inventory : null); if (!((Object)(object)val2 != (Object)null) || ((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)6)) { return; } int itemCountEffective = val2.GetItemCountEffective(Items.Seed); if (itemCountEffective > 0) { HealthComponent val3 = ((component != null) ? ((Component)component).GetComponent() : null); if ((Object)(object)val3 != (Object)null && Object.op_Implicit((Object)(object)val3)) { ProcChainMask procChainMask = damageInfo.procChainMask; ((ProcChainMask)(ref procChainMask)).AddProc((ProcType)6); double num = val3.Heal((float)itemCountEffective * _extraHeal, procChainMask, true); } } } } public static float _extraHeal; public static void TryInit(ConfigFile configFile) { bool value = configFile.Bind("Leeching Seed Buff", "Enable Leeching Seed Buff", true, "Leeching seed also heals for additional health regardless of proc coefficient.").Value; _extraHeal = configFile.Bind("Leeching Seed Buff", "Leeching Seed Extra Heal", 0.2f, "Leeching seed heals X extra health regardless of proc coefficient.\nDefault:0.2\nVanilla:0.0").Value; if (value) { Init(); } } public static void Init() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown try { object obj = <>c.<>9__2_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_007c: Unknown result type (might be due to invalid IL or missing references) ILCursor val2 = new ILCursor(il); int num3 = default(int); int num2 = default(int); val2.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num3), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "combinedHealth"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num2) }); val2.Emit(OpCodes.Ldarg_1); val2.EmitDelegate>((Action)delegate(DamageInfo damageInfo) { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) if (damageInfo != null && !((Object)(object)damageInfo.attacker == (Object)null)) { CharacterBody component = damageInfo.attacker.GetComponent(); CharacterMaster val3 = ((component != null) ? component.master : null); Inventory val4 = ((val3 != null) ? val3.inventory : null); if ((Object)(object)val4 != (Object)null && !((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)6)) { int itemCountEffective = val4.GetItemCountEffective(Items.Seed); if (itemCountEffective > 0) { HealthComponent val5 = ((component != null) ? ((Component)component).GetComponent() : null); if ((Object)(object)val5 != (Object)null && Object.op_Implicit((Object)(object)val5)) { ProcChainMask procChainMask = damageInfo.procChainMask; ((ProcChainMask)(ref procChainMask)).AddProc((ProcType)6); double num = val5.Heal((float)itemCountEffective * _extraHeal, procChainMask, true); } } } } }); }; <>c.<>9__2_0 = val; obj = (object)val; } HealthComponent.TakeDamageProcess += (Manipulator)obj; UpdateText(); Log.LogInfo("Added Leeching Seed Buff"); } catch (Exception ex) { VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } private static void UpdateText() { LanguageAPI.Add("ITEM_SEED_DESC", "Proc damage heals you for 1 (+1 per stack), health. Also heals for " + _extraHeal + " (+" + _extraHeal + " per stack)on all damage instances."); } } internal class LeptonDaisyBehavior : MonoBehaviour { private float _timer = 0f; private GameObject _obj; private Vector3 _arenaPosition; public void SetPos(Vector3 pos) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) _arenaPosition = pos; } private void OnDestroy() { Log.LogDebug("Daisy Behavior destroyed!"); } private void OnDisable() { Log.LogDebug("Daisy Behavior disabled!"); Object.Destroy((Object)(object)_obj); } private void OnEnable() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown _obj = new GameObject(); NetworkServer.Spawn(_obj); _timer = 0f; Log.LogDebug("Daisy Behavior enabled!, " + _timer); } private void Pulse() { //IL_0019: 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_0084: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } int itemCountForTeam = Util.GetItemCountForTeam((TeamIndex)1, Items.TPHealingNova.itemIndex, false, false); Log.LogDebug("Daisies: " + itemCountForTeam); if (itemCountForTeam >= 1) { if ((Object)(object)_obj.transform == (Object)null) { Log.LogDebug("parentTransform is NULL"); } GameObject val = Object.Instantiate(TeleporterHealNovaGeneratorMain.pulsePrefab, _arenaPosition, _obj.transform.rotation, _obj.transform); TeleporterHealNovaPulse component = val.GetComponent(); val.GetComponent().teamIndex = (TeamIndex)1; NetworkServer.Spawn(val); } } private void FixedUpdate() { _timer += Time.deltaTime; if (_timer > LeptonDaisyRework._cooldown) { _timer = 0f; Pulse(); } } } public static class LeptonDaisyBuff { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__5_4; public static Func <>9__5_5; public static Action <>9__5_6; public static Manipulator <>9__5_0; public static Func <>9__5_7; public static Manipulator <>9__5_1; public static Func <>9__5_9; public static Func <>9__5_8; public static Manipulator <>9__5_2; public static Func <>9__5_11; public static Func <>9__5_12; public static Func <>9__5_10; public static Manipulator <>9__5_3; internal void b__5_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_0069: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int num2 = default(int); int num = default(int); val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num) }); val.Index += 3; val.Emit(OpCodes.Ldloc_2); val.EmitDelegate>((Action)delegate(HealthComponent healthComponent) { CleanseSystem.CleanseBodyServer(healthComponent.body, _cleanseDebuff, false, _cleanseCooldown, _cleanseDebuff, _cleanseDebuff, _cleanseProjecties); }); } internal bool b__5_4(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdarg(x, ref num); } internal bool b__5_5(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdloc(x, ref num); } internal void b__5_6(HealthComponent healthComponent) { CleanseSystem.CleanseBodyServer(healthComponent.body, _cleanseDebuff, false, _cleanseCooldown, _cleanseDebuff, _cleanseDebuff, _cleanseProjecties); } internal void b__5_1(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); float num = default(float); val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num) }); val.Next.Operand = _healVal; } internal bool b__5_7(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal void b__5_2(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (!val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchMul(x) })) { Log.LogInstrNotFound(il); return; } int index = val.Index; val.Index = index + 1; val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Func)((float nextPulseFraction, float prevPulseFraction) => (prevPulseFraction < 0.01f) ? 0.01f : nextPulseFraction)); } internal bool b__5_9(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal float b__5_8(float nextPulseFraction, float prevPulseFraction) { if (prevPulseFraction < 0.01f) { return 0.01f; } return nextPulseFraction; } internal void b__5_3(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); int num = default(int); if (!val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchAdd(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num) })) { Log.LogInstrNotFound(il); return; } val.EmitDelegate>((Func)((int defaultPulseCount) => defaultPulseCount * _pulseCount)); } internal bool b__5_11(Instruction x) { return ILPatternMatchingExt.MatchAdd(x); } internal bool b__5_12(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchStloc(x, ref num); } internal int b__5_10(int defaultPulseCount) { return defaultPulseCount * _pulseCount; } } public static int _pulseCount; public static float _healVal; public static bool _cleanseDebuff; public static bool _cleanseProjecties; public static bool _cleanseCooldown; public static void Init(int pulseCount, float healVal, bool cleanseDebuff, bool cleanseProjectiles, bool cleanseCooldown) { //IL_0035: 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_0040: Expected O, but got Unknown //IL_005a: 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_0065: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown try { _pulseCount = pulseCount; _healVal = healVal; _cleanseDebuff = cleanseDebuff; _cleanseProjecties = cleanseProjectiles; _cleanseCooldown = cleanseCooldown; object obj = <>c.<>9__5_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_0069: Unknown result type (might be due to invalid IL or missing references) ILCursor val8 = new ILCursor(il); int num4 = default(int); int num3 = default(int); val8.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num4), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num3) }); val8.Index += 3; val8.Emit(OpCodes.Ldloc_2); val8.EmitDelegate>((Action)delegate(HealthComponent healthComponent) { CleanseSystem.CleanseBodyServer(healthComponent.body, _cleanseDebuff, false, _cleanseCooldown, _cleanseDebuff, _cleanseDebuff, _cleanseProjecties); }); }; <>c.<>9__5_0 = val; obj = (object)val; } HealPulse.Update += (Manipulator)obj; object obj2 = <>c.<>9__5_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 ILCursor val7 = new ILCursor(il); float num2 = default(float); val7.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num2) }); val7.Next.Operand = _healVal; }; <>c.<>9__5_1 = val2; obj2 = (object)val2; } TeleporterHealNovaPulse.OnEnter += (Manipulator)obj2; object obj3 = <>c.<>9__5_2; if (obj3 == null) { Manipulator val3 = 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_0059: Unknown result type (might be due to invalid IL or missing references) ILCursor val6 = new ILCursor(il); if (!val6.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchMul(x) })) { Log.LogInstrNotFound(il); } else { int index = val6.Index; val6.Index = index + 1; val6.Emit(OpCodes.Ldarg_1); val6.EmitDelegate>((Func)((float nextPulseFraction, float prevPulseFraction) => (prevPulseFraction < 0.01f) ? 0.01f : nextPulseFraction)); } }; <>c.<>9__5_2 = val3; obj3 = (object)val3; } TeleporterHealNovaGeneratorMain.CalculateNextPulseFraction += (Manipulator)obj3; object obj4 = <>c.<>9__5_3; if (obj4 == null) { Manipulator val4 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val5 = new ILCursor(il); int num = default(int); if (!val5.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchAdd(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num) })) { Log.LogInstrNotFound(il); } else { val5.EmitDelegate>((Func)((int defaultPulseCount) => defaultPulseCount * _pulseCount)); } }; <>c.<>9__5_3 = val4; obj4 = (object)val4; } TeleporterHealNovaGeneratorMain.CalculatePulseCount += (Manipulator)obj4; UpdateText(); Log.LogInfo("Lepton Daisy Buff"); } catch (Exception ex) { VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } private static void UpdateText() { LanguageAPI.Add("ITEM_TPHEALINGNOVA_DESC", "Release a healing nova during the Teleporter event, " + ((_cleanseDebuff || _cleanseCooldown) ? "cleansing and " : "") + "healing all nearby allies for " + _healVal * 100f + "% of their maximum health. Occurs " + (_pulseCount + 1) + " (+" + _pulseCount + " per stack) times."); } } internal class LeptonDaisyChoice { public static void TryInit(ConfigFile configFile) { bool value = configFile.Bind("Lepton Daisy Rework", "Enable Lepton Daisy Rework", true, "Lepton Daisy now heals on a timer during bosses (including final bosses).").Value; float value2 = configFile.Bind("Lepton Daisy Rework", "Lepton Daisy Cooldown", 30f, "Lepton Daisy pulse occurs every X seconds.").Value; float healFrac = configFile.Bind("Lepton Daisy Rework", "Lepton Daisy Heal", 25f, "Each Lepton Daisy pulse heals for X% max health.").Value / 100f; bool value3 = configFile.Bind("Lepton Daisy Rework", "Lepton Daisy Cleanses Debuffs", true, "").Value; bool value4 = configFile.Bind("Lepton Daisy Rework", "Lepton Daisy Cleanses Projectiles Near Allies", true, "").Value; bool value5 = configFile.Bind("Lepton Daisy Rework", "Lepton Daisy Cleanses Item Cooldowns", false, "").Value; bool value6 = configFile.Bind("Lepton Daisy Buff", "Enable Lepton Daisy Buff", false, "Lepton Daisy now pulses more often at a lower value, cleansing debuffs. Also heals once on holdout start.\nRework overrides buff.").Value; int pulseCount = configFile.Bind("Lepton Daisy Buff", "Lepton Daisy Pulse Count", 3, "Lepton Daisy now pulses X times (+ X-1 times per stack).").Value - 1; float healVal = configFile.Bind("Lepton Daisy Buff", "Lepton Daisy Heal", 35f, "Lepton Daisy heals X% health per pulse.").Value / 100f; bool value7 = configFile.Bind("Lepton Daisy Buff", "Lepton Daisy Cleanses Debuffs", true, "").Value; bool value8 = configFile.Bind("Lepton Daisy Buff", "Lepton Daisy Cleanses Projectiles Near Allies", true, "").Value; bool value9 = configFile.Bind("Lepton Daisy Buff", "Lepton Daisy Cleanses Item Cooldowns", false, "").Value; if (value) { LeptonDaisyRework.Init(value2, healFrac, value3, value4, value5); } else if (value6) { LeptonDaisyBuff.Init(pulseCount, healVal, value7, value8, value9); } } } public static class LeptonDaisyRework { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__8_13; public static Func <>9__8_14; public static Action <>9__8_15; public static Manipulator <>9__8_0; public static Func <>9__8_16; public static Func <>9__8_17; public static Func <>9__8_18; public static Manipulator <>9__8_1; public static Func <>9__8_19; public static Func <>9__8_20; public static Manipulator <>9__8_2; public static Func <>9__8_21; public static Func <>9__8_22; public static Func <>9__8_23; public static Func <>9__8_24; public static Action <>9__8_25; public static Manipulator <>9__8_3; public static hook_OnDisable <>9__8_4; public static hook_OnEnter <>9__8_5; public static hook_OnEnter <>9__8_6; public static hook_BeginEncounter <>9__8_7; public static hook_OnEnter <>9__8_8; public static hook_OnEnter <>9__8_9; public static hook_OnExit <>9__8_10; public static hook_OnEnter <>9__8_11; public static hook_OnEnter <>9__8_12; internal void b__8_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_0069: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int num2 = default(int); int num = default(int); val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num) }); val.Index += 3; val.Emit(OpCodes.Ldloc_2); val.EmitDelegate>((Action)delegate(HealthComponent healthComponent) { CleanseSystem.CleanseBodyServer(healthComponent.body, _cleanseDebuff, false, _cleanseCooldown, _cleanseDebuff, _cleanseDebuff, _cleanseProjecties); }); } internal bool b__8_13(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdarg(x, ref num); } internal bool b__8_14(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdloc(x, ref num); } internal void b__8_15(HealthComponent healthComponent) { CleanseSystem.CleanseBodyServer(healthComponent.body, _cleanseDebuff, false, _cleanseCooldown, _cleanseDebuff, _cleanseDebuff, _cleanseProjecties); } internal void b__8_1(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.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1), (Instruction x) => ILPatternMatchingExt.MatchAnd(x) }); int index = val.Index; val.Index = index + 1; val.EmitDelegate>((Func)((bool isCharging) => true)); } internal bool b__8_16(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 1); } internal bool b__8_17(Instruction x) { return ILPatternMatchingExt.MatchAnd(x); } internal bool b__8_18(bool isCharging) { return true; } internal void b__8_2(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); float num = default(float); val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num) }); int index = val.Index; val.Index = index + 1; val.Emit(OpCodes.Ldloc, 1); val.EmitDelegate>((Func)((float healFrac, TeamIndex teamIndex) => _healFrac * (float)Util.GetItemCountForTeam(teamIndex, Items.TPHealingNova.itemIndex, false, false))); } internal bool b__8_19(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal float b__8_20(float healFrac, TeamIndex teamIndex) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) return _healFrac * (float)Util.GetItemCountForTeam(teamIndex, Items.TPHealingNova.itemIndex, false, false); } internal void b__8_3(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel val4 = default(ILLabel); val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1f), (Instruction x) => ILPatternMatchingExt.MatchBltUn(x, ref val4) }); val.Next.Operand = 2f; MethodReference val3 = default(MethodReference); FieldReference val2 = default(FieldReference); val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val3), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, ref val2) }); val.Index -= 2; val.EmitDelegate>((Action)delegate(TeleporterHealNovaGeneratorMain self) { Log.LogDebug("Firing pulse with countdown timer at: " + self.secondsUntilPulseAvailable); self.Pulse(); self.secondsUntilPulseAvailable = _cooldown; Log.LogDebug("New cooldown: " + self.secondsUntilPulseAvailable); }); val.Emit(OpCodes.Ret); val.Emit(OpCodes.Ldarg_0); } internal bool b__8_21(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 1f); } internal bool b__8_22(Instruction x) { ILLabel val = default(ILLabel); return ILPatternMatchingExt.MatchBltUn(x, ref val); } internal bool b__8_23(Instruction x) { MethodReference val = default(MethodReference); return ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val); } internal bool b__8_24(Instruction x) { FieldReference val = default(FieldReference); return ILPatternMatchingExt.MatchStfld(x, ref val); } internal void b__8_25(TeleporterHealNovaGeneratorMain self) { Log.LogDebug("Firing pulse with countdown timer at: " + self.secondsUntilPulseAvailable); self.Pulse(); self.secondsUntilPulseAvailable = _cooldown; Log.LogDebug("New cooldown: " + self.secondsUntilPulseAvailable); } internal void b__8_4(orig_OnDisable orig, HoldoutZoneController self) { orig.Invoke(self); for (int i = 0; i < self.healingNovaGeneratorsByTeam.Length; i++) { Object.Destroy((Object)(object)self.healingNovaGeneratorsByTeam[i]); self.healingNovaGeneratorsByTeam[i] = null; } } internal void b__8_5(orig_OnEnter orig, FireShotgunBlast self) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); Vector3 footPosition = CharacterMaster.readOnlyInstancesList.First().GetBody().footPosition; Log.LogDebug("pos: " + ((object)(Vector3)(ref footPosition)).ToString()); } internal void b__8_6(orig_OnEnter orig, TeleporterHealNovaPulse self) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) if (self.radius <= 0f) { self.radius = 176f; } orig.Invoke(self); Log.LogDebug("tpstats: " + self.radius); Vector3 localScale = ((EntityState)self).transform.localScale; Log.LogDebug("tpstats: " + ((object)(Vector3)(ref localScale)).ToString()); } internal void b__8_7(orig_BeginEncounter orig, BrotherEncounterPhaseBaseState self) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if ((Object)(object)((EntityState)self).gameObject.GetComponent() == (Object)null) { Log.LogDebug("No behavior found, adding new behavior!"); Log.LogDebug("Daisy behavior parent disabled: " + !((EntityState)self).gameObject.activeInHierarchy); ((EntityState)self).gameObject.AddComponent().SetPos(MITHRIX_ARENA_POSITION); } } internal void b__8_8(orig_OnEnter orig, BossDeath self) { orig.Invoke(self); if ((Object)(object)((EntityState)self).gameObject.GetComponent() != (Object)null) { ((Behaviour)((EntityState)self).gameObject.GetComponent()).enabled = false; Log.LogDebug("Cleaning up LeptonDaisyBehavior by disabling!"); } } internal void b__8_9(orig_OnEnter orig, Phase1 self) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if ((Object)(object)((EntityState)self).gameObject.GetComponent() == (Object)null) { Log.LogDebug("No behavior found, adding new behavior!"); Log.LogDebug("Daisy behavior parent disabled: " + !((EntityState)self).gameObject.activeInHierarchy); ((EntityState)self).gameObject.AddComponent().SetPos(FALSESON_ARENA_POSITION); } } internal void b__8_10(orig_OnExit orig, Phase3 self) { orig.Invoke(self); if ((Object)(object)((EntityState)self).gameObject.GetComponent() != (Object)null) { ((Behaviour)((EntityState)self).gameObject.GetComponent()).enabled = false; Log.LogDebug("Cleaning up LeptonDaisyBehavior by disabling!"); } } internal void b__8_11(orig_OnEnter orig, SpawnState self) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if ((Object)(object)((EntityState)self).gameObject.GetComponent() == (Object)null) { Log.LogDebug("No behavior found, adding new behavior!"); Log.LogDebug("Daisy behavior parent disabled: " + !((EntityState)self).gameObject.activeInHierarchy); ((EntityState)self).gameObject.AddComponent().SetPos(SOLUSWING_ARENA_POSITION); } } internal void b__8_12(orig_OnEnter orig, DeathState self) { orig.Invoke(self); if ((Object)(object)((EntityState)self).gameObject.GetComponent() != (Object)null) { ((Behaviour)((EntityState)self).gameObject.GetComponent()).enabled = false; Log.LogDebug("Cleaning up LeptonDaisyBehavior by disabling!"); } } } private static Vector3 MITHRIX_ARENA_POSITION = new Vector3(-89f, 492f, 0f); private static Vector3 FALSESON_ARENA_POSITION = new Vector3(108.5f, 145f, -120f); private static Vector3 SOLUSWING_ARENA_POSITION = new Vector3(211f, -493f, -289f); public static float _cooldown; private static float _healFrac; private static bool _cleanseDebuff; private static bool _cleanseProjecties; private static bool _cleanseCooldown; public static void Init(float cooldown, float healFrac, bool cleanseDebuff, bool cleanseProjectiles, bool cleanseCooldown) { //IL_0035: 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_0040: Expected O, but got Unknown //IL_005a: 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_0065: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Expected O, but got Unknown //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Expected O, but got Unknown //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0168: 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_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Expected O, but got Unknown //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Expected O, but got Unknown //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Expected O, but got Unknown _cooldown = cooldown; _healFrac = healFrac; _cleanseDebuff = cleanseDebuff; _cleanseProjecties = cleanseProjectiles; _cleanseCooldown = cleanseCooldown; try { object obj = <>c.<>9__8_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_0069: Unknown result type (might be due to invalid IL or missing references) ILCursor val20 = new ILCursor(il); int num3 = default(int); int num2 = default(int); val20.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num3), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2) }); val20.Index += 3; val20.Emit(OpCodes.Ldloc_2); val20.EmitDelegate>((Action)delegate(HealthComponent healthComponent) { CleanseSystem.CleanseBodyServer(healthComponent.body, _cleanseDebuff, false, _cleanseCooldown, _cleanseDebuff, _cleanseDebuff, _cleanseProjecties); }); }; <>c.<>9__8_0 = val; obj = (object)val; } HealPulse.Update += (Manipulator)obj; object obj2 = <>c.<>9__8_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 ILCursor val19 = new ILCursor(il); val19.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1), (Instruction x) => ILPatternMatchingExt.MatchAnd(x) }); int index2 = val19.Index; val19.Index = index2 + 1; val19.EmitDelegate>((Func)((bool isCharging) => true)); }; <>c.<>9__8_1 = val2; obj2 = (object)val2; } HoldoutZoneController.UpdateHealingNovas += (Manipulator)obj2; object obj3 = <>c.<>9__8_2; if (obj3 == null) { Manipulator val3 = 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_0049: Unknown result type (might be due to invalid IL or missing references) ILCursor val18 = new ILCursor(il); float num = default(float); val18.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num) }); int index = val18.Index; val18.Index = index + 1; val18.Emit(OpCodes.Ldloc, 1); val18.EmitDelegate>((Func)((float healFrac, TeamIndex teamIndex) => _healFrac * (float)Util.GetItemCountForTeam(teamIndex, Items.TPHealingNova.itemIndex, false, false))); }; <>c.<>9__8_2 = val3; obj3 = (object)val3; } TeleporterHealNovaPulse.OnEnter += (Manipulator)obj3; object obj4 = <>c.<>9__8_3; if (obj4 == null) { Manipulator val4 = 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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) ILCursor val14 = new ILCursor(il); ILLabel val17 = default(ILLabel); val14.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1f), (Instruction x) => ILPatternMatchingExt.MatchBltUn(x, ref val17) }); val14.Next.Operand = 2f; MethodReference val16 = default(MethodReference); FieldReference val15 = default(FieldReference); val14.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val16), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, ref val15) }); val14.Index -= 2; val14.EmitDelegate>((Action)delegate(TeleporterHealNovaGeneratorMain self) { Log.LogDebug("Firing pulse with countdown timer at: " + self.secondsUntilPulseAvailable); self.Pulse(); self.secondsUntilPulseAvailable = _cooldown; Log.LogDebug("New cooldown: " + self.secondsUntilPulseAvailable); }); val14.Emit(OpCodes.Ret); val14.Emit(OpCodes.Ldarg_0); }; <>c.<>9__8_3 = val4; obj4 = (object)val4; } TeleporterHealNovaGeneratorMain.FixedUpdate += (Manipulator)obj4; object obj5 = <>c.<>9__8_4; if (obj5 == null) { hook_OnDisable val5 = delegate(orig_OnDisable orig, HoldoutZoneController self) { orig.Invoke(self); for (int i = 0; i < self.healingNovaGeneratorsByTeam.Length; i++) { Object.Destroy((Object)(object)self.healingNovaGeneratorsByTeam[i]); self.healingNovaGeneratorsByTeam[i] = null; } }; <>c.<>9__8_4 = val5; obj5 = (object)val5; } HoldoutZoneController.OnDisable += (hook_OnDisable)obj5; object obj6 = <>c.<>9__8_5; if (obj6 == null) { hook_OnEnter val6 = delegate(orig_OnEnter orig, FireShotgunBlast self) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); Vector3 footPosition = CharacterMaster.readOnlyInstancesList.First().GetBody().footPosition; Log.LogDebug("pos: " + ((object)(Vector3)(ref footPosition)).ToString()); }; <>c.<>9__8_5 = val6; obj6 = (object)val6; } FireShotgunBlast.OnEnter += (hook_OnEnter)obj6; object obj7 = <>c.<>9__8_6; if (obj7 == null) { hook_OnEnter val7 = delegate(orig_OnEnter orig, TeleporterHealNovaPulse self) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) if (self.radius <= 0f) { self.radius = 176f; } orig.Invoke(self); Log.LogDebug("tpstats: " + self.radius); Vector3 localScale = ((EntityState)self).transform.localScale; Log.LogDebug("tpstats: " + ((object)(Vector3)(ref localScale)).ToString()); }; <>c.<>9__8_6 = val7; obj7 = (object)val7; } TeleporterHealNovaPulse.OnEnter += (hook_OnEnter)obj7; object obj8 = <>c.<>9__8_7; if (obj8 == null) { hook_BeginEncounter val8 = delegate(orig_BeginEncounter orig, BrotherEncounterPhaseBaseState self) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if ((Object)(object)((EntityState)self).gameObject.GetComponent() == (Object)null) { Log.LogDebug("No behavior found, adding new behavior!"); Log.LogDebug("Daisy behavior parent disabled: " + !((EntityState)self).gameObject.activeInHierarchy); ((EntityState)self).gameObject.AddComponent().SetPos(MITHRIX_ARENA_POSITION); } }; <>c.<>9__8_7 = val8; obj8 = (object)val8; } BrotherEncounterPhaseBaseState.BeginEncounter += (hook_BeginEncounter)obj8; object obj9 = <>c.<>9__8_8; if (obj9 == null) { hook_OnEnter val9 = delegate(orig_OnEnter orig, BossDeath self) { orig.Invoke(self); if ((Object)(object)((EntityState)self).gameObject.GetComponent() != (Object)null) { ((Behaviour)((EntityState)self).gameObject.GetComponent()).enabled = false; Log.LogDebug("Cleaning up LeptonDaisyBehavior by disabling!"); } }; <>c.<>9__8_8 = val9; obj9 = (object)val9; } BossDeath.OnEnter += (hook_OnEnter)obj9; object obj10 = <>c.<>9__8_9; if (obj10 == null) { hook_OnEnter val10 = delegate(orig_OnEnter orig, Phase1 self) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if ((Object)(object)((EntityState)self).gameObject.GetComponent() == (Object)null) { Log.LogDebug("No behavior found, adding new behavior!"); Log.LogDebug("Daisy behavior parent disabled: " + !((EntityState)self).gameObject.activeInHierarchy); ((EntityState)self).gameObject.AddComponent().SetPos(FALSESON_ARENA_POSITION); } }; <>c.<>9__8_9 = val10; obj10 = (object)val10; } Phase1.OnEnter += (hook_OnEnter)obj10; object obj11 = <>c.<>9__8_10; if (obj11 == null) { hook_OnExit val11 = delegate(orig_OnExit orig, Phase3 self) { orig.Invoke(self); if ((Object)(object)((EntityState)self).gameObject.GetComponent() != (Object)null) { ((Behaviour)((EntityState)self).gameObject.GetComponent()).enabled = false; Log.LogDebug("Cleaning up LeptonDaisyBehavior by disabling!"); } }; <>c.<>9__8_10 = val11; obj11 = (object)val11; } Phase3.OnExit += (hook_OnExit)obj11; object obj12 = <>c.<>9__8_11; if (obj12 == null) { hook_OnEnter val12 = delegate(orig_OnEnter orig, SpawnState self) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if ((Object)(object)((EntityState)self).gameObject.GetComponent() == (Object)null) { Log.LogDebug("No behavior found, adding new behavior!"); Log.LogDebug("Daisy behavior parent disabled: " + !((EntityState)self).gameObject.activeInHierarchy); ((EntityState)self).gameObject.AddComponent().SetPos(SOLUSWING_ARENA_POSITION); } }; <>c.<>9__8_11 = val12; obj12 = (object)val12; } SpawnState.OnEnter += (hook_OnEnter)obj12; object obj13 = <>c.<>9__8_12; if (obj13 == null) { hook_OnEnter val13 = delegate(orig_OnEnter orig, DeathState self) { orig.Invoke(self); if ((Object)(object)((EntityState)self).gameObject.GetComponent() != (Object)null) { ((Behaviour)((EntityState)self).gameObject.GetComponent()).enabled = false; Log.LogDebug("Cleaning up LeptonDaisyBehavior by disabling!"); } }; <>c.<>9__8_12 = val13; obj13 = (object)val13; } DeathState.OnEnter += (hook_OnEnter)obj13; UpdateText(); Log.LogInfo("Added Lepton Daisy Rework"); } catch (Exception ex) { VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } private static void UpdateText() { LanguageAPI.Add("ITEM_TPHEALINGNOVA_DESC", "Release a healing nova during holdout zones and boss fights, cleansing and healing all nearby allies for " + _healFrac * 100f + "% (+" + _healFrac * 100f + "% per stack) of their maximum health every " + _cooldown + " seconds."); } } internal class OldGuillotineBuff { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__2_1; public static Manipulator <>9__2_0; internal void b__2_0(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); if (!val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 13f) })) { Log.LogInstrNotFound(il); } else { val.Next.Operand = ThresholdToDamageAmp(_threshold); } } internal bool b__2_1(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 13f); } } public static float _threshold; public static void TryInit(ConfigFile configFile) { bool value = configFile.Bind("Old Guillotine Buff", "Enable Old Guillotine Buff", true, "Changes guillotine execution threshold.").Value; _threshold = configFile.Bind("Old Guillotine Buff", "Old Guillotine Execute Threshold", 20f, "Guillotine executes enemies at X% health. Default: 20.0. Vanilla: 11.5 (not 13).").Value; if (value) { Init(); } } public static void Init() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown try { object obj = <>c.<>9__2_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 ILCursor val2 = new ILCursor(il); if (!val2.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 13f) })) { Log.LogInstrNotFound(il); } else { val2.Next.Operand = ThresholdToDamageAmp(_threshold); } }; <>c.<>9__2_0 = val; obj = (object)val; } CharacterBody.OnInventoryChanged += (Manipulator)obj; UpdateText(); Log.LogInfo("Added Old Guillotine Buff"); } catch (Exception ex) { Log.LogError(ex.Message + " - " + ex.StackTrace); } } private static float ThresholdToDamageAmp(float threshold) { return 10000f / (100f - threshold) - 100f; } private static void UpdateText() { LanguageAPI.Add("ITEM_EXECUTELOWHEALTHELITE_DESC", "Instantly kill Elite monsters below " + _threshold + "% (+" + _threshold + " hyperbolically per stack) health. In other words, a " + ThresholdToDamageAmp(_threshold) + "% (+" + ThresholdToDamageAmp(_threshold) + "% per stack) damage increase to elites."); } } public static class RedWhipBuff { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__2_1; public static Func <>9__2_2; public static Func <>9__2_3; public static Manipulator <>9__2_0; internal void b__2_0(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.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.3f), (Instruction x) => ILPatternMatchingExt.MatchMul(x) }); int index = val.Index; val.Index = index + 1; val.Next.Operand = _moveSpeed; } internal bool b__2_1(Instruction x) { return ILPatternMatchingExt.MatchConvR4(x); } internal bool b__2_2(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 0.3f); } internal bool b__2_3(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } } public static float _moveSpeed; public static void TryInit(ConfigFile configFile) { bool value = configFile.Bind("Red Whip Buff", "Enable Red Whip Buff", true, "Raises Red Whip speed to 40%.").Value; _moveSpeed = configFile.Bind("Red Whip Buff", "Red Whip Movement Speed", 40f, "Red Whip grants X% move speed.").Value / 100f; if (value) { Init(); } } public static void Init() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown try { object obj = <>c.<>9__2_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 ILCursor val2 = new ILCursor(il); val2.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.3f), (Instruction x) => ILPatternMatchingExt.MatchMul(x) }); int index = val2.Index; val2.Index = index + 1; val2.Next.Operand = _moveSpeed; }; <>c.<>9__2_0 = val; obj = (object)val; } CharacterBody.RecalculateStats += (Manipulator)obj; UpdateText(); Log.LogInfo("Added Red Whip Buff"); } catch (Exception ex) { VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } public static void UpdateText() { LanguageAPI.Add("ITEM_SPRINTOUTOFCOMBAT_DESC", "Leaving combat boosts your movement speed by " + _moveSpeed * 100f + "% (+" + _moveSpeed * 100f + "% per stack)."); } } internal class RegeneratingScrapBuff { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__1_2; public static Func <>9__1_1; public static Manipulator <>9__1_0; internal void b__1_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_0048: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (!val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "CreateItemTakenOrb") })) { Log.LogInstrNotFound(il); return; } val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(ItemIndex itemIndex, ScrapperController scrapper) { //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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) if (itemIndex == Items.RegeneratingScrap.itemIndex) { CharacterBody component = ((Component)scrapper.interactor).GetComponent(); component.inventory.GiveItemPermanent(Items.RegeneratingScrapConsumed, 1); CharacterMasterNotificationQueue.SendTransformNotification(component.master, Items.RegeneratingScrap.itemIndex, Items.RegeneratingScrapConsumed.itemIndex, (TransformationType)5); } return itemIndex; }); } internal bool b__1_2(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "CreateItemTakenOrb"); } internal ItemIndex b__1_1(ItemIndex itemIndex, ScrapperController scrapper) { //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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) if (itemIndex == Items.RegeneratingScrap.itemIndex) { CharacterBody component = ((Component)scrapper.interactor).GetComponent(); component.inventory.GiveItemPermanent(Items.RegeneratingScrapConsumed, 1); CharacterMasterNotificationQueue.SendTransformNotification(component.master, Items.RegeneratingScrap.itemIndex, Items.RegeneratingScrapConsumed.itemIndex, (TransformationType)5); } return itemIndex; } } public static void TryInit(ConfigFile configFile) { if (configFile.Bind("Regenerating Scrap Buff", "Enable Regenerating Scrap Buff", true, "Regenerating Scrap returns after being scrapped.").Value) { Init(); } } public static void Init() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown try { object obj = <>c.<>9__1_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_0048: Unknown result type (might be due to invalid IL or missing references) ILCursor val2 = new ILCursor(il); if (!val2.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "CreateItemTakenOrb") })) { Log.LogInstrNotFound(il); } else { val2.Emit(OpCodes.Ldarg_0); val2.EmitDelegate>((Func)delegate(ItemIndex itemIndex, ScrapperController scrapper) { //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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) if (itemIndex == Items.RegeneratingScrap.itemIndex) { CharacterBody component = ((Component)scrapper.interactor).GetComponent(); component.inventory.GiveItemPermanent(Items.RegeneratingScrapConsumed, 1); CharacterMasterNotificationQueue.SendTransformNotification(component.master, Items.RegeneratingScrap.itemIndex, Items.RegeneratingScrapConsumed.itemIndex, (TransformationType)5); } return itemIndex; }); } }; <>c.<>9__1_0 = val; obj = (object)val; } ScrapperController.BeginScrapping_UniquePickup += (Manipulator)obj; UpdateText(); Log.LogInfo("Added Regenerating Scrap Buff"); } catch (Exception ex) { VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } private static void UpdateText() { } } internal class SquidPolypBuff { private enum DebuffType { Beetlejuice, Tar, Weaken } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__5_1; public static Func <>9__5_2; public static Func <>9__5_3; public static Action <>9__5_4; public static Manipulator <>9__5_0; internal void b__5_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) ILCursor val = new ILCursor(il); int num2 = default(int); int num = default(int); MethodReference val2 = default(MethodReference); val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val2) }); val.Index += 3; val.Emit(OpCodes.Ldloc_0); val.EmitDelegate>((Action)delegate(HealthComponent healthComponent) { CharacterBody body = healthComponent.body; if (body != null) { body.AddTimedBuff(Buffs.BeetleJuice, 2f); } }); } internal bool b__5_1(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdloc(x, ref num); } internal bool b__5_2(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdloc(x, ref num); } internal bool b__5_3(Instruction x) { MethodReference val = default(MethodReference); return ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val); } internal void b__5_4(HealthComponent healthComponent) { CharacterBody body = healthComponent.body; if (body != null) { body.AddTimedBuff(Buffs.BeetleJuice, 2f); } } } private static BuffDef _debuffType; public static void TryInit(ConfigFile configFile) { bool value = configFile.Bind("Squid Polyp Buff", "Enable Squid Polyp Buff", true, "Squid Polyp inflicts beetlejuice debuff.").Value; _debuffType = GetBuffDef(configFile.Bind("Squid Polyp Buff", "Squid Polyp Debuff Type", DebuffType.Beetlejuice, "Squid Polyp inflicts this debuff on hit.").Value); if (value) { Init(); } } private static BuffDef GetBuffDef(DebuffType debuffType) { switch (debuffType) { case DebuffType.Beetlejuice: return Buffs.BeetleJuice; case DebuffType.Weaken: return Buffs.Weak; case DebuffType.Tar: return Buffs.ClayGoo; default: Log.LogError("SquidPolypBuff Debuff type not recognized! Defaulting to BeetleJuice."); return Buffs.BeetleJuice; } } private static string GetBuffDefString(BuffDef buffDef) { if ((Object)(object)buffDef == (Object)(object)Buffs.BeetleJuice) { return "Beetlejuice"; } if ((Object)(object)buffDef == (Object)(object)Buffs.Weak) { return "Weak"; } return "Tar"; } public static void Init() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown try { object obj = <>c.<>9__5_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) ILCursor val2 = new ILCursor(il); int num2 = default(int); int num = default(int); MethodReference val3 = default(MethodReference); val2.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val3) }); val2.Index += 3; val2.Emit(OpCodes.Ldloc_0); val2.EmitDelegate>((Action)delegate(HealthComponent healthComponent) { CharacterBody body = healthComponent.body; if (body != null) { body.AddTimedBuff(Buffs.BeetleJuice, 2f); } }); }; <>c.<>9__5_0 = val; obj = (object)val; } SquidOrb.OnArrival += (Manipulator)obj; UpdateText(); Log.LogInfo("Added Squid Polyp Buff"); } catch (Exception ex) { VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } private static void UpdateText() { LanguageAPI.Add("ITEM_SQUIDTURRET_DESC", "Activating an interactable summons a Squid Turret that attacks nearby enemies at 100% (+100% per stack) attack speed and applies " + GetBuffDefString(_debuffType) + ". Lasts 30 seconds."); } } } namespace VanillaItemTweaks.Lunar { public static class GestureNerf { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__3_4; public static Func <>9__3_5; public static Manipulator <>9__3_0; public static Func <>9__3_7; public static Func <>9__3_8; public static Func, EquipmentSlot, EquipmentDef, bool> <>9__3_6; public static Manipulator <>9__3_1; public static Func <>9__3_10; public static Func <>9__3_11; public static Func <>9__3_9; public static Manipulator <>9__3_2; public static Func <>9__3_13; public static Func <>9__3_14; public static Func <>9__3_12; public static Manipulator <>9__3_3; internal void b__3_0(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); float num2 = default(float); float num = default(float); if (!val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num) })) { Log.LogInstrNotFound(il); return; } val.Next.Operand = _cooldownReduction; int index = val.Index; val.Index = index + 1; val.Next.Operand = _cooldownReduction; } internal bool b__3_4(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool b__3_5(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal void b__3_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_006a: 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) ILCursor val = new ILCursor(il); ILLabel val2 = default(ILLabel); if (!val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchBrtrue(x, ref val2), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0) })) { Log.LogInstrNotFound(il); return; } val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate, EquipmentSlot, EquipmentDef, bool>>((Func, EquipmentSlot, EquipmentDef, bool>)delegate(Func func, EquipmentSlot equipSlot, EquipmentDef equipDef) { List list = new List { Equipment.Lightning, Equipment.Recycle, Equipment.BossHunter, Equipment.HealAndRevive }; if (func == null) { return false; } foreach (EquipmentDef item in list) { } return list.Contains(equipDef) || GestureFailureCheck(equipSlot); }); } internal bool b__3_7(Instruction x) { ILLabel val = default(ILLabel); return ILPatternMatchingExt.MatchBrtrue(x, ref val); } internal bool b__3_8(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 0); } internal bool b__3_6(Func func, EquipmentSlot equipSlot, EquipmentDef equipDef) { List list = new List { Equipment.Lightning, Equipment.Recycle, Equipment.BossHunter, Equipment.HealAndRevive }; if (func == null) { return false; } foreach (EquipmentDef item in list) { } if (list.Contains(equipDef)) { return true; } return GestureFailureCheck(equipSlot); } internal void b__3_2(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int num2 = default(int); float num = default(float); if (!val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num) })) { Log.LogInstrNotFound(il); return; } val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)((EquipmentSlot equipSlot) => GestureFailureCheck(equipSlot))); ILLabel val2 = val.DefineLabel(); val2.Target = val.Next; val.Emit(OpCodes.Brtrue_S, (object)val2); val.Emit(OpCodes.Ldc_I4_0); val.Emit(OpCodes.Ret); } internal bool b__3_10(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdarg(x, ref num); } internal bool b__3_11(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool b__3_9(EquipmentSlot equipSlot) { return GestureFailureCheck(equipSlot); } internal void b__3_3(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int num2 = default(int); int num = default(int); if (!val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num) })) { Log.LogInstrNotFound(il); return; } val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)((EquipmentSlot equipSlot) => GestureFailureCheck(equipSlot))); ILLabel val2 = val.DefineLabel(); val2.Target = val.Next; val.Emit(OpCodes.Brtrue_S, (object)val2); val.Emit(OpCodes.Ldc_I4_0); val.Emit(OpCodes.Ret); } internal bool b__3_13(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdloc(x, ref num); } internal bool b__3_14(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdloc(x, ref num); } internal bool b__3_12(EquipmentSlot equipSlot) { return GestureFailureCheck(equipSlot); } } public static float _failChance; public static float _cooldownReduction; public static void TryInit(ConfigFile configFile) { bool value = configFile.Bind("Gesture of the Drowned Nerf", "Enable Gesture Nerf", true, "Gesture causes equipment to gain a chance to do nothing on activation.").Value; _failChance = configFile.Bind("Gesture of the Drowned Nerf", "Gesture Misfire Chance", 10f, "Gesture has a X% to fail to activate equipment. Default: 10.0. Vanilla: 0.0").Value; _cooldownReduction = configFile.Bind("Gesture of the Dronwed Nerf", "Gesture Cooldown Reduction", 50f, "Gesture gives X% equipment cooldown reduction.").Value / 100f; if (value) { Init(); } } public static void Init() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown try { object obj = <>c.<>9__3_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 ILCursor val11 = new ILCursor(il); float num6 = default(float); float num5 = default(float); if (!val11.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num6), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num5) })) { Log.LogInstrNotFound(il); } else { val11.Next.Operand = _cooldownReduction; int index = val11.Index; val11.Index = index + 1; val11.Next.Operand = _cooldownReduction; } }; <>c.<>9__3_0 = val; obj = (object)val; } Inventory.CalculateEquipmentCooldownScale += (Manipulator)obj; object obj2 = <>c.<>9__3_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_006a: 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) ILCursor val9 = new ILCursor(il); ILLabel val10 = default(ILLabel); if (!val9.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchBrtrue(x, ref val10), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0) })) { Log.LogInstrNotFound(il); } else { val9.Emit(OpCodes.Ldarg_0); val9.Emit(OpCodes.Ldarg_1); val9.EmitDelegate, EquipmentSlot, EquipmentDef, bool>>((Func, EquipmentSlot, EquipmentDef, bool>)delegate(Func func, EquipmentSlot equipSlot, EquipmentDef equipDef) { List list = new List { Equipment.Lightning, Equipment.Recycle, Equipment.BossHunter, Equipment.HealAndRevive }; if (func == null) { return false; } foreach (EquipmentDef item in list) { } return list.Contains(equipDef) || GestureFailureCheck(equipSlot); }); } }; <>c.<>9__3_1 = val2; obj2 = (object)val2; } EquipmentSlot.PerformEquipmentAction += (Manipulator)obj2; object obj3 = <>c.<>9__3_2; if (obj3 == null) { Manipulator val3 = 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) ILCursor val7 = new ILCursor(il); int num4 = default(int); float num3 = default(float); if (!val7.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, ref num4), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num3) })) { Log.LogInstrNotFound(il); } else { val7.Emit(OpCodes.Ldarg_0); val7.EmitDelegate>((Func)((EquipmentSlot equipSlot) => GestureFailureCheck(equipSlot))); ILLabel val8 = val7.DefineLabel(); val8.Target = val7.Next; val7.Emit(OpCodes.Brtrue_S, (object)val8); val7.Emit(OpCodes.Ldc_I4_0); val7.Emit(OpCodes.Ret); } }; <>c.<>9__3_2 = val3; obj3 = (object)val3; } EquipmentSlot.FireLightning += (Manipulator)obj3; object obj4 = <>c.<>9__3_3; if (obj4 == null) { Manipulator val4 = 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) ILCursor val5 = new ILCursor(il); int num2 = default(int); int num = default(int); if (!val5.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num) })) { Log.LogInstrNotFound(il); } else { val5.Emit(OpCodes.Ldarg_0); val5.EmitDelegate>((Func)((EquipmentSlot equipSlot) => GestureFailureCheck(equipSlot))); ILLabel val6 = val5.DefineLabel(); val6.Target = val5.Next; val5.Emit(OpCodes.Brtrue_S, (object)val6); val5.Emit(OpCodes.Ldc_I4_0); val5.Emit(OpCodes.Ret); } }; <>c.<>9__3_3 = val4; obj4 = (object)val4; } EquipmentSlot.FireRecycle += (Manipulator)obj4; UpdateText(); Log.LogInfo("Added Gesture Nerf"); } catch (Exception ex) { VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } private static bool GestureFailureCheck(EquipmentSlot equipSlot) { Inventory inventory = equipSlot.inventory; int num = (((Object)(object)inventory != (Object)null) ? inventory.GetItemCountEffective(Items.AutoCastEquipment) : 0); if (num >= 1 && !Util.CheckRoll(100f - _failChance, (float)(1 - num), (CharacterMaster)null)) { equipSlot.inventory.DeductEquipmentCharges(equipSlot.activeEquipmentSlot, 1); equipSlot.UpdateInventory(); Util.PlaySound("Play_drone_deathpt1", ((Component)equipSlot.characterBody).gameObject); return false; } return true; } private static void UpdateText() { LanguageAPI.Add("ITEM_AUTOCASTEQUIPMENT_DESC", "Reduce Equipment cooldown by " + _cooldownReduction * 100f + "% (+" + _cooldownReduction * 100f + "% per stack). Forces your Equipment to activate whenever it is off cooldown with a " + _failChance + "% (+" + _failChance + "% hyperbolically per stack) chance to fail."); LanguageAPI.Add("ITEM_AUTOCASTEQUIPMENT_PICKUP", "Halve Equipment cooldown... BUT it automatically activates with a chance to fail."); } } public static class TranscendenceNerf { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__3_3; public static Func <>9__3_4; public static Func <>9__3_5; public static Manipulator <>9__3_0; public static Func <>9__3_6; public static Func <>9__3_7; public static Manipulator <>9__3_1; public static Func <>9__3_8; public static Func <>9__3_9; public static Func <>9__3_10; public static Manipulator <>9__3_2; internal void b__3_0(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); float num2 = default(float); val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchMul(x) }); val.Index -= 2; val.RemoveRange(4); val.EmitDelegate>((Func)delegate(HealthComponent healthComp) { CharacterBody body = healthComp.body; Inventory inventory = healthComp.body.inventory; int num = (((Object)(object)inventory != (Object)null) ? inventory.GetItemCountEffective(Items.ShieldOnly) : 0); return body.maxShield * 0.5f * Mathf.Pow(_regenSlow, (float)num); }); } internal bool b__3_3(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool b__3_4(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal float b__3_5(HealthComponent healthComp) { CharacterBody body = healthComp.body; Inventory inventory = healthComp.body.inventory; int num = (((Object)(object)inventory != (Object)null) ? inventory.GetItemCountEffective(Items.ShieldOnly) : 0); return body.maxShield * 0.5f * Mathf.Pow(_regenSlow, (float)num); } internal void b__3_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_0038: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchMul(x) }); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Func)delegate(float num, CharacterBody cb) { Inventory inventory = cb.inventory; return num + ((inventory != null && inventory.GetItemCountEffective(Items.ShieldOnly) > 0) ? cb.maxShield : 0f); }); } internal bool b__3_6(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal float b__3_7(float num, CharacterBody cb) { Inventory inventory = cb.inventory; return num + ((inventory != null && inventory.GetItemCountEffective(Items.ShieldOnly) > 0) ? cb.maxShield : 0f); } internal void b__3_2(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); float num = default(float); val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchSub(x), (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num) }); val.Index -= 3; val.Next.Operand = 1f + _healthBoost; val.Index += 5; val.Next.Operand = _healthBoost; } internal bool b__3_8(Instruction x) { return ILPatternMatchingExt.MatchSub(x); } internal bool b__3_9(Instruction x) { return ILPatternMatchingExt.MatchConvR4(x); } internal bool b__3_10(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } } private static float _healthBoost; private static float _regenSlow; public static void TryInit(ConfigFile configFile) { bool value = configFile.Bind("Transcendence Nerf", "Enable Transcendence Nerf", true, "Transcendence shields regen slower with each stack.").Value; _healthBoost = configFile.Bind("Transcendence Nerf", "Transcendence Health Boost", 50f, "Transcsendence boost health X%. Default: 50.0. Vanilla: 50.0 (but lower per stack).").Value / 100f; _regenSlow = 1f - configFile.Bind("Transcendence Nerf", "Transcendence Regen Slow", 75f, "Transcendence causes shields to regenerate X% slower. Default: 75.0. Vanilla: 0.0.").Value / 100f; if (value) { Init(); } } public static void Init() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown try { object obj = <>c.<>9__3_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 ILCursor val6 = new ILCursor(il); float num4 = default(float); val6.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num4), (Instruction x) => ILPatternMatchingExt.MatchMul(x) }); val6.Index -= 2; val6.RemoveRange(4); val6.EmitDelegate>((Func)delegate(HealthComponent healthComp) { CharacterBody body = healthComp.body; Inventory inventory2 = healthComp.body.inventory; int num3 = (((Object)(object)inventory2 != (Object)null) ? inventory2.GetItemCountEffective(Items.ShieldOnly) : 0); return body.maxShield * 0.5f * Mathf.Pow(_regenSlow, (float)num3); }); }; <>c.<>9__3_0 = val; obj = (object)val; } HealthComponent.ServerFixedUpdate += (Manipulator)obj; object obj2 = <>c.<>9__3_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_0038: Unknown result type (might be due to invalid IL or missing references) ILCursor val5 = new ILCursor(il); val5.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchMul(x) }); val5.Emit(OpCodes.Ldarg_1); val5.EmitDelegate>((Func)delegate(float num, CharacterBody cb) { Inventory inventory = cb.inventory; return num + ((inventory != null && inventory.GetItemCountEffective(Items.ShieldOnly) > 0) ? cb.maxShield : 0f); }); }; <>c.<>9__3_1 = val2; obj2 = (object)val2; } GlobalEventManager.OnCharacterHitGroundServer += (Manipulator)obj2; object obj3 = <>c.<>9__3_2; if (obj3 == null) { Manipulator val3 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val4 = new ILCursor(il); float num2 = default(float); val4.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchSub(x), (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num2) }); val4.Index -= 3; val4.Next.Operand = 1f + _healthBoost; val4.Index += 5; val4.Next.Operand = _healthBoost; }; <>c.<>9__3_2 = val3; obj3 = (object)val3; } CharacterBody.RecalculateStats += (Manipulator)obj3; UpdateText(); Log.LogInfo("Added Transcendence Nerf"); } catch (Exception ex) { Log.LogError(ex.Message + " - " + ex.StackTrace); } } private static void UpdateText() { LanguageAPI.Add("ITEM_SHIELDONLY_DESC", "Convert all but 1 health into regenerating shields. Gain " + _healthBoost * 100f + "% (+" + _healthBoost * 100f + "% per stack) maximum health. Shields regenerate " + (100f - _regenSlow * 100f) + "% (+" + (100f - _regenSlow * 100f) + "% per stack) slower."); LanguageAPI.Add("Item_SHIELDONLY_PICKUP", "Increases health and converts it all into shields, BUT shields regen slower."); } } } namespace VanillaItemTweaks.Legendary { internal class HappiestMaskBehavior : BaseItemBodyBehavior { public static bool _configEnabled; private CharacterBody _ghost; [ItemDefAssociation(useOnClient = false, useOnServer = true)] private static ItemDef GetItemDef() { return _configEnabled ? Items.GhostOnKill : null; } private void OnDisable() { if (Object.op_Implicit((Object)(object)_ghost) && (Object)(object)_ghost.healthComponent != (Object)null) { _ghost.healthComponent.health = 0f; } } public bool HasGhost() { return Object.op_Implicit((Object)(object)_ghost); } public void SetGhost(CharacterBody newGhost) { _ghost = newGhost; } } public static class HappiestMaskRework { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Action <>9__1_0; public static Func <>9__1_4; public static Func <>9__1_2; public static Func <>9__1_5; public static Func <>9__1_6; public static Func <>9__1_7; public static Action <>9__1_3; public static Manipulator <>9__1_1; internal void b__1_0() { List list = Items.GhostOnKill.tags.ToList(); list.Add((ItemTag)13); Items.GhostOnKill.tags = list.ToArray(); } internal void b__1_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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (!val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 7f) })) { Log.LogInstrNotFound(il); return; } val.RemoveRange(5); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Func)delegate(DamageReport damageReport) { HappiestMaskBehavior component = damageReport.attacker.GetComponent(); Log.LogDebug("Behavior null?: " + (object)component == ". Has ghost?: " + component.HasGhost()); return (Object)(object)component != (Object)null && !component.HasGhost(); }); int num3 = default(int); int num2 = default(int); int num = default(int); if (!val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num3), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num) })) { Log.LogInstrNotFound(il); return; } val.Index += 2; val.Remove(); int index = val.Index; val.Index = index + 1; val.Remove(); index = val.Index; val.Index = index + 1; val.Remove(); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Action)delegate(CharacterBody ghostBody, DamageReport damageReport) { if ((Object)(object)ghostBody != (Object)null) { damageReport.attacker.GetComponent().SetGhost(ghostBody); ghostBody.master.inventory.GiveItemPermanent(Items.BoostDamage, 75 * damageReport.attackerBody.inventory.GetItemCountEffective(Items.GhostOnKill) - 150); } }); } internal bool b__1_4(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 7f); } internal bool b__1_2(DamageReport damageReport) { HappiestMaskBehavior component = damageReport.attacker.GetComponent(); Log.LogDebug("Behavior null?: " + (object)component == ". Has ghost?: " + component.HasGhost()); return (Object)(object)component != (Object)null && !component.HasGhost(); } internal bool b__1_5(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdloc(x, ref num); } internal bool b__1_6(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdloc(x, ref num); } internal bool b__1_7(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdloc(x, ref num); } internal void b__1_3(CharacterBody ghostBody, DamageReport damageReport) { if ((Object)(object)ghostBody != (Object)null) { damageReport.attacker.GetComponent().SetGhost(ghostBody); ghostBody.master.inventory.GiveItemPermanent(Items.BoostDamage, 75 * damageReport.attackerBody.inventory.GetItemCountEffective(Items.GhostOnKill) - 150); } } } public static void TryInit(ConfigFile configFile) { if (configFile.Bind("Happiest Mask Rework", "Enable Happiest Mask Rework", true, "Happiest Mask now spawns a ghost for 30 seconds if you don't have one on enemy kill.").Value) { HappiestMaskBehavior._configEnabled = true; Init(); } } public static void Init() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown try { RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate { List list = Items.GhostOnKill.tags.ToList(); list.Add((ItemTag)13); Items.GhostOnKill.tags = list.ToArray(); }); object obj = <>c.<>9__1_1; 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) ILCursor val2 = new ILCursor(il); if (!val2.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 7f) })) { Log.LogInstrNotFound(il); } else { val2.RemoveRange(5); val2.Emit(OpCodes.Ldarg_1); val2.EmitDelegate>((Func)delegate(DamageReport damageReport) { HappiestMaskBehavior component = damageReport.attacker.GetComponent(); Log.LogDebug("Behavior null?: " + (object)component == ". Has ghost?: " + component.HasGhost()); return (Object)(object)component != (Object)null && !component.HasGhost(); }); int num3 = default(int); int num2 = default(int); int num = default(int); if (!val2.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num3), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num) })) { Log.LogInstrNotFound(il); } else { val2.Index += 2; val2.Remove(); int index = val2.Index; val2.Index = index + 1; val2.Remove(); index = val2.Index; val2.Index = index + 1; val2.Remove(); val2.Emit(OpCodes.Ldarg_1); val2.EmitDelegate>((Action)delegate(CharacterBody ghostBody, DamageReport damageReport) { if ((Object)(object)ghostBody != (Object)null) { damageReport.attacker.GetComponent().SetGhost(ghostBody); ghostBody.master.inventory.GiveItemPermanent(Items.BoostDamage, 75 * damageReport.attackerBody.inventory.GetItemCountEffective(Items.GhostOnKill) - 150); } }); } } }; <>c.<>9__1_1 = val; obj = (object)val; } GlobalEventManager.OnCharacterDeath += (Manipulator)obj; UpdateText(); Log.LogInfo("Added Happiest Mask Rework"); } catch (Exception ex) { VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } private static void UpdateText() { LanguageAPI.Add("ITEM_GHOSTONKILL_DESC", "Killing an enemy will spawn a ghost of the killed enemy with 750%(+750% per stack) damage for 30s. "); LanguageAPI.Add("ITEM_GHOSTONKILL_PICKUP", "Killing an enemy spawns a ghost of them."); } } public static class LaserScopeBuff { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static StatHookEventHandler <>9__2_0; internal void b__2_0(CharacterBody sender, StatHookEventArgs args) { if ((Object)(object)sender.inventory != (Object)null && sender.inventory.GetItemCountEffective(Items.CritDamage) > 0) { args.critAdd += _critChance; } } } private static float _critChance; public static void TryInit(ConfigFile configFile) { bool value = configFile.Bind("Laser Scope Buff", "Enable Laser Scope Buff", true, "Gives Laser Scope 15% non-stacking crit chance for the first stack.").Value; _critChance = configFile.Bind("Laser Scope Buff", "Laser Scope Crit Chance", 15f, "Gives Laser Scope X% crit chance on the first stack.").Value; if (value) { Init(); } } public static void Init() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown try { object obj = <>c.<>9__2_0; if (obj == null) { StatHookEventHandler val = delegate(CharacterBody sender, StatHookEventArgs args) { if ((Object)(object)sender.inventory != (Object)null && sender.inventory.GetItemCountEffective(Items.CritDamage) > 0) { args.critAdd += _critChance; } }; <>c.<>9__2_0 = val; obj = (object)val; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj; UpdateText(); Log.LogInfo("Added laser Scope Buff"); } catch (Exception ex) { VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } private static void UpdateText() { LanguageAPI.Add("ITEM_CRITDAMAGE_DESC", "Gain " + _critChance + "% critical chance. Critical Strikes deal an additional 100% damage (+100% per stack)."); } } } namespace VanillaItemTweaks.Common { public static class BustlingFungusBuff { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__2_1; public static Manipulator <>9__2_0; internal void b__2_0(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); float num = default(float); if (!val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num) })) { Log.LogInstrNotFound(il); } else { val.Next.Operand = _waitTime; } } internal bool b__2_1(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } } private static float _waitTime; public static void TryInit(ConfigFile configFile) { bool value = configFile.Bind("Bustling Fungus Buff", "Enable Bustling Fungus Buff", true, "Bustling Fungus activates in X seconds.").Value; _waitTime = configFile.Bind("Bustling Fungus Buff", "Bustling Fungus Delay", 0.75f, "Seconds before Bustling Fungus activates.").Value; if (value) { Init(); } } public static void Init() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown try { object obj = <>c.<>9__2_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 ILCursor val2 = new ILCursor(il); float num = default(float); if (!val2.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num) })) { Log.LogInstrNotFound(il); } else { val2.Next.Operand = _waitTime; } }; <>c.<>9__2_0 = val; obj = (object)val; } CharacterBody.GetNotMoving += (Manipulator)obj; UpdateText(); Log.LogInfo("Added Bustling Fungus Buff"); } catch (Exception ex) { VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } private static void UpdateText() { LanguageAPI.Add("ITEM_MUSHROOM_PICKUP", "Heal all nearby allies after standing still for " + _waitTime + " second" + ((_waitTime == 1f) ? "" : "s")); LanguageAPI.Add("ITEM_MUSHROOM_DESC", "After standing still for " + _waitTime + " second" + ((_waitTime == 1f) ? "" : "s") + ", create a zone that heals for 4.5% (+2.25% per stack) of your health every second to all allies within 3m (+1.5m per stack)."); } } public static class MochaRework { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static StatHookEventHandler <>9__2_0; internal void b__2_0(CharacterBody sender, StatHookEventArgs args) { if ((Object)(object)sender.inventory != (Object)null) { int itemCountEffective = sender.inventory.GetItemCountEffective(Items.AttackSpeedAndMoveSpeed); args.allSkills.cooldownReductionMultAdd += CooldownRateToReduction((float)itemCountEffective * _cooldownRate); args.attackSpeedMultAdd -= (float)itemCountEffective * 0.075f; args.moveSpeedMultAdd -= (float)itemCountEffective * 0.07f; } } } public static float _cooldownRate; public static void TryInit(ConfigFile configFile) { bool value = configFile.Bind("Mocha Rework", "Enable Mocha Rework", true, "Mocha instead gives cooldown rate per stack.").Value; _cooldownRate = configFile.Bind("Mocha Rework", "Mocha Cooldown Rate", 7f, "Mocha gives X% cooldown rate per stack.").Value / 100f; if (value) { Init(); } } public static void Init() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown try { object obj = <>c.<>9__2_0; if (obj == null) { StatHookEventHandler val = delegate(CharacterBody sender, StatHookEventArgs args) { if ((Object)(object)sender.inventory != (Object)null) { int itemCountEffective = sender.inventory.GetItemCountEffective(Items.AttackSpeedAndMoveSpeed); args.allSkills.cooldownReductionMultAdd += CooldownRateToReduction((float)itemCountEffective * _cooldownRate); args.attackSpeedMultAdd -= (float)itemCountEffective * 0.075f; args.moveSpeedMultAdd -= (float)itemCountEffective * 0.07f; } }; <>c.<>9__2_0 = val; obj = (object)val; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj; UpdateText(); Log.LogInfo("Added Mocha Rework"); } catch (Exception ex) { VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } private static void UpdateText() { LanguageAPI.Add("ITEM_ATTACKSPEEDANDMOVESPEED_PICKUP", "Increases cooldown rate"); LanguageAPI.Add("ITEM_ATTACKSPEEDANDMOVESPEED_DESC", "Increases skill cooldown rate by " + _cooldownRate * 100f + "% (+" + _cooldownRate * 100f + "% per stack)."); } private static float CooldownRateToReduction(float cooldownRate) { return cooldownRate / (cooldownRate + 1f); } } public static class StickyBombBuff { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__1_2; public static Manipulator <>9__1_0; public static Func <>9__1_4; public static Func <>9__1_5; public static Func <>9__1_6; public static Func <>9__1_3; public static Manipulator <>9__1_1; internal void b__1_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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (!val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "StickyBomb") })) { Log.LogInstrNotFound(il); return; } val.Index += 2; val.Emit(OpCodes.Ldc_I4_0); val.Emit(OpCodes.Mul); } internal bool b__1_2(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "StickyBomb"); } internal void b__1_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_009b: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); MethodReference val7 = default(MethodReference); MethodReference val6 = default(MethodReference); ILLabel val5 = default(ILLabel); if (!val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val7), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val6), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val5) })) { Log.LogInstrNotFound(il); return; } val.Index += 4; val.Emit(OpCodes.Ldarg_2); val.EmitDelegate>((Func)delegate(DamageInfo dmgInfo, GameObject obj) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = dmgInfo.attacker.GetComponent(); int itemCountEffective = component.inventory.GetItemCountEffective(Items.StickyBomb); if (itemCountEffective > 0 && (((ProcChainMask)(ref dmgInfo.procChainMask)).HasProc((ProcType)26) || Util.CheckRoll(5f * (float)itemCountEffective * dmgInfo.procCoefficient, component.master))) { CharacterBody component2 = obj.GetComponent(); float num = 5f; Vector3 val2 = dmgInfo.position; bool flag = true; float num2 = 0f; Vector3 val3 = default(Vector3); if (Object.op_Implicit((Object)(object)component2)) { val3 = component2.corePosition - val2; flag = component2.healthComponent.alive; num2 = ((Vector3)(ref val3)).magnitude; } else { val2 = dmgInfo.position + 0.1f * Vector3.upVector; } Quaternion val4 = (((double)num2 != 0.0) ? Util.QuaternionSafeLookRotation(val3) : Random.rotationUniform); float num3 = 1.8f; float num4 = Util.OnHitProcDamage(dmgInfo.damage, component.damage, num3); ProjectileManager.instance.FireProjectileWithoutDamageType(LegacyResourcesAPI.Load("Prefabs/Projectiles/StickyBomb"), val2, val4, dmgInfo.attacker, num4, 100f, dmgInfo.crit, (DamageColorIndex)3, (GameObject)null, flag ? (num2 * num) : (-1f)); } return dmgInfo; }); } internal bool b__1_4(Instruction x) { MethodReference val = default(MethodReference); return ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val); } internal bool b__1_5(Instruction x) { MethodReference val = default(MethodReference); return ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val); } internal bool b__1_6(Instruction x) { ILLabel val = default(ILLabel); return ILPatternMatchingExt.MatchBrfalse(x, ref val); } internal DamageInfo b__1_3(DamageInfo dmgInfo, GameObject obj) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = dmgInfo.attacker.GetComponent(); int itemCountEffective = component.inventory.GetItemCountEffective(Items.StickyBomb); if (itemCountEffective > 0 && (((ProcChainMask)(ref dmgInfo.procChainMask)).HasProc((ProcType)26) || Util.CheckRoll(5f * (float)itemCountEffective * dmgInfo.procCoefficient, component.master))) { CharacterBody component2 = obj.GetComponent(); float num = 5f; Vector3 val = dmgInfo.position; bool flag = true; float num2 = 0f; Vector3 val2 = default(Vector3); if (Object.op_Implicit((Object)(object)component2)) { val2 = component2.corePosition - val; flag = component2.healthComponent.alive; num2 = ((Vector3)(ref val2)).magnitude; } else { val = dmgInfo.position + 0.1f * Vector3.upVector; } Quaternion val3 = (((double)num2 != 0.0) ? Util.QuaternionSafeLookRotation(val2) : Random.rotationUniform); float num3 = 1.8f; float num4 = Util.OnHitProcDamage(dmgInfo.damage, component.damage, num3); ProjectileManager.instance.FireProjectileWithoutDamageType(LegacyResourcesAPI.Load("Prefabs/Projectiles/StickyBomb"), val, val3, dmgInfo.attacker, num4, 100f, dmgInfo.crit, (DamageColorIndex)3, (GameObject)null, flag ? (num2 * num) : (-1f)); } return dmgInfo; } } public static void TryInit(ConfigFile configFile) { if (configFile.Bind("Sticky Bomb Buff", "Enable Sticky Bomb Buff", true, "Sticky Bomb can now also proc when shooting surfaces.").Value) { Init(); } } public static void Init() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown try { object obj2 = <>c.<>9__1_0; if (obj2 == 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) ILCursor val10 = new ILCursor(il); if (!val10.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "StickyBomb") })) { Log.LogInstrNotFound(il); } else { val10.Index += 2; val10.Emit(OpCodes.Ldc_I4_0); val10.Emit(OpCodes.Mul); } }; <>c.<>9__1_0 = val; obj2 = (object)val; } GlobalEventManager.ProcessHitEnemy += (Manipulator)obj2; object obj3 = <>c.<>9__1_1; if (obj3 == 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_009b: Unknown result type (might be due to invalid IL or missing references) ILCursor val3 = new ILCursor(il); MethodReference val9 = default(MethodReference); MethodReference val8 = default(MethodReference); ILLabel val7 = default(ILLabel); if (!val3.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val9), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val8), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val7) })) { Log.LogInstrNotFound(il); } else { val3.Index += 4; val3.Emit(OpCodes.Ldarg_2); val3.EmitDelegate>((Func)delegate(DamageInfo dmgInfo, GameObject obj) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = dmgInfo.attacker.GetComponent(); int itemCountEffective = component.inventory.GetItemCountEffective(Items.StickyBomb); if (itemCountEffective > 0 && (((ProcChainMask)(ref dmgInfo.procChainMask)).HasProc((ProcType)26) || Util.CheckRoll(5f * (float)itemCountEffective * dmgInfo.procCoefficient, component.master))) { CharacterBody component2 = obj.GetComponent(); float num = 5f; Vector3 val4 = dmgInfo.position; bool flag = true; float num2 = 0f; Vector3 val5 = default(Vector3); if (Object.op_Implicit((Object)(object)component2)) { val5 = component2.corePosition - val4; flag = component2.healthComponent.alive; num2 = ((Vector3)(ref val5)).magnitude; } else { val4 = dmgInfo.position + 0.1f * Vector3.upVector; } Quaternion val6 = (((double)num2 != 0.0) ? Util.QuaternionSafeLookRotation(val5) : Random.rotationUniform); float num3 = 1.8f; float num4 = Util.OnHitProcDamage(dmgInfo.damage, component.damage, num3); ProjectileManager.instance.FireProjectileWithoutDamageType(LegacyResourcesAPI.Load("Prefabs/Projectiles/StickyBomb"), val4, val6, dmgInfo.attacker, num4, 100f, dmgInfo.crit, (DamageColorIndex)3, (GameObject)null, flag ? (num2 * num) : (-1f)); } return dmgInfo; }); } }; <>c.<>9__1_1 = val2; obj3 = (object)val2; } GlobalEventManager.OnHitAllProcess += (Manipulator)obj3; UpdateText(); Log.LogInfo("Added Sticky Bomb Buff"); } catch (Exception ex) { VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } private static void UpdateText() { LanguageAPI.Add("ITEM_STICKYBOMB_PICKUP", "Chance on hit to attach a bomb to target."); LanguageAPI.Add("ITEM_STICKYBOMB_DESC", "5% (+5% per stack) chance on hit to attach a bomb to target, detonating for 180% TOTAL damage."); } } public static class WarbannerBuff { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_OnExit <>9__1_0; public static hook_OnEnter <>9__1_1; public static hook_OnEnter <>9__1_2; internal void b__1_0(orig_OnExit orig, PreEncounter self) { orig.Invoke(self); TrySpawnWarbanner(); } internal void b__1_1(orig_OnEnter orig, Phase1 self) { orig.Invoke(self); TrySpawnWarbanner(); } internal void b__1_2(orig_OnEnter orig, SpawnState self) { orig.Invoke(self); TrySpawnWarbanner(); } } public static void TryInit(ConfigFile configFile) { if (configFile.Bind("Warbanner Buff", "Enable Warbanner Buff", true, "Warbanner activates when starting Mithrix fight.").Value) { Init(); } } public static void Init() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown object obj = <>c.<>9__1_0; if (obj == null) { hook_OnExit val = delegate(orig_OnExit orig, PreEncounter self) { orig.Invoke(self); TrySpawnWarbanner(); }; <>c.<>9__1_0 = val; obj = (object)val; } PreEncounter.OnExit += (hook_OnExit)obj; object obj2 = <>c.<>9__1_1; if (obj2 == null) { hook_OnEnter val2 = delegate(orig_OnEnter orig, Phase1 self) { orig.Invoke(self); TrySpawnWarbanner(); }; <>c.<>9__1_1 = val2; obj2 = (object)val2; } Phase1.OnEnter += (hook_OnEnter)obj2; object obj3 = <>c.<>9__1_2; if (obj3 == null) { hook_OnEnter val3 = delegate(orig_OnEnter orig, SpawnState self) { orig.Invoke(self); TrySpawnWarbanner(); }; <>c.<>9__1_2 = val3; obj3 = (object)val3; } SpawnState.OnEnter += (hook_OnEnter)obj3; Log.LogInfo("Added Warbanner Buff"); } private static void TrySpawnWarbanner() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } ReadOnlyCollection teamMembers = TeamComponent.GetTeamMembers((TeamIndex)1); for (int i = 0; i < teamMembers.Count; i++) { TeamComponent val = teamMembers[i]; CharacterBody body = val.body; if (!Object.op_Implicit((Object)(object)body)) { continue; } CharacterMaster master = val.body.master; if (Object.op_Implicit((Object)(object)master)) { int itemCountEffective = master.inventory.GetItemCountEffective(Items.WardOnLevel); if (itemCountEffective > 0) { GameObject val2 = Object.Instantiate(LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/WarbannerWard"), body.transform.position, Quaternion.identity); val2.GetComponent().teamIndex = (TeamIndex)1; val2.GetComponent().Networkradius = (float)(8.0 + 8.0 * (double)itemCountEffective); NetworkServer.Spawn(val2); } } } } } } namespace VanillaItemTweaks.Boss { public static class KnurlBuff { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static StatHookEventHandler <>9__2_0; internal void b__2_0(CharacterBody sender, StatHookEventArgs args) { if ((Object)(object)sender.inventory != (Object)null) { args.armorAdd += (float)sender.inventory.GetItemCountEffective(Items.Knurl) * _knurlArmor; } } } private static float _knurlArmor; public static void TryInit(ConfigFile configFile) { bool value = configFile.Bind("Titanic Knurl Buff", "Enable Titanic Knurl Buff", true, "Gives Titanic Knurl additional armor per stack.").Value; _knurlArmor = configFile.Bind("Titanic Knurl Buff", "Titanic Knurl Armor", 10f, "Gives Titanic Knurl X armor per stack.").Value; if (value) { Init(); } } public static void Init() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown try { object obj = <>c.<>9__2_0; if (obj == null) { StatHookEventHandler val = delegate(CharacterBody sender, StatHookEventArgs args) { if ((Object)(object)sender.inventory != (Object)null) { args.armorAdd += (float)sender.inventory.GetItemCountEffective(Items.Knurl) * _knurlArmor; } }; <>c.<>9__2_0 = val; obj = (object)val; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj; UpdateText(); Log.LogInfo("Added Knurl Buff"); } catch (Exception ex) { VanillaItemTweaks.logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } private static void UpdateText() { LanguageAPI.Add("ITEM_KNURL_PICKUP", "Boosts health, regeneration, and armor"); LanguageAPI.Add("ITEM_KNURL_DESC", "Increase maximum health by " + _knurlArmor + " (+" + _knurlArmor + " per stack), base health regeneration by +1.6 hp/s (+1.6 hp/s per stack), and armor by 10 (+10 per stack)."); } } }