using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using AboubiBirthdayPartyMod.Patches;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
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("AboubiBirthdayParty")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AboubiBirthdayParty")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("89dc387f-dda9-4eaf-9bef-01f65ef74317")]
[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 AboubiBirthdayPartyMod
{
[BepInPlugin("Leo.AboubiBirthdayPartyMod", "Aboubi Birthday Party Mod", "1.0")]
public class AboubiBirthdayPartyModBase : BaseUnityPlugin
{
private const string modGUID = "Leo.AboubiBirthdayPartyMod";
private const string modName = "Aboubi Birthday Party Mod";
private const string modVersion = "1.0";
public static ConfigEntry<bool> mEnabled;
public ConfigDefinition mEnabledDef = new ConfigDefinition("1.0", "Enable/Disable Mod");
private readonly Harmony harmony = new Harmony("Leo.AboubiBirthdayPartyMod");
internal static AboubiBirthdayPartyModBase Instance;
internal static ManualLogSource mls;
internal static AudioClip SoundFX;
internal static GameObject VideoFX;
internal static AssetBundle Bundle;
private void Awake()
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Expected O, but got Unknown
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
mEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>(mEnabledDef, false, new ConfigDescription("Controll if the mod should be enabled or diasbled", (AcceptableValueBase)null, Array.Empty<object>()));
mls = Logger.CreateLogSource("Leo.AboubiBirthdayPartyMod");
mls.LogInfo((object)"AboubiBirthdayParty loaded");
harmony.PatchAll(typeof(AboubiBirthdayPartyModBase));
harmony.PatchAll(typeof(WeaponsPatch));
mls = ((BaseUnityPlugin)this).Logger;
string location = ((BaseUnityPlugin)Instance).Info.Location;
location = location.TrimEnd("AboubiBirthdayPartyModBase.dll".ToCharArray());
Bundle = AssetBundle.LoadFromFile(location + "party");
if ((Object)(object)Bundle != (Object)null)
{
mls.LogInfo((object)"Succesfully loaded asset bundle");
SoundFX = Bundle.LoadAsset<AudioClip>("party_sfx");
VideoFX = Bundle.LoadAsset<GameObject>("party_vfx");
}
else
{
mls.LogError((object)"Failed to load asset bundle");
}
}
}
}
namespace AboubiBirthdayPartyMod.Patches
{
[HarmonyPatch(typeof(Weapon))]
internal class WeaponsPatch
{
[HarmonyPatch("Awake")]
[HarmonyPostfix]
private static void OverrideHeadshotEffects(Weapon __instance)
{
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
if (AboubiBirthdayPartyModBase.mEnabled.Value)
{
__instance.headHitClip = AboubiBirthdayPartyModBase.SoundFX;
__instance.headImpact = AboubiBirthdayPartyModBase.VideoFX;
__instance.headImpact.transform.localScale = new Vector3(0.35f, 0.35f, 0.35f);
}
}
}
}