Decompiled source of Ye Olde Burn v1.0.3

YeOldeBurn.dll

Decompiled a week ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using IL.RoR2;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using RoR2;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("YeOldeBurn")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+3f06e7087963f7a66ce30707661422f939929727")]
[assembly: AssemblyProduct("YeOldeBurn")]
[assembly: AssemblyTitle("YeOldeBurn")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace OldBurn;

[BepInPlugin("xyz.yekoc.YeOldeBurn", "Ye Olde Burn", "1.0.2")]
public class OldBurnPlugin : BaseUnityPlugin
{
	[Serializable]
	[CompilerGenerated]
	private sealed class <>c
	{
		public static readonly <>c <>9 = new <>c();

		public static Func<Instruction, bool> <>9__0_3;

		public static Manipulator <>9__0_0;

		public static Func<Instruction, bool> <>9__0_5;

		public static Manipulator <>9__0_1;

		public static Func<Instruction, bool> <>9__0_7;

		public static Func<Instruction, bool> <>9__0_10;

		public static Func<Instruction, bool> <>9__0_11;

		public static Func<Instruction, bool> <>9__0_12;

		public static Manipulator <>9__0_2;

		internal void <Awake>b__0_0(ILContext il)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_0062: 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_0081: Unknown result type (might be due to invalid IL or missing references)
			<>c__DisplayClass0_0 CS$<>8__locals3 = new <>c__DisplayClass0_0();
			ILCursor val = new ILCursor(il);
			CS$<>8__locals3.InflictLoc = -1;
			val.GotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(InflictDotInfo).GetField("totalDamage"))
			});
			val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref CS$<>8__locals3.InflictLoc)
			});
			val.Emit(OpCodes.Ldloca, CS$<>8__locals3.InflictLoc);
			val.Emit(OpCodes.Ldarg, 1);
			val.Emit(OpCodes.Call, (MethodBase)typeof(OldBurnPlugin).GetMethod("ProcessHitEnemy", (BindingFlags)(-1)));
		}

		internal bool <Awake>b__0_3(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld(x, typeof(InflictDotInfo).GetField("totalDamage"));
		}

		internal void <Awake>b__0_1(ILContext il)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_0062: 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_0081: Unknown result type (might be due to invalid IL or missing references)
			<>c__DisplayClass0_1 CS$<>8__locals3 = new <>c__DisplayClass0_1();
			ILCursor val = new ILCursor(il);
			CS$<>8__locals3.InflictLoc = -1;
			val.GotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(InflictDotInfo).GetField("totalDamage"))
			});
			val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref CS$<>8__locals3.InflictLoc)
			});
			val.Emit(OpCodes.Ldloca, CS$<>8__locals3.InflictLoc);
			val.Emit(OpCodes.Ldarg, 1);
			val.Emit(OpCodes.Call, (MethodBase)typeof(OldBurnPlugin).GetMethod("ProcIgniteOnKill", (BindingFlags)(-1)));
		}

		internal bool <Awake>b__0_5(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld(x, typeof(InflictDotInfo).GetField("totalDamage"));
		}

		internal void <Awake>b__0_2(ILContext il)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			<>c__DisplayClass0_2 CS$<>8__locals6 = new <>c__DisplayClass0_2();
			ILCursor val = new ILCursor(il);
			CS$<>8__locals6.InflictLoc = -1;
			CS$<>8__locals6.numloc = -1;
			val.GotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(InflictDotInfo).GetField("totalDamage"))
			});
			val.GotoPrev(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdloca(x, ref CS$<>8__locals6.InflictLoc)
			});
			ILLabel val2 = default(ILLabel);
			val.GotoPrev(new Func<Instruction, bool>[3]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref CS$<>8__locals6.numloc),
				(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0),
				(Instruction x) => ILPatternMatchingExt.MatchBle(x, ref val2)
			});
			val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(InflictDotInfo).GetField("totalDamage"))
			});
			val.Emit(OpCodes.Ldloca, CS$<>8__locals6.InflictLoc);
			val.Emit(OpCodes.Ldloc, CS$<>8__locals6.numloc);
			val.Emit(OpCodes.Conv_R4);
			val.Emit(OpCodes.Ldarg, 0);
			val.Emit(OpCodes.Call, (MethodBase)typeof(OldBurnPlugin).GetMethod("AddOverheatServer", (BindingFlags)(-1)));
		}

		internal bool <Awake>b__0_7(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld(x, typeof(InflictDotInfo).GetField("totalDamage"));
		}

		internal bool <Awake>b__0_10(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdcI4(x, 0);
		}

		internal bool <Awake>b__0_11(Instruction x)
		{
			ILLabel val = default(ILLabel);
			return ILPatternMatchingExt.MatchBle(x, ref val);
		}

		internal bool <Awake>b__0_12(Instruction x)
		{
			return ILPatternMatchingExt.MatchStfld(x, typeof(InflictDotInfo).GetField("totalDamage"));
		}
	}

	[CompilerGenerated]
	private sealed class <>c__DisplayClass0_0
	{
		public int InflictLoc;

		internal bool <Awake>b__4(Instruction x)
		{
			return ILPatternMatchingExt.MatchStloc(x, ref InflictLoc);
		}
	}

	[CompilerGenerated]
	private sealed class <>c__DisplayClass0_1
	{
		public int InflictLoc;

		internal bool <Awake>b__6(Instruction x)
		{
			return ILPatternMatchingExt.MatchStloc(x, ref InflictLoc);
		}
	}

	[CompilerGenerated]
	private sealed class <>c__DisplayClass0_2
	{
		public int InflictLoc;

		public int numloc;

		internal bool <Awake>b__8(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdloca(x, ref InflictLoc);
		}

		internal bool <Awake>b__9(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdloc(x, ref numloc);
		}
	}

	private void Awake()
	{
		//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__0_0;
		if (obj == null)
		{
			Manipulator val = delegate(ILContext il)
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Expected O, but got Unknown
				//IL_0062: 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_0081: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val4 = new ILCursor(il);
				int InflictLoc = -1;
				val4.GotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(InflictDotInfo).GetField("totalDamage"))
				});
				val4.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref InflictLoc)
				});
				val4.Emit(OpCodes.Ldloca, InflictLoc);
				val4.Emit(OpCodes.Ldarg, 1);
				val4.Emit(OpCodes.Call, (MethodBase)typeof(OldBurnPlugin).GetMethod("ProcessHitEnemy", (BindingFlags)(-1)));
			};
			<>c.<>9__0_0 = val;
			obj = (object)val;
		}
		GlobalEventManager.ProcessHitEnemy += (Manipulator)obj;
		object obj2 = <>c.<>9__0_1;
		if (obj2 == null)
		{
			Manipulator val2 = delegate(ILContext il)
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Expected O, but got Unknown
				//IL_0062: 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_0081: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val4 = new ILCursor(il);
				int InflictLoc = -1;
				val4.GotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(InflictDotInfo).GetField("totalDamage"))
				});
				val4.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref InflictLoc)
				});
				val4.Emit(OpCodes.Ldloca, InflictLoc);
				val4.Emit(OpCodes.Ldarg, 1);
				val4.Emit(OpCodes.Call, (MethodBase)typeof(OldBurnPlugin).GetMethod("ProcIgniteOnKill", (BindingFlags)(-1)));
			};
			<>c.<>9__0_1 = val2;
			obj2 = (object)val2;
		}
		GlobalEventManager.ProcIgniteOnKill += (Manipulator)obj2;
		object obj3 = <>c.<>9__0_2;
		if (obj3 == null)
		{
			Manipulator val3 = delegate(ILContext il)
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Expected O, but got Unknown
				//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
				//IL_010a: Unknown result type (might be due to invalid IL or missing references)
				//IL_011c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0128: Unknown result type (might be due to invalid IL or missing references)
				//IL_0135: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val4 = new ILCursor(il);
				int InflictLoc = -1;
				int numloc = -1;
				val4.GotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(InflictDotInfo).GetField("totalDamage"))
				});
				val4.GotoPrev(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdloca(x, ref InflictLoc)
				});
				ILLabel val5 = default(ILLabel);
				val4.GotoPrev(new Func<Instruction, bool>[3]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref numloc),
					(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0),
					(Instruction x) => ILPatternMatchingExt.MatchBle(x, ref val5)
				});
				val4.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(InflictDotInfo).GetField("totalDamage"))
				});
				val4.Emit(OpCodes.Ldloca, InflictLoc);
				val4.Emit(OpCodes.Ldloc, numloc);
				val4.Emit(OpCodes.Conv_R4);
				val4.Emit(OpCodes.Ldarg, 0);
				val4.Emit(OpCodes.Call, (MethodBase)typeof(OldBurnPlugin).GetMethod("AddOverheatServer", (BindingFlags)(-1)));
			};
			<>c.<>9__0_2 = val3;
			obj3 = (object)val3;
		}
		OverheatSystem.AddOverheatServer += (Manipulator)obj3;
	}

	private static void ProcessHitEnemy(ref InflictDotInfo dot, DamageInfo damage)
	{
		dot.totalDamage = null;
		dot.duration = damage.procCoefficient * 4f;
	}

	private static void ProcIgniteOnKill(ref InflictDotInfo dot, int ignitecount)
	{
		dot.totalDamage = null;
		dot.duration = 1.5f * (float)(1 + ignitecount);
	}

	private static void AddOverheatServer(ref InflictDotInfo dot, float heatCount, in OverheatInfo heat)
	{
		dot.totalDamage = null;
		dot.duration = heat.burnTotalDamageScale;
		dot.damageMultiplier = heatCount;
	}
}