Decompiled source of InfusedTurrets v1.0.0

InfusedTurrets.dll

Decompiled 8 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using Microsoft.CodeAnalysis;
using On.RoR2;
using R2API.Utils;
using RoR2;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("Chinchi")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Engineer Turrets inherit Infusion HP bonus.")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("InfusedTurrets")]
[assembly: AssemblyTitle("InfusedTurrets")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/schinchi/InfusedTurrets")]
[assembly: AssemblyVersion("1.0.0.0")]
[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 InfusedTurrets
{
	[BepInPlugin("Chinchi.InfusedTurrets", "InfusedTurrets", "1.0.0")]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	public class InfusedTurrets : BaseUnityPlugin
	{
		public const string PluginGUID = "Chinchi.InfusedTurrets";

		public const string PluginAuthor = "Chinchi";

		public const string PluginName = "InfusedTurrets";

		public const string PluginVersion = "1.0.0";

		private void OnEnable()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			CharacterMaster.AddDeployable += new hook_AddDeployable(InheritInfusion);
		}

		private void OnDisable()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			CharacterMaster.AddDeployable -= new hook_AddDeployable(InheritInfusion);
		}

		private void InheritInfusion(orig_AddDeployable orig, CharacterMaster self, Deployable deployable, DeployableSlot slot)
		{
			//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_000d: Invalid comparison between Unknown and I4
			orig.Invoke(self, deployable, slot);
			if ((int)slot == 1)
			{
				CharacterMaster component = ((Component)deployable).GetComponent<CharacterMaster>();
				if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory) && Object.op_Implicit((Object)(object)self.inventory))
				{
					component.inventory.AddInfusionBonus(self.inventory.infusionBonus);
				}
			}
		}
	}
}