Decompiled source of ArrowWall v1.0.0

arrowWall.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 BoplFixedMath;
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("arrowWall")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("arrowWall")]
[assembly: AssemblyTitle("arrowWall")]
[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 arrowWall
{
	[BepInPlugin("com.WackyModer.arrowWall", "Arrow Wall", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private void Awake()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Expected O, but got Unknown
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Expected O, but got Unknown
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin arrowWall is loaded!");
			Harmony val = new Harmony("com.WackyModer.arrowWall");
			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_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: 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_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: 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_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: 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)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i <= 39; i++)
			{
				int num = 20 - i;
				Vec2 val = ___body.position + (___FirepointOffset.x + (Fix)(long)num) * ___body.right + ___FirepointOffset.y * ___body.up;
				BoplBody val2 = FixTransform.InstantiateFixed<BoplBody>(___Arrow, val, ___body.rotation);
				val2.gravityScale = (Fix)0L;
				val2.Scale = ___body.fixtrans.Scale;
				Fix val3 = Fix.One + (___body.fixtrans.Scale - Fix.One) / (Fix)2L;
				___Arrows.Add(val2);
				((Component)val2).GetComponent<IPlayerIdHolder>().SetPlayerId(___playerInfo.playerId);
				((Renderer)((Component)val2).GetComponent<SpriteRenderer>()).material = ___playerInfo.playerMaterial;
				val2.StartVelocity = dir * ((Fix)4L + Fix.One) * ___ArrowSpeed * val3 + ___body.selfImposedVelocity;
				((Component)val2).GetComponent<Projectile>().DelayedEnableHurtOwner(___TimeBeforeArrowsHurtOwner * val3 / Vec2.Magnitude(val2.StartVelocity));
				val2.rotation = ___body.rotation;
				___hasFired = true;
			}
			return false;
		}

		public static bool Awake_bowtrans_myplug(BowTransform __instance, ref int ___maxNumberOfArrows)
		{
			___maxNumberOfArrows = 5000;
			return true;
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "arrowWall";

		public const string PLUGIN_NAME = "arrowWall";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}