using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Photon.Pun;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("")]
[assembly: AssemblyCompany("Omniscye")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("cursedjumping")]
[assembly: AssemblyTitle("cursedjumping")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace cursedjump
{
[BepInPlugin("Omniscye.cursedjump", "cursedjump", "1.0")]
public class cursedjump : BaseUnityPlugin
{
internal static cursedjump Instance { get; private set; }
internal static ManualLogSource Logger => Instance._logger;
private ManualLogSource _logger => ((BaseUnityPlugin)this).Logger;
internal Harmony? Harmony { get; set; }
private void Awake()
{
Instance = this;
((Component)this).gameObject.transform.parent = null;
((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
Patch();
Logger.LogInfo((object)$"{((BaseUnityPlugin)this).Info.Metadata.GUID} v{((BaseUnityPlugin)this).Info.Metadata.Version} has loaded!");
}
internal void Patch()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Expected O, but got Unknown
//IL_0026: Expected O, but got Unknown
if (Harmony == null)
{
Harmony val = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID);
Harmony val2 = val;
Harmony = val;
}
Harmony.PatchAll();
}
internal void Unpatch()
{
Harmony? harmony = Harmony;
if (harmony != null)
{
harmony.UnpatchSelf();
}
}
private void Update()
{
}
}
[HarmonyPatch(typeof(PlayerAvatar), "Jump")]
public class JumpDeathPatch
{
[CompilerGenerated]
private sealed class <DelayedSelfDestruct>d__1 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public PlayerAvatar player;
private bool <isOfflineMode>5__1;
private bool <isConnected>5__2;
private bool <isMasterClient>5__3;
private bool <isMultiplayer>5__4;
private ChatManager <instance>5__5;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <DelayedSelfDestruct>d__1(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<instance>5__5 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = (object)new WaitForSeconds(0.2f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
cursedjump.Logger.LogInfo((object)"Triggering self-destruct after cursed jump!");
<isOfflineMode>5__1 = PhotonNetwork.OfflineMode;
<isConnected>5__2 = PhotonNetwork.IsConnected;
<isMasterClient>5__3 = PhotonNetwork.IsMasterClient;
<isMultiplayer>5__4 = GameManager.Multiplayer();
cursedjump.Logger.LogInfo((object)$"Network Debug - OfflineMode: {<isOfflineMode>5__1}, IsConnected: {<isConnected>5__2}, IsMasterClient: {<isMasterClient>5__3}, GameManager.Multiplayer(): {<isMultiplayer>5__4}");
if (!<isMultiplayer>5__4)
{
cursedjump.Logger.LogInfo((object)"Singleplayer detected - using direct playerHealth.Hurt");
if ((Object)(object)player.playerHealth != (Object)null)
{
player.playerHealth.Hurt(player.playerHealth.health, false, -1);
cursedjump.Logger.LogInfo((object)"Successfully hurt player in singleplayer!");
}
else
{
cursedjump.Logger.LogWarning((object)"PlayerHealth not found in singleplayer");
player.PlayerDeath(-1);
}
}
else
{
cursedjump.Logger.LogInfo((object)"Multiplayer detected - using ChatManager.PossessSelfDestruction");
<instance>5__5 = ChatManager.instance;
if ((Object)(object)<instance>5__5 != (Object)null)
{
<instance>5__5.PossessSelfDestruction();
cursedjump.Logger.LogInfo((object)"Successfully triggered PossessSelfDestruction!");
}
else
{
cursedjump.Logger.LogWarning((object)"ChatManager instance not found, using fallback");
player.PlayerDeath(-1);
}
<instance>5__5 = null;
}
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[HarmonyPrefix]
private static bool Prefix(PlayerAvatar __instance, bool _powerupEffect)
{
bool flag = GameManager.Multiplayer();
bool isLocal = __instance.isLocal;
cursedjump.Logger.LogInfo((object)$"Jump triggered - Multiplayer: {flag}, isLocal: {isLocal}");
if (!isLocal)
{
cursedjump.Logger.LogInfo((object)"Not local player, skipping curse");
return true;
}
float num = Random.Range(0f, 1f);
cursedjump.Logger.LogInfo((object)$"Random roll: {num} (need < 0.2 to trigger)");
if (num < 0.2f)
{
cursedjump.Logger.LogInfo((object)"Player jumped too hard and will self-destruct!");
((MonoBehaviour)__instance).StartCoroutine(DelayedSelfDestruct(__instance));
}
else
{
cursedjump.Logger.LogInfo((object)"Lucky jump, no death this time");
}
return true;
}
[IteratorStateMachine(typeof(<DelayedSelfDestruct>d__1))]
private static IEnumerator DelayedSelfDestruct(PlayerAvatar player)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <DelayedSelfDestruct>d__1(0)
{
player = player
};
}
}
}
namespace cursedjumping
{
[BepInPlugin("Omniscye.cursedjumping", "cursedjumping", "1.0")]
public class cursedjumping : BaseUnityPlugin
{
internal static cursedjumping Instance { get; private set; }
internal static ManualLogSource Logger => Instance._logger;
private ManualLogSource _logger => ((BaseUnityPlugin)this).Logger;
internal Harmony? Harmony { get; set; }
private void Awake()
{
Instance = this;
((Component)this).gameObject.transform.parent = null;
((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
Patch();
Logger.LogInfo((object)$"{((BaseUnityPlugin)this).Info.Metadata.GUID} v{((BaseUnityPlugin)this).Info.Metadata.Version} has loaded!");
}
internal void Patch()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Expected O, but got Unknown
//IL_0026: Expected O, but got Unknown
if (Harmony == null)
{
Harmony val = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID);
Harmony val2 = val;
Harmony = val;
}
Harmony.PatchAll();
}
internal void Unpatch()
{
Harmony? harmony = Harmony;
if (harmony != null)
{
harmony.UnpatchSelf();
}
}
private void Update()
{
}
}
}