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 UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("FTKTragicDie")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FTKTragicDie")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("939d8d7a-6533-49ad-9486-af7ce75b5f04")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace FTKTragicDie;
[BepInPlugin("FTKTragicDie", "FTK Tragic Die", "1.0.0")]
public class Main : BaseUnityPlugin
{
public static ConfigEntry<float> ConfigDeathForceMultiplier;
private void Awake()
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
ConfigDeathForceMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("General", "DeathForceMultiplier", 22f, "Multiplica la fuerza con la que los enemigos salen volando al morir.\nAdemás, la componente vertical (Y) se fuerza a ser positiva (hacia arriba).\n⚠\ufe0f ADVERTENCIA: Valores superiores a 60 pueden causar inestabilidad o crasheos (no probados).\n⚠\ufe0f WARNING: Values above 60 may cause instability or crashes (untested).\nRecomendado / Recommended: 10 – 40.");
new Harmony("FTKTragicDie").PatchAll();
((BaseUnityPlugin)this).Logger.LogInfo((object)$"FTK Tragic Die loaded! Multiplier = {ConfigDeathForceMultiplier.Value}");
((BaseUnityPlugin)this).Logger.LogInfo((object)"----------------------------------------------");
((BaseUnityPlugin)this).Logger.LogInfo((object)"Hecho por Finishim en el mejor pais de chile");
((BaseUnityPlugin)this).Logger.LogInfo((object)"----------------------------------------------");
}
}
[HarmonyPatch(typeof(CharacterEventListener), "SetRagdollForce")]
public static class SetRagdollForcePatch
{
private static void Prefix(CharacterEventListener __instance, ref Vector3 _vel)
{
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
float value = Main.ConfigDeathForceMultiplier.Value;
_vel.x *= value;
_vel.z *= value;
_vel.y = Mathf.Abs(_vel.y) * value;
Debug.Log((object)$"[FTKTragicDie] Velocidad modificada: {_vel}");
}
}