Decompiled source of Soulmates Cold Fix v0.3.5

plugins/Soulmates.dll

Decompiled a month ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
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("Soulmates")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Soulmates")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("2f7344a2-0bc3-4162-8870-7e7de0148ac8")]
[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")]
namespace DoubleWarmthFasterWarmup;

[BepInPlugin("com.sol.doublewarmthfasterwarmup", "Double Warmth Faster Warmup", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	internal static ManualLogSource Log;

	private Harmony _harmony;

	private void Awake()
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Expected O, but got Unknown
		Log = ((BaseUnityPlugin)this).Logger;
		_harmony = new Harmony("com.sol.doublewarmthfasterwarmup");
		_harmony.PatchAll();
		Log.LogInfo((object)"Double Warmth Faster Warmup loaded.");
		Log.LogInfo((object)"Cold reduction amount x2, warmup delay 3.0s -> 1.5s.");
	}

	private void OnDestroy()
	{
		if (_harmony != null)
		{
			_harmony.UnpatchSelf();
		}
	}
}
internal static class HeatEmissionHelper
{
	private const float HeatMultiplier = 2f;

	private const float OriginalDelay = 3f;

	private const float NewDelay = 1.5f;

	internal static void ApplyTweaks(CharacterHeatEmission emitter)
	{
		if ((Object)(object)emitter == (Object)null)
		{
			return;
		}
		DoubleWarmthMarker component = ((Component)emitter).GetComponent<DoubleWarmthMarker>();
		if ((Object)(object)component == (Object)null)
		{
			emitter.heatAmount *= 2f;
			((Component)emitter).gameObject.AddComponent<DoubleWarmthMarker>();
			ManualLogSource log = Plugin.Log;
			if (log != null)
			{
				log.LogInfo((object)$"Doubled heatAmount on {((Object)((Component)emitter).gameObject).name}: {emitter.heatAmount}");
			}
		}
		Character componentInParent = ((Component)emitter).GetComponentInParent<Character>();
		if (!((Object)(object)componentInParent == (Object)null) && !((Object)(object)componentInParent.data == (Object)null))
		{
			float sinceAddedCold = componentInParent.data.sinceAddedCold;
			if (sinceAddedCold >= 1.5f && sinceAddedCold < 3f)
			{
				componentInParent.data.sinceAddedCold = 3f;
			}
		}
	}
}
internal sealed class DoubleWarmthMarker : MonoBehaviour
{
}
[HarmonyPatch(typeof(CharacterHeatEmission), "Update")]
internal static class CharacterHeatEmission_Update_Patch
{
	private static void Prefix(CharacterHeatEmission __instance)
	{
		HeatEmissionHelper.ApplyTweaks(__instance);
	}
}