Decompiled source of Additive Stats v1.0.0

AdditiveStats.dll

Decompiled a month ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")]
[assembly: SecurityPermission(8, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(/*Could not decode attribute arguments.*/)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace AdditiveStats
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("Systems.R00t.AdditiveStats", "Additive Stats", "1.0.0")]
	[BepInProcess("Rounds.exe")]
	public class Plugin : BaseUnityPlugin
	{
		private const string ModId = "Systems.R00t.AdditiveStats";

		private const string ModName = "Additive Stats";

		public const string Version = "1.0.0";

		private void Awake()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("Systems.R00t.AdditiveStats").PatchAll();
		}
	}
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	[HarmonyPriority(0)]
	public class PatchApplyCardStats : Object
	{
		[HarmonyPatch("ApplyStats")]
		[HarmonyPatch("CopyGunStats")]
		private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, MethodBase original)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Expected O, but got Unknown
			//IL_0067: 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_0077: Expected O, but got Unknown
			//IL_0097: 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_00b0: Expected O, but got Unknown
			//IL_00b1: 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_00c1: Expected O, but got Unknown
			//IL_00e1: 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_00fa: Expected O, but got Unknown
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Expected O, but got Unknown
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Expected O, but got Unknown
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Expected O, but got Unknown
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Expected O, but got Unknown
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Expected O, but got Unknown
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Expected O, but got Unknown
			List<CodeInstruction> val = Enumerable.ToList<CodeInstruction>(instructions);
			List<CodeInstruction> val2 = new List<CodeInstruction>();
			for (int i = 0; i < Enumerable.Count<CodeInstruction>((IEnumerable<CodeInstruction>)(object)val); i++)
			{
				if (val[i].opcode == OpCodes.Mul && val[i + 1].opcode == OpCodes.Stfld)
				{
					val2.Add(new CodeInstruction(OpCodes.Ldc_R4, (object)1f));
					val2.Add(new CodeInstruction(OpCodes.Sub, (object)null));
					if (val[i + 1].operand.ToString().Contains("knockback"))
					{
						val2.Add(new CodeInstruction(OpCodes.Ldc_R4, (object)150f));
						val2.Add(new CodeInstruction(OpCodes.Mul, (object)null));
					}
					if (val[i + 1].operand.ToString().Contains("attackSpeed"))
					{
						val2.Add(new CodeInstruction(OpCodes.Ldc_R4, (object)0.3f));
						val2.Add(new CodeInstruction(OpCodes.Mul, (object)null));
					}
					if (val[i + 1].operand.ToString().Contains("maxHealth"))
					{
						val2.Add(new CodeInstruction(OpCodes.Ldc_R4, (object)100f));
						val2.Add(new CodeInstruction(OpCodes.Mul, (object)null));
					}
					if (val[i + 1].operand.ToString().Contains("gravityForce"))
					{
						val2.Add(new CodeInstruction(OpCodes.Ldc_R4, (object)1000f));
						val2.Add(new CodeInstruction(OpCodes.Mul, (object)null));
					}
					val2.Add(new CodeInstruction(OpCodes.Add, (object)null));
				}
				else
				{
					val2.Add(val[i]);
				}
			}
			return (IEnumerable<CodeInstruction>)(object)val2.ToArray();
		}
	}
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	public class MinMaxHealth : Object
	{
		public static void Prefix(CharacterData ___data)
		{
			if (___data.maxHealth < 0.1f)
			{
				___data.maxHealth = 0.1f;
			}
		}
	}
}