Decompiled source of MoreReviveHP v1.0.0

More Revive HP.dll

Decompiled 9 hours ago
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 More_Revive_HP.Patches;
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("More Revive HP")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("More Revive HP")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("46ab4f67-24f2-4385-81cf-415d36226ff4")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("Tidaleus.MoreReviveHP", "More Revive HP", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	public const string modGUID = "Tidaleus.MoreReviveHP";

	public const string modName = "More Revive HP";

	public const string modVersion = "1.0.0";

	private readonly Harmony harmony = new Harmony("Tidaleus.MoreReviveHP");

	private static Plugin Instance;

	private ConfigEntry<int> ExtraHealth;

	private void Awake()
	{
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Tidaleus.MoreReviveHP has loaded");
		if ((Object)(object)Instance == (Object)null)
		{
			Instance = this;
		}
		ExtraHealth = ((BaseUnityPlugin)this).Config.Bind<int>("General", "DuplicationAmount", 19, "Extra Health to add to the 1 you spawn with, therefore make this something 1 through 99.");
		harmony.PatchAll(typeof(Plugin));
		harmony.PatchAll(typeof(PlayerAvatarPatch));
	}

	public static int GetExtraHealth()
	{
		return Instance.ExtraHealth.Value;
	}
}
namespace More_Revive_HP.Patches;

[HarmonyPatch(typeof(PlayerAvatar), "ReviveRPC")]
internal class PlayerAvatarPatch
{
	private static void Postfix(PlayerAvatar __instance, bool _revivedByTruck)
	{
		int extraHealth = Plugin.GetExtraHealth();
		if (__instance.photonView.IsMine)
		{
			__instance.playerHealth.HealOther(extraHealth, true);
		}
	}
}