Decompiled source of UnexplodableMissile v1.0.0

plugins/Unexplodable_Missile.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using BoplFixedMath;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Scen_Maker")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Scen_Maker")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("73007518-1d07-4874-8be4-928927af7047")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Unexplodable_Missile;

[BepInPlugin("com.000diggity000.Unexplodable_missile", "Unexplodable Missile", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	public class Patches
	{
		public static bool Awake_Missile_Plug(Missile __instance, FixTransform ___fixTrans, BoplBody ___body)
		{
			return false;
		}

		public static bool Update_Missile_Plug(Missile __instance, FixTransform ___fixTrans, BoplBody ___body, float ___spawnTime, Fix ___accel)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: 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_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_0041: Unknown result type (might be due to invalid IL or missing references)
			((Component)FixTransform.InstantiateFixed<Explosion>(__instance.onHitExplosionPrefab, new Vec2(___body.position.x, ___body.position.y))).GetComponent<IPhysicsCollider>().Scale = ___fixTrans.Scale;
			___body.AddForce(___fixTrans.up * ___accel, (ForceMode2D)0);
			return true;
		}

		public static bool Init_Missile_Plug(Missile __instance, FixTransform ___fixTrans, BoplBody ___body)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: 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_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			___body.position = new Vec2(___body.position.x, ___body.position.y + (Fix)10L);
			return true;
		}
	}

	public static ManualLogSource LogSource;

	private void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Expected O, but got Unknown
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Expected O, but got Unknown
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Expected O, but got Unknown
		Harmony val = new Harmony("com.000diggity000.Unexplodable_missile");
		MethodInfo methodInfo = AccessTools.Method(typeof(Missile), "OnCollide", (Type[])null, (Type[])null);
		MethodInfo methodInfo2 = AccessTools.Method(typeof(Patches), "Awake_Missile_Plug", (Type[])null, (Type[])null);
		val.Patch((MethodBase)methodInfo, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		MethodInfo methodInfo3 = AccessTools.Method(typeof(Missile), "Update", (Type[])null, (Type[])null);
		MethodInfo methodInfo4 = AccessTools.Method(typeof(Patches), "Update_Missile_Plug", (Type[])null, (Type[])null);
		val.Patch((MethodBase)methodInfo3, new HarmonyMethod(methodInfo4), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		MethodInfo methodInfo5 = AccessTools.Method(typeof(Missile), "Awake", (Type[])null, (Type[])null);
		MethodInfo methodInfo6 = AccessTools.Method(typeof(Patches), "Init_Missile_Plug", (Type[])null, (Type[])null);
		val.Patch((MethodBase)methodInfo5, new HarmonyMethod(methodInfo6), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
	}
}