Decompiled source of ReplayCoolsRight v1.0.0

ReplayCoolsRight.dll

Decompiled 3 weeks ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BepInEx;
using BepInEx.Logging;
using Events.Car;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("ReplayCoolsRight")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ReplayCoolsRight")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("E4DB0CB6-0DC1-4004-AB13-E57A20575943")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ReplayCoolsRight
{
	public static class Constants
	{
		public const string PluginGuid = "c4a1f2e3-8b7d-4c9a-a2f5-6e0d3b8c1a4f";

		public const string PluginName = "ReplayCoolsRight";

		public const string HarmonyId = "de.kilika.distance.ReplayCoolsRight";
	}
	[BepInPlugin("c4a1f2e3-8b7d-4c9a-a2f5-6e0d3b8c1a4f", "ReplayCoolsRight", "1.0.0")]
	public sealed class Mod : BaseUnityPlugin
	{
		internal static ManualLogSource Logger { get; private set; }

		private void Awake()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			Logger = Logger.CreateLogSource("ReplayCoolsRight");
			Harmony val = new Harmony("de.kilika.distance.ReplayCoolsRight");
			Logger.LogInfo((object)"Loading ReplayCoolsRight...");
			val.PatchAll();
			Logger.LogInfo((object)"ReplayCoolsRight loaded successfully!");
		}
	}
}
namespace ReplayCoolsRight.Patches
{
	[HarmonyPatch(typeof(SetAbilitiesTrigger), "OnTriggerEnter")]
	internal static class SetAbilitiesTrigger_OnTriggerEnter
	{
		[HarmonyPostfix]
		private static void Postfix(SetAbilitiesTrigger __instance, Collider other, bool ___triggered_)
		{
			if (!___triggered_)
			{
				CarLogic componentInParent = ((Component)other).GetComponentInParent<CarLogic>();
				if (!((Object)(object)componentInParent == (Object)null) && /*isinst with value type is only supported in some contexts*/is PlayerDataReplay)
				{
					componentInParent.SetInfiniteCooldown(__instance.infiniteCooldown_, false);
				}
			}
		}
	}
	[HarmonyPatch(typeof(PlayerDataBase), "OnEventWarpAnchorHit")]
	internal static class PlayerDataBase_OnEventWarpAnchorHit
	{
		[HarmonyPostfix]
		private static void Postfix(PlayerDataBase __instance, Data data)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			if (__instance is PlayerDataReplay)
			{
				__instance.Events_.Broadcast<Data>(new Data(1f));
			}
		}
	}
}