using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using LethalLib.Modules;
using PixelMod.Patches;
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("PixelMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PixelMod")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("83053a24-cc84-4fdb-a4eb-5b2dab760c0f")]
[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 PixelMod
{
[BepInPlugin("Carrot.PixelMod", "PixelMod", "1.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class ModBase : BaseUnityPlugin
{
private const string ModGuid = "Carrot.PixelMod";
private const string ModName = "PixelMod";
private const string ModVersion = "1.0.0";
private readonly Harmony harmony = new Harmony("Carrot.PixelMod");
internal static ModBase instance;
internal ManualLogSource mls;
internal static List<AudioClip> SoundFx;
internal static AssetBundle Bundle;
private void Awake()
{
if ((Object)(object)instance == (Object)null)
{
instance = this;
}
string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "scrapmod");
AssetBundle val = AssetBundle.LoadFromFile(text);
Item val2 = val.LoadAsset<Item>("Assets/ItemMod/FoxPlushItem.asset");
NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab);
Utilities.FixMixerGroups(val2.spawnPrefab);
Items.RegisterScrap(val2, 50, (LevelTypes)(-1));
mls = Logger.CreateLogSource("Carrot.PixelMod");
mls.LogInfo((object)"The mod has awaken");
SoundFx = new List<AudioClip>();
string location = ((BaseUnityPlugin)instance).Info.Location;
location = location.TrimEnd("PixelMod.dll".ToCharArray());
Bundle = AssetBundle.LoadFromFile(location + "ohhisoundfx");
harmony.PatchAll(typeof(ModBase));
harmony.PatchAll(typeof(TurretDetectionPatch));
}
}
}
namespace PixelMod.Patches
{
[HarmonyPatch(typeof(Turret))]
internal class TurretDetectionPatch
{
[HarmonyPatch("Start")]
[HarmonyPostfix]
private static void OverrideAudio(Turret __instance)
{
__instance.detectPlayerSFX = ModBase.SoundFx[0];
}
}
}