Decompiled source of FrictionlessArrows v1.0.1

FrictionlessArrows.dll

Decompiled 6 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 BoplFixedMath;
using HarmonyLib;
using Microsoft.CodeAnalysis;
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(".NETFramework,Version=v4.6", FrameworkDisplayName = ".NET Framework 4.6")]
[assembly: AssemblyCompany("FrictonlessArrows")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("FrictonlessArrows")]
[assembly: AssemblyTitle("FrictonlessArrows")]
[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 MyFirstBoplPlugin
{
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "FrictonlessArrows";

		public const string PLUGIN_NAME = "FrictonlessArrows";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace FrictonlessArrows
{
	[BepInPlugin("com.Melon.FrictonlessArrows", "FrictonlessArrows", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		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_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			Harmony val = new Harmony("com.Melon.FrictonlessArrows");
			MethodInfo methodInfo = AccessTools.Method(typeof(BowTransform), "Shoot", (Type[])null, (Type[])null);
			MethodInfo methodInfo2 = AccessTools.Method(typeof(myPatches), "Shoot_bowtrans_myplug", (Type[])null, (Type[])null);
			val.Patch((MethodBase)methodInfo, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			methodInfo = AccessTools.Method(typeof(BowTransform), "Awake", (Type[])null, (Type[])null);
			methodInfo2 = AccessTools.Method(typeof(myPatches), "Awake_bowtrans_myplug", (Type[])null, (Type[])null);
			val.Patch((MethodBase)methodInfo, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}
	}
	public class myPatches
	{
		public static bool Shoot_bowtrans_myplug(Vec2 dir, BowTransform __instance, ref Fix ___ArrowSpeed, ref PlayerBody ___body, ref RingBuffer<BoplBody> ___Arrows, ref BoplBody ___Arrow, ref bool ___hasFired, ref Vec2 ___FirepointOffset, ref Fix ___TimeBeforeArrowsHurtOwner, ref int ___loadingFrame, ref PlayerInfo ___playerInfo, ref int ___maxNumberOfArrows)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: 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_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: 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_003c: 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_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			Vec2 val = ___body.position + ___FirepointOffset.x * ___body.right + ___FirepointOffset.y * ___body.up;
			BoplBody val2 = FixTransform.InstantiateFixed<BoplBody>(___Arrow, val, ___body.rotation);
			val2.gravityScale = (Fix)0L;
			val2.Scale = ___body.fixtrans.Scale;
			___Arrows.Add(val2);
			((Component)val2).GetComponent<IPlayerIdHolder>().SetPlayerId(___playerInfo.playerId);
			((Renderer)((Component)val2).GetComponent<SpriteRenderer>()).material = ___playerInfo.playerMaterial;
			___ArrowSpeed = (Fix)30L;
			val2.StartVelocity = dir * ___ArrowSpeed + ___body.selfImposedVelocity;
			((Component)val2).GetComponent<Projectile>().DelayedEnableHurtOwner(___TimeBeforeArrowsHurtOwner);
			___hasFired = true;
			return false;
		}

		public static bool Awake_bowtrans_myplug(BowTransform __instance, ref int ___maxNumberOfArrows)
		{
			___maxNumberOfArrows = 5000;
			return true;
		}
	}
}