Decompiled source of MULTrocket v0.1.0

MULTrocket.dll

Decompiled a day 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 EntityStates;
using EntityStates.Toolbot;
using Microsoft.CodeAnalysis;
using On.EntityStates.Toolbot;
using RoR2;
using RoR2.Projectile;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("MULTrocket")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+bd8e44fcc487e2c8744be82795f911fb79d82fa6")]
[assembly: AssemblyProduct("MULTrocket")]
[assembly: AssemblyTitle("MULTrocket")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 MULTrocket
{
	[BepInPlugin("com.Luc1405.MULTrocket", "MULTrocket", "0.1.0")]
	public sealed class MULTrocketPlugin : BaseUnityPlugin
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_ModifyProjectileInfo <0>__FireGrenadeLauncher_ModifyProjectileInfo;
		}

		public const string PluginName = "MULTrocket";

		public const string PluginAuthor = "Luc1405";

		public const string PluginGUID = "com.Luc1405.MULTrocket";

		public const string PluginVersion = "0.1.0";

		private const float ExtraRocketYawAngle = 15f;

		private void Awake()
		{
			//IL_0010: 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_001b: Expected O, but got Unknown
			object obj = <>O.<0>__FireGrenadeLauncher_ModifyProjectileInfo;
			if (obj == null)
			{
				hook_ModifyProjectileInfo val = FireGrenadeLauncher_ModifyProjectileInfo;
				<>O.<0>__FireGrenadeLauncher_ModifyProjectileInfo = val;
				obj = (object)val;
			}
			FireGrenadeLauncher.ModifyProjectileInfo += (hook_ModifyProjectileInfo)obj;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"MULTrocket 0.1.0 loaded");
		}

		private void OnDestroy()
		{
			//IL_0010: 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_001b: Expected O, but got Unknown
			object obj = <>O.<0>__FireGrenadeLauncher_ModifyProjectileInfo;
			if (obj == null)
			{
				hook_ModifyProjectileInfo val = FireGrenadeLauncher_ModifyProjectileInfo;
				<>O.<0>__FireGrenadeLauncher_ModifyProjectileInfo = val;
				obj = (object)val;
			}
			FireGrenadeLauncher.ModifyProjectileInfo -= (hook_ModifyProjectileInfo)obj;
		}

		private static void FireGrenadeLauncher_ModifyProjectileInfo(orig_ModifyProjectileInfo orig, FireGrenadeLauncher self, ref FireProjectileInfo fireProjectileInfo)
		{
			//IL_0071: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: 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_009b: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, ref fireProjectileInfo);
			Inventory val = (Object.op_Implicit((Object)(object)((EntityState)self).characterBody) ? ((EntityState)self).characterBody.inventory : null);
			int num = (Object.op_Implicit((Object)(object)val) ? val.GetItemCountEffective(Items.MoreMissile) : 0);
			if (num > 0)
			{
				fireProjectileInfo.damage *= MissileUtils.GetMoreMissileDamageMultiplier(num);
				float[] array = new float[2] { 15f, -15f };
				foreach (float num2 in array)
				{
					FireProjectileInfo val2 = fireProjectileInfo;
					val2.rotation = Quaternion.AngleAxis(num2, Vector3.up) * fireProjectileInfo.rotation;
					ProjectileManager.instance.FireProjectile(val2);
				}
			}
		}
	}
}