using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using JetBrains.Annotations;
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("FireproofMounts")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FireproofMounts")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9d0defd2-50b7-45ce-8c65-454bcb104cc8")]
[assembly: AssemblyFileVersion("0.0.1.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.1.0")]
[module: UnverifiableCode]
namespace FireproofMounts;
[HarmonyPatch]
internal class Burning
{
[HarmonyPrefix]
[HarmonyPatch(typeof(SE_Burning), "UpdateStatusEffect")]
public static void BurningUpdate_Prefix(ref SE_Burning __instance, float dt)
{
Player localPlayer = Player.m_localPlayer;
bool flag = ((Character)localPlayer).IsRiding();
if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead() || !flag)
{
return;
}
IDoodadController doodadController = localPlayer.m_doodadController;
Sadle val = (Sadle)(object)((doodadController is Sadle) ? doodadController : null);
Tameable tameable = val.GetTameable();
if (!((Object)(object)tameable == (Object)null))
{
StatusEffect statusEffect = ((Character)localPlayer).GetSEMan().GetStatusEffect("Burning".GetHashCode());
StatusEffect statusEffect2 = tameable.m_character.GetSEMan().GetStatusEffect("Burning".GetHashCode());
if ((Object)(object)__instance == (Object)(object)statusEffect)
{
((Character)localPlayer).GetSEMan().RemoveStatusEffect(statusEffect, false);
}
else if ((Object)(object)__instance == (Object)(object)statusEffect2)
{
tameable.m_character.GetSEMan().RemoveStatusEffect(statusEffect2, false);
}
}
}
}
[BepInPlugin("nullex.mods.fireproofmounts", "Fireproof Mounts", "0.0.1")]
public class FireproofMounts : BaseUnityPlugin
{
public const string PluginId = "nullex.mods.fireproofmounts";
private Harmony _harmony;
[UsedImplicitly]
private void Awake()
{
_harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "nullex.mods.fireproofmounts");
}
[UsedImplicitly]
private void OnDestroy()
{
Harmony harmony = _harmony;
if (harmony != null)
{
harmony.UnpatchSelf();
}
}
}