Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of TandamRandomEnemyHP v1.1.0
BepInEx\plugins\RandomEnemyHP.dll
Decompiled 4 hours agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; 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("RandomEnemyHP")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("RandomEnemyHP")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("81f347d3-4680-40b7-b9e6-41997f3df91b")] [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("tandam.randomenemyhp", "Tandam Random Enemy HP", "1.1.0")] public class RandomEnemyHP : BaseUnityPlugin { public static ConfigEntry<float> MinimumMultiplier; public static ConfigEntry<float> MaximumMultiplier; private void Awake() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown MinimumMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Random HP", "Minimum Multiplier", 0.5f, new ConfigDescription("敵HPの最低倍率", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 10f), Array.Empty<object>())); MaximumMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Random HP", "Maximum Multiplier", 2f, new ConfigDescription("敵HPの最高倍率", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 10f), Array.Empty<object>())); Harmony val = new Harmony("tandam.randomenemyhp"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Tandam Random Enemy HP v1.1.0 loaded!"); } } [HarmonyPatch(typeof(EnemyHealth), "OnSpawn")] public static class EnemyHealthPatch { [HarmonyPrefix] private static void OnSpawn(EnemyHealth __instance) { if (SemiFunc.IsMasterClientOrSingleplayer()) { int health = __instance.health; float num = RandomEnemyHP.MinimumMultiplier.Value; float num2 = RandomEnemyHP.MaximumMultiplier.Value; if (num > num2) { float num3 = num; num = num2; num2 = num3; } float num4 = Random.Range(num, num2); __instance.health = Mathf.Max(1, Mathf.RoundToInt((float)health * num4)); Debug.Log((object)$"[Tandam Random Enemy HP] {health} -> {__instance.health} (x{num4:F2})"); } } }