Decompiled source of ExplosiveArrowMinigunThingyThisIsAReallyLongName v1.0.0

ArrowVollE.dll

Decompiled 3 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.Configuration;
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 = "")]
[assembly: AssemblyCompany("ArrowVollE")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ArrowVollE")]
[assembly: AssemblyTitle("ArrowVollE")]
[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 BoplModOG
{
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "ArrowVollE";

		public const string PLUGIN_NAME = "ArrowVollE";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace AntiKick
{
	[BepInPlugin("com.Custos.PlugenName", "PlugenName", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(BowTransform))]
		public class myPatches
		{
			[HarmonyPatch("OldUpdate")]
			[HarmonyPrefix]
			private static bool FuncName_PlugenName_Plug(BowTransform __instance)
			{
				//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_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_003e: 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_0044: 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_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_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_0078: Unknown result type (might be due to invalid IL or missing references)
				//IL_007d: 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_0104: Unknown result type (might be due to invalid IL or missing references)
				//IL_0109: Unknown result type (might be due to invalid IL or missing references)
				//IL_010e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0114: Unknown result type (might be due to invalid IL or missing references)
				//IL_0119: 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_0128: Unknown result type (might be due to invalid IL or missing references)
				//IL_012d: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
				Vec2 val = __instance.player.AimVector();
				if (Vec2.Magnitude(val) > Constants.DEADZONE && !__instance.releasedButton)
				{
					__instance.inputVector = Vec2.Normalized(val);
				}
				if (Vec2.Magnitude(val) > Constants.DEADZONE && !__instance.releasedButton && __instance.player.AbilityButtonIsDown(__instance.playerInfo.AbilityButtonUsedIndex012))
				{
					__instance.inputVector = Vec2.Normalized(val);
					__instance.Fire(__instance.inputVector);
				}
				if (!__instance.player.AbilityButtonIsDown(__instance.playerInfo.AbilityButtonUsedIndex012) && !__instance.hasFired)
				{
					__instance.releasedButton = true;
				}
				if (__instance.releasedButton && !__instance.hasFired && (__instance.loadingFrame > 0 || __instance.animator.getNumberOfPassedSprites() > 2))
				{
					__instance.Fire(__instance.inputVector);
				}
				Debug.DrawRay(Vector2.op_Implicit((Vector2)__instance.CurrentFirePoint()), Vector2.op_Implicit((Vector2)Vec2.Normalized(__instance.inputVector) * 20f));
				return false;
			}

			[HarmonyPatch("Awake")]
			[HarmonyPrefix]
			private static void Func2(BowTransform __instance)
			{
				//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)
				__instance.maxNumberOfArrows = 2000;
				__instance.TimeBeforeArrowsHurtOwner = (Fix)10000000000L;
			}

			[HarmonyPatch("Fire")]
			[HarmonyPrefix]
			private static bool Func3(BowTransform __instance, Vec2 inputVector)
			{
				//IL_001b: 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)
				//IL_0042: 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_004a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0067: Unknown result type (might be due to invalid IL or missing references)
				//IL_006c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0120: Unknown result type (might be due to invalid IL or missing references)
				//IL_0121: Unknown result type (might be due to invalid IL or missing references)
				//IL_012d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0132: Unknown result type (might be due to invalid IL or missing references)
				//IL_0137: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00db: Unknown result type (might be due to invalid IL or missing references)
				if (__instance.isLoading && __instance.loadingSound.timesPlayed == AudioManager.Get().TimesSoundsPlayed(__instance.loadingSound))
				{
					__instance.loadingSound.source.Stop();
				}
				inputVector = Vec2.Normalized(inputVector);
				__instance.Shoot(inputVector);
				AudioManager.Get().Play("arrowShoot");
				__instance.physics.gravity_modifier = Fix.One;
				if (__instance.physics.IsGrounded())
				{
					__instance.animator.beginAnimThenDoAction(__instance.animData.GetAnimation("fireGround"), (Action)__instance.ExitAbility);
					__instance.body.selfImposedVelocity = -__instance.physics.getAttachedGround().currentNormal(__instance.body) * (Fix)(long)__instance.KnockBack;
					__instance.physics.UnGround(false, true);
					return false;
				}
				__instance.animator.beginAnimThenDoAction(__instance.animData.GetAnimation("fireAir"), (Action)__instance.ExitAbility);
				__instance.body.selfImposedVelocity = -inputVector * (Fix)(long)__instance.KnockBack;
				return false;
			}

			[HarmonyPatch("Shoot")]
			[HarmonyPrefix]
			private static bool Func4(BowTransform __instance, Vec2 dir)
			{
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: 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)
				//IL_002a: Unknown result type (might be due to invalid IL or missing references)
				//IL_002f: 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_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_0054: Unknown result type (might be due to invalid IL or missing references)
				//IL_005b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0062: Unknown result type (might be due to invalid IL or missing references)
				//IL_0079: 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_0094: Unknown result type (might be due to invalid IL or missing references)
				//IL_0099: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
				//IL_00af: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
				//IL_0129: Unknown result type (might be due to invalid IL or missing references)
				//IL_012e: Unknown result type (might be due to invalid IL or missing references)
				//IL_011d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0122: Unknown result type (might be due to invalid IL or missing references)
				//IL_0131: Unknown result type (might be due to invalid IL or missing references)
				//IL_0139: Unknown result type (might be due to invalid IL or missing references)
				//IL_013e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0143: Unknown result type (might be due to invalid IL or missing references)
				//IL_0148: Unknown result type (might be due to invalid IL or missing references)
				//IL_014e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0153: Unknown result type (might be due to invalid IL or missing references)
				//IL_0158: Unknown result type (might be due to invalid IL or missing references)
				//IL_0159: Unknown result type (might be due to invalid IL or missing references)
				//IL_0164: Unknown result type (might be due to invalid IL or missing references)
				//IL_0169: Unknown result type (might be due to invalid IL or missing references)
				//IL_016a: Unknown result type (might be due to invalid IL or missing references)
				//IL_016f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0174: Unknown result type (might be due to invalid IL or missing references)
				//IL_0180: Unknown result type (might be due to invalid IL or missing references)
				//IL_0185: Unknown result type (might be due to invalid IL or missing references)
				//IL_0186: Unknown result type (might be due to invalid IL or missing references)
				//IL_018c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0191: Unknown result type (might be due to invalid IL or missing references)
				//IL_0196: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
				Fix val = default(Fix);
				Vec2 val2 = __instance.body.position + __instance.FirepointOffset.x * __instance.body.right + __instance.FirepointOffset.y * __instance.body.up;
				BoplBody val3 = FixTransform.InstantiateFixed<BoplBody>(__instance.Arrow, val2, __instance.body.rotation);
				val3.Scale = __instance.body.fixtrans.Scale;
				Fix val4 = Fix.One + (__instance.body.fixtrans.Scale - Fix.One) / (Fix)2L;
				__instance.Arrows.Add(val3);
				val3.gravityScale = (Fix)0L;
				((Component)val3).GetComponent<IPlayerIdHolder>().SetPlayerId(__instance.playerInfo.playerId);
				((Renderer)((Component)val3).GetComponent<SpriteRenderer>()).material = __instance.playerInfo.playerMaterial;
				val = ((!__instance.player.AbilityButtonIsDown(__instance.playerInfo.AbilityButtonUsedIndex012)) ? ((Fix)1L) : ((Fix)(-2L)));
				val3.StartVelocity = dir * ((Fix)(long)__instance.loadingFrame + Fix.One) * __instance.ArrowSpeed * val4 + __instance.body.selfImposedVelocity * val;
				((Component)val3).GetComponent<Projectile>().DelayedEnableHurtOwner(__instance.TimeBeforeArrowsHurtOwner * val4 / Vec2.Magnitude(val3.StartVelocity));
				val3.rotation = __instance.body.rotation;
				if (!__instance.player.AbilityButtonIsDown(__instance.playerInfo.AbilityButtonUsedIndex012))
				{
					__instance.hasFired = true;
				}
				return false;
			}
		}

		[HarmonyPatch(typeof(Arrow))]
		public class myPatches2
		{
			[HarmonyPatch("OnCollide")]
			[HarmonyPrefix]
			public static bool OnCollide_Patch(ref Arrow __instance, ref FixTransform ___fixTrans, ref DPhysicsCircle ___hitbox, ref CollisionInformation collision)
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_002c: Expected O, but got Unknown
				//IL_0086: Unknown result type (might be due to invalid IL or missing references)
				//IL_009b: Unknown result type (might be due to invalid IL or missing references)
				if (collision.layer != LayerMask.NameToLayer("wall"))
				{
					return true;
				}
				Explosion val = new Explosion();
				Explosion[] array = Resources.FindObjectsOfTypeAll(typeof(Explosion)) as Explosion[];
				Explosion[] array2 = array;
				foreach (Explosion val2 in array2)
				{
					if (((Object)val2).name == "MineExplosion")
					{
						val = val2;
					}
				}
				Explosion val3 = FixTransform.InstantiateFixed<Explosion>(val, ___fixTrans.position);
				((Component)val3).GetComponent<IPhysicsCollider>().Scale = ___hitbox.Scale;
				val3.PlayerOwnerId = ((Component)__instance).gameObject.GetComponent<Projectile>().playerOwnerId;
				AudioManager.Get().Play("explosion");
				return true;
			}

			[HarmonyPatch("Awake")]
			[HarmonyPrefix]
			public static void HarmonyPatch2(Arrow __instance)
			{
			}
		}

		private Fix valuea = new Fix(0);

		private Fix valueb = new Fix(1);

		private static ConfigEntry<double> ConfigMax;

		private void Awake()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			ConfigMax = ((BaseUnityPlugin)this).Config.Bind<double>("General", "General sliders", 1.0, "this times 20 is the amount of repeats for the arrow chain");
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin PlugenName is loaded!");
			Harmony val = new Harmony("com.Custos.PlugenName");
			((BaseUnityPlugin)this).Logger.LogInfo((object)"harmany created");
			val.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"PlugenName Patch Compleate!");
		}
	}
}