Decompiled source of Sharkis Hard Core mod v2.0.0

Mods/SharkisHardCoreMod.dll

Decompiled 4 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BoneLib;
using BoneLib.BoneMenu;
using BoneLib.Notifications;
using HarmonyLib;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppSLZ.Bonelab;
using Il2CppSLZ.Marrow;
using Il2CppSLZ.Marrow.Data;
using MelonLoader;
using MelonLoader.Preferences;
using SharkisHardCoreMod;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Bonemenumain), "SharkisHardCoreMod", "2.0.0", "CooladTheGreat", null)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: AssemblyTitle("Sharkis Hard Core Mod")]
[assembly: AssemblyDescription("Make your life hard.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("SharkiCorp")]
[assembly: AssemblyProduct("SharkisHardCoreMod")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("0c09c087-de1d-4c18-bec8-1e7429c02787")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace SharkisHardCoreMod;

public class Bonemenumain : MelonMod
{
	public override void OnInitializeMelon()
	{
		Save();
		bonemenustarter();
	}

	public void currentstats()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: 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_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Expected O, but got Unknown
		Notifier.Send(new Notification
		{
			Title = NotificationText.op_Implicit("Sharki's Hard code mod."),
			Message = NotificationText.op_Implicit((Domoredamage.domoredamage ? "Damage:True" : "Damage:False") + (Noreloading.dieonreload ? "Noreload:True" : "Noreload:False") + (Removeammoondeath.loseallammo ? "Loseall:True" : "Loseall:False") + (Removetweiceasmuchammo.removetwice ? "Removetwice:True" : "Removetwice:False")),
			Type = (NotificationType)0,
			ShowTitleOnPopup = true,
			PopupLength = 3f
		});
	}

	public void Save()
	{
		Domoredamage.Save();
		Noreloading.Save();
		Removeammoondeath.Save();
		Removetweiceasmuchammo.Save();
		Removeammoondamage.Save();
		Instantdeath.Save();
		Halfammoonpickup.Save();
		Ragdollondamage.Save();
	}

	public void bonemenustarter()
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		Page menu = Page.Root.CreatePage("Sharki's Hard Core Mod", Color.red, 0, true);
		Domoredamage domoredamage = new Domoredamage();
		domoredamage.domoredamagemneu(menu);
		Removeammoondeath removeammoondeath = new Removeammoondeath();
		removeammoondeath.Loseallammomenu(menu);
		Noreloading noreloading = new Noreloading();
		noreloading.Noreloadingmenu(menu);
		Removetweiceasmuchammo removetweiceasmuchammo = new Removetweiceasmuchammo();
		removetweiceasmuchammo.twicedeductionmenu(menu);
		Removeammoondamage removeammoondamage = new Removeammoondamage();
		removeammoondamage.RemoveonDamage(menu);
		Instantdeath instantdeath = new Instantdeath();
		instantdeath.InstantDeath(menu);
		Halfammoonpickup halfammoonpickup = new Halfammoonpickup();
		halfammoonpickup.halfammomenu(menu);
		Ragdollondamage ragdollondamage = new Ragdollondamage();
		ragdollondamage.Ragdollondamagemenu(menu);
	}
}
[HarmonyPatch]
internal class Domoredamage
{
	[HarmonyPatch(typeof(Player_Health), "TAKEDAMAGE")]
	public static class damage
	{
		[HarmonyPrefix]
		public static void Prefix(ref float damage)
		{
			if (domoredamage)
			{
				damage *= Multiplire;
			}
		}
	}

	public static int Multiplire = 2;

	private static bool _preferencesSetup;

	public static bool domoredamage;

	public static MelonPreferences_Category MelonPrefCategory { get; private set; }

	public static MelonPreferences_Entry<bool> MelonPrefEnabled { get; private set; }

	public static void Save()
	{
		MelonPrefCategory = MelonPreferences.CreateCategory("Do more damage");
		MelonPrefEnabled = MelonPrefCategory.CreateEntry<bool>("Enabled", false, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
		domoredamage = MelonPrefEnabled.Value;
		_preferencesSetup = true;
	}

	public void domoredamagemneu(Page menu)
	{
		//IL_0007: 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)
		Page val = menu.CreatePage("Do more Damage", Color.blue, 0, true);
		val.CreateBool("Enabled", Color.red, domoredamage, (Action<bool>)Toggled);
	}

	public static void Toggled(bool value)
	{
		domoredamage = value;
		MelonPrefEnabled.Value = value;
		MelonPrefCategory.SaveToFile(true);
		notif();
	}

	public static void notif()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: 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_0034: 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_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Expected O, but got Unknown
		Notifier.Send(new Notification
		{
			Title = NotificationText.op_Implicit("Do More Damage"),
			Message = NotificationText.op_Implicit(domoredamage ? "Enabled!" : "Disabled"),
			Type = (NotificationType)(domoredamage ? 1 : 3),
			ShowTitleOnPopup = true,
			PopupLength = 1f
		});
	}
}
[HarmonyPatch]
internal class Halfammoonpickup
{
	[HarmonyPatch(typeof(AmmoPickup), "OnTriggerEnter")]
	public static class ammopicked
	{
		[HarmonyPrefix]
		public static void Prefix(AmmoPickup __instance, out int __state)
		{
			AmmoInventory instance = AmmoInventory.Instance;
			int ammoCount = __instance.ammoCount;
			AmmoGroup ammoGroup = __instance.ammoGroup;
			int num = __instance.ammoCount / 2;
			__state = __instance.ammoCount;
			if (halfammo)
			{
				__instance.ammoCount /= 2;
			}
		}

		[HarmonyPostfix]
		public static void Postfix(AmmoPickup __instance, int __state)
		{
			__instance.ammoCount = __state;
		}
	}

	private static bool _preferencesSetup;

	public static bool halfammo;

	public static MelonPreferences_Category MelonPrefCategory { get; private set; }

	public static MelonPreferences_Entry<bool> MelonPrefEnabled { get; private set; }

	public static void Save()
	{
		MelonPrefCategory = MelonPreferences.CreateCategory("Half ammo");
		MelonPrefEnabled = MelonPrefCategory.CreateEntry<bool>("Enabled", false, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
		halfammo = MelonPrefEnabled.Value;
		_preferencesSetup = true;
	}

	public void halfammomenu(Page menu)
	{
		//IL_0007: 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)
		Page val = menu.CreatePage("Half ammo picked up", Color.blue, 0, true);
		val.CreateBool("Enabled", Color.red, halfammo, (Action<bool>)Toggled);
	}

	private static void Toggled(bool value)
	{
		halfammo = value;
		MelonPrefEnabled.Value = value;
		MelonPrefCategory.SaveToFile(true);
		notif();
	}

	public static void notif()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: 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_0034: 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_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Expected O, but got Unknown
		Notifier.Send(new Notification
		{
			Title = NotificationText.op_Implicit("Half ammo picked up."),
			Message = NotificationText.op_Implicit(halfammo ? "Enabled!" : "Disabled"),
			Type = (NotificationType)(halfammo ? 1 : 3),
			ShowTitleOnPopup = true,
			PopupLength = 1f
		});
	}
}
internal class Instantdeath
{
	private static bool _preferencesSetup;

	public static bool insteantdeath;

	public static MelonPreferences_Category MelonPrefCategory { get; private set; }

	public static MelonPreferences_Entry<bool> MelonPrefEnabled { get; private set; }

	public static void Save()
	{
		MelonPrefCategory = MelonPreferences.CreateCategory("Instant death.");
		MelonPrefEnabled = MelonPrefCategory.CreateEntry<bool>("Enabled", false, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
		insteantdeath = MelonPrefEnabled.Value;
		_preferencesSetup = true;
	}

	public void InstantDeath(Page menu)
	{
		//IL_0007: 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)
		Page val = menu.CreatePage("Instant death.", Color.blue, 0, true);
		val.CreateBool("Enabled", Color.red, insteantdeath, (Action<bool>)Toggled);
	}

	private static void Toggled(bool value)
	{
		insteantdeath = value;
		MelonPrefEnabled.Value = value;
		MelonPrefCategory.SaveToFile(true);
		checkinsta();
		notif();
	}

	public static void notif()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: 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_0034: 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_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Expected O, but got Unknown
		Notifier.Send(new Notification
		{
			Title = NotificationText.op_Implicit("Instant Death:"),
			Message = NotificationText.op_Implicit(insteantdeath ? "Enabled!" : "Disabled"),
			Type = (NotificationType)(insteantdeath ? 1 : 3),
			ShowTitleOnPopup = true,
			PopupLength = 1f
		});
	}

	public static void checkinsta()
	{
		Player_Health p = Noreloading.p;
		if (insteantdeath)
		{
			p.deathTimeAmount = 0f;
		}
		else
		{
			p.deathTimeAmount = 5f;
		}
	}
}
[HarmonyPatch]
internal class Noreloading
{
	[HarmonyPatch(typeof(Magazine), "OnEject")]
	public static class youdidnotjustdothat
	{
		[HarmonyPostfix]
		public static void Postfix()
		{
			if (dieonreload)
			{
				p.ApplyKillDamage();
			}
		}
	}

	private static bool _preferencesSetup;

	public static bool dieonreload;

	public static MelonPreferences_Category MelonPrefCategory { get; private set; }

	public static MelonPreferences_Entry<bool> MelonPrefEnabled { get; private set; }

	public static Player_Health p
	{
		get
		{
			if (Object.op_Implicit((Object)(object)((Il2CppObjectBase)Player.RigManager.health).TryCast<Player_Health>()))
			{
				return ((Il2CppObjectBase)Player.RigManager.health).TryCast<Player_Health>();
			}
			return null;
		}
	}

	public static void Save()
	{
		MelonPrefCategory = MelonPreferences.CreateCategory("No reloading");
		MelonPrefEnabled = MelonPrefCategory.CreateEntry<bool>("Enabled", false, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
		dieonreload = MelonPrefEnabled.Value;
		_preferencesSetup = true;
	}

	public void Noreloadingmenu(Page menu)
	{
		//IL_0007: 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)
		Page val = menu.CreatePage("Reload = death", Color.blue, 0, true);
		val.CreateBool("Enabled", Color.red, dieonreload, (Action<bool>)Toggled);
	}

	public static void Toggled(bool value)
	{
		dieonreload = value;
		MelonPrefEnabled.Value = value;
		MelonPrefCategory.SaveToFile(true);
		notif();
	}

	public static void notif()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: 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_0034: 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_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Expected O, but got Unknown
		Notifier.Send(new Notification
		{
			Title = NotificationText.op_Implicit("Die on reload"),
			Message = NotificationText.op_Implicit(dieonreload ? "Enabled!" : "Disabled"),
			Type = (NotificationType)(dieonreload ? 1 : 3),
			ShowTitleOnPopup = true,
			PopupLength = 1f
		});
	}
}
internal class Ragdollondamage
{
	[HarmonyPatch(typeof(Player_Health), "TAKEDAMAGE")]
	public static class ragdoll
	{
		[CompilerGenerated]
		private sealed class <ragdolldetection>d__3 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			private RigManager <rig>5__1;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <ragdolldetection>d__3(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<rig>5__1 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0047: Unknown result type (might be due to invalid IL or missing references)
				//IL_0051: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					if (Ragdoll)
					{
						<rig>5__1 = Player.RigManager;
						Startragdoll(<rig>5__1);
						<>2__current = (object)new WaitForSeconds(5f);
						<>1__state = 1;
						return true;
					}
					break;
				case 1:
					<>1__state = -1;
					endragdoll(<rig>5__1);
					isactive = false;
					coroutineToken = null;
					<rig>5__1 = null;
					break;
				}
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public static bool isactive;

		private static object coroutineToken;

		[HarmonyPostfix]
		public static void postfix()
		{
			if (!Ragdoll || isactive)
			{
				return;
			}
			Random random = new Random();
			if (random.Next(1, 10) == 1)
			{
				if (coroutineToken != null)
				{
					MelonCoroutines.Stop((object)ragdolldetection());
				}
				isactive = true;
				coroutineToken = MelonCoroutines.Start(ragdolldetection());
			}
		}

		[IteratorStateMachine(typeof(<ragdolldetection>d__3))]
		private static IEnumerator ragdolldetection()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <ragdolldetection>d__3(0);
		}
	}

	private static bool _preferencesSetup;

	public static bool Ragdoll;

	public static MelonPreferences_Category MelonPrefCategory { get; private set; }

	public static MelonPreferences_Entry<bool> MelonPrefEnabled { get; private set; }

	public static void Save()
	{
		MelonPrefCategory = MelonPreferences.CreateCategory("Ragdoll on damage");
		MelonPrefEnabled = MelonPrefCategory.CreateEntry<bool>("Enabled", false, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
		Ragdoll = MelonPrefEnabled.Value;
		_preferencesSetup = true;
	}

	public void Ragdollondamagemenu(Page menu)
	{
		//IL_0007: 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)
		Page val = menu.CreatePage("Ragdoll on damahe", Color.blue, 0, true);
		val.CreateBool("Enabled", Color.red, Ragdoll, (Action<bool>)Toggled);
	}

	private static void Toggled(bool value)
	{
		Ragdoll = value;
		MelonPrefEnabled.Value = value;
		MelonPrefCategory.SaveToFile(true);
		notif();
	}

	public static void notif()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: 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_0034: 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_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Expected O, but got Unknown
		Notifier.Send(new Notification
		{
			Title = NotificationText.op_Implicit("Half ammo picked up."),
			Message = NotificationText.op_Implicit(Ragdoll ? "Enabled!" : "Disabled"),
			Type = (NotificationType)(Ragdoll ? 1 : 3),
			ShowTitleOnPopup = true,
			PopupLength = 1f
		});
	}

	public static void Startragdoll(RigManager rig)
	{
		PhysicsRig physicsRig = rig.physicsRig;
		physicsRig.RagdollRig();
		physicsRig.ShutdownRig();
		physicsRig.leftHand.DetachObject();
		physicsRig.rightHand.DetachObject();
	}

	public static void endragdoll(RigManager rig)
	{
		PhysicsRig physicsRig = rig.physicsRig;
		physicsRig.UnRagdollRig();
		physicsRig.TurnOnRig();
	}
}
[HarmonyPatch]
internal class Removeammoondamage
{
	[HarmonyPatch(typeof(Player_Health), "TAKEDAMAGE")]
	public static class removesomeondamage
	{
		[HarmonyPostfix]
		public static void Postfix(ref float damage)
		{
			if (removeondamage)
			{
				AmmoInventory instance = AmmoInventory.Instance;
				int cartridgeCount = instance.GetCartridgeCount("heavy");
				int cartridgeCount2 = instance.GetCartridgeCount("light");
				int cartridgeCount3 = instance.GetCartridgeCount("medium");
				int val = (int)Math.Round(damage);
				instance.AddCartridge(instance.heavyAmmoGroup, -Math.Min(cartridgeCount, val));
				instance.AddCartridge(instance.lightAmmoGroup, -Math.Min(cartridgeCount2, val));
				instance.AddCartridge(instance.mediumAmmoGroup, -Math.Min(cartridgeCount3, val));
			}
		}
	}

	private static bool _preferencesSetup;

	public static bool removeondamage;

	public static MelonPreferences_Category MelonPrefCategory { get; private set; }

	public static MelonPreferences_Entry<bool> MelonPrefEnabled { get; private set; }

	public static void Save()
	{
		MelonPrefCategory = MelonPreferences.CreateCategory("Lose ammo on damage.");
		MelonPrefEnabled = MelonPrefCategory.CreateEntry<bool>("Enabled", false, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
		removeondamage = MelonPrefEnabled.Value;
		_preferencesSetup = true;
	}

	public void RemoveonDamage(Page menu)
	{
		//IL_0007: 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)
		Page val = menu.CreatePage("Lose ammo on damage.", Color.blue, 0, true);
		val.CreateBool("Enabled", Color.red, removeondamage, (Action<bool>)Toggled);
	}

	public static void Toggled(bool value)
	{
		removeondamage = value;
		MelonPrefEnabled.Value = value;
		MelonPrefCategory.SaveToFile(true);
		notif();
	}

	public static void notif()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: 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_0034: 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_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Expected O, but got Unknown
		Notifier.Send(new Notification
		{
			Title = NotificationText.op_Implicit("Lose some ammo on damage."),
			Message = NotificationText.op_Implicit(removeondamage ? "Enabled!" : "Disabled"),
			Type = (NotificationType)(removeondamage ? 1 : 3),
			ShowTitleOnPopup = true,
			PopupLength = 1f
		});
	}
}
[HarmonyPatch]
internal class Removeammoondeath
{
	[HarmonyPatch(typeof(Player_Health), "MakeVignette")]
	public static class onloaded
	{
		[HarmonyPostfix]
		public static void Postfix()
		{
			if (loseallammo)
			{
				AmmoInventory instance = AmmoInventory.Instance;
				if (loseallammo)
				{
					instance.ClearAmmo();
				}
			}
			Instantdeath.checkinsta();
		}
	}

	[HarmonyPatch(typeof(Player_Health), "Death")]
	public static class ondeath
	{
		[HarmonyPostfix]
		public static void Postfix()
		{
			if (loseallammo)
			{
				AmmoInventory instance = AmmoInventory.Instance;
				if (loseallammo)
				{
					instance.ClearAmmo();
				}
			}
		}
	}

	private static bool _preferencesSetup;

	public static bool loseallammo;

	public static MelonPreferences_Category MelonPrefCategory { get; private set; }

	public static MelonPreferences_Entry<bool> MelonPrefEnabled { get; private set; }

	public static void Save()
	{
		MelonPrefCategory = MelonPreferences.CreateCategory("Lose all ammo on death.");
		MelonPrefEnabled = MelonPrefCategory.CreateEntry<bool>("Enabled", false, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
		loseallammo = MelonPrefEnabled.Value;
		_preferencesSetup = true;
	}

	public void Loseallammomenu(Page menu)
	{
		//IL_0007: 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)
		Page val = menu.CreatePage("Lose all ammo on death.", Color.blue, 0, true);
		val.CreateBool("Enabled", Color.red, loseallammo, (Action<bool>)Toggled);
	}

	public static void Toggled(bool value)
	{
		loseallammo = value;
		MelonPrefEnabled.Value = value;
		MelonPrefCategory.SaveToFile(true);
		notif();
	}

	public static void notif()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: 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_0034: 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_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Expected O, but got Unknown
		Notifier.Send(new Notification
		{
			Title = NotificationText.op_Implicit("Lose all ammo on death"),
			Message = NotificationText.op_Implicit(loseallammo ? "Enabled!" : "Disabled"),
			Type = (NotificationType)(loseallammo ? 1 : 3),
			ShowTitleOnPopup = true,
			PopupLength = 1f
		});
	}
}
[HarmonyPatch]
internal class Removetweiceasmuchammo
{
	[HarmonyPatch(typeof(AmmoInventory), "RemoveCartridge")]
	public static class ohno
	{
		[HarmonyPrefix]
		public static void Prefix(AmmoInventory __instance, int count, CartridgeData cartridge)
		{
			if (removetwice)
			{
				__instance.AddCartridge(cartridge, -count);
			}
		}
	}

	private static bool _preferencesSetup;

	public static bool removetwice;

	public static MelonPreferences_Category MelonPrefCategory { get; private set; }

	public static MelonPreferences_Entry<bool> MelonPrefEnabled { get; private set; }

	public static void Save()
	{
		MelonPrefCategory = MelonPreferences.CreateCategory("Remove twice as much ammo");
		MelonPrefEnabled = MelonPrefCategory.CreateEntry<bool>("Enabled", false, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
		removetwice = MelonPrefEnabled.Value;
		_preferencesSetup = true;
	}

	public void twicedeductionmenu(Page menu)
	{
		//IL_0007: 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)
		Page val = menu.CreatePage("Remove twice as much ammo.", Color.blue, 0, true);
		val.CreateBool("Enabled", Color.red, removetwice, (Action<bool>)Toggled);
	}

	public static void Toggled(bool value)
	{
		removetwice = value;
		MelonPrefEnabled.Value = value;
		MelonPrefCategory.SaveToFile(true);
		notif();
	}

	public static void notif()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: 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_0034: 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_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Expected O, but got Unknown
		Notifier.Send(new Notification
		{
			Title = NotificationText.op_Implicit("Remove twice as much ammo"),
			Message = NotificationText.op_Implicit(removetwice ? "Enabled!" : "Disabled"),
			Type = (NotificationType)(removetwice ? 1 : 3),
			ShowTitleOnPopup = true,
			PopupLength = 1f
		});
	}
}