Decompiled source of Healing Campfires v1.0.0

campfireHealingMod.dll

Decompiled a week ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
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("campfireHealingMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("campfireHealingMod")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("cd03913a-c5ed-4f16-b1aa-3eb53997b91c")]
[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("com.yourname.campfirehealing", "Campfire Healing Mod", "1.0.0")]
public class CampfireHealingMod : BaseUnityPlugin
{
	private const float HealingRadius = 15f;

	private const float HealPerSecond = 0.1f;

	private void Update()
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Invalid comparison between Unknown and I4
		//IL_0034: 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)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		Campfire[] array = Object.FindObjectsByType<Campfire>((FindObjectsSortMode)0);
		Campfire[] array2 = array;
		foreach (Campfire val in array2)
		{
			if ((int)val.state != 1)
			{
				continue;
			}
			Vector3 position = ((Component)val).transform.position;
			foreach (Character allPlayerCharacter in PlayerHandler.GetAllPlayerCharacters())
			{
				if (!allPlayerCharacter.data.dead)
				{
					float num = Vector3.Distance(position, allPlayerCharacter.Center);
					if (num <= 15f)
					{
						float num2 = 0.1f * Time.deltaTime;
						allPlayerCharacter.refs.afflictions.SubtractStatus((STATUSTYPE)0, num2, false);
					}
				}
			}
		}
	}
}