using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using Configgy;
using HarmonyLib;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("OneHit")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Every enemy dies in one hit, but you also do.")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("OneHit")]
[assembly: AssemblyTitle("OneHit")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
public class OneHitHandler : MonoBehaviour
{
[Configgable("", "Is enabled?", 0, null)]
public static ConfigToggle isOn = new ConfigToggle(true);
}
public class Patches
{
[HarmonyPatch(typeof(NewMovement), "GetHurt")]
[HarmonyPrefix]
public static bool p_NewMovement_GetHurt(ref NewMovement __instance, ref int __0)
{
if (((ConfigValueElement<bool>)(object)OneHitHandler.isOn).Value && __0 != 0)
{
__0 = int.MaxValue;
}
return true;
}
[HarmonyPatch(typeof(EnemyIdentifier), "DeliverDamage")]
[HarmonyPrefix]
public static bool p_EnemyIdentifier_DeliverDamage(ref EnemyIdentifier __instance, ref float __3)
{
if (((ConfigValueElement<bool>)(object)OneHitHandler.isOn).Value && __3 != 0f)
{
__3 = 2.1474836E+09f;
}
return true;
}
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
[HarmonyPostfix]
public static void p_CanSubmitScores(ref bool __result)
{
if (((ConfigValueElement<bool>)(object)OneHitHandler.isOn).Value)
{
__result = false;
}
}
}
public class PluginData
{
public const string GUID = "com.ssar.onehit";
public const string Name = "One Hit";
public const string Version = "1.3.0";
}
namespace OneHit;
[BepInPlugin("com.ssar.onehit", "One Hit", "1.3.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
private ConfigBuilder config;
private void Awake()
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Expected O, but got Unknown
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
config = new ConfigBuilder("com.ssar.onehit", "One Hit");
config.BuildAll();
Object.DontDestroyOnLoad((Object)(object)new GameObject("com.ssar.onehit").AddComponent<OneHitHandler>());
new Harmony("com.ssar.onehit").PatchAll(typeof(Patches));
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "OneHit";
public const string PLUGIN_NAME = "OneHit";
public const string PLUGIN_VERSION = "1.0.0";
}