Decompiled source of Oops All Size2 v1.0.0

oopsallsize2.dll

Decompiled 8 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.AI;

[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("oopsallsize2")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("oopsallsize2")]
[assembly: AssemblyTitle("oopsallsize2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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]
	[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;
		}
	}
}
namespace OopsAllSize2
{
	[BepInPlugin("com.yourname.oopsallsize2", "Oops All Size 2", "1.0.0")]
	public class MainPlugin : BaseUnityPlugin
	{
		private void Awake()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			((BaseUnityPlugin)this).Logger.LogInfo((object)"OopsAllSize2 loaded! Unleashing the big bois.");
			Harmony val = new Harmony("com.yourname.oopsallsize2");
			val.PatchAll();
		}
	}
	[HarmonyPatch(typeof(EnemyIdentifier), "Start")]
	public static class EnemySpawnPatch
	{
		private static void Postfix(EnemyIdentifier __instance)
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)__instance == (Object)null))
			{
				string text = ((Object)((Component)__instance).gameObject).name.ToLower();
				float num = ((text.Contains("spider") || text.Contains("malicious")) ? 3f : 2f);
				Transform transform = ((Component)__instance).transform;
				transform.localScale *= num;
				Animator componentInChildren = ((Component)__instance).GetComponentInChildren<Animator>();
				if ((Object)(object)componentInChildren != (Object)null)
				{
					componentInChildren.speed *= num;
				}
				NavMeshAgent component = ((Component)__instance).GetComponent<NavMeshAgent>();
				if ((Object)(object)component != (Object)null)
				{
					component.speed *= num;
					component.acceleration *= num;
				}
			}
		}
	}
	[HarmonyPatch(typeof(EnemyIdentifier), "DeliverDamage")]
	public static class EnemyTankPatch
	{
		private static void Prefix(EnemyIdentifier __instance, ref float multiplier)
		{
			if (!((Object)(object)__instance == (Object)null))
			{
				string text = ((Object)((Component)__instance).gameObject).name.ToLower();
				float num = ((text.Contains("spider") || text.Contains("malicious")) ? 3f : 2f);
				multiplier /= num;
			}
		}
	}
}