Decompiled source of LLBCommunityPatch v1.5.1
BepInEx/patchers/LLBPatcher.dll
Decompiled 3 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using BepInEx.Logging; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using Mono.Collections.Generic; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyCompany("LLBPatcher")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("LLBPatcher")] [assembly: AssemblyTitle("LLBPatcher")] [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.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace LLBPatcher { public class Plugin { internal static ManualLogSource Logger = Logger.CreateLogSource("LLBPatcher"); private static TypeReference vector3; private static TypeReference quaternion; public static IEnumerable<string> TargetDLLs => GetDLLs(); public static void Initialize() { } public static void Patch(AssemblyDefinition assembly) { //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Expected O, but got Unknown //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Expected O, but got Unknown //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Expected O, but got Unknown //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Expected O, but got Unknown //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Expected O, but got Unknown //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Expected O, but got Unknown //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Expected O, but got Unknown if (((AssemblyNameReference)assembly.Name).Name == "Assembly-CSharp") { Logger.LogWarning((object)("<<<< Starting Patch: " + ((AssemblyNameReference)assembly.Name).Name)); TypeDefinition type = assembly.MainModule.GetType("GameplayEntities", "MovableEntity"); Logger.LogInfo((object)("MovableEntity: " + ((MemberReference)type).FullName)); TypeDefinition type2 = assembly.MainModule.GetType("GameplayEntities", "RobotPlayer"); Logger.LogInfo((object)("RobotPlayer: " + ((MemberReference)type2).FullName)); MethodDefinition val = ((IEnumerable<MethodDefinition>)type.Methods).First((MethodDefinition method) => ((MemberReference)method).Name == "CheckJumpAndFastFall"); Logger.LogInfo((object)("baseMethod: " + ((MemberReference)val).FullName)); MethodDefinition val2 = new MethodDefinition(((MemberReference)val).Name, val.Attributes, ((MethodReference)val).ReturnType); val2.Attributes = (MethodAttributes)(val2.Attributes & 0xFEFF); val2.Attributes = (MethodAttributes)(val2.Attributes | 0); val2.ImplAttributes = val.ImplAttributes; val2.SemanticsAttributes = val.SemanticsAttributes; type2.Methods.Add(val2); ILProcessor iLProcessor = val2.Body.GetILProcessor(); iLProcessor.Append(iLProcessor.Create(OpCodes.Ldarg_0)); iLProcessor.Append(iLProcessor.Create(OpCodes.Call, (MethodReference)(object)val)); iLProcessor.Append(iLProcessor.Create(OpCodes.Ret)); Logger.LogInfo((object)("newMethod: " + ((MemberReference)val2).FullName)); Logger.LogInfo((object)$"newMethod: {val2.Body}"); Logger.LogWarning((object)("<<<< End Patch: " + ((AssemblyNameReference)assembly.Name).Name)); } if (!(((AssemblyNameReference)assembly.Name).Name == "Assembly-CSharp")) { return; } Enumerator<ModuleDefinition> enumerator = assembly.MainModule.Assembly.Modules.GetEnumerator(); try { while (enumerator.MoveNext()) { ModuleDefinition current = enumerator.Current; Enumerator<TypeDefinition> enumerator2 = current.Types.GetEnumerator(); try { while (enumerator2.MoveNext()) { TypeDefinition current2 = enumerator2.Current; if (((MemberReference)current2).Name == "BouncingData") { FieldDefinition val3 = new FieldDefinition("fromCounterParry", (FieldAttributes)6, assembly.MainModule.TypeSystem.Int32); current2.Fields.Add(val3); Logger.LogInfo((object)("BouncingData FOUND!: Added " + ((MemberReference)val3).Name)); } if (((MemberReference)current2).Name == "MovableData") { TypeReference val4 = current.ImportReference(new TypeReference("", "HHBCPNCDNDH", current, (IMetadataScope)(object)assembly.MainModule)); FieldDefinition val5 = new FieldDefinition("crouchTimer", (FieldAttributes)6, val4); current2.Fields.Add(val5); Logger.LogInfo((object)("MovableData FOUND!: Added " + ((MemberReference)val5).Name)); } if (((MemberReference)current2).Name == "AbilityData") { TypeReference val6 = current.ImportReference(new TypeReference("", "HHBCPNCDNDH", current, (IMetadataScope)(object)assembly.MainModule)); FieldDefinition val7 = new FieldDefinition("downAirHitRecoveryTimer", (FieldAttributes)6, val6); current2.Fields.Add(val7); Logger.LogInfo((object)("AbilityData FOUND!: Added " + ((MemberReference)val7).Name)); } if (((MemberReference)current2).Name == "GetHitBallEntity") { FieldDefinition val8 = new FieldDefinition("ballTrailCounter", (FieldAttributes)6, assembly.MainModule.TypeSystem.SByte); current2.Fields.Add(val8); Logger.LogInfo((object)("GetHitBallEntity FOUND!: Added " + ((MemberReference)val8).Name)); } if (((MemberReference)current2).Name == "AbilityState") { FieldDefinition val9 = new FieldDefinition("canCrouchCancel", (FieldAttributes)6, assembly.MainModule.TypeSystem.Boolean); current2.Fields.Add(val9); Logger.LogInfo((object)("AbilityState FOUND!: Added " + ((MemberReference)val9).Name)); } } } finally { ((IDisposable)enumerator2).Dispose(); } } } finally { ((IDisposable)enumerator).Dispose(); } } public static void CheckPlayer() { } public static IEnumerable<string> GetDLLs() { yield return "UnityEngine.CoreModule.dll"; yield return "Assembly-CSharp.dll"; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "LLBPatcher"; public const string PLUGIN_NAME = "LLBPatcher"; public const string PLUGIN_VERSION = "1.0.0"; } }
BepInEx/plugins/LLBCommunityPatch/com.github.daioutzu.llbcommunitypatch.dll
Decompiled 3 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using Abilities; using BepInEx; using BepInEx.Logging; using GameplayEntities; using HarmonyLib; using LLBCommunityPatch.Characters; using LLBCommunityPatch.ParryChanges; using LLBT; using LLBT.Tweaks; using LLGUI; using LLHandlers; using LLScreen; using Microsoft.CodeAnalysis; using Multiplayer; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyCompany("com.github.daioutzu.llbcommunitypatch")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.5.1.0")] [assembly: AssemblyInformationalVersion("1.5.1+a5db68acd4b3f8b8bff79d70b0fec9ac8bbe3ec3")] [assembly: AssemblyProduct("LLBCommunityPatch")] [assembly: AssemblyTitle("com.github.daioutzu.llbcommunitypatch")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.5.1.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.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace LLBCommunityPatch { [HarmonyPatch] internal class BallPatch { [HarmonyPatch(typeof(CollidableEntity), "SweepCollision")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> AddMoreBallSteps(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown return new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[3] { new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && i.operand == typeof(CollidableEntity).GetMethod("GetSmallestCollisionSize")), (string)null), new CodeMatch((OpCode?)OpCodes.Stloc_S, (object)null, (string)null) }).Advance(1).SetInstruction(Transpilers.EmitDelegate<Func<CollidableEntity, HHBCPNCDNDH>>((Func<CollidableEntity, HHBCPNCDNDH>)((CollidableEntity entity) => ((object)((object)entity).GetType() != typeof(BallEntity)) ? entity.GetSmallestCollisionSize() : HHBCPNCDNDH.NKKIFJJEPOL(0.02m)))) .InstructionEnumeration(); } [HarmonyPatch(typeof(GetHitBallEntity), "CheckSweep")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> CheckSweep(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown return new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[4] { new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldfld && i.operand == typeof(GetHitBallEntity).GetField("trailPosList1")), (string)null), new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && i.operand == typeof(Entity).GetMethod("GetPosition")), (string)null), new CodeMatch((OpCode?)OpCodes.Callvirt, (object)null, (string)null) }).RemoveInstructions(4).Insert((CodeInstruction[])(object)new CodeInstruction[1] { Transpilers.EmitDelegate<Action<GetHitBallEntity>>((Action<GetHitBallEntity>)delegate(GetHitBallEntity ballEntity) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) FieldInfo fieldInfo = AccessTools.Field(typeof(GetHitBallEntity), "ballTrailCounter"); sbyte b = (sbyte)fieldInfo.GetValue(ballEntity); if (b >= 10) { ballEntity.trailPosList1.Add(((Entity)ballEntity).GetPosition()); b = 0; } else { b++; } fieldInfo.SetValue(ballEntity, b); }) }) .InstructionEnumeration(); } [HarmonyPatch(typeof(BallEntity), "CleanUp")] [HarmonyPrefix] private static void Prefix(BallEntity __instance) { AccessTools.Field(typeof(BouncingData), "fromCounterParry").SetValue(((BouncableEntity)__instance).bouncingData, 0); } [HarmonyPatch(typeof(BouncableEntity), "WallBounce")] [HarmonyPrefix] private static void BounceReset(BouncableEntity __instance) { FieldInfo fieldInfo = AccessTools.Field(typeof(BouncingData), "fromCounterParry"); fieldInfo.SetValue(__instance.bouncingData, Mathf.Max(0, (int)fieldInfo.GetValue(__instance.bouncingData) - 1)); } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyPostfix] private static void OnConstruciton(BouncingData __instance) { AccessTools.Field(typeof(BouncingData), "fromCounterParry").SetValue(__instance, 0); } [HarmonyPatch(typeof(BouncingData), "Load")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> OnLoad(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); val.End(); val.Advance(-1); val.Insert((CodeInstruction[])(object)new CodeInstruction[4] { new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Ldloc_0, (object)null), new CodeInstruction(OpCodes.Ldfld, (object)AccessTools.Field(typeof(BouncingData), "fromCounterParry")), new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(BouncingData), "fromCounterParry")) }); return val.InstructionEnumeration(); } [HarmonyPatch(typeof(GetHitPlayerEntity), "CounterParry")] [HarmonyPostfix] private static void AddToCounterParry(GetHitPlayerEntity __instance, BallEntity ball) { AccessTools.Field(typeof(BouncingData), "fromCounterParry").SetValue(((GetHitBallEntity)ball).ballData, 2); } [HarmonyPatch(typeof(HittingEntity), "Hit", new Type[] { typeof(HitableEntity), typeof(bool), typeof(HHBCPNCDNDH), typeof(HitstunState), typeof(bool), typeof(bool) })] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> OnHitReset(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Expected O, but got Unknown //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Expected O, but got Unknown //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); val.MatchForward(true, (CodeMatch[])(object)new CodeMatch[6] { new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldfld && ((FieldInfo)i.operand).Name == "fromSpecial"), (string)null), new CodeMatch((OpCode?)OpCodes.Brtrue, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldloc_2, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldfld && ((FieldInfo)i.operand).Name == "ballData"), (string)null), new CodeMatch((OpCode?)OpCodes.Ldc_I4_0, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldfld && ((FieldInfo)i.operand).Name == "fromCounter"), (string)null) }).Advance(1).Insert((CodeInstruction[])(object)new CodeInstruction[4] { new CodeInstruction(OpCodes.Ldloc_2, (object)null), new CodeInstruction(OpCodes.Ldfld, (object)AccessTools.Field(typeof(GetHitBallEntity), "ballData")), new CodeInstruction(OpCodes.Ldc_I4_0, (object)null), new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(BouncingData), "fromCounterParry")) }); return val.InstructionEnumeration(); } [HarmonyPatch(typeof(GetHitBallEntity), "GetDamage")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> GetDoDamage(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[4] { new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldfld && ((FieldInfo)i.operand).Name == "ballData"), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldfld && ((FieldInfo)i.operand).Name == "fromCounter"), (string)null), new CodeMatch((OpCode?)OpCodes.Brfalse, (object)null, (string)null) }).Advance(2).RemoveInstruction() .Insert((CodeInstruction[])(object)new CodeInstruction[1] { Transpilers.EmitDelegate<Func<BouncingData, bool>>((Func<BouncingData, bool>)((BouncingData getHitBall) => (int)AccessTools.Field(typeof(BouncingData), "fromCounterParry").GetValue(getHitBall) > 0)) }); return val.InstructionEnumeration(); } [HarmonyPatch(typeof(GetHitPlayerEntity), "CounterParry")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> ChangeCounterParriedPos(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[5] { new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Newobj), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Call && ((MethodInfo)i.operand).Name == "NKKIFJJEPOL"), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Call && ((MethodInfo)i.operand).Name == "GAFCIOAEGKD"), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Call && ((MethodInfo)i.operand).Name == "BBGBJJELCFJ"), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Stfld && ((FieldInfo)i.operand).Name == "CGJJEHPPOAN"), (string)null) }).SearchBack((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldfld && ((FieldInfo)i.operand).Name == "CGJJEHPPOAN")).Advance(1) .SetOpcodeAndAdvance(OpCodes.Ldc_I4_3); return val.InstructionEnumeration(); } } [HarmonyPatch] internal class CursorSpeedPatch { [HarmonyTargetMethod] private static MethodInfo TargetMethod() { return AccessTools.Method(AccessTools.FirstInner(typeof(UIInput), (Func<Type, bool>)((Type t) => t.Name == "<HandleCursors>c__AnonStorey0")), "<>m__0", (Type[])null, (Type[])null); } [HarmonyTranspiler] private static IEnumerable<CodeInstruction> CursorSpeedRelativeToResolution(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); int num = -1; int num2 = -1; val.MatchForward(true, (CodeMatch[])(object)new CodeMatch[3] { new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Call && ((MethodInfo)i.operand).Name == "get_deltaTime"), (string)null), new CodeMatch((OpCode?)OpCodes.Call, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Stfld && ((FieldInfo)i.operand).Name == "move"), (string)null) }).Advance(-1); num2 = val.Pos; val.MatchBack(true, (CodeMatch[])(object)new CodeMatch[3] { new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldfld && ((FieldInfo)i.operand).Name == "move"), (string)null) }).Advance(1); num = val.Pos; val.RemoveInstructionsInRange(num, num2).Insert((CodeInstruction[])(object)new CodeInstruction[2] { new CodeInstruction(OpCodes.Ldloc_0, (object)null), Transpilers.EmitDelegate<Func<Vector2, LLCursor, Vector2>>((Func<Vector2, LLCursor, Vector2>)((Vector2 move, LLCursor cursor) => move * UIInput.cursorSpeed * cursor.GetHoverSlow() * Time.deltaTime * (float)Screen.width / 1280f)) }); return val.InstructionEnumeration(); } } internal class DownAirHitRecoveryPatch { private static FieldInfo downAirHitRecoveryTimer => AccessTools.Field(typeof(AbilityData), "downAirHitRecoveryTimer"); private static HHBCPNCDNDH Get_downAirHitRecoveryTimer(object instance) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return (HHBCPNCDNDH)downAirHitRecoveryTimer.GetValue(instance); } private static void Set_downAirHitRecoveryTimer(object instance, object value) { downAirHitRecoveryTimer.SetValue(instance, value); } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyPostfix] private static void Add_DownAirHitRecoveryTimerToConstructor_PostFix(AbilityData __instance) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Set_downAirHitRecoveryTimer(__instance, HHBCPNCDNDH.DBOMOJGKIFI); } [HarmonyPatch(typeof(AbilityData), "Load")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> Load_DownAirHitRecoveryTimer_Transpiler(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); val.End(); val.MatchBack(false, (CodeMatch[])(object)new CodeMatch[3] { new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldarg_1, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Call && ((MethodInfo)i.operand).Name == "Load"), (string)null) }).Insert((CodeInstruction[])(object)new CodeInstruction[4] { new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Ldloc_0, (object)null), CodeInstruction.LoadField(typeof(AbilityData), "downAirHitRecoveryTimer", false), CodeInstruction.StoreField(typeof(AbilityData), "downAirHitRecoveryTimer") }); return val.InstructionEnumeration(); } [HarmonyPatch(typeof(AbilityData), "Pack")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> Pack_DownAirHitRecoveryTimer_Transpiler(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); val.SearchForward((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldarg_0 && i.labels.Count > 0)).Insert((CodeInstruction[])(object)new CodeInstruction[3] { new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Ldarg_1, (object)null), Transpilers.EmitDelegate<Action<AbilityData, SendableState>>((Action<AbilityData, SendableState>)delegate(AbilityData inst, SendableState p) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) p.AddFloatf(Get_downAirHitRecoveryTimer(inst), "Ability.downAirHitRecoveryTimer"); }) }); return val.InstructionEnumeration(); } [HarmonyPatch(typeof(Ability), "Start")] [HarmonyPostfix] private static void ResetHitTimer(Ability __instance) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) Set_downAirHitRecoveryTimer(__instance.data, HHBCPNCDNDH.DBOMOJGKIFI); } [HarmonyPatch(typeof(DownAirSwingAbility), "Update")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> DownAirUpdate_Transpiler(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); int num = -1; int num2 = -1; val.SearchForward((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && ((MethodInfo)i.operand).Name == "SetAbilityState")); num2 = val.Pos; val.Start(); num = val.Pos; val.RemoveInstructionsInRange(num, num2); val.Insert((CodeInstruction[])(object)new CodeInstruction[2] { new CodeInstruction(OpCodes.Ldarg_0, (object)null), Transpilers.EmitDelegate<Action<DownAirSwingAbility>>((Action<DownAirSwingAbility>)delegate(DownAirSwingAbility inst) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) if (((MovableData)((AbilityEntity)((Ability)inst).entity).abilityData).abilityState != "DOWN_AIR_LAND" && ((Entity)((Ability)inst).entity).OnGround() && !DebugSettings.instance.testAirAttacksOnGround) { ((Ability)inst).SetAbilityState("DOWN_AIR_LAND"); } if (((AttackingData)((Ability)inst).data).hitSomething) { Set_downAirHitRecoveryTimer(((Ability)inst).data, HHBCPNCDNDH.GAFCIOAEGKD(Get_downAirHitRecoveryTimer(((Ability)inst).data), World.FDELTA_TIME)); if (HHBCPNCDNDH.OCDKNPDIPOB(Get_downAirHitRecoveryTimer(((Ability)inst).data), ((Ability)inst).framesDuration60fps(12)) && ((MovableData)((AbilityEntity)((Ability)inst).entity).abilityData).abilityState == "DOWN_AIR_LAND" && (((MovableEntity)((Ability)inst).entity).CheckActions() || ((ControllableEntity)((Ability)inst).entity).GetInput(InputAction.LEFT) || ((ControllableEntity)((Ability)inst).entity).GetInput(InputAction.RIGHT))) { ((AbilityEntity)((Ability)inst).entity).EndAbilityStateToNormal(); } } }) }); return val.InstructionEnumeration(); } } internal class FPP_Patch { [HarmonyPatch(typeof(GetHitPlayerEntity), "DoParrySuccess")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> Transpiler_FPPFix(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Expected O, but got Unknown //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Expected O, but got Unknown //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Expected O, but got Unknown //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Expected O, but got Unknown //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Expected O, but got Unknown //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); int num = -1; int num2 = -1; val.MatchForward(true, (CodeMatch[])(object)new CodeMatch[6] { new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && ((MethodInfo)i.operand).Name == "GetPosition"), (string)null), new CodeMatch((OpCode?)OpCodes.Ldarg_2, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && ((MethodInfo)i.operand).Name == "GetPosition"), (string)null), new CodeMatch((OpCode?)OpCodes.Call, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && ((MethodInfo)i.operand).Name == "CreateParrySuccessEffect"), (string)null) }); num2 = val.Pos; val.MatchBack(false, (CodeMatch[])(object)new CodeMatch[3] { new CodeMatch((OpCode?)OpCodes.Ldarg_1, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && ((MethodInfo)i.operand).Name == "IsHittingBall"), (string)null), new CodeMatch((OpCode?)OpCodes.Brfalse, (object)null, (string)null) }); num = val.Pos; val.RemoveInstructionsInRange(num, num2); val.Insert((CodeInstruction[])(object)new CodeInstruction[5] { new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Ldarg_1, (object)null), new CodeInstruction(OpCodes.Ldarg_2, (object)null), new CodeInstruction(OpCodes.Ldloc_S, (object)6), Transpilers.EmitDelegate<Action<GetHitPlayerEntity, PlayerEntity, BallEntity, HHBCPNCDNDH>>((Action<GetHitPlayerEntity, PlayerEntity, BallEntity, HHBCPNCDNDH>)delegate(GetHitPlayerEntity inst, PlayerEntity succesfulPlayer, BallEntity ball, HHBCPNCDNDH hitstunDur) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (!((HittingEntity)succesfulPlayer).IsHittingBall() && ((BouncableEntity)ball).hitbox.Intersects(((AttackingEntity)succesfulPlayer).parryBox, false, true)) { ((Entity)ball).SetPosition(((AttackingEntity)succesfulPlayer).parryBox.GetPosition()); ((MovableEntity)succesfulPlayer).PlaySfx((Sfx)87); } ((HitableEntity)ball).StartHitstun(hitstunDur, ((HitableEntity)ball).hitableData.hitstunState); ScreenGameHud.StartHitStun((HitableEntity)(object)ball, true); ((HitableEntity)ball).GetPixelFlySpeed(true); ((EffectHandler)AccessTools.Field(typeof(GetHitPlayerEntity), "effectHandler").GetValue(inst)).CreateParrySuccessEffect(((Entity)ball).GetPosition(), IBGCBLLKIHA.FCKBPDNEAOG(((Entity)inst).GetPosition(), ((Entity)ball).GetPosition())); }) }); return val.InstructionEnumeration(); } } [HarmonyPatch] internal class GeneralPatch { [HarmonyPatch(typeof(ScreenGameHud), "DoUpdate")] [HarmonyTranspiler] [HarmonyDebug] private static IEnumerable<CodeInstruction> FixSpeedOMeterSpillOver(IEnumerable<CodeInstruction> instructions, ILGenerator iLGenerator) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); val.SearchForward((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldsfld && ((FieldInfo)i.operand).Name == "hitStunDuration")); val.SetAndAdvance(OpCodes.Ldsfld, (object)typeof(ScreenGameHud).GetField("hitStunEntity", BindingFlags.Static | BindingFlags.NonPublic)); val.Insert((CodeInstruction[])(object)new CodeInstruction[2] { new CodeInstruction(OpCodes.Ldfld, (object)typeof(HitableEntity).GetField("hitableData")), new CodeInstruction(OpCodes.Ldfld, (object)typeof(HitableData).GetField("hitstunDuration")) }); return val.InstructionEnumeration(); } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> PitchJumpBuffer_Transpiler(IEnumerable<CodeInstruction> instructions) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown new List<CodeInstruction>(instructions); return new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[3] { new CodeMatch((OpCode?)OpCodes.Ldloc_0, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldc_I4_2, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Stfld, (object)AccessTools.Field(typeof(AbilityState), "jumpCancel"), (string)null) }).Advance(1).SetOpcodeAndAdvance(OpCodes.Ldc_I4_0) .InstructionEnumeration(); } [HarmonyPatch(typeof(GetUpGrabAbility), "SetAbilityState")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> BlazeGetUpEffectMoved_Transpiler(IEnumerable<CodeInstruction> instructions) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Expected O, but got Unknown //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Expected O, but got Unknown //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Expected O, but got Unknown //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Expected O, but got Unknown //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Expected O, but got Unknown //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Expected O, but got Unknown int num = -1; int num2 = -1; CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[4] { new CodeMatch((OpCode?)OpCodes.Ldsfld, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldfld && ((FieldInfo)i.operand).Name == "entity"), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && ((MethodInfo)i.operand).Name == "GetPosition"), (string)null) }); num = val.Pos; val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && ((MethodInfo)i.operand).Name == "CreateGetUpBlazeEffect"), (string)null) }); num2 = val.Pos; val.MatchForward(true, (CodeMatch[])(object)new CodeMatch[7] { new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldstr && i.operand?.ToString() == "GET_UP_GRAB_DURING"), (string)null), new CodeMatch((OpCode?)OpCodes.Call, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Brfalse, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldfld && ((FieldInfo)i.operand).Name == "data"), (string)null), new CodeMatch((OpCode?)OpCodes.Ldc_I4_1, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Stfld && ((FieldInfo)i.operand).Name == "inGetUpBlaze"), (string)null) }).Insert((CodeInstruction[])(object)new CodeInstruction[2] { new CodeInstruction(OpCodes.Ldarg_0, (object)null), Transpilers.EmitDelegate<Action<GetUpGrabAbility>>((Action<GetUpGrabAbility>)delegate(GetUpGrabAbility getUpGrab) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) EffectHandler.instance.CreateGetUpBlazeEffect(((Entity)((Ability)getUpGrab).entity).GetPosition(), ((HitableEntity)((Ability)getUpGrab).entity).GetTeam()); }) }); val.RemoveInstructionsInRange(num, num2); return val.InstructionEnumeration(); } [HarmonyPatch(typeof(EffectHandler), "CreateGetUpBlazeEffect")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> CreateGetUpBlazeEffect_Transpiler(IEnumerable<CodeInstruction> instructions) { List<CodeInstruction> list = new List<CodeInstruction>(instructions); int num = -1; bool flag = false; for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Ldc_I4) { num = i; } if (list[i].opcode == OpCodes.Stfld && ((FieldInfo)list[i].operand).Name == "animSpeed") { flag = true; break; } } if (num > -1 && flag) { list[num].operand = 180; } else { Plugin.Logger.LogFatal((object)"Did not find animSpeed"); } return list.AsEnumerable(); } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> UnifyDownAirAbility(IEnumerable<CodeInstruction> instructions) { List<CodeInstruction> list = new List<CodeInstruction>(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Ldc_I4_S && (sbyte)list[i].operand == 14) { list[i].operand = (sbyte)11; } if (list[i].opcode == OpCodes.Ldc_I4_8) { list[i].opcode = OpCodes.Ldc_I4_S; list[i].operand = (sbyte)9; Plugin.Logger.LogInfo((object)"DownAirAbility Values Changed"); break; } } return list.AsEnumerable(); } [HarmonyPatch(typeof(World), "FrameUpdate")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> FrameUpdate_Trans(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown return new CodeMatcher(instructions, (ILGenerator)null).MatchForward(true, (CodeMatch[])(object)new CodeMatch[3] { new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldfld && i.operand == typeof(World).GetField("playerHandler")), (string)null), new CodeMatch((OpCode?)OpCodes.Callvirt, (object)null, (string)null) }).Insert((CodeInstruction[])(object)new CodeInstruction[2] { new CodeInstruction(OpCodes.Ldarg_0, (object)null), Transpilers.EmitDelegate<Action<World>>((Action<World>)delegate { ALDOKEMAOMB.ICOCPAFKCCE((Action<PlayerEntity>)delegate(PlayerEntity player) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Invalid comparison between Unknown and I4 //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 if ((int)((MovableData)player.playerData).playerState == 1 || (int)((MovableData)player.playerData).playerState == 2) { ((AbilityEntity)player).CheckParry(); } }); }) }).InstructionEnumeration(); } [HarmonyPatch(typeof(PlayerEntity), "UpdateState")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> RemoveCheckParry_Transpiler(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown return new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[2] { new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && i.operand == typeof(AbilityEntity).GetMethod("CheckParry")), (string)null) }).Repeat((Action<CodeMatcher>)delegate(CodeMatcher matcher) { matcher.RemoveInstructions(2); }, (Action<string>)null).InstructionEnumeration(); } [HarmonyPatch(typeof(GetHitBallEntity), "CheckHitboxesLogic")] [HarmonyTranspiler] [HarmonyDebug] private static IEnumerable<CodeInstruction> CheckSameFrameGrabs(IEnumerable<CodeInstruction> instructions) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Expected O, but got Unknown //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Expected O, but got Unknown //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Expected O, but got Unknown //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Expected O, but got Unknown //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Expected O, but got Unknown //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Expected O, but got Unknown //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Expected O, but got Unknown //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Expected O, but got Unknown //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Expected O, but got Unknown //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Expected O, but got Unknown //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Expected O, but got Unknown int num = -1; int num2 = -1; CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); val.MatchForward(true, (CodeMatch[])(object)new CodeMatch[4] { new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldc_I4_S, (object)(sbyte)19, (string)null), new CodeMatch((OpCode?)OpCodes.Ldc_I4_S, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && ((MethodInfo)i.operand).Name == "SetBallState"), (string)null) }); num2 = val.Pos; val.SearchBack((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldsfld && ((FieldInfo)i.operand).Name == "GIGAKBJGFDI")); num = val.Pos; val.RemoveInstructionsInRange(num, num2); num2 = -1; val.Insert((CodeInstruction[])(object)new CodeInstruction[2] { new CodeInstruction(OpCodes.Ldarg_0, (object)null), Transpilers.EmitDelegate<Action<GetHitBallEntity>>((Action<GetHitBallEntity>)delegate(GetHitBallEntity hitBallEntity) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Invalid comparison between Unknown and I4 //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (!hitBallEntity.IsActiveCuffedBall()) { if ((int)JOMBNFKIHIC.GIGAKBJGFDI.PNJOKAICMNN == 5) { ((HitableData)hitBallEntity.ballData).flyDirection = IBGCBLLKIHA.DABJBJIFJNL(); } else { ((HitableData)hitBallEntity.ballData).flyDirection = IBGCBLLKIHA.GNBPBDKODEA(); } ((BouncableEntity)hitBallEntity).SetBallState((BallState)19, (HitstunState)51); } else { ((BouncableEntity)hitBallEntity).SetBallState((BallState)12, (HitstunState)51); ((HitableEntity)hitBallEntity).StartHitstun(((Entity)hitBallEntity).framesDuration60fps(5), (HitstunState)51); } }) }); num2 = val.MatchForward(true, (CodeMatch[])(object)new CodeMatch[3] { new CodeMatch((OpCode?)OpCodes.Ldarg_2, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && ((MethodInfo)i.operand).Name == "HandleHitboxGrab"), (string)null) }).Pos; num = val.MatchBack(false, (CodeMatch[])(object)new CodeMatch[4] { new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldfld && ((FieldInfo)i.operand).Name == "ballData"), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldfld && ((FieldInfo)i.operand).Name == "cuffBallOwner"), (string)null), new CodeMatch((OpCode?)OpCodes.Ldc_I4_M1, (object)null, (string)null) }).Pos; val.RemoveInstructionsInRange(num, num2); val.Insert((CodeInstruction[])(object)new CodeInstruction[5] { new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Ldarg_1, (object)null), new CodeInstruction(OpCodes.Ldarg_2, (object)null), Transpilers.EmitDelegate<Func<GetHitBallEntity, PlayerEntity, string, bool>>((Func<GetHitBallEntity, PlayerEntity, string, bool>)delegate(GetHitBallEntity hitBallEntity, PlayerEntity player, string hitboxName) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Invalid comparison between Unknown and I4 //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Invalid comparison between Unknown and I4 //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Invalid comparison between Unknown and I4 //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Invalid comparison between Unknown and I4 bool isGrabvsSwing = false; bool isGrabvsGrab = false; ALDOKEMAOMB.ICOCPAFKCCE((Action<PlayerEntity>)delegate(PlayerEntity otherPlayer) { if (!((Object)(object)otherPlayer == (Object)(object)player)) { bool flag = false; bool flag2 = false; string text = ((AttackingEntity)otherPlayer).CheckHitboxes(((BouncableEntity)hitBallEntity).hitbox, false, false); if (((HitableEntity)hitBallEntity).MatchPowerupIs((Powerup)3, (PowerupPhase)2)) { flag = false; } else if (text != PlayerBox.NONE && !((AttackingEntity)otherPlayer).hitboxes[text].grabs) { flag = true; } else if (text != PlayerBox.NONE && ((AttackingEntity)otherPlayer).hitboxes[text].grabs) { flag2 = true; } if ((Object)(object)player != (Object)(object)otherPlayer && !((AttackingEntity)otherPlayer).EntityTracked(((Entity)hitBallEntity).entityID) && flag) { isGrabvsSwing = true; } else if ((Object)(object)player != (Object)(object)otherPlayer && !((AttackingEntity)otherPlayer).EntityTracked(((Entity)hitBallEntity).entityID) && flag2) { hitBallEntity.SameFrameClashPlayer(otherPlayer, text); isGrabvsGrab = true; } } }); if (isGrabvsSwing) { return false; } if (isGrabvsGrab) { if ((int)((HitableData)hitBallEntity.ballData).team != 4) { if ((int)JOMBNFKIHIC.GIGAKBJGFDI.PNJOKAICMNN == 5) { ((HitableData)hitBallEntity.ballData).flyDirection = IBGCBLLKIHA.DABJBJIFJNL(); } else { ((HitableData)hitBallEntity.ballData).flyDirection = new IBGCBLLKIHA(new HHBCPNCDNDH(0), HHBCPNCDNDH.NKKIFJJEPOL(0.3m)); } ((BouncableEntity)hitBallEntity).SetBallState((BallState)19, (HitstunState)51); } hitBallEntity.SameFrameClashPlayer(player, hitboxName); return false; } if (hitBallEntity.ballData.cuffBallOwner != -1 && hitBallEntity.ballData.cuffBallOwner != ((AbilityEntity)player).player.CJFLMDNNMIE && ((int)((BouncingData)hitBallEntity.ballData).ballState == 11 || (int)((BouncingData)hitBallEntity.ballData).ballState == 22)) { return false; } ((HittingEntity)player).HandleHitboxGrab(hitboxName, (HitableEntity)(object)hitBallEntity); return true; }), new CodeInstruction(OpCodes.Ret, (object)null) }); return val.InstructionEnumeration(); } [HarmonyPatch(typeof(GetHitPlayerEntity), "ParryAnimFromHitbox")] [HarmonyPrefix] private static bool ParryAnimFromHitbox_Prefix(GetHitPlayerEntity __instance, ref string boxName) { if (boxName == "GRAB_HITBOX") { ((AnimatableEntity)__instance).PlayAnim("grab", "main"); ((AnimatableEntity)__instance).UpdateAnimatableEntity(); ((Entity)__instance).UpdateUnityTransform(); return false; } return true; } [HarmonyPatch(typeof(MovableData), "Load")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> LoadCrouchTimer_Transpiler(IEnumerable<CodeInstruction> instructions) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown List<CodeInstruction> list = new List<CodeInstruction>(instructions); list.Insert(list.Count - 4, new CodeInstruction(OpCodes.Ldarg_0, (object)null)); list.Insert(list.Count - 4, new CodeInstruction(OpCodes.Ldloc_0, (object)null)); list.Insert(list.Count - 4, CodeInstruction.LoadField(typeof(MovableData), "crouchTimer", false)); list.Insert(list.Count - 4, CodeInstruction.StoreField(typeof(MovableData), "crouchTimer")); return list.AsEnumerable(); } [HarmonyPatch(typeof(MovableData), "Pack")] [HarmonyPrefix] private static void PackCrouchTimer_Prefix(SendableState p, bool extensive, MovableData __instance) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) FieldInfo fieldInfo = AccessTools.Field(typeof(MovableData), "crouchTimer"); fieldInfo.SetValue(__instance, HHBCPNCDNDH.DBOMOJGKIFI); p.AddFloatf((HHBCPNCDNDH)fieldInfo.GetValue(__instance), "Movable.crouchTimer"); } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyPostfix] private static void AddCrouchTimerToConstructor_PostFix(MovableData __instance) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) AccessTools.Field(typeof(MovableData), "crouchTimer").SetValue(__instance, HHBCPNCDNDH.DBOMOJGKIFI); } [HarmonyPatch(typeof(CrouchAbility), "Update")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> CrouchStickyFix(IEnumerable<CodeInstruction> instructions, ILGenerator iLGenerator) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Expected O, but got Unknown //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Expected O, but got Unknown //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Expected O, but got Unknown //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Expected O, but got Unknown //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Expected O, but got Unknown //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Expected O, but got Unknown //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Expected O, but got Unknown //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Expected O, but got Unknown //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); Label label = iLGenerator.DefineLabel(); FieldInfo crouchTimerFieldInfo = AccessTools.Field(typeof(MovableData), "crouchTimer"); val.MatchForward(true, (CodeMatch[])(object)new CodeMatch[6] { new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldfld && ((FieldInfo)i.operand).Name == "data"), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldfld && ((FieldInfo)i.operand).Name == "abilityStateTimer"), (string)null), new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldfld && ((FieldInfo)i.operand).Name == "entity"), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldfld && ((FieldInfo)i.operand).Name == "crouchOutDuration"), (string)null), new CodeMatch((OpCode?)OpCodes.Call, (object)null, (string)null) }); val.SearchForward((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Brfalse)); val.Operand = label; val.SearchForward((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && ((MethodInfo)i.operand).Name == "DoJump")).Advance(1); val.Operand = label; val.SearchForward((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && ((MethodInfo)i.operand).Name == "StartAbility")).Advance(1); val.Operand = label; val.SearchForward((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && ((MethodInfo)i.operand).Name == "EndAbilityStateToNormal")).Advance(1); val.Insert((CodeInstruction[])(object)new CodeInstruction[1] { new CodeInstruction(OpCodes.Ldarg_0, (object)null) }); val.Labels.Add(label); val.Advance(1); val.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[1] { Transpilers.EmitDelegate<Action<CrouchAbility>>((Action<CrouchAbility>)delegate(CrouchAbility inst) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) crouchTimerFieldInfo.SetValue(((Ability)inst).data, HHBCPNCDNDH.DBOMOJGKIFI); }) }); val.SearchForward((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldstr && i.operand.ToString() == "IN_CROUCH")); val.SearchForward((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldarg_0)); val.Insert((CodeInstruction[])(object)new CodeInstruction[2] { new CodeInstruction(OpCodes.Ldarg_0, (object)null), Transpilers.EmitDelegate<Action<CrouchAbility>>((Action<CrouchAbility>)delegate(CrouchAbility inst) { //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_0024: Unknown result type (might be due to invalid IL or missing references) FieldInfo fieldInfo = crouchTimerFieldInfo; fieldInfo.SetValue(((Ability)inst).data, HHBCPNCDNDH.GAFCIOAEGKD((HHBCPNCDNDH)fieldInfo.GetValue(((Ability)inst).data), World.FDELTA_TIME)); }) }); int num = -1; int num2 = -1; val.MatchForward(true, (CodeMatch[])(object)new CodeMatch[3] { new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldfld && ((FieldInfo)i.operand).Name == "entity"), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldsfld && ((FieldInfo)i.operand).Name == "DOWN"), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && ((MethodInfo)i.operand).Name == "GetInput"), (string)null) }); num = val.Pos; val.MatchBack(false, (CodeMatch[])(object)new CodeMatch[3] { new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldfld && ((FieldInfo)i.operand).Name == "data"), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldfld && ((FieldInfo)i.operand).Name == "abilityStateTimer"), (string)null) }); num2 = val.Pos; val.RemoveInstructionsInRange(num2, num); val.Insert((CodeInstruction[])(object)new CodeInstruction[2] { new CodeInstruction(OpCodes.Ldarg_0, (object)null), Transpilers.EmitDelegate<Func<CrouchAbility, bool>>((Func<CrouchAbility, bool>)((CrouchAbility inst) => !HHBCPNCDNDH.OAHDEOGKOIM((HHBCPNCDNDH)crouchTimerFieldInfo.GetValue(((Ability)inst).data), ((MovableEntity)((Ability)inst).entity).crouchMinDuration) || ((ControllableEntity)((Ability)inst).entity).GetInput(InputAction.DOWN))) }); return val.InstructionEnumeration(); } [HarmonyPatch(typeof(CrouchAbility), "Start")] [HarmonyPostfix] private static void GetCrouchTimer(CrouchAbility __instance) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) AccessTools.Field(typeof(MovableData), "crouchTimer").SetValue(((Ability)__instance).data, HHBCPNCDNDH.DBOMOJGKIFI); } [HarmonyPatch(typeof(AbilityEntity), "UpdateAbilityState")] [HarmonyPostfix] private static void CheckCrouchCancel_Postfix(AbilityEntity __instance) { FieldInfo fieldInfo = AccessTools.Field(typeof(AbilityState), "canCrouchCancel"); AbilityState obj = __instance.abilityStates[((MovableData)__instance.abilityData).abilityState]; if ((bool)fieldInfo.GetValue(obj) && ((Ability)__instance.crouchAbility).CheckActivation(true) && !__instance.abilityData.isEatingStuff) { __instance.abilityData.bufferAbility = string.Empty; ((MovableEntity)__instance).SetAbilityState("IN_CROUCH"); } } [HarmonyPatch(typeof(AbilityEntity), "SetEntityAbilities")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> AddCanCrouchCancel_Transpiler(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); val.MatchForward(true, (CodeMatch[])(object)new CodeMatch[5] { new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldstr && i.operand.ToString().Contains("_HURTBOX")), (string)null), new CodeMatch((OpCode?)OpCodes.Callvirt, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldloc_1, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Stfld, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldloc_0, (object)null, (string)null) }).Insert((CodeInstruction[])(object)new CodeInstruction[3] { new CodeInstruction(OpCodes.Ldloc_0, (object)null), new CodeInstruction(OpCodes.Ldc_I4_1, (object)null), new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(AbilityState), "canCrouchCancel")) }); return val.InstructionEnumeration(); } [HarmonyPatch(typeof(MovableEntity), "Movement")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator iLGenerator) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); Label label = iLGenerator.DefineLabel(); val.MatchForward(true, (CodeMatch[])(object)new CodeMatch[4] { new CodeMatch((OpCode?)OpCodes.Ldloc_S, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldstr, (object)"startRun", (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Call && ((MethodInfo)i.operand).Name == "op_Equality"), (string)null), new CodeMatch((OpCode?)OpCodes.Brfalse, (object)null, (string)null) }); val.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[4] { new CodeInstruction(OpCodes.Brtrue, (object)label), new CodeInstruction(OpCodes.Ldloc_S, (object)(byte)7), new CodeInstruction(OpCodes.Ldstr, (object)"land"), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(string), "op_Equality", (Type[])null, (Type[])null)) }).Advance(1); val.Labels.Add(label); return val.InstructionEnumeration(); } [HarmonyPatch(typeof(InputAction), "ActionHeldRelevant")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> GrabTranspiler(IEnumerable<CodeInstruction> instructions, ILGenerator iLGenerator) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected O, but got Unknown //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); Label label = iLGenerator.DefineLabel(); val.End(); val.MatchBack(false, (CodeMatch[])(object)new CodeMatch[4] { new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldsfld && ((FieldInfo)i.operand).Name == "BUNT"), (string)null), new CodeMatch((OpCode?)OpCodes.Beq, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null) }).Insert((CodeInstruction[])(object)new CodeInstruction[3] { new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Ldsfld, (object)AccessTools.Field(typeof(InputAction), "GRAB")), new CodeInstruction(OpCodes.Beq, (object)label) }).SearchForward((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldc_I4_1)); val.Labels.Add(label); return val.InstructionEnumeration(); } [HarmonyPatch(typeof(MovableEntity), "Movement")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> AirPivotBuffer_Transpiler(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[3] { new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldsfld && ((FieldInfo)i.operand).Name == "UP"), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Call && ((MethodInfo)i.operand).Name == "GetInputNew"), (string)null) }); val.Advance(1).Insert((CodeInstruction[])(object)new CodeInstruction[2] { Transpilers.EmitDelegate<Action<MovableEntity>>((Action<MovableEntity>)delegate(MovableEntity moveEnt) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) if (HHBCPNCDNDH.EAOICALCHJI(moveEnt.moveableData.pivotBuffer, HHBCPNCDNDH.DBOMOJGKIFI) && ((ControllableEntity)moveEnt).GetInput(InputAction.DOWN)) { string currentAnim = ((AnimatableEntity)moveEnt).GetAnimDataOfVisual("main").currentAnim; if (((Entity)moveEnt).OnGround() && currentAnim == "land") { moveEnt.StartAbility("crouch"); moveEnt.moveableData.pivotBuffer = HHBCPNCDNDH.GANELPBAOPN(HHBCPNCDNDH.NPDCPLFLLIG(moveEnt.moveableData.pivotBuffer)); } } else if (HHBCPNCDNDH.OAHDEOGKOIM(moveEnt.moveableData.pivotBuffer, ((Entity)moveEnt).framesDuration60fps(6))) { string currentAnim2 = ((AnimatableEntity)moveEnt).GetAnimDataOfVisual("main").currentAnim; if (((Entity)moveEnt).OnGround() && currentAnim2 == "land") { if (((ControllableEntity)moveEnt).GetInput(InputAction.LEFT) && HHBCPNCDNDH.EAOICALCHJI(HHBCPNCDNDH.FCGOICMIBEA(moveEnt.moveableData.pivotBuffer, HHBCPNCDNDH.GEIMAIJIPKI(2L)), HHBCPNCDNDH.DBOMOJGKIFI)) { EffectHandler.instance.CreateSlowDustEffect(new IBGCBLLKIHA(HHBCPNCDNDH.FCKBPDNEAOG(((Entity)moveEnt).GetPosition().GCPKPHMKLBN, HHBCPNCDNDH.AJOCFFLIIIH(HHBCPNCDNDH.NKKIFJJEPOL(14m), World.FPIXEL_SIZE)), ((JEPKNLONCHD)(ref moveEnt.moveBox.bounds)).DLIFPGENCIG().CGJJEHPPOAN), (Side)0); moveEnt.SetMoveDirection((Side)1, IBGCBLLKIHA.GCPFGINDGEM()); moveEnt.SetAbilityState("START_RUN"); moveEnt.moveableData.pivotBuffer = HHBCPNCDNDH.GANELPBAOPN(HHBCPNCDNDH.NPDCPLFLLIG(moveEnt.moveableData.pivotBuffer)); } else if (((ControllableEntity)moveEnt).GetInput(InputAction.RIGHT) && HHBCPNCDNDH.EAOICALCHJI(HHBCPNCDNDH.FCGOICMIBEA(moveEnt.moveableData.pivotBuffer, HHBCPNCDNDH.GEIMAIJIPKI(2L)), HHBCPNCDNDH.DBOMOJGKIFI)) { EffectHandler.instance.CreateSlowDustEffect(new IBGCBLLKIHA(HHBCPNCDNDH.GAFCIOAEGKD(((Entity)moveEnt).GetPosition().GCPKPHMKLBN, HHBCPNCDNDH.AJOCFFLIIIH(HHBCPNCDNDH.NKKIFJJEPOL(46m), World.FPIXEL_SIZE)), ((JEPKNLONCHD)(ref moveEnt.moveBox.bounds)).DLIFPGENCIG().CGJJEHPPOAN), (Side)1); moveEnt.SetMoveDirection((Side)0, IBGCBLLKIHA.GCPFGINDGEM()); moveEnt.SetAbilityState("START_RUN"); moveEnt.moveableData.pivotBuffer = HHBCPNCDNDH.GANELPBAOPN(HHBCPNCDNDH.NPDCPLFLLIG(moveEnt.moveableData.pivotBuffer)); } } } }), new CodeInstruction(OpCodes.Ldarg_0, (object)null) }); return val.InstructionEnumeration(); } [HarmonyPatch(typeof(UIInput), "HandleCursors")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> CursorSpeedRelativeToResolution(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); int num = -1; int num2 = -1; val.MatchForward(true, (CodeMatch[])(object)new CodeMatch[3] { new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Call && ((MethodInfo)i.operand).Name == "get_deltaTime"), (string)null), new CodeMatch((OpCode?)OpCodes.Call, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Stfld && ((FieldInfo)i.operand).Name == "move"), (string)null) }).Advance(-1); num2 = val.Pos; val.MatchBack(true, (CodeMatch[])(object)new CodeMatch[3] { new CodeMatch((OpCode?)OpCodes.Ldloc_0, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldloc_0, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldfld && ((FieldInfo)i.operand).Name == "move"), (string)null) }).Advance(1); num = val.Pos; val.RemoveInstructionsInRange(num, num2).Insert((CodeInstruction[])(object)new CodeInstruction[1] { Transpilers.EmitDelegate<Func<Vector2, Vector2>>((Func<Vector2, Vector2>)((Vector2 move) => move * UIInput.cursorSpeed * UIInput.mainCursor.GetHoverSlow() * Time.deltaTime * ((float)Screen.width / 1280f))) }); return val.InstructionEnumeration(); } } [HarmonyPatch] internal class LandingHurtboxPatch { [HarmonyPatch(typeof(AbilityEntity), "SetEntityAbilities")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> AddLandingHurtboxToState(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown return new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldstr && i.operand?.ToString() == "LAND"), (string)null) }).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldstr && i.operand?.ToString() == "CROUCH_HURTBOX"), (string)null) }).SetOperandAndAdvance((object)"LANDING_HURTBOX") .End() .InstructionEnumeration(); } private static IEnumerable<CodeInstruction> GetLandingHurtboxInstructions(IEnumerable<CodeInstruction> instructions, int sizeX, int sizeY) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Expected O, but got Unknown return new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[2] { new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldstr && i.operand?.ToString() == "CROUCH_HURTBOX"), (string)null) }).Insert((CodeInstruction[])(object)new CodeInstruction[3] { new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Ldloc_0, (object)null), Transpilers.EmitDelegate<Action<AttackingEntity, HHBCPNCDNDH>>((Action<AttackingEntity, HHBCPNCDNDH>)delegate(AttackingEntity attEntity, HHBCPNCDNDH fpixel_SIZE) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) IBGCBLLKIHA val = default(IBGCBLLKIHA); ((IBGCBLLKIHA)(ref val))..ctor(((JEPKNLONCHD)(ref ((MovableEntity)(PlayerEntity)attEntity).moveBox.bounds)).FDMPHHEJPCH().GCPKPHMKLBN, HHBCPNCDNDH.GAFCIOAEGKD(((JEPKNLONCHD)(ref ((MovableEntity)(PlayerEntity)attEntity).moveBox.bounds)).DLIFPGENCIG().CGJJEHPPOAN, HHBCPNCDNDH.AJOCFFLIIIH(HHBCPNCDNDH.NKKIFJJEPOL((decimal)sizeY * 0.5m), fpixel_SIZE))); attEntity.CreateHurtbox("LANDING_HURTBOX", IBGCBLLKIHA.AJOCFFLIIIH(new IBGCBLLKIHA(sizeX, sizeY), fpixel_SIZE), val); }) }).InstructionEnumeration(); } [HarmonyPatch(typeof(PongPlayer), "SetEntityBoxes")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> PongPlayer_Transpiler(IEnumerable<CodeInstruction> instructions) { return GetLandingHurtboxInstructions(instructions, 80, 74).AsEnumerable(); } [HarmonyPatch(typeof(BagPlayer), "SetEntityBoxes")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> BagPlayer_Transpiler(IEnumerable<CodeInstruction> instructions) { return GetLandingHurtboxInstructions(instructions, 80, 94).AsEnumerable(); } [HarmonyPatch(typeof(BossPlayer), "SetEntityBoxes")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> BossPlayer_Transpiler(IEnumerable<CodeInstruction> instructions) { return GetLandingHurtboxInstructions(instructions, 100, 115).AsEnumerable(); } [HarmonyPatch(typeof(CopPlayer), "SetEntityBoxes")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> CopPlayer_Transpiler(IEnumerable<CodeInstruction> instructions) { return GetLandingHurtboxInstructions(instructions, 80, 90).AsEnumerable(); } [HarmonyPatch(typeof(CrocPlayer), "SetEntityBoxes")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> CrocPlayer_Transpiler(IEnumerable<CodeInstruction> instructions) { return GetLandingHurtboxInstructions(instructions, 80, 80).AsEnumerable(); } [HarmonyPatch(typeof(KidPlayer), "SetEntityBoxes")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> KidPlayer_Transpiler(IEnumerable<CodeInstruction> instructions) { return GetLandingHurtboxInstructions(instructions, 80, 74).AsEnumerable(); } [HarmonyPatch(typeof(RobotPlayer), "SetEntityBoxes")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> RobotPlayer_Transpiler(IEnumerable<CodeInstruction> instructions) { return GetLandingHurtboxInstructions(instructions, 80, 100).AsEnumerable(); } [HarmonyPatch(typeof(SkatePlayer), "SetEntityBoxes")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> SkatePlayer_Transpiler(IEnumerable<CodeInstruction> instructions) { return GetLandingHurtboxInstructions(instructions, 80, 100).AsEnumerable(); } [HarmonyPatch(typeof(ElectroPlayer), "SetEntityBoxes")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> ElectroPlayer_Transpiler(IEnumerable<CodeInstruction> instructions) { return GetLandingHurtboxInstructions(instructions, 70, 119).AsEnumerable(); } [HarmonyPatch(typeof(BoomPlayer), "SetEntityBoxes")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> BoomPlayer_Transpiler(IEnumerable<CodeInstruction> instructions) { return GetLandingHurtboxInstructions(instructions, 80, 100).AsEnumerable(); } [HarmonyPatch(typeof(CandyPlayer), "SetEntityBoxes")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> CandyPlayer_Transpiler(IEnumerable<CodeInstruction> instructions) { return GetLandingHurtboxInstructions(instructions, 80, 74).AsEnumerable(); } [HarmonyPatch(typeof(GrafPlayer), "SetEntityBoxes")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> GrafPlayer_Transpiler(IEnumerable<CodeInstruction> instructions) { return GetLandingHurtboxInstructions(instructions, 80, 90).AsEnumerable(); } } internal class LieHurtboxPatch { [HarmonyTargetMethods] private static IEnumerable<MethodBase> TargetMethods() { yield return AccessTools.Method(typeof(BossPlayer), "SetEntityBoxes", (Type[])null, (Type[])null); } private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); int num = -1; int num2 = -1; val.SearchForward((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldstr && i.operand.ToString() == "LIE_HURTBOX")); num = val.Pos; val.MatchForward(true, (CodeMatch[])(object)new CodeMatch[3] { new CodeMatch((OpCode?)OpCodes.Call, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Call && ((MethodInfo)i.operand).Name == "CreateHurtbox"), (string)null), new CodeMatch((OpCode?)OpCodes.Pop, (object)null, (string)null) }); num2 = val.Pos; val.SearchBack((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Ldstr && i.operand.ToString() == "LIE_HURTBOX")); val.RemoveInstructionsInRange(num, num2); val.Insert((CodeInstruction[])(object)new CodeInstruction[1] { Transpilers.EmitDelegate<Action<PlayerEntity>>((Action<PlayerEntity>)delegate(PlayerEntity character) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) ((AttackingEntity)character).CreateHurtbox("LIE_HURTBOX", IBGCBLLKIHA.AJOCFFLIIIH(new IBGCBLLKIHA(new HHBCPNCDNDH(character.pxHeight), HHBCPNCDNDH.NKKIFJJEPOL(45)), World.FPIXEL_SIZE), new IBGCBLLKIHA(HHBCPNCDNDH.DBOMOJGKIFI, HHBCPNCDNDH.GAFCIOAEGKD(((JEPKNLONCHD)(ref ((MovableEntity)character).moveBox.bounds)).DLIFPGENCIG().CGJJEHPPOAN, HHBCPNCDNDH.NKKIFJJEPOL(0.23m)))); }) }); return val.InstructionEnumeration(); } } public class LLBCommunityTweak : HarmonyTweak { public LLBCommunityTweak() : base("com.github.daioutzu.llbcommunitypatch-tweak", "LLBCommunityPatch", (Harmony)null) { ((HarmonyTweak)this).AddPatchClass(typeof(BallPatch), false); ((HarmonyTweak)this).AddPatchClass(typeof(CheckParryPatch), false); ((HarmonyTweak)this).AddPatchClass(typeof(GeneralPatch), false); ((HarmonyTweak)this).AddPatchClass(typeof(LandingHurtboxPatch), false); ((HarmonyTweak)this).AddPatchClass(typeof(FPP_Patch), false); ((HarmonyTweak)this).AddPatchClass(typeof(VisualsPatch), false); ((HarmonyTweak)this).AddPatchClass(typeof(LieHurtboxPatch), false); ((HarmonyTweak)this).AddPatchClass(typeof(DownAirHitRecoveryPatch), false); ((HarmonyTweak)this).AddPatchClass(typeof(SimpleParryChanges), false); ((HarmonyTweak)this).AddPatchClass(typeof(PushPlayersInRadius_Patch), false); ((HarmonyTweak)this).AddPatchClass(typeof(CursorSpeedPatch), false); ((HarmonyTweak)this).AddPatchClass(typeof(DicePatch), false); ((HarmonyTweak)this).AddPatchClass(typeof(DustAshesPatch), false); ((HarmonyTweak)this).AddPatchClass(typeof(LatchPatch), false); ((HarmonyTweak)this).AddPatchClass(typeof(ToxicPatch), false); ((HarmonyTweak)this).AddPatchClass(typeof(NitroPatch), false); ((HarmonyTweak)this).AddPatchClass(typeof(SwitchPatch), false); ((HarmonyTweak)this).AddPatchClass(typeof(GridPatch), false); } protected override void DoPatch() { ((HarmonyTweak)this).DoPatch(); } protected override void DoUnpatch() { ((HarmonyTweak)this).DoUnpatch(); } } [BepInPlugin("com.github.daioutzu.llbcommunitypatch", "LLBCommunityPatch", "1.5.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInProcess("LLBlaze.exe")] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger; private Harmony harmony = new Harmony("com.github.daioutzu.llbcommunitypatch"); private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; Logger.LogInfo((object)"Plugin LLBCommunityPatch is loaded!"); bool flag = false; string[] patcherDLLs = GetPatcherDLLs(); for (int i = 0; i < patcherDLLs.Length; i++) { if (Path.GetFileName(patcherDLLs[i]).Contains("LLBPatcher.dll")) { LLBTweaker.AddTweak((TweakBase)(object)new LLBCommunityTweak()); flag = true; break; } } if (!flag) { Logger.LogFatal((object)("Could not find patcher file \"LLBPatcher.dll\" in " + Paths.PatcherPluginPath)); } } public static float Floatf2Float(HHBCPNCDNDH BKPKJLGNIMB) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) return (float)(long)AccessTools.Field(typeof(HHBCPNCDNDH), "OHJPAPMBBKM").GetValue(BKPKJLGNIMB) / 4.2949673E+09f; } public static string[] GetPatcherDLLs() { return Directory.GetFiles(Paths.PatcherPluginPath, "*.dll", SearchOption.AllDirectories); } } internal class VisualsPatch { [HarmonyPatch(typeof(BagPlayerModel), "SetEntityVisuals")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> StaticAltBag_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator iLGenerator) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Expected O, but got Unknown //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Expected O, but got Unknown //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Expected O, but got Unknown //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Expected O, but got Unknown //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Expected O, but got Unknown //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Expected O, but got Unknown //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Expected O, but got Unknown //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, iLGenerator); Label label = iLGenerator.DefineLabel(); val.MatchForward(true, (CodeMatch[])(object)new CodeMatch[4] { new CodeMatch((OpCode?)OpCodes.Ldstr, (object)"root/s1/s2/s3/flap/neck", (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && ((MethodInfo)i.operand).Name == "Find"), (string)null), new CodeMatch((OpCode?)OpCodes.Stfld, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null) }); Label label2 = default(Label); val.CreateLabel(ref label2); val.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[5] { new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Ldfld, (object)AccessTools.Field(typeof(AbilityEntity), "player")), new CodeInstruction(OpCodes.Ldfld, (object)AccessTools.Field(typeof(ALDOKEMAOMB), "AIINAIDBHJI")), new CodeInstruction(OpCodes.Ldc_I4_8, (object)null), new CodeInstruction(OpCodes.Bne_Un_S, (object)label2) }); val.Insert((CodeInstruction[])(object)new CodeInstruction[4] { new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Ldloc_0, (object)null), Transpilers.EmitDelegate<Func<BagPlayerModel, AOOJOMIECLD, bool>>((Func<BagPlayerModel, AOOJOMIECLD, bool>)delegate(BagPlayerModel bagModel, AOOJOMIECLD characterModelValues) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Invalid comparison between Unknown and I4 //IL_0029: Unknown result type (might be due to invalid IL or missing references) if ((int)((AbilityEntity)bagModel).player.AIINAIDBHJI == 8) { ((VisualEntity)bagModel).SetVisualModel("shadowVisual", AOOJOMIECLD.HCFBCKBLLAH((Character)11, "shadow", ((AOOJOMIECLD)(ref characterModelValues)).KGFMPDNFIEC(), 0.39f, 0, (FKBHNEMDBMK)3), false, false); return true; } return false; }), new CodeInstruction(OpCodes.Br, (object)label) }); val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[5] { new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldstr, (object)"shadowVisual", (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Call && ((MethodInfo)i.operand).Name == "GetVisual"), (string)null), new CodeMatch((OpCode?)OpCodes.Ldc_I4_0, (object)null, (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction i) => i.opcode == OpCodes.Stfld && ((FieldInfo)i.operand).Name == "flipMode"), (string)null) }); val.Labels.Add(label); return val.InstructionEnumeration(); } [HarmonyPatch(typeof(BossPlayerModel), "SetEntityVisuals")] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> StaticAltBox_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator iLGenerator) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Expected O, but got Unknown //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Expected O, but got Unknown //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Expected O, but got Unknown //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Expected O, but got Unknown //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Expected O, but got Unknown //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Expected O, but got Unknown //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Expected O, but got Unknown //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Expected O, but got Unknown //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Expected O, but got Unknown //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Expected O, but got Unknown //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Expected O, but got Unknown //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Expected O, but got Unknown //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Expected O, but got Unknown //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, iLGenerator); Label label = iLGenerator.DefineLabel(); val.MatchForward(true, (CodeMatch[])(object)new CodeMatch[6] { new CodeMatch((OpCode?)OpCodes.Ldstr, (object)"boostFlameL", (string)null), new CodeMatch((OpCode?)OpCodes.Ldc_I4_6, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldstr, (object)"boostFlame", (string)null), new CodeMatch((OpCode?)OpCodes.Ldloca_S, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Call, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldc_R4, (object)null, (string)null) }).Advance(2).InsertAndAdvance((Co