Maniac
0 of 0

File information

Last updated

Original upload

Created by

DeathWrench

Uploaded by

DeathWrench

Virus scan

Safe to use

Tags for this mod

About this mod

Infinite Health

Requirements
Permissions and credits
BepinEx plugin for infinite health. 

    Installation:
  • Install BepInEx by extracting the, doorstop_config.ini, winhttp.dll, and the BepInEx folder to the game directory:
  • Run the game once and do not close it until the console has fully initialized. If you close the game too early, when you start the game, the console no longer pops up anymore. You will have to delete the BepInEx folder, and start from step 1. again.
  • Place the .dll from this mod into the BepInEx/plugins folder.
You can tell if it's working because there will be a single heart at the bottom left of the screen.

Source code:
using BepInEx;
using HarmonyLib;
using Maniac;
using System.Reflection;
[BepInPlugin("DeathWrench.InfiniteHealth", "Infinite Health Plugin", "1.0.0")]
public class InfiniteHealthPlugin : BaseUnityPlugin
{
    private Harmony harmony;
    void Awake()
    {
        harmony = new Harmony("DeathWrench.InfiniteHealth");
        harmony.PatchAll(Assembly.GetExecutingAssembly());
        Logger.LogInfo("Plugin \"DeathWrench.InfiniteHealth\" is loaded!");
    }
    [HarmonyPatch(typeof(GameManager), "CreateLolekPlayer")]
    public static class CreateLolekPlayerPatch
    {
        [HarmonyPostfix]
        public static void Postfix(ref GameManager __instance)
        {
            __instance.playerLolekImpact.invincibilityTime = float.PositiveInfinity;
            __instance.playerLolekImpact.Health = float.MaxValue;
            __instance.playerLolekImpact.MaxHealth = float.MaxValue; 
        }
    }
    [HarmonyPatch(typeof(HeartBar), "FixedUpdate")]
    static class HeartBar_Update_Patch
    {
        public static void Postfix(HeartBar __instance)
        {
            __instance.SetHealth(float.MaxValue);
            __instance.SetArmor(float.MaxValue);
            __instance.CreateHearts(float.MaxValue, 10f);
        }
    }
}