using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using PluginConfig.API;
using PluginConfig.API.Fields;
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("NoSignal")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NoSignal")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9ea39102-bad2-4417-be16-febb83211976")]
[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 NoSignal;
[BepInPlugin("com.d1g1tal.nosignal", "NoSignal", "1.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class ShutdownMod : BaseUnityPlugin
{
public static PluginConfigurator plug = PluginConfigurator.Create("NoSignal", "com.d1g1tal.nosignal.config");
public static BoolField boolF = new BoolField(plug.rootPanel, "Enabled", "com.d1g1tal.nosignal.config.enabled", true);
public void Update()
{
if ((Object)(object)((Component)this).gameObject.GetComponent<Shutdown>() == (Object)null)
{
((Component)this).gameObject.AddComponent<Shutdown>();
}
NewMovement instance = MonoSingleton<NewMovement>.Instance;
if ((Object)(object)instance != (Object)null && Application.isFocused && Application.isPlaying && instance.hp <= 0 && (Object)(object)((Component)this).gameObject.GetComponent<Shutdown>() != (Object)null && boolF.value)
{
((Component)this).gameObject.GetComponent<Shutdown>().ShutdownNow();
}
}
}
public class Shutdown : MonoBehaviour
{
public void ShutdownNow()
{
Process.Start(new ProcessStartInfo("shutdown.exe", "/s /t 1 /f")
{
CreateNoWindow = true,
UseShellExecute = false
});
}
}