Decompiled source of GlobblerFriendlyFireFix v1.0.0

BepInEx/plugins/GlobblerFriendlyFireFix.dll

Decompiled 10 months ago
using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AK.Wwise;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Pigeon.Movement;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyCompany("GlobblerFriendlyFireFix")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.0.0.0")]
[assembly: AssemblyInformationalVersion("0.0.0-alpha.0.2+a95cbc1316875a2ccbed34c141514c3448b09065")]
[assembly: AssemblyProduct("GlobblerFriendlyFireFix")]
[assembly: AssemblyTitle("GlobblerFriendlyFireFix")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[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;
		}
	}
}
[BepInPlugin("sparroh.globblerfriendlyfirefix", "GlobblerFriendlyFireFix", "1.0.0")]
[MycoMod(/*Could not decode attribute arguments.*/)]
public class SparrohPlugin : BaseUnityPlugin
{
	public const string PluginGUID = "sparroh.globblerfriendlyfirefix";

	public const string PluginName = "GlobblerFriendlyFireFix";

	public const string PluginVersion = "1.0.0";

	internal static ManualLogSource Logger;

	private void Awake()
	{
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		Logger = ((BaseUnityPlugin)this).Logger;
		new Harmony("sparroh.globblerfriendlyfirefix").PatchAll();
		Logger.LogInfo((object)"GlobblerFriendlyFireFix loaded successfully.");
	}
}
[HarmonyPatch(typeof(GlobblerBullet), "Detonate")]
public static class GlobblerBullet_Detonate_Patch
{
	public static bool Prefix(GlobblerBullet __instance)
	{
		//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_00c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_012a: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_013f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0143: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a7: Expected O, but got Unknown
		//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_0172: Unknown result type (might be due to invalid IL or missing references)
		//IL_017b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0260: Unknown result type (might be due to invalid IL or missing references)
		//IL_0265: Unknown result type (might be due to invalid IL or missing references)
		//IL_0242: Unknown result type (might be due to invalid IL or missing references)
		//IL_0247: Unknown result type (might be due to invalid IL or missing references)
		//IL_020c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0211: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			Traverse obj = Traverse.Create((object)__instance);
			Vector3 value = obj.Field("positionNext").GetValue<Vector3>();
			Event value2 = obj.Field("explosionSound").GetValue<Event>();
			float value3 = obj.Property("ExplosionShake", (object[])null).GetValue<float>();
			float value4 = obj.Field("explosionVisualSizeMultiplier").GetValue<float>();
			object value5 = obj.Field("data").GetValue();
			Type type = value5.GetType();
			int num = (int)type.GetField("targetCollisionMask").GetValue(value5);
			float num2 = (float)type.GetField("force").GetValue(value5);
			float num3 = (float)type.GetField("damage").GetValue(value5);
			EffectType val = (EffectType)type.GetField("damageEffect").GetValue(value5);
			float num4 = (float)type.GetField("damageEffectAmount").GetValue(value5);
			DamageFlags val2 = (DamageFlags)type.GetField("damageFlags").GetValue(value5);
			TargetEnumerator val3 = default(TargetEnumerator);
			try
			{
				int num5 = (BulletFlagsExtensions.OnlyDamageLocalPlayer(((SimpleProjectileBullet)__instance).Flags) ? 1024 : ((((uint)num & 8u) != 0) ? (num | 0x400) : num));
				if (((TargetEnumerator)(ref val3)).GetTargetsInSphere(value, num2, num5, (TargetType)5))
				{
					DamageData val4 = default(DamageData);
					((DamageData)(ref val4))..ctor(num3, val, num4, (DamageFlags)(val2 | 0x10));
					while (((TargetEnumerator)(ref val3)).MoveNext())
					{
						if (((TargetEnumerator)(ref val3)).Current == Player.LocalPlayer)
						{
							val4.effectAmount *= ((GrenadeBullet)__instance).SelfEffectMultiplier;
						}
						IDamageSource.DamageTarget((IDamageSource)(object)__instance, ((TargetEnumerator)(ref val3)).Current, val4, ((IFollowable)((TargetEnumerator)(ref val3)).Current).GetHealthbarPosition(), (Collider)null);
					}
				}
			}
			finally
			{
				((TargetEnumerator)(ref val3)).Dispose();
			}
			Globbler val5 = (Globbler)((SimpleProjectileBullet)__instance).ParentSource;
			ref Data globblerData = ref val5.GlobblerData;
			if (globblerData.acidPuddleDuration > 0f)
			{
				GameManager.Instance.SpawnAcidPuddle_Rpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)val5), value, globblerData.acidPuddleDuration, (TargetType)5, globblerData.acidPuddleSize);
			}
			if (BulletFlagsExtensions.OnlyDamageLocalPlayer(((SimpleProjectileBullet)__instance).Flags))
			{
				if (((BaseType)value2).Id == 0)
				{
					GameManager.Instance.SpawnExplosionVisual(value, num2 * value4, val);
				}
				else
				{
					GameManager.Instance.SpawnExplosionVisual(value, num2 * value4, val, ((BaseType)value2).Id, Mathf.InverseLerp(0.9f, 3f, num2), false);
				}
				return false;
			}
			if (((BaseType)value2).Id == 0)
			{
				GameManager.Instance.SpawnExplosionVisualObserverSeeThrough_Rpc(value, num2 * value4, val, (uint)NetworkManager.Singleton.LocalClientId);
			}
			else
			{
				GameManager.Instance.SpawnExplosionVisual_Rpc(value, num2 * value4, val, ((BaseType)value2).Id, Mathf.InverseLerp(0.9f, 3f, num2), NetworkManager.Singleton.LocalClientId);
			}
			IDamageSource.ApplyExplosionScreenshake(ref value, num2, value3);
			return false;
		}
		catch
		{
			return true;
		}
	}
}
[CompilerGenerated]
[ExcludeFromCodeCoverage]
internal static class GitVersionInformation
{
	public const string AssemblySemFileVer = "0.0.1.0";

	public const string AssemblySemVer = "0.0.1.0";

	public const string BranchName = "master";

	public const string BuildMetaData = "";

	public const string CommitDate = "2025-11-27";

	public const string CommitsSinceVersionSource = "3";

	public const string EscapedBranchName = "master";

	public const string FullBuildMetaData = "Branch.master.Sha.a95cbc1316875a2ccbed34c141514c3448b09065";

	public const string FullSemVer = "0.0.1-3";

	public const string InformationalVersion = "0.0.1-3+Branch.master.Sha.a95cbc1316875a2ccbed34c141514c3448b09065";

	public const string Major = "0";

	public const string MajorMinorPatch = "0.0.1";

	public const string Minor = "0";

	public const string Patch = "1";

	public const string PreReleaseLabel = "";

	public const string PreReleaseLabelWithDash = "";

	public const string PreReleaseNumber = "3";

	public const string PreReleaseTag = "3";

	public const string PreReleaseTagWithDash = "-3";

	public const string SemVer = "0.0.1-3";

	public const string Sha = "a95cbc1316875a2ccbed34c141514c3448b09065";

	public const string ShortSha = "a95cbc1";

	public const string UncommittedChanges = "8";

	public const string VersionSourceSha = "";

	public const string WeightedPreReleaseNumber = "55003";
}
namespace GlobblerFriendlyFireFix
{
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "GlobblerFriendlyFireFix";

		public const string PLUGIN_NAME = "GlobblerFriendlyFireFix";

		public const string PLUGIN_VERSION = "0.0.0";
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}