Decompiled source of InstantGust v1.0.0

InstantGust.DLL

Decompiled 8 months 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 BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = ".NET Framework 4.6")]
[assembly: AssemblyCompany("InstantGust")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Cast gust with lightning speed for the ultimate clutch!")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("InstantGust")]
[assembly: AssemblyTitle("InstantGust")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace InstantGust
{
	[BepInPlugin("me.antimality.InstantGust", "InstantGust", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Log;

		private static Harmony harmony;

		private void Awake()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			Log.LogInfo((object)"Plugin InstantGust is loaded!");
			harmony = new Harmony("me.antimality.InstantGust");
			harmony.PatchAll(typeof(Patch));
		}

		private void OnDestroy()
		{
			harmony.UnpatchSelf();
		}
	}
	[HarmonyPatch]
	public class Patch
	{
		[HarmonyPatch(typeof(QuickSpell), "OnEnterAbility")]
		[HarmonyPrefix]
		public static bool DontWaitForAnim(ref Player ___player, ref PlayerInfo ___playerInfo, ref SpriteAnimator ___animator, ref SpriteRenderer ___spriteRen, ref PlayerPhysics ___physics, ref DPhysicsCircle ___smallCollider, ref PlayerBody ___body, ref Vec2 ___EnterAbilityOffset, ref QuickSpell __instance, ref Ability ___ability, ref AnimationData ___animData, ref string ___AudioToPlayOnEnter)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			___playerInfo = ___ability.GetPlayerInfo();
			___player = PlayerHandler.Get().GetPlayer(___playerInfo.playerId);
			((Renderer)___spriteRen).material = ___playerInfo.playerMaterial;
			___physics.SyncPhysicsTo(___playerInfo);
			___smallCollider.UpdatePhysicsPositions();
			___body.position = ___playerInfo.position + ___EnterAbilityOffset;
			((Component)__instance).transform.position = (Vector3)___body.position;
			___physics.UnGround(true, true);
			___body.selfImposedVelocity = Vec2.zero;
			___body.externalVelocity = Vec2.zero;
			if (!string.IsNullOrEmpty(___AudioToPlayOnEnter))
			{
				AudioManager.Get().Play(___AudioToPlayOnEnter);
			}
			___animator.beginAnimation(___animData.GetAnimation("castAir"));
			typeof(QuickSpell).GetMethod("Cast", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(__instance, Array.Empty<object>());
			return false;
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "InstantGust";

		public const string PLUGIN_NAME = "InstantGust";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}