Decompiled source of Death by Flashbang v1.0.1

Death_by_Flashbang.dll

Decompiled 10 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Death_by_Flashbang")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Death_by_Flashbang")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("b3b96457-f41e-4cc4-926a-a41f3cad4264")]
[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 Death_by_Flashbang
{
	[BepInPlugin("Pepeja.Death_by_Flashbang", "Death_by_Flashbang", "1.0.1")]
	public class FlashbangDeathBase : BaseUnityPlugin
	{
		private const string modGUID = "Pepeja.Death_by_Flashbang";

		private const string modName = "Death_by_Flashbang";

		private const string modVersion = "1.0.1";

		private readonly Harmony harmony = new Harmony("Pepeja.Death_by_Flashbang");

		private static FlashbangDeathBase Instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Pepeja.Death_by_Flashbang");
			mls.LogInfo((object)"ambasing");
			harmony.PatchAll();
		}
	}
}
namespace Death_by_Flashbang.Patches
{
	[HarmonyPatch(typeof(StunGrenadeItem), "StunExplosion")]
	internal class StunExplosionPatch
	{
		[HarmonyPrefix]
		public static void Prefix([HarmonyArgument("isHeldItem")] ref bool isHeldItem, [HarmonyArgument("playerHeldBy")] ref PlayerControllerB playerHeldBy)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			if (isHeldItem && (Object)(object)playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController)
			{
				GameNetworkManager.Instance.localPlayerController.DamagePlayer(1000, false, true, (CauseOfDeath)3, 0, false, Vector3.up * 100f);
			}
		}
	}
}