using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using HutongGames.PlayMaker;
using HutongGames.PlayMaker.Actions;
using InControl;
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("SeparateFloating")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SeparateFloating")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("4bd8ccac-9134-44ed-acd3-4bcfcc8cce8b")]
[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")]
[BepInPlugin("com.EylonShachmon.SeparateFloating", "Separate Floating", "1.0.0")]
public class SeparateFloatingClass : BaseUnityPlugin
{
[CompilerGenerated]
private sealed class <TranspilerDoDoubleJump>d__26 : IEnumerable<CodeInstruction>, IEnumerable, IEnumerator<CodeInstruction>, IDisposable, IEnumerator
{
private int <>1__state;
private CodeInstruction <>2__current;
private int <>l__initialThreadId;
private IEnumerable<CodeInstruction> instructions;
public IEnumerable<CodeInstruction> <>3__instructions;
private bool <injectedAlready>5__1;
private IEnumerator<CodeInstruction> <>s__2;
private CodeInstruction <instr>5__3;
private MethodInfo <mi>5__4;
CodeInstruction IEnumerator<CodeInstruction>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <TranspilerDoDoubleJump>d__26(int <>1__state)
{
this.<>1__state = <>1__state;
<>l__initialThreadId = Environment.CurrentManagedThreadId;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
int num = <>1__state;
if (num == -3 || (uint)(num - 1) <= 3u)
{
try
{
}
finally
{
<>m__Finally1();
}
}
<>s__2 = null;
<instr>5__3 = null;
<mi>5__4 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_011c: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Expected O, but got Unknown
//IL_0143: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: Expected O, but got Unknown
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: Expected O, but got Unknown
try
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<injectedAlready>5__1 = false;
<>s__2 = instructions.GetEnumerator();
<>1__state = -3;
break;
case 1:
<>1__state = -3;
<>2__current = new CodeInstruction(OpCodes.Pop, (object)null);
<>1__state = 2;
return true;
case 2:
<>1__state = -3;
<>2__current = new CodeInstruction(OpCodes.Ldc_I4_0, (object)null);
<>1__state = 3;
return true;
case 3:
<>1__state = -3;
<injectedAlready>5__1 = true;
break;
case 4:
<>1__state = -3;
<mi>5__4 = null;
<instr>5__3 = null;
break;
}
if (<>s__2.MoveNext())
{
<instr>5__3 = <>s__2.Current;
if (<instr>5__3.opcode == OpCodes.Call)
{
object operand = <instr>5__3.operand;
<mi>5__4 = operand as MethodInfo;
if ((object)<mi>5__4 != null && <mi>5__4 == canFloatMethod)
{
if (!<injectedAlready>5__1)
{
<>2__current = new CodeInstruction(OpCodes.Pop, (object)null);
<>1__state = 1;
return true;
}
Debug.LogError((object)"Separate-Float buildtime error: trying to turn off DoDoubleJump float check in 2 places");
}
}
<>2__current = <instr>5__3;
<>1__state = 4;
return true;
}
<>m__Finally1();
<>s__2 = null;
if (!<injectedAlready>5__1)
{
Debug.LogError((object)"Separate-Float buildtime error: Line to remove updrift check has not been found (1)");
}
return false;
}
catch
{
//try-fault
((IDisposable)this).Dispose();
throw;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
private void <>m__Finally1()
{
<>1__state = -1;
if (<>s__2 != null)
{
<>s__2.Dispose();
}
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
[DebuggerHidden]
IEnumerator<CodeInstruction> IEnumerable<CodeInstruction>.GetEnumerator()
{
<TranspilerDoDoubleJump>d__26 <TranspilerDoDoubleJump>d__;
if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
{
<>1__state = 0;
<TranspilerDoDoubleJump>d__ = this;
}
else
{
<TranspilerDoDoubleJump>d__ = new <TranspilerDoDoubleJump>d__26(0);
}
<TranspilerDoDoubleJump>d__.instructions = <>3__instructions;
return <TranspilerDoDoubleJump>d__;
}
[DebuggerHidden]
IEnumerator IEnumerable.GetEnumerator()
{
return ((IEnumerable<CodeInstruction>)this).GetEnumerator();
}
}
[CompilerGenerated]
private sealed class <TranspilerDoubleJump>d__27 : IEnumerable<CodeInstruction>, IEnumerable, IEnumerator<CodeInstruction>, IDisposable, IEnumerator
{
private int <>1__state;
private CodeInstruction <>2__current;
private int <>l__initialThreadId;
private IEnumerable<CodeInstruction> instructions;
public IEnumerable<CodeInstruction> <>3__instructions;
private bool <injectedAlready>5__1;
private IEnumerator<CodeInstruction> <>s__2;
private CodeInstruction <instr>5__3;
private MethodInfo <mi>5__4;
CodeInstruction IEnumerator<CodeInstruction>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <TranspilerDoubleJump>d__27(int <>1__state)
{
this.<>1__state = <>1__state;
<>l__initialThreadId = Environment.CurrentManagedThreadId;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
int num = <>1__state;
if (num == -3 || (uint)(num - 1) <= 3u)
{
try
{
}
finally
{
<>m__Finally1();
}
}
<>s__2 = null;
<instr>5__3 = null;
<mi>5__4 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_011c: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Expected O, but got Unknown
//IL_0143: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: Expected O, but got Unknown
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: Expected O, but got Unknown
try
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<injectedAlready>5__1 = false;
<>s__2 = instructions.GetEnumerator();
<>1__state = -3;
break;
case 1:
<>1__state = -3;
<>2__current = new CodeInstruction(OpCodes.Pop, (object)null);
<>1__state = 2;
return true;
case 2:
<>1__state = -3;
<>2__current = new CodeInstruction(OpCodes.Ldc_I4_0, (object)null);
<>1__state = 3;
return true;
case 3:
<>1__state = -3;
<injectedAlready>5__1 = true;
break;
case 4:
<>1__state = -3;
<mi>5__4 = null;
<instr>5__3 = null;
break;
}
if (<>s__2.MoveNext())
{
<instr>5__3 = <>s__2.Current;
if (<instr>5__3.opcode == OpCodes.Call)
{
object operand = <instr>5__3.operand;
<mi>5__4 = operand as MethodInfo;
if ((object)<mi>5__4 != null && <mi>5__4 == canFloatMethod)
{
if (!<injectedAlready>5__1)
{
<>2__current = new CodeInstruction(OpCodes.Pop, (object)null);
<>1__state = 1;
return true;
}
Debug.LogError((object)"Separate-Float buildtime error: trying to turn off DoubleJump float check in 2 places");
}
}
<>2__current = <instr>5__3;
<>1__state = 4;
return true;
}
<>m__Finally1();
<>s__2 = null;
if (!<injectedAlready>5__1)
{
Debug.LogError((object)"Separate-Float buildtime error: Line to remove updrift check has not been found (2)");
}
return false;
}
catch
{
//try-fault
((IDisposable)this).Dispose();
throw;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
private void <>m__Finally1()
{
<>1__state = -1;
if (<>s__2 != null)
{
<>s__2.Dispose();
}
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
[DebuggerHidden]
IEnumerator<CodeInstruction> IEnumerable<CodeInstruction>.GetEnumerator()
{
<TranspilerDoubleJump>d__27 <TranspilerDoubleJump>d__;
if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
{
<>1__state = 0;
<TranspilerDoubleJump>d__ = this;
}
else
{
<TranspilerDoubleJump>d__ = new <TranspilerDoubleJump>d__27(0);
}
<TranspilerDoubleJump>d__.instructions = <>3__instructions;
return <TranspilerDoubleJump>d__;
}
[DebuggerHidden]
IEnumerator IEnumerable.GetEnumerator()
{
return ((IEnumerable<CodeInstruction>)this).GetEnumerator();
}
}
[CompilerGenerated]
private sealed class <TranspilerFixedUpdate>d__24 : IEnumerable<CodeInstruction>, IEnumerable, IEnumerator<CodeInstruction>, IDisposable, IEnumerator
{
private int <>1__state;
private CodeInstruction <>2__current;
private int <>l__initialThreadId;
private IEnumerable<CodeInstruction> instructions;
public IEnumerable<CodeInstruction> <>3__instructions;
private FieldInfo <floatingField>5__1;
private bool <injectedAlready>5__2;
private IEnumerator<CodeInstruction> <>s__3;
private CodeInstruction <instr>5__4;
private FieldInfo <fi>5__5;
CodeInstruction IEnumerator<CodeInstruction>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <TranspilerFixedUpdate>d__24(int <>1__state)
{
this.<>1__state = <>1__state;
<>l__initialThreadId = Environment.CurrentManagedThreadId;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
int num = <>1__state;
if (num == -3 || (uint)(num - 1) <= 2u)
{
try
{
}
finally
{
<>m__Finally1();
}
}
<floatingField>5__1 = null;
<>s__3 = null;
<instr>5__4 = null;
<fi>5__5 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_012b: Unknown result type (might be due to invalid IL or missing references)
//IL_0135: Expected O, but got Unknown
//IL_0104: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Expected O, but got Unknown
try
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<floatingField>5__1 = AccessTools.Field(typeof(HeroControllerStates), "floating");
<injectedAlready>5__2 = false;
<>s__3 = instructions.GetEnumerator();
<>1__state = -3;
break;
case 1:
<>1__state = -3;
<>2__current = new CodeInstruction(OpCodes.Ldc_I4_0, (object)null);
<>1__state = 2;
return true;
case 2:
<>1__state = -3;
<injectedAlready>5__2 = true;
break;
case 3:
<>1__state = -3;
<fi>5__5 = null;
<instr>5__4 = null;
break;
}
if (<>s__3.MoveNext())
{
<instr>5__4 = <>s__3.Current;
if (<instr>5__4.opcode == OpCodes.Ldfld)
{
object operand = <instr>5__4.operand;
<fi>5__5 = operand as FieldInfo;
if ((object)<fi>5__5 != null && <fi>5__5 == <floatingField>5__1)
{
if (!<injectedAlready>5__2)
{
<>2__current = new CodeInstruction(OpCodes.Pop, (object)null);
<>1__state = 1;
return true;
}
Debug.LogError((object)"Separate-Float buildtime error: trying to turn off FixedUpdate float check in 2 places");
}
}
<>2__current = <instr>5__4;
<>1__state = 3;
return true;
}
<>m__Finally1();
<>s__3 = null;
if (!<injectedAlready>5__2)
{
Debug.LogError((object)"Separate-Float buildtime error: Line to remove floating check has not been found");
}
return false;
}
catch
{
//try-fault
((IDisposable)this).Dispose();
throw;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
private void <>m__Finally1()
{
<>1__state = -1;
if (<>s__3 != null)
{
<>s__3.Dispose();
}
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
[DebuggerHidden]
IEnumerator<CodeInstruction> IEnumerable<CodeInstruction>.GetEnumerator()
{
<TranspilerFixedUpdate>d__24 <TranspilerFixedUpdate>d__;
if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
{
<>1__state = 0;
<TranspilerFixedUpdate>d__ = this;
}
else
{
<TranspilerFixedUpdate>d__ = new <TranspilerFixedUpdate>d__24(0);
}
<TranspilerFixedUpdate>d__.instructions = <>3__instructions;
return <TranspilerFixedUpdate>d__;
}
[DebuggerHidden]
IEnumerator IEnumerable.GetEnumerator()
{
return ((IEnumerable<CodeInstruction>)this).GetEnumerator();
}
}
[CompilerGenerated]
private sealed class <TranspilerLookForInput>d__22 : IEnumerable<CodeInstruction>, IEnumerable, IEnumerator<CodeInstruction>, IDisposable, IEnumerator
{
private int <>1__state;
private CodeInstruction <>2__current;
private int <>l__initialThreadId;
private IEnumerable<CodeInstruction> instructions;
public IEnumerable<CodeInstruction> <>3__instructions;
private FieldInfo <floatingField>5__1;
private MethodInfo <filterInputMethod>5__2;
private bool <injectedAlready>5__3;
private IEnumerator<CodeInstruction> <>s__4;
private CodeInstruction <instr>5__5;
private FieldInfo <fi>5__6;
private MethodInfo <mi>5__7;
CodeInstruction IEnumerator<CodeInstruction>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <TranspilerLookForInput>d__22(int <>1__state)
{
this.<>1__state = <>1__state;
<>l__initialThreadId = Environment.CurrentManagedThreadId;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
int num = <>1__state;
if (num == -3 || (uint)(num - 1) <= 4u)
{
try
{
}
finally
{
<>m__Finally1();
}
}
<floatingField>5__1 = null;
<filterInputMethod>5__2 = null;
<>s__4 = null;
<instr>5__5 = null;
<fi>5__6 = null;
<mi>5__7 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_013d: Unknown result type (might be due to invalid IL or missing references)
//IL_0147: Expected O, but got Unknown
//IL_0216: Unknown result type (might be due to invalid IL or missing references)
//IL_0220: Expected O, but got Unknown
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_0120: Expected O, but got Unknown
//IL_01da: Unknown result type (might be due to invalid IL or missing references)
//IL_01e4: Expected O, but got Unknown
try
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<floatingField>5__1 = AccessTools.Field(typeof(HeroControllerStates), "floating");
<filterInputMethod>5__2 = AccessTools.Method(typeof(HeroController), "FilterInput", (Type[])null, (Type[])null);
<injectedAlready>5__3 = false;
<>s__4 = instructions.GetEnumerator();
<>1__state = -3;
goto IL_0274;
case 1:
<>1__state = -3;
<>2__current = new CodeInstruction(OpCodes.Pop, (object)null);
<>1__state = 2;
return true;
case 2:
<>1__state = -3;
goto IL_0274;
case 3:
<>1__state = -3;
<>2__current = new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(SeparateFloatingClass), "FloatingCancelButtonChecker", (Type[])null, (Type[])null));
<>1__state = 4;
return true;
case 4:
<>1__state = -3;
<injectedAlready>5__3 = true;
goto IL_023f;
case 5:
{
<>1__state = -3;
<fi>5__6 = null;
<mi>5__7 = null;
<instr>5__5 = null;
goto IL_0274;
}
IL_0274:
if (<>s__4.MoveNext())
{
<instr>5__5 = <>s__4.Current;
if (<instr>5__5.opcode == OpCodes.Stfld)
{
object operand = <instr>5__5.operand;
<fi>5__6 = operand as FieldInfo;
if ((object)<fi>5__6 != null && <fi>5__6 == <floatingField>5__1)
{
<>2__current = new CodeInstruction(OpCodes.Pop, (object)null);
<>1__state = 1;
return true;
}
}
if (<instr>5__5.opcode == OpCodes.Call)
{
object operand = <instr>5__5.operand;
<mi>5__7 = operand as MethodInfo;
if ((object)<mi>5__7 != null && <mi>5__7 == <filterInputMethod>5__2)
{
if (!<injectedAlready>5__3)
{
<>2__current = new CodeInstruction(OpCodes.Ldarg_0, (object)null);
<>1__state = 3;
return true;
}
Debug.LogError((object)"Separate-Float buildtime error: Trying to turn off float in 2 places");
}
}
goto IL_023f;
}
<>m__Finally1();
<>s__4 = null;
if (!<injectedAlready>5__3)
{
Debug.LogError((object)"Separate-Float buildtime error: Line to add back floating has not been found");
}
return false;
IL_023f:
<>2__current = <instr>5__5;
<>1__state = 5;
return true;
}
}
catch
{
//try-fault
((IDisposable)this).Dispose();
throw;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
private void <>m__Finally1()
{
<>1__state = -1;
if (<>s__4 != null)
{
<>s__4.Dispose();
}
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
[DebuggerHidden]
IEnumerator<CodeInstruction> IEnumerable<CodeInstruction>.GetEnumerator()
{
<TranspilerLookForInput>d__22 <TranspilerLookForInput>d__;
if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
{
<>1__state = 0;
<TranspilerLookForInput>d__ = this;
}
else
{
<TranspilerLookForInput>d__ = new <TranspilerLookForInput>d__22(0);
}
<TranspilerLookForInput>d__.instructions = <>3__instructions;
return <TranspilerLookForInput>d__;
}
[DebuggerHidden]
IEnumerator IEnumerable.GetEnumerator()
{
return ((IEnumerable<CodeInstruction>)this).GetEnumerator();
}
}
[CompilerGenerated]
private sealed class <TranspilerLookForQueueInput>d__23 : IEnumerable<CodeInstruction>, IEnumerable, IEnumerator<CodeInstruction>, IDisposable, IEnumerator
{
private int <>1__state;
private CodeInstruction <>2__current;
private int <>l__initialThreadId;
private IEnumerable<CodeInstruction> instructions;
public IEnumerable<CodeInstruction> <>3__instructions;
private MethodInfo <canFloatMethod>5__1;
private FieldInfo <regainControlJumpQueuedField>5__2;
private FieldInfo <acceptingInputField>5__3;
private bool <injectedAlready>5__4;
private IEnumerator<CodeInstruction> <>s__5;
private CodeInstruction <instr>5__6;
private MethodInfo <mi>5__7;
private FieldInfo <fi1>5__8;
CodeInstruction IEnumerator<CodeInstruction>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <TranspilerLookForQueueInput>d__23(int <>1__state)
{
this.<>1__state = <>1__state;
<>l__initialThreadId = Environment.CurrentManagedThreadId;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
int num = <>1__state;
if (num == -3 || (uint)(num - 1) <= 5u)
{
try
{
}
finally
{
<>m__Finally1();
}
}
<canFloatMethod>5__1 = null;
<regainControlJumpQueuedField>5__2 = null;
<acceptingInputField>5__3 = null;
<>s__5 = null;
<instr>5__6 = null;
<mi>5__7 = null;
<fi1>5__8 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0160: Unknown result type (might be due to invalid IL or missing references)
//IL_016a: Expected O, but got Unknown
//IL_0187: Unknown result type (might be due to invalid IL or missing references)
//IL_0191: Expected O, but got Unknown
//IL_0260: Unknown result type (might be due to invalid IL or missing references)
//IL_026a: Expected O, but got Unknown
//IL_0265: Unknown result type (might be due to invalid IL or missing references)
//IL_026f: Expected O, but got Unknown
//IL_0139: Unknown result type (might be due to invalid IL or missing references)
//IL_0143: Expected O, but got Unknown
//IL_0224: Unknown result type (might be due to invalid IL or missing references)
//IL_022e: Expected O, but got Unknown
try
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<canFloatMethod>5__1 = AccessTools.Method(typeof(HeroController), "CanFloat", (Type[])null, (Type[])null);
<regainControlJumpQueuedField>5__2 = AccessTools.Field(typeof(HeroController), "regainControlJumpQueued");
<acceptingInputField>5__3 = AccessTools.Field(typeof(HeroController), "acceptingInput");
<injectedAlready>5__4 = false;
<>s__5 = instructions.GetEnumerator();
<>1__state = -3;
goto IL_02c3;
case 1:
<>1__state = -3;
<>2__current = new CodeInstruction(OpCodes.Pop, (object)null);
<>1__state = 2;
return true;
case 2:
<>1__state = -3;
<>2__current = new CodeInstruction(OpCodes.Ldc_I4_0, (object)null);
<>1__state = 3;
return true;
case 3:
<>1__state = -3;
goto IL_02c3;
case 4:
<>1__state = -3;
<>2__current = new CodeInstruction(new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(SeparateFloatingClass), "FloatingButtonChecker", (Type[])null, (Type[])null)));
<>1__state = 5;
return true;
case 5:
<>1__state = -3;
<injectedAlready>5__4 = true;
goto IL_028e;
case 6:
{
<>1__state = -3;
<mi>5__7 = null;
<fi1>5__8 = null;
<instr>5__6 = null;
goto IL_02c3;
}
IL_02c3:
if (<>s__5.MoveNext())
{
<instr>5__6 = <>s__5.Current;
if (<instr>5__6.opcode == OpCodes.Call)
{
object operand = <instr>5__6.operand;
<mi>5__7 = operand as MethodInfo;
if ((object)<mi>5__7 != null && <mi>5__7 == <canFloatMethod>5__1)
{
<>2__current = new CodeInstruction(OpCodes.Pop, (object)null);
<>1__state = 1;
return true;
}
}
if (<instr>5__6.opcode == OpCodes.Stfld)
{
object operand = <instr>5__6.operand;
<fi1>5__8 = operand as FieldInfo;
if ((object)<fi1>5__8 != null && <fi1>5__8 == <regainControlJumpQueuedField>5__2)
{
if (!<injectedAlready>5__4)
{
<>2__current = new CodeInstruction(OpCodes.Ldarg_0, (object)null);
<>1__state = 4;
return true;
}
Debug.LogError((object)"Separate-Float buildtime error: Trying to add StartFloat in 2 places");
}
}
goto IL_028e;
}
<>m__Finally1();
<>s__5 = null;
if (!<injectedAlready>5__4)
{
Debug.LogError((object)"Separate-Float buildtime error: Line to put StartFloat has not been found");
}
return false;
IL_028e:
<>2__current = <instr>5__6;
<>1__state = 6;
return true;
}
}
catch
{
//try-fault
((IDisposable)this).Dispose();
throw;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
private void <>m__Finally1()
{
<>1__state = -1;
if (<>s__5 != null)
{
<>s__5.Dispose();
}
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
[DebuggerHidden]
IEnumerator<CodeInstruction> IEnumerable<CodeInstruction>.GetEnumerator()
{
<TranspilerLookForQueueInput>d__23 <TranspilerLookForQueueInput>d__;
if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
{
<>1__state = 0;
<TranspilerLookForQueueInput>d__ = this;
}
else
{
<TranspilerLookForQueueInput>d__ = new <TranspilerLookForQueueInput>d__23(0);
}
<TranspilerLookForQueueInput>d__.instructions = <>3__instructions;
return <TranspilerLookForQueueInput>d__;
}
[DebuggerHidden]
IEnumerator IEnumerable.GetEnumerator()
{
return ((IEnumerable<CodeInstruction>)this).GetEnumerator();
}
}
[CompilerGenerated]
private sealed class <TranspilerRegainControl>d__25 : IEnumerable<CodeInstruction>, IEnumerable, IEnumerator<CodeInstruction>, IDisposable, IEnumerator
{
private int <>1__state;
private CodeInstruction <>2__current;
private int <>l__initialThreadId;
private IEnumerable<CodeInstruction> instructions;
public IEnumerable<CodeInstruction> <>3__instructions;
private bool <injectedAlready>5__1;
private IEnumerator<CodeInstruction> <>s__2;
private CodeInstruction <instr>5__3;
private MethodInfo <mi>5__4;
CodeInstruction IEnumerator<CodeInstruction>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <TranspilerRegainControl>d__25(int <>1__state)
{
this.<>1__state = <>1__state;
<>l__initialThreadId = Environment.CurrentManagedThreadId;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
int num = <>1__state;
if (num == -3 || (uint)(num - 1) <= 3u)
{
try
{
}
finally
{
<>m__Finally1();
}
}
<>s__2 = null;
<instr>5__3 = null;
<mi>5__4 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_011c: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Expected O, but got Unknown
//IL_0143: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: Expected O, but got Unknown
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: Expected O, but got Unknown
try
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<injectedAlready>5__1 = false;
<>s__2 = instructions.GetEnumerator();
<>1__state = -3;
break;
case 1:
<>1__state = -3;
<>2__current = new CodeInstruction(OpCodes.Pop, (object)null);
<>1__state = 2;
return true;
case 2:
<>1__state = -3;
<>2__current = new CodeInstruction(OpCodes.Ldc_I4_0, (object)null);
<>1__state = 3;
return true;
case 3:
<>1__state = -3;
<injectedAlready>5__1 = true;
break;
case 4:
<>1__state = -3;
<mi>5__4 = null;
<instr>5__3 = null;
break;
}
if (<>s__2.MoveNext())
{
<instr>5__3 = <>s__2.Current;
if (<instr>5__3.opcode == OpCodes.Call)
{
object operand = <instr>5__3.operand;
<mi>5__4 = operand as MethodInfo;
if ((object)<mi>5__4 != null && <mi>5__4 == canFloatMethod)
{
if (!<injectedAlready>5__1)
{
<>2__current = new CodeInstruction(OpCodes.Pop, (object)null);
<>1__state = 1;
return true;
}
Debug.LogError((object)"Separate-Float buildtime error: trying to turn off RegainControl float check in 2 places");
}
}
<>2__current = <instr>5__3;
<>1__state = 4;
return true;
}
<>m__Finally1();
<>s__2 = null;
if (!<injectedAlready>5__1)
{
Debug.LogError((object)"Separate-Float buildtime error: Line to remove float check has not been found");
}
return false;
}
catch
{
//try-fault
((IDisposable)this).Dispose();
throw;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
private void <>m__Finally1()
{
<>1__state = -1;
if (<>s__2 != null)
{
<>s__2.Dispose();
}
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
[DebuggerHidden]
IEnumerator<CodeInstruction> IEnumerable<CodeInstruction>.GetEnumerator()
{
<TranspilerRegainControl>d__25 <TranspilerRegainControl>d__;
if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
{
<>1__state = 0;
<TranspilerRegainControl>d__ = this;
}
else
{
<TranspilerRegainControl>d__ = new <TranspilerRegainControl>d__25(0);
}
<TranspilerRegainControl>d__.instructions = <>3__instructions;
return <TranspilerRegainControl>d__;
}
[DebuggerHidden]
IEnumerator IEnumerable.GetEnumerator()
{
return ((IEnumerable<CodeInstruction>)this).GetEnumerator();
}
}
private static readonly FieldInfo inputHandlerField = AccessTools.Field(typeof(HeroController), "inputHandler");
private static readonly MethodInfo startFloatMethod = AccessTools.Method(typeof(HeroController), "StartFloat", (Type[])null, (Type[])null);
private static readonly MethodInfo canFloatMethod = AccessTools.Method(typeof(HeroController), "CanFloat", (Type[])null, (Type[])null);
private static readonly FieldInfo wallFloatThingField = AccessTools.Field(typeof(HeroController), "queuedWallJumpInterrupt");
private static readonly FieldInfo gmJumpToFloatField = AccessTools.Field(typeof(ListenForJump), "gm");
private static readonly FieldInfo inputJumpToFloatField = AccessTools.Field(typeof(ListenForJump), "inputHandler");
private static readonly FieldInfo gmHeroControllerField = AccessTools.Field(typeof(HeroController), "gm");
private static readonly MethodInfo doDoubleJumpMethod = AccessTools.Method(typeof(HeroController), "DoDoubleJump", (Type[])null, (Type[])null);
private static readonly FieldInfo needleStrikeTimerField = AccessTools.Field(typeof(HeroController), "nailChargeTimer");
private static readonly PropertyInfo ChargeTimePropery = AccessTools.Property(typeof(HeroController), "CurrentNailChargeTime");
private static readonly FieldInfo waterHcField = AccessTools.Field(typeof(HeroWaterController), "hc");
private static int frameCounter = 0;
private static float Floatingbuffer = 0f;
private void Awake()
{
Harmony.CreateAndPatchAll(typeof(SeparateFloatingClass), (string)null);
((BaseUnityPlugin)this).Logger.LogInfo((object)"SeparateFloating plugin loaded");
}
[HarmonyPrefix]
[HarmonyPatch(typeof(HeroController), "Update")]
private static void generalUpdater(HeroController __instance)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Expected O, but got Unknown
frameCounter++;
if (Floatingbuffer > 0f)
{
GameManager val = (GameManager)gmHeroControllerField.GetValue(__instance);
if ((Object)(object)val != (Object)null && !val.isPaused)
{
Floatingbuffer -= Time.unscaledDeltaTime;
}
else
{
float num = 0f;
num += Time.unscaledDeltaTime;
}
}
if (Floatingbuffer < 0f)
{
Floatingbuffer = 0f;
}
}
public static void CancelFloat(HeroController hc)
{
if (hc.cState.floating)
{
hc.cState.floating = false;
Floatingbuffer = 0.25f;
}
}
public static void FloatingButtonChecker(HeroController hc)
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
InputHandler val = (InputHandler)inputHandlerField.GetValue(hc);
bool flag = (bool)wallFloatThingField.GetValue(hc);
object[] parameters = new object[1] { true };
if (!hc.acceptingInput || hc.cState.floating || flag || hc.wallLocked || !(Floatingbuffer <= 0f) || hc.cState.jumping || hc.cState.doubleJumping)
{
return;
}
if (((OneAxisInputControl)val.inputActions.OpenInventoryQuests).WasPressed)
{
if ((bool)canFloatMethod.Invoke(hc, parameters))
{
startFloatMethod.Invoke(hc, null);
}
}
else if (((OneAxisInputControl)val.inputActions.OpenInventoryQuests).IsPressed && (bool)canFloatMethod.Invoke(hc, new object[1] { true }))
{
startFloatMethod.Invoke(hc, null);
}
}
public static void FloatingCancelButtonChecker(HeroController hc)
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
InputHandler val = (InputHandler)inputHandlerField.GetValue(hc);
if (!((OneAxisInputControl)val.inputActions.OpenInventoryQuests).IsPressed)
{
CancelFloat(hc);
}
}
[HarmonyPostfix]
[HarmonyPatch(typeof(HeroController), "StartFloat")]
private static void FloatStateFlag(HeroController __instance)
{
if (__instance.cState.floating)
{
Debug.LogError((object)"Separate-Float runtime error: StartFloat while already floating");
}
__instance.cState.floating = true;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(ListenForJump), "CheckInput")]
private static bool FloatReplaceJumpButton(ListenForJump __instance)
{
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Expected O, but got Unknown
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Expected O, but got Unknown
HeroController instance = HeroController.instance;
if ((Object)(object)instance == (Object)null || (!instance.cState.floating && Floatingbuffer <= 0f))
{
return true;
}
GameManager val = (GameManager)gmJumpToFloatField.GetValue(__instance);
if (val.isPaused || (!((NamedVariable)__instance.activeBool).IsNone && !__instance.activeBool.Value))
{
return false;
}
InputHandler val2 = (InputHandler)inputJumpToFloatField.GetValue(__instance);
if (((OneAxisInputControl)val2.inputActions.OpenInventoryQuests).WasPressed)
{
((FsmStateAction)__instance).Fsm.Event(__instance.wasPressed);
if (!((NamedVariable)__instance.queueBool).IsNone)
{
__instance.queueBool.Value = true;
}
}
if (((OneAxisInputControl)val2.inputActions.OpenInventoryQuests).WasReleased)
{
((FsmStateAction)__instance).Fsm.Event(__instance.wasReleased);
CancelFloat(instance);
}
if (((OneAxisInputControl)val2.inputActions.OpenInventoryQuests).IsPressed)
{
((FsmStateAction)__instance).Fsm.Event(__instance.isPressed);
}
if (!((OneAxisInputControl)val2.inputActions.OpenInventoryQuests).IsPressed)
{
((FsmStateAction)__instance).Fsm.Event(__instance.isNotPressed);
if (!((NamedVariable)__instance.queueBool).IsNone)
{
__instance.queueBool.Value = false;
}
CancelFloat(instance);
}
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(HeroController), "JumpReleased")]
private static bool JumpReleasedDisable(HeroController __instance)
{
if (__instance.cState.floating)
{
return false;
}
return true;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(InventoryPaneInput), "GetInventoryInputPressed")]
private static bool TurnOffQuestsButton(HeroActions ia, ref PaneTypes __result)
{
if (((OneAxisInputControl)ia.OpenInventoryQuests).WasPressed || OneAxisInputControl.op_Implicit((OneAxisInputControl)(object)ia.SwipeInventoryQuests))
{
__result = (PaneTypes)(-1);
return false;
}
return true;
}
[IteratorStateMachine(typeof(<TranspilerLookForInput>d__22))]
[HarmonyTranspiler]
[HarmonyPatch(typeof(HeroController), "LookForInput")]
private static IEnumerable<CodeInstruction> TranspilerLookForInput(IEnumerable<CodeInstruction> instructions)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <TranspilerLookForInput>d__22(-2)
{
<>3__instructions = instructions
};
}
[IteratorStateMachine(typeof(<TranspilerLookForQueueInput>d__23))]
[HarmonyTranspiler]
[HarmonyPatch(typeof(HeroController), "LookForQueueInput")]
private static IEnumerable<CodeInstruction> TranspilerLookForQueueInput(IEnumerable<CodeInstruction> instructions)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <TranspilerLookForQueueInput>d__23(-2)
{
<>3__instructions = instructions
};
}
[IteratorStateMachine(typeof(<TranspilerFixedUpdate>d__24))]
[HarmonyTranspiler]
[HarmonyPatch(typeof(HeroController), "FixedUpdate")]
private static IEnumerable<CodeInstruction> TranspilerFixedUpdate(IEnumerable<CodeInstruction> instructions)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <TranspilerFixedUpdate>d__24(-2)
{
<>3__instructions = instructions
};
}
[IteratorStateMachine(typeof(<TranspilerRegainControl>d__25))]
[HarmonyTranspiler]
[HarmonyPatch(typeof(HeroController), "RegainControl", new Type[] { typeof(bool) })]
private static IEnumerable<CodeInstruction> TranspilerRegainControl(IEnumerable<CodeInstruction> instructions)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <TranspilerRegainControl>d__25(-2)
{
<>3__instructions = instructions
};
}
[IteratorStateMachine(typeof(<TranspilerDoDoubleJump>d__26))]
[HarmonyTranspiler]
[HarmonyPatch(typeof(HeroController), "DoDoubleJump")]
private static IEnumerable<CodeInstruction> TranspilerDoDoubleJump(IEnumerable<CodeInstruction> instructions)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <TranspilerDoDoubleJump>d__26(-2)
{
<>3__instructions = instructions
};
}
[IteratorStateMachine(typeof(<TranspilerDoubleJump>d__27))]
[HarmonyTranspiler]
[HarmonyPatch(typeof(HeroController), "DoubleJump")]
private static IEnumerable<CodeInstruction> TranspilerDoubleJump(IEnumerable<CodeInstruction> instructions)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <TranspilerDoubleJump>d__27(-2)
{
<>3__instructions = instructions
};
}
[HarmonyPrefix]
[HarmonyPatch(typeof(ListenForAttack), "OnUpdate")]
private static void NeedleStrikeFloatCancel(ListenForAttack __instance)
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Expected O, but got Unknown
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Expected O, but got Unknown
FieldInfo fieldInfo = AccessTools.Field(typeof(ListenForAttack), "gm");
GameManager val = (GameManager)fieldInfo.GetValue(__instance);
if (val.isPaused)
{
return;
}
FieldInfo fieldInfo2 = AccessTools.Field(typeof(ListenForAttack), "timer");
float num = (float)fieldInfo2.GetValue(__instance);
if (num > 0f)
{
return;
}
FieldInfo fieldInfo3 = AccessTools.Field(typeof(ListenForAttack), "inputHandler");
InputHandler val2 = (InputHandler)fieldInfo3.GetValue(__instance);
if (((OneAxisInputControl)val2.inputActions.Attack).WasReleased)
{
HeroController instance = HeroController.instance;
float num2 = (float)ChargeTimePropery.GetValue(instance);
float num3 = (float)needleStrikeTimerField.GetValue(instance);
if (num3 >= num2)
{
CancelFloat(instance);
}
}
}
[HarmonyPrefix]
[HarmonyPatch(typeof(HeroController), "HeroDash")]
private static void DashFloatCancel(HeroController __instance)
{
CancelFloat(__instance);
}
[HarmonyPrefix]
[HarmonyPatch(typeof(HeroController), "DoWallJump")]
private static void WallJumpFloatCancel(HeroController __instance)
{
CancelFloat(__instance);
}
[HarmonyPrefix]
[HarmonyPatch(typeof(HeroController), "HeroJump", new Type[] { typeof(bool) })]
private static void JumpFloatCancel(HeroController __instance)
{
CancelFloat(__instance);
}
[HarmonyPrefix]
[HarmonyPatch(typeof(HeroController), "DoDoubleJump")]
private static void DoDoubleJumpFloatCancel(HeroController __instance)
{
CancelFloat(__instance);
}
[HarmonyPrefix]
[HarmonyPatch(typeof(HeroController), "DoubleJump")]
private static void DoubleJumpFloatCancel(HeroController __instance)
{
CancelFloat(__instance);
}
[HarmonyPrefix]
[HarmonyPatch(typeof(HeroController), "DoAttack")]
private static void AttackFloatCancel(HeroController __instance)
{
CancelFloat(__instance);
}
[HarmonyPrefix]
[HarmonyPatch(typeof(HeroController), "BeginWallSlide")]
private static void WallSlideFloatCancel(HeroController __instance)
{
CancelFloat(__instance);
}
[HarmonyPrefix]
[HarmonyPatch(typeof(HeroController), "IncrementAttackCounter")]
private static void IncrementAttackCounterFloatCancel(HeroController __instance)
{
CancelFloat(__instance);
}
[HarmonyPrefix]
[HarmonyPatch(typeof(HeroController), "ResetMotion")]
private static void ResetMotionFloatCancel(HeroController __instance)
{
CancelFloat(__instance);
}
[HarmonyPrefix]
[HarmonyPatch(typeof(HeroController), "BindCompleted")]
private static void BindFloatCancel(HeroController __instance)
{
CancelFloat(__instance);
}
[HarmonyPrefix]
[HarmonyPatch(typeof(HeroController), "ResetUpdraft")]
private static void ResetUpdraftFloatCancel(HeroController __instance)
{
CancelFloat(__instance);
}
[HarmonyPrefix]
[HarmonyPatch(typeof(HeroController), "ExitUpdraft")]
private static void ExitUpdraftFloatCancel(HeroController __instance)
{
FieldInfo fieldInfo = AccessTools.Field(typeof(HeroController), "updraftsEntered");
int num = (int)fieldInfo.GetValue(__instance);
if (num <= 1)
{
CancelFloat(__instance);
}
}
[HarmonyPrefix]
[HarmonyPatch(typeof(HeroController), "ThrowTool")]
private static void ThrowToolFloatCancel(HeroController __instance, bool isAutoThrow)
{
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Expected O, but got Unknown
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Expected O, but got Unknown
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
FieldInfo fieldInfo = AccessTools.Field(typeof(HeroController), "canThrowTime");
FieldInfo fieldInfo2 = AccessTools.Field(typeof(HeroController), "willThrowTool");
MethodInfo methodInfo = AccessTools.Method(typeof(HeroController), "CanThrowTool", new Type[3]
{
typeof(ToolItem),
typeof(AttackToolBinding),
typeof(bool)
}, (Type[])null);
double num = (double)fieldInfo.GetValue(__instance);
ToolItem val = (ToolItem)fieldInfo2.GetValue(__instance);
InputHandler val2 = (InputHandler)inputHandlerField.GetValue(__instance);
if ((!isAutoThrow && Time.timeAsDouble < num) || !Object.op_Implicit((Object)(object)val))
{
return;
}
AttackToolBinding? attackToolBinding = ToolItemManager.GetAttackToolBinding(val);
if (attackToolBinding.HasValue)
{
((OneAxisInputControl)val2.inputActions.QuickCast).ClearInputState();
AttackToolBinding value = attackToolBinding.Value;
if ((bool)methodInfo.Invoke(__instance, new object[3] { val, value, true }))
{
CancelFloat(__instance);
}
}
}
[HarmonyPrefix]
[HarmonyPatch(typeof(HeroWaterController), "EnterWaterRegion")]
private static void EnterWaterFloatCancel(HeroWaterController __instance)
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
HeroController hc = (HeroController)waterHcField.GetValue(__instance);
CancelFloat(hc);
}
[HarmonyPrefix]
[HarmonyPatch(typeof(HeroWaterController), "ExitWaterRegion", new Type[] { typeof(bool) })]
private static void ExitWaterFloatCancel(HeroWaterController __instance)
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
HeroController hc = (HeroController)waterHcField.GetValue(__instance);
CancelFloat(hc);
}
}