Decompiled source of HelldiversPack v1.1.1

BepInEx/plugins/GuydoomedEternaly-HelldiversPack/GuydoomedEternaly.HelldiversPack.dll

Decompiled 2 weeks ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using LethalLib.Modules;
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(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("GuydoomedEternaly.HelldiversPack")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("HelldiversPack")]
[assembly: AssemblyTitle("GuydoomedEternaly.HelldiversPack")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
public class Energytoelectricity : MonoBehaviour
{
	public ShotgunItem shotgu;

	public float shots = 43f;

	private void Update()
	{
		if (shotgu.shellsLoaded < 1 && ((GrabbableObject)shotgu).insertedBattery.charge > 0f)
		{
			shotgu.shellsLoaded = 1;
			Battery insertedBattery = ((GrabbableObject)shotgu).insertedBattery;
			insertedBattery.charge -= 0.1f;
		}
	}
}
public class Infiniteammoglitch : MonoBehaviour
{
	public ShotgunItem shotgu;

	public float shots = 43f;

	private void Update()
	{
		if (shotgu.shellsLoaded < 2 && shots > 0f)
		{
			shotgu.shellsLoaded = 2;
			shots -= 1f;
		}
		else if (shotgu.isReloading)
		{
			shots = 43f;
		}
		if (((GrabbableObject)shotgu).playerHeldBy.isHoldingInteract && ((GrabbableObject)shotgu).currentUseCooldown <= 0f && shots > 0f && !((GrabbableObject)shotgu).isPocketed)
		{
			((GrabbableObject)shotgu).currentUseCooldown = ((GrabbableObject)shotgu).useCooldown;
			shotgu.ShootGunAndSync(true);
		}
	}
}
namespace HelldiversPack
{
	[BepInPlugin("GuydoomedEternaly.HelldiversPack", "HelldiversPack", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		public static AssetBundle helldiversliberator;

		public static Plugin Instance;

		internal static ManualLogSource Logger;

		internal static Harmony? Harmony { get; set; }

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			Instance = this;
			string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			helldiversliberator = AssetBundle.LoadFromFile(Path.Combine(directoryName, "helldiversliberator"));
			if (!((Object)(object)helldiversliberator == (Object)null))
			{
				int num = 30;
				Item val = helldiversliberator.LoadAsset<Item>("Assets/LiberatorItem.asset");
				Infiniteammoglitch infiniteammoglitch = val.spawnPrefab.AddComponent<Infiniteammoglitch>();
				infiniteammoglitch.shotgu = val.spawnPrefab.GetComponent<ShotgunItem>();
				NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab);
				Items.RegisterScrap(val, num, (LevelTypes)(-1));
				int num2 = 100;
				TerminalNode val2 = helldiversliberator.LoadAsset<TerminalNode>("Assets/Node1.asset");
				Items.RegisterShopItem(val, (TerminalNode)null, (TerminalNode)null, val2, num2);
				num = 30;
				Item val3 = helldiversliberator.LoadAsset<Item>("Assets/ScorcherItem.asset");
				Energytoelectricity energytoelectricity = val3.spawnPrefab.AddComponent<Energytoelectricity>();
				energytoelectricity.shotgu = val3.spawnPrefab.GetComponent<ShotgunItem>();
				NetworkPrefabs.RegisterNetworkPrefab(val3.spawnPrefab);
				Items.RegisterScrap(val3, num, (LevelTypes)(-1));
				Item val4 = helldiversliberator.LoadAsset<Item>("Assets/FlamethrowerItem.asset");
				Infiniteammoglitch infiniteammoglitch2 = val4.spawnPrefab.AddComponent<Infiniteammoglitch>();
				infiniteammoglitch2.shotgu = val4.spawnPrefab.GetComponent<ShotgunItem>();
				NetworkPrefabs.RegisterNetworkPrefab(val4.spawnPrefab);
				Items.RegisterScrap(val4, num, (LevelTypes)(-1));
				Logger.LogInfo((object)"GuydoomedEternaly.HelldiversPack v1.0.0 has loaded!");
			}
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "GuydoomedEternaly.HelldiversPack";

		public const string PLUGIN_NAME = "HelldiversPack";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}