using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using Il2CppInterop.Runtime.Injection;
using UnityEngine;
using UnityEngine.SceneManagement;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("PermArsenal")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PermArsenal")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("5aeb3d8a-8eaa-49b6-82ca-86e2f33a1463")]
[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")]
[BepInPlugin("Direct.PermArsenal", "PermArsenal", "1.0.0")]
public class Plugin : BasePlugin
{
internal static ManualLogSource Log;
public override void Load()
{
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Expected O, but got Unknown
Log = ((BasePlugin)this).Log;
Log.LogInfo((object)"==============");
Log.LogInfo((object)"PermArsenal Loaded!");
Log.LogInfo((object)"==============");
ClassInjector.RegisterTypeInIl2Cpp<ArsenalController>();
GameObject val = new GameObject("PermArsenal_Release");
Object.DontDestroyOnLoad((Object)(object)val);
val.AddComponent<ArsenalController>();
}
}
public class ArsenalController : MonoBehaviour
{
private bool attempted;
private int lastScene = -1;
public ArsenalController(IntPtr ptr)
: base(ptr)
{
}
private void Update()
{
//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)
Scene activeScene = SceneManager.GetActiveScene();
int buildIndex = ((Scene)(ref activeScene)).buildIndex;
if (buildIndex != lastScene)
{
lastScene = buildIndex;
attempted = false;
Plugin.Log.LogInfo((object)"Scene Changed.. Searching for Emergency Weapons Arsenal (EWA)...");
}
if (attempted)
{
return;
}
GameObject val = GameObject.Find("EMERGENCY WEAPONS ARSENAL");
if ((Object)(object)val == (Object)null)
{
return;
}
Transform val2 = val.transform.Find("WallCover");
if ((Object)(object)val2 == (Object)null)
{
Plugin.Log.LogError((object)"EWA WallCover Was Not Found!");
attempted = true;
return;
}
Animator component = ((Component)val2).GetComponent<Animator>();
if ((Object)(object)component == (Object)null)
{
Plugin.Log.LogError((object)"WallCover Animator Was Not Found!");
attempted = true;
return;
}
Plugin.Log.LogInfo((object)"Found WallCover Animator!");
((Behaviour)component).enabled = true;
component.Play("WallCover", 0, 0f);
Plugin.Log.LogInfo((object)"Played WallCover Animation + Enabled Animator!");
attempted = true;
}
}