Decompiled source of LevelStats v1.1.0

plugins/LevelStats/LevelStats.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using IL.RoR2;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.RoR2;
using RoR2;
using UnityEngine;

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

[BepInPlugin("com.TPDespair.LevelStats", "LevelStats", "1.1.0")]
public class LevelStatsPlugin : BaseUnityPlugin
{
	[Serializable]
	[CompilerGenerated]
	private sealed class <>c
	{
		public static readonly <>c <>9 = new <>c();

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

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

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

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

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

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

		public static Func<CharacterBody, float, float> <>9__32_7;

		public static Manipulator <>9__32_0;

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

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

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

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

		public static Func<CharacterBody, float, float> <>9__33_5;

		public static Manipulator <>9__33_0;

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

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

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

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

		public static Func<CharacterBody, float, float> <>9__34_5;

		public static Manipulator <>9__34_0;

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

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

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

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

		public static Func<CharacterBody, float, float> <>9__35_5;

		public static Manipulator <>9__35_0;

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

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

		public static Func<CharacterBody, float, float, float> <>9__36_3;

		public static Manipulator <>9__36_0;

		public static hook_RecalculateStats <>9__37_0;

		internal void <MovementSpeedHook>b__32_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_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[6]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 84),
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 85),
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 86),
				(Instruction x) => ILPatternMatchingExt.MatchDiv(x),
				(Instruction x) => ILPatternMatchingExt.MatchMul(x),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 84)
			}))
			{
				val.Index += 1;
				val.Emit(OpCodes.Pop);
				val.Emit(OpCodes.Ldarg, 0);
				val.Emit(OpCodes.Ldloc, 85);
				val.EmitDelegate<Func<CharacterBody, float, float>>((Func<CharacterBody, float, float>)delegate(CharacterBody self, float value)
				{
					if (IsPlayer(self))
					{
						value += PlayerMovSpdLevel.Value * (self.level - 1f);
					}
					return value;
				});
				val.Emit(OpCodes.Stloc, 85);
				val.Emit(OpCodes.Ldloc, 84);
			}
			else
			{
				logSource.LogWarning((object)"MovementSpeedHook Failed");
			}
		}

		internal bool <MovementSpeedHook>b__32_1(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdloc(x, 84);
		}

		internal bool <MovementSpeedHook>b__32_2(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdloc(x, 85);
		}

		internal bool <MovementSpeedHook>b__32_3(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdloc(x, 86);
		}

		internal bool <MovementSpeedHook>b__32_4(Instruction x)
		{
			return ILPatternMatchingExt.MatchDiv(x);
		}

		internal bool <MovementSpeedHook>b__32_5(Instruction x)
		{
			return ILPatternMatchingExt.MatchMul(x);
		}

		internal bool <MovementSpeedHook>b__32_6(Instruction x)
		{
			return ILPatternMatchingExt.MatchStloc(x, 84);
		}

		internal float <MovementSpeedHook>b__32_7(CharacterBody self, float value)
		{
			if (IsPlayer(self))
			{
				value += PlayerMovSpdLevel.Value * (self.level - 1f);
			}
			return value;
		}

		internal void <AttackSpeedHook>b__33_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_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: 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)
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[4]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 94),
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 95),
				(Instruction x) => ILPatternMatchingExt.MatchMul(x),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 94)
			}))
			{
				val.Emit(OpCodes.Ldarg, 0);
				val.Emit(OpCodes.Ldloc, 95);
				val.EmitDelegate<Func<CharacterBody, float, float>>((Func<CharacterBody, float, float>)delegate(CharacterBody self, float value)
				{
					if (IsPlayer(self))
					{
						value += PlayerAtkSpdLevel.Value * (self.level - 1f);
					}
					return value;
				});
				val.Emit(OpCodes.Stloc, 95);
			}
			else
			{
				logSource.LogWarning((object)"AttackSpeedHook Failed");
			}
		}

		internal bool <AttackSpeedHook>b__33_1(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdloc(x, 94);
		}

		internal bool <AttackSpeedHook>b__33_2(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdloc(x, 95);
		}

		internal bool <AttackSpeedHook>b__33_3(Instruction x)
		{
			return ILPatternMatchingExt.MatchMul(x);
		}

		internal bool <AttackSpeedHook>b__33_4(Instruction x)
		{
			return ILPatternMatchingExt.MatchStloc(x, 94);
		}

		internal float <AttackSpeedHook>b__33_5(CharacterBody self, float value)
		{
			if (IsPlayer(self))
			{
				value += PlayerAtkSpdLevel.Value * (self.level - 1f);
			}
			return value;
		}

		internal void <DamageHook>b__34_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_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: 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)
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[4]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 88),
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 89),
				(Instruction x) => ILPatternMatchingExt.MatchMul(x),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 88)
			}))
			{
				val.Emit(OpCodes.Ldarg, 0);
				val.Emit(OpCodes.Ldloc, 88);
				val.EmitDelegate<Func<CharacterBody, float, float>>((Func<CharacterBody, float, float>)delegate(CharacterBody self, float value)
				{
					if (IsPlayer(self))
					{
						value += PlayerDamageLevel.Value * (self.level - 1f);
					}
					return value;
				});
				val.Emit(OpCodes.Stloc, 88);
			}
			else
			{
				logSource.LogWarning((object)"DamageHook Failed");
			}
		}

		internal bool <DamageHook>b__34_1(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdloc(x, 88);
		}

		internal bool <DamageHook>b__34_2(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdloc(x, 89);
		}

		internal bool <DamageHook>b__34_3(Instruction x)
		{
			return ILPatternMatchingExt.MatchMul(x);
		}

		internal bool <DamageHook>b__34_4(Instruction x)
		{
			return ILPatternMatchingExt.MatchStloc(x, 88);
		}

		internal float <DamageHook>b__34_5(CharacterBody self, float value)
		{
			if (IsPlayer(self))
			{
				value += PlayerDamageLevel.Value * (self.level - 1f);
			}
			return value;
		}

		internal void <HealthHook>b__35_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_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: 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)
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[4]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 70),
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 71),
				(Instruction x) => ILPatternMatchingExt.MatchMul(x),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 70)
			}))
			{
				val.Emit(OpCodes.Ldarg, 0);
				val.Emit(OpCodes.Ldloc, 70);
				val.EmitDelegate<Func<CharacterBody, float, float>>((Func<CharacterBody, float, float>)delegate(CharacterBody self, float value)
				{
					if (IsPlayer(self))
					{
						value += PlayerHealthLevel.Value * (self.level - 1f);
					}
					return value;
				});
				val.Emit(OpCodes.Stloc, 70);
			}
			else
			{
				logSource.LogWarning((object)"HealthHook Failed");
			}
		}

		internal bool <HealthHook>b__35_1(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdloc(x, 70);
		}

		internal bool <HealthHook>b__35_2(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdloc(x, 71);
		}

		internal bool <HealthHook>b__35_3(Instruction x)
		{
			return ILPatternMatchingExt.MatchMul(x);
		}

		internal bool <HealthHook>b__35_4(Instruction x)
		{
			return ILPatternMatchingExt.MatchStloc(x, 70);
		}

		internal float <HealthHook>b__35_5(CharacterBody self, float value)
		{
			if (IsPlayer(self))
			{
				value += PlayerHealthLevel.Value * (self.level - 1f);
			}
			return value;
		}

		internal void <RegenHook>b__36_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_0060: 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_00af: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1f),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 82)
			}))
			{
				val.Emit(OpCodes.Ldarg, 0);
				val.Emit(OpCodes.Ldloc, 76);
				val.Emit(OpCodes.Ldloc, 75);
				val.EmitDelegate<Func<CharacterBody, float, float, float>>((Func<CharacterBody, float, float, float>)delegate(CharacterBody self, float value, float scaling)
				{
					float num = 0f;
					if (IsPlayer(self))
					{
						num += PlayerRegenLevel.Value * (self.level - 1f);
					}
					if (num != 0f)
					{
						value += num * scaling;
					}
					return value;
				});
				val.Emit(OpCodes.Stloc, 76);
			}
			else
			{
				logSource.LogWarning((object)"RegenHook Failed");
			}
		}

		internal bool <RegenHook>b__36_1(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdcR4(x, 1f);
		}

		internal bool <RegenHook>b__36_2(Instruction x)
		{
			return ILPatternMatchingExt.MatchStloc(x, 82);
		}

		internal float <RegenHook>b__36_3(CharacterBody self, float value, float scaling)
		{
			float num = 0f;
			if (IsPlayer(self))
			{
				num += PlayerRegenLevel.Value * (self.level - 1f);
			}
			if (num != 0f)
			{
				value += num * scaling;
			}
			return value;
		}

		internal void <ArmorHook>b__37_0(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && IsPlayer(self))
			{
				self.armor += PlayerArmorLevel.Value * (self.level - 1f);
			}
		}
	}

	public const string ModVer = "1.1.0";

	public const string ModName = "LevelStats";

	public const string ModGuid = "com.TPDespair.LevelStats";

	public static ManualLogSource logSource;

	public static ConfigEntry<float> PlayerMovSpdLevel { get; set; }

	public static ConfigEntry<float> PlayerAtkSpdLevel { get; set; }

	public static ConfigEntry<float> PlayerDamageLevel { get; set; }

	public static ConfigEntry<float> PlayerHealthLevel { get; set; }

	public static ConfigEntry<float> PlayerRegenLevel { get; set; }

	public static ConfigEntry<float> PlayerArmorLevel { get; set; }

	public void Awake()
	{
		RoR2Application.isModded = true;
		NetworkModCompatibilityHelper.networkModList = NetworkModCompatibilityHelper.networkModList.Append("com.TPDespair.LevelStats:1.1.0");
		logSource = ((BaseUnityPlugin)this).Logger;
		SetupConfig(((BaseUnityPlugin)this).Config);
		StatHooks();
	}

	private static void SetupConfig(ConfigFile Config)
	{
		PlayerMovSpdLevel = Config.Bind<float>("PlayerStats", "PlayerMovSpdLevel", 0.015f, "Movement Speed increase granted per Level.");
		PlayerAtkSpdLevel = Config.Bind<float>("PlayerStats", "PlayerAtkSpdLevel", 0.01f, "Attack Speed increase granted per Level.");
		PlayerDamageLevel = Config.Bind<float>("PlayerStats", "PlayerDamageLevel", 0f, "Added Damage per Level. This is not a percent increase! Most survivors have around 12 (+2.4 per level) damage.");
		PlayerHealthLevel = Config.Bind<float>("PlayerStats", "PlayerHealthLevel", 0f, "Added Health per Level. This is not a percent increase! Most survivors have around 110 (+33 per level) health.");
		PlayerRegenLevel = Config.Bind<float>("PlayerStats", "PlayerRegenLevel", 0.1f, "Added Health Regeneration per Level. This is not a percent increase! Most survivors have around 1 hp/s (+0.2 hp/s per level) regeneration.");
		PlayerArmorLevel = Config.Bind<float>("PlayerStats", "PlayerArmorLevel", 0f, "Added Armor per Level. This is not a percent increase! Most survivors have 0 or 20 armor.");
	}

	private static void StatHooks()
	{
		MovementSpeedHook();
		AttackSpeedHook();
		DamageHook();
		HealthHook();
		RegenHook();
		ArmorHook();
	}

	private static bool IsPlayer(CharacterBody body)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Invalid comparison between Unknown and I4
		return (int)body.teamComponent.teamIndex == 1;
	}

	private static void MovementSpeedHook()
	{
		//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
		object obj = <>c.<>9__32_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_00f7: Unknown result type (might be due to invalid IL or missing references)
				//IL_0103: Unknown result type (might be due to invalid IL or missing references)
				//IL_0110: Unknown result type (might be due to invalid IL or missing references)
				//IL_0144: Unknown result type (might be due to invalid IL or missing references)
				//IL_0152: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val2 = new ILCursor(il);
				if (val2.TryGotoNext(new Func<Instruction, bool>[6]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 84),
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 85),
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 86),
					(Instruction x) => ILPatternMatchingExt.MatchDiv(x),
					(Instruction x) => ILPatternMatchingExt.MatchMul(x),
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 84)
				}))
				{
					val2.Index += 1;
					val2.Emit(OpCodes.Pop);
					val2.Emit(OpCodes.Ldarg, 0);
					val2.Emit(OpCodes.Ldloc, 85);
					val2.EmitDelegate<Func<CharacterBody, float, float>>((Func<CharacterBody, float, float>)delegate(CharacterBody self, float value)
					{
						if (IsPlayer(self))
						{
							value += PlayerMovSpdLevel.Value * (self.level - 1f);
						}
						return value;
					});
					val2.Emit(OpCodes.Stloc, 85);
					val2.Emit(OpCodes.Ldloc, 84);
				}
				else
				{
					logSource.LogWarning((object)"MovementSpeedHook Failed");
				}
			};
			<>c.<>9__32_0 = val;
			obj = (object)val;
		}
		CharacterBody.RecalculateStats += (Manipulator)obj;
	}

	private static void AttackSpeedHook()
	{
		//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
		object obj = <>c.<>9__33_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_00a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b1: 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)
				ILCursor val2 = new ILCursor(il);
				if (val2.TryGotoNext(new Func<Instruction, bool>[4]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 94),
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 95),
					(Instruction x) => ILPatternMatchingExt.MatchMul(x),
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 94)
				}))
				{
					val2.Emit(OpCodes.Ldarg, 0);
					val2.Emit(OpCodes.Ldloc, 95);
					val2.EmitDelegate<Func<CharacterBody, float, float>>((Func<CharacterBody, float, float>)delegate(CharacterBody self, float value)
					{
						if (IsPlayer(self))
						{
							value += PlayerAtkSpdLevel.Value * (self.level - 1f);
						}
						return value;
					});
					val2.Emit(OpCodes.Stloc, 95);
				}
				else
				{
					logSource.LogWarning((object)"AttackSpeedHook Failed");
				}
			};
			<>c.<>9__33_0 = val;
			obj = (object)val;
		}
		CharacterBody.RecalculateStats += (Manipulator)obj;
	}

	private static void DamageHook()
	{
		//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
		object obj = <>c.<>9__34_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_00a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b1: 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)
				ILCursor val2 = new ILCursor(il);
				if (val2.TryGotoNext(new Func<Instruction, bool>[4]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 88),
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 89),
					(Instruction x) => ILPatternMatchingExt.MatchMul(x),
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 88)
				}))
				{
					val2.Emit(OpCodes.Ldarg, 0);
					val2.Emit(OpCodes.Ldloc, 88);
					val2.EmitDelegate<Func<CharacterBody, float, float>>((Func<CharacterBody, float, float>)delegate(CharacterBody self, float value)
					{
						if (IsPlayer(self))
						{
							value += PlayerDamageLevel.Value * (self.level - 1f);
						}
						return value;
					});
					val2.Emit(OpCodes.Stloc, 88);
				}
				else
				{
					logSource.LogWarning((object)"DamageHook Failed");
				}
			};
			<>c.<>9__34_0 = val;
			obj = (object)val;
		}
		CharacterBody.RecalculateStats += (Manipulator)obj;
	}

	private static void HealthHook()
	{
		//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
		object obj = <>c.<>9__35_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_00a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b1: 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)
				ILCursor val2 = new ILCursor(il);
				if (val2.TryGotoNext(new Func<Instruction, bool>[4]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 70),
					(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 71),
					(Instruction x) => ILPatternMatchingExt.MatchMul(x),
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 70)
				}))
				{
					val2.Emit(OpCodes.Ldarg, 0);
					val2.Emit(OpCodes.Ldloc, 70);
					val2.EmitDelegate<Func<CharacterBody, float, float>>((Func<CharacterBody, float, float>)delegate(CharacterBody self, float value)
					{
						if (IsPlayer(self))
						{
							value += PlayerHealthLevel.Value * (self.level - 1f);
						}
						return value;
					});
					val2.Emit(OpCodes.Stloc, 70);
				}
				else
				{
					logSource.LogWarning((object)"HealthHook Failed");
				}
			};
			<>c.<>9__35_0 = val;
			obj = (object)val;
		}
		CharacterBody.RecalculateStats += (Manipulator)obj;
	}

	private static void RegenHook()
	{
		//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
		object obj = <>c.<>9__36_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_0060: 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_00af: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val2 = new ILCursor(il);
				if (val2.TryGotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1f),
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 82)
				}))
				{
					val2.Emit(OpCodes.Ldarg, 0);
					val2.Emit(OpCodes.Ldloc, 76);
					val2.Emit(OpCodes.Ldloc, 75);
					val2.EmitDelegate<Func<CharacterBody, float, float, float>>((Func<CharacterBody, float, float, float>)delegate(CharacterBody self, float value, float scaling)
					{
						float num = 0f;
						if (IsPlayer(self))
						{
							num += PlayerRegenLevel.Value * (self.level - 1f);
						}
						if (num != 0f)
						{
							value += num * scaling;
						}
						return value;
					});
					val2.Emit(OpCodes.Stloc, 76);
				}
				else
				{
					logSource.LogWarning((object)"RegenHook Failed");
				}
			};
			<>c.<>9__36_0 = val;
			obj = (object)val;
		}
		CharacterBody.RecalculateStats += (Manipulator)obj;
	}

	private static void ArmorHook()
	{
		//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
		object obj = <>c.<>9__37_0;
		if (obj == null)
		{
			hook_RecalculateStats val = delegate(orig_RecalculateStats orig, CharacterBody self)
			{
				orig.Invoke(self);
				if (Object.op_Implicit((Object)(object)self) && IsPlayer(self))
				{
					self.armor += PlayerArmorLevel.Value * (self.level - 1f);
				}
			};
			<>c.<>9__37_0 = val;
			obj = (object)val;
		}
		CharacterBody.RecalculateStats += (hook_RecalculateStats)obj;
	}
}