using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using HardcoreHealth; using HarmonyLib; using Il2Cpp; using Il2CppActiveRagdoll; using MelonLoader; using MelonLoader.Preferences; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: MelonInfo(typeof(Core), "HardcoreHealth", "1.0.0", "MajedCT", null)] [assembly: MelonGame("Kubunautilus", "BrutalistickVR")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("HardcoreHealth")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("HardcoreHealth")] [assembly: AssemblyTitle("HardcoreHealth")] [assembly: NeutralResourcesLanguage("en-US")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace HardcoreHealth { public class Core : MelonMod { [HarmonyPatch(typeof(StickHealth), "FixedUpdate")] internal class KillPatch { public static void Postfix(StickHealth __instance) { if (shouldKillsStopBleeding.Value) { bool isDead = __instance.isDead; wasDead.TryGetValue(__instance, out var value); if (isDead && !value) { isBleeding = false; bleedTimer = 0f; bleedIncrement = 0; } wasDead[__instance] = isDead; } } } [HarmonyPatch(typeof(PlayerDamageBridge), "HitByBullet")] internal class HitPatch { public static void Prefix(PlayerDamageBridge __instance, ref Vector3 worldPoint, ref Vector3 hitNormal, ref float damage) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) luhNormalThing = hitNormal; damage = damageTakenFromShots.Value; if (__instance.dmgMultiplier >= 2f && shouldHeadshotInstakill.Value) { damage *= 6769420f; } else if (bleeding.Value) { AssignBleed(__instance); isBleeding = true; } } } public static Transform bleedPos; public static Vector3 luhNormalThing; public static bool isMainMenu = true; public static bool isBleeding = false; public static int bleedIncrement = 0; public static PlayerDamageBridge playerD; public static float bleedTimer = 0f; public static MelonPreferences_Category category; public static MelonPreferences_Entry damageTakenFromShots; public static MelonPreferences_Entry damageTakenFromBleeds; public static MelonPreferences_Entry shouldHeadshotInstakill; public static MelonPreferences_Entry bleeding; public static MelonPreferences_Entry bleedAmount; public static MelonPreferences_Entry timeBetweenBleeds; public static MelonPreferences_Entry shouldKillsStopBleeding; public static Dictionary wasDead = new Dictionary(); public override void OnInitializeMelon() { ((MelonBase)this).LoggerInstance.Msg("Initialized."); category = MelonPreferences.CreateCategory("HardcoreHealth"); damageTakenFromShots = category.CreateEntry("damageTakenFromShots", 30f, "damageTakenFromShots", "amount of damage taken from gunshots, default value is 30", false, false, (ValueValidator)null, (string)null); damageTakenFromBleeds = category.CreateEntry("damageTakenFromBleeds", 30f, "damageTakenFromBleeds", "amount of damage taken from bleeding, default value is 30", false, false, (ValueValidator)null, (string)null); shouldHeadshotInstakill = category.CreateEntry("shouldHeadshotInstaKill", true, "shouldHeadshotInstaKill", "should being shot in the head insta-kill you, default value is true", false, false, (ValueValidator)null, (string)null); bleeding = category.CreateEntry("bleeding", true, "bleeding", "should you bleed when shot in the body, default value is true", false, false, (ValueValidator)null, (string)null); bleedAmount = category.CreateEntry("bleedAmount", 3, "bleedAmount", "amount of times to bleed before stopping, default value is 3", false, false, (ValueValidator)null, (string)null); timeBetweenBleeds = category.CreateEntry("timeBetweenBleeds", 3f, "timeBetweenBleeds", "amount of seconds between each time you take bleeding damage, default is value 3", false, false, (ValueValidator)null, (string)null); shouldKillsStopBleeding = category.CreateEntry("shouldKillsStopBleeding", true, "shouldKillsStopBleeding", "should getting a kill stop your bleeding, default value is true", false, false, (ValueValidator)null, (string)null); category.SaveToFile(true); } public override void OnSceneWasLoaded(int buildIndex, string sceneName) { if (sceneName == "MainMenuScene") { isMainMenu = true; } else if (sceneName != "MainMenuScene") { isMainMenu = false; } } public static void AssignBleed(PlayerDamageBridge player) { if ((Object)(object)playerD != (Object)(object)player) { playerD = player; } } public override void OnUpdate() { //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) if (isMainMenu || !((Object)(object)playerD != (Object)null)) { return; } bleedPos = ((Component)playerD).transform; if (isBleeding) { if (bleedIncrement < bleedAmount.Value) { bleedTimer += Time.deltaTime; } else if (bleedIncrement >= bleedAmount.Value) { bleedTimer = 0f; bleedIncrement = 0; isBleeding = false; } if (bleedTimer >= timeBetweenBleeds.Value) { playerD.HitByBullet(bleedPos.position, luhNormalThing, damageTakenFromBleeds.Value); bleedTimer = 0f; bleedIncrement++; } } } } }