using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using EntityStates;
using EntityStates.BrotherMonster;
using EntityStates.LunarExploderMonster;
using EntityStates.MinorConstruct;
using EntityStates.Scrapper;
using EntityStates.VoidCamp;
using Facepunch.Steamworks;
using HarmonyLib;
using IL.EntityStates.BrotherMonster;
using IL.EntityStates.ChildMonster;
using IL.EntityStates.Duplicator;
using IL.EntityStates.Huntress.Weapon;
using IL.EntityStates.Merc;
using IL.EntityStates.MinorConstruct;
using IL.EntityStates.Scrapper;
using IL.RoR2;
using IL.RoR2.UI;
using Microsoft.CodeAnalysis;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using On.RoR2;
using On.RoR2.PostProcessing;
using Rewired;
using RoR2;
using RoR2.Items;
using RoR2.Navigation;
using RoR2.Orbs;
using RoR2.PostProcessing;
using RoR2.Projectile;
using RoR2.Stats;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.EventSystems;
using UnityEngine.Networking;
using UnityEngine.ResourceManagement.AsyncOperations;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("MiscFixes")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+49dbfa8ef4ba1ce1e079df1efdc43012d7922a02")]
[assembly: AssemblyProduct("MiscFixes")]
[assembly: AssemblyTitle("MiscFixes")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: UnverifiableCode]
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 MiscFixes
{
[HarmonyPatch]
public class FixVanilla
{
[HarmonyPatch(typeof(FlickerLight), "Update")]
[HarmonyPrefix]
public static bool Ugh(FlickerLight __instance)
{
return Object.op_Implicit((Object)(object)__instance.light);
}
[HarmonyPatch(typeof(CharacterBody), "TriggerEnemyDebuffs")]
[HarmonyILManipulator]
public static void WhatTheFuck(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
int num = default(int);
if (val.TryGotoNext(new Func<Instruction, bool>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<DotController>(x, "GetDotDef"),
(Instruction x) => ILPatternMatchingExt.MatchPop(x)
}))
{
ILLabel val2 = val.DefineLabel();
val.Emit(OpCodes.Br, (object)val2);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchPop(x)
});
val.MarkLabel(val2);
}
else
{
Debug.LogError((object)"IL hook failed for CharacterBody.TriggerEnemyDebuffs");
}
}
[HarmonyPatch(typeof(CharacterBody), "TryGiveFreeUnlockWhenLevelUp")]
[HarmonyILManipulator]
public static void FreeFortniteCard(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_006c: 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_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
ILLabel retLabel = null;
ILCursor[] array = default(ILCursor[]);
if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)AccessTools.PropertyGetter(typeof(CharacterBody), "inventory"))
}) && val.TryFindNext(ref array, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchBle(x, ref retLabel)
}))
{
ILLabel val2 = val.DefineLabel();
val.Emit(OpCodes.Dup);
val.EmitOpImplicit();
val.Emit(OpCodes.Brtrue, (object)val2);
val.Emit(OpCodes.Pop);
val.Emit(OpCodes.Br, (object)retLabel);
val.MarkLabel(val2);
}
else
{
Debug.LogError((object)"IL hook failed for CharacterBody.TryGiveFreeUnlockWhenLevelUp");
}
}
[HarmonyPatch(typeof(VineOrb), "OnArrival")]
[HarmonyILManipulator]
public static void VineOrbArrival(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
int bodyLoc = 0;
ILCursor[] array = default(ILCursor[]);
if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2]
{
(Instruction x) => ILPatternMatchingExt.MatchLdfld<HealthComponent>(x, "body"),
(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref bodyLoc)
}) && val.TryFindNext(ref array, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "Play_item_proc_triggerEnemyDebuffs")
}))
{
ILLabel val2 = val.DefineLabel();
val.Emit(OpCodes.Ldloc, bodyLoc);
val.EmitOpImplicit();
val.Emit(OpCodes.Brfalse, (object)val2);
val.GotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "Play_item_proc_triggerEnemyDebuffs")
});
val.MarkLabel(val2);
}
else
{
Debug.LogError((object)"IL hook failed for VineOrb.OnArrival");
}
}
[HarmonyPatch(typeof(BossGroup), "OnDefeatedServer")]
[HarmonyILManipulator]
public static void BossGroupEvent(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
if (val.TryGotoNext(new Func<Instruction, bool>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)AccessTools.PropertyGetter(typeof(Run), "instance")),
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Run>(x, "OnServerBossDefeated")
}))
{
ILLabel val2 = val.DefineLabel();
ILLabel val3 = val.DefineLabel();
int index = val.Index;
val.Index = index + 1;
val.Emit(OpCodes.Dup);
val.EmitOpImplicit();
val.Emit(OpCodes.Brtrue, (object)val3);
val.Emit(OpCodes.Pop);
val.Emit(OpCodes.Br, (object)val2);
val.MarkLabel(val3);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Run>(x, "OnServerBossDefeated")
});
val.MarkLabel(val2);
}
else
{
Debug.LogError((object)"IL hook failed for BossGroup.OnDefeatedServer");
}
}
[HarmonyPatch(typeof(ProjectileController), "Start")]
[HarmonyILManipulator]
public static void ProjectileStart(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_0110: 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_0142: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
ILLabel label = null;
int num = default(int);
ILLabel val2 = default(ILLabel);
if (val.TryGotoNext(new Func<Instruction, bool>[4]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)AccessTools.PropertySetter(typeof(ProjectileController), "shouldPlaySounds")),
(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num),
(Instruction x) => x.MatchOpImplicit(),
(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref label)
}) && val.TryGotoNext((MoveType)1, new Func<Instruction, bool>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)AccessTools.PropertyGetter(typeof(ProjectileController), "isPrediction")),
(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val2)
}))
{
val.Emit(OpCodes.Ldarg_0);
val.Emit(OpCodes.Call, (MethodBase)AccessTools.PropertyGetter(typeof(ProjectileController), "ghost"));
val.EmitOpImplicit();
val.Emit(OpCodes.Brfalse, (object)label);
}
else
{
Debug.LogError((object)"IL hook failed for ProjectileController.Start");
}
}
[HarmonyPatch(typeof(TemporaryOverlayInstance), "SetupMaterial")]
[HarmonyPrefix]
public static void SetupMaterial(TemporaryOverlayInstance __instance)
{
if (!Object.op_Implicit((Object)(object)__instance.originalMaterial) && __instance.ValidateOverlay())
{
__instance.componentReference.CopyDataFromPrefabToInstance();
}
}
[HarmonyPatch(typeof(StatManager), "ProcessGoldEvents")]
[HarmonyILManipulator]
public static void ProcessGold(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
ILCursor val = new ILCursor(il);
ILLabel val3 = default(ILLabel);
if (val.TryGotoNext(new Func<Instruction, bool>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchLdfld<GoldEvent>(x, "characterMaster"),
(Instruction x) => ILPatternMatchingExt.MatchDup(x),
(Instruction x) => ILPatternMatchingExt.MatchBrtrue(x, ref val3)
}))
{
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchDup(x)
});
val.EmitOpImplicit();
}
else
{
Debug.LogError((object)"IL hook failed for StatManager.ProcessGoldEvents 1");
}
ILLabel val2 = default(ILLabel);
if (val.TryGotoNext(new Func<Instruction, bool>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Component>(x, "GetComponent"),
(Instruction x) => ILPatternMatchingExt.MatchDup(x),
(Instruction x) => ILPatternMatchingExt.MatchBrtrue(x, ref val2)
}))
{
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchDup(x)
});
val.EmitOpImplicit();
}
else
{
Debug.LogError((object)"IL hook failed for StatManager.ProcessGoldEvents 2");
}
}
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
[HarmonyILManipulator]
private static void DevotionTele(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_0169: Unknown result type (might be due to invalid IL or missing references)
//IL_0175: Unknown result type (might be due to invalid IL or missing references)
//IL_018d: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
ILLabel nextLoopLabel = null;
FieldReference bodyField = null;
int num = default(int);
ILLabel val3 = default(ILLabel);
FieldReference val2 = default(FieldReference);
if (val.TryGotoNext(new Func<Instruction, bool>[4]
{
(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)AccessTools.PropertyGetter(typeof(List<NodeIndex>), "Count")),
(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val3),
(Instruction x) => ILPatternMatchingExt.MatchBr(x, ref nextLoopLabel)
}) && val.TryGotoPrev(new Func<Instruction, bool>[6]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld(x, ref val2),
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld(x, ref bodyField),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)AccessTools.PropertyGetter(typeof(Component), "transform")),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)AccessTools.PropertyGetter(typeof(Transform), "position"))
}))
{
val.Emit(OpCodes.Ldarg_0);
val.Emit(OpCodes.Ldfld, bodyField);
val.EmitOpImplicit();
val.Emit(OpCodes.Brfalse, (object)nextLoopLabel);
}
else
{
Debug.LogError((object)"IL hook failed for DevotedLemurianController.TryTeleport");
}
}
[HarmonyPatch(typeof(MinionLeashBodyBehavior), "OnDisable")]
[HarmonyILManipulator]
private static void MinionLeash(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_010d: Unknown result type (might be due to invalid IL or missing references)
//IL_011f: Unknown result type (might be due to invalid IL or missing references)
//IL_012c: Unknown result type (might be due to invalid IL or missing references)
//IL_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_0149: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
if (new ILCursor(il).TryGotoNext(new Func<Instruction, bool>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)AccessTools.PropertyGetter(typeof(SceneInfo), "instance")),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)AccessTools.PropertyGetter(typeof(SceneInfo), "sceneDef")),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)AccessTools.PropertyGetter(typeof(SceneDef), "cachedName"))
}))
{
int index = val.Index;
val.Index = index + 1;
ILLabel val2 = val.DefineLabel();
ILLabel val3 = val.DefineLabel();
ILLabel val4 = val.DefineLabel();
val.Emit(OpCodes.Dup);
val.EmitOpImplicit();
val.Emit(OpCodes.Brtrue, (object)val3);
val.Emit(OpCodes.Pop);
val.Emit<string>(OpCodes.Ldsfld, "Empty");
val.Emit(OpCodes.Br, (object)val2);
val.MarkLabel(val3);
index = val.Index;
val.Index = index + 1;
val.Emit(OpCodes.Dup);
val.EmitOpImplicit();
val.Emit(OpCodes.Brtrue, (object)val4);
val.Emit(OpCodes.Pop);
val.Emit<string>(OpCodes.Ldsfld, "Empty");
val.Emit(OpCodes.Br, (object)val2);
val.MarkLabel(val4);
index = val.Index;
val.Index = index + 1;
val.MarkLabel(val2);
}
else
{
Debug.LogError((object)"IL hook failed for MinionLeashBodyBehavior.OnDisable");
}
}
[HarmonyPatch(typeof(ElusiveAntlersPickup), "Start")]
[HarmonyILManipulator]
private static void FixAntlerStart(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: 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)
ILCursor val = new ILCursor(il);
ILLabel retLabel = null;
if (new ILCursor(il).TryGotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref retLabel)
}) && val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdfld<ElusiveAntlersPickup>(x, "ownerBody")
}))
{
ILLabel val2 = val.DefineLabel();
val.Emit(OpCodes.Dup);
val.EmitOpImplicit();
val.Emit(OpCodes.Brtrue, (object)val2);
val.Emit(OpCodes.Pop);
val.Emit(OpCodes.Br, (object)retLabel);
val.MarkLabel(val2);
}
else
{
Debug.LogError((object)"IL hook failed for ElusiveAntlersPickup.Start");
}
}
[HarmonyPatch(typeof(CharacterBody), "OnShardDestroyed")]
[HarmonyILManipulator]
private static void FixRpcShardDestroy(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
if (val.TryGotoNext(new Func<Instruction, bool>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "CallRpcOnShardDestroyedClient")
}))
{
ILLabel val2 = val.DefineLabel();
val.Emit(OpCodes.Ldarg_0);
val.EmitOpImplicit();
val.Emit(OpCodes.Brfalse, (object)val2);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "CallRpcOnShardDestroyedClient")
});
val.MarkLabel(val2);
}
else
{
Debug.LogError((object)"IL hook failed for CharacterBody.OnShardDestroyed");
}
}
[HarmonyILManipulator]
[HarmonyPatch(typeof(ElusiveAntlersPickup), "FixedUpdate")]
private static void ElusiveAntlersPickup_FixedUpdate(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: 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_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
int num2 = default(int);
if (val.TryGotoNext(new Func<Instruction, bool>[5]
{
(Instruction x) => ILPatternMatchingExt.MatchLdfld<ElusiveAntlersPickup>(x, "ownerBody"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)AccessTools.PropertyGetter(typeof(Component), "gameObject")),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)AccessTools.PropertyGetter(typeof(GameObject), "transform")),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)AccessTools.PropertyGetter(typeof(Transform), "position")),
(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num2)
}))
{
int index = val.Index;
val.Index = index + 1;
ILLabel val2 = val.DefineLabel();
ILLabel val3 = val.DefineLabel();
val.Emit(OpCodes.Dup);
val.EmitOpImplicit();
val.Emit(OpCodes.Brtrue, (object)val3);
val.Emit(OpCodes.Pop);
val.Emit<Vector3>(OpCodes.Ldsfld, "zeroVector");
val.Emit(OpCodes.Br, (object)val2);
val.MarkLabel(val3);
int num = default(int);
val.GotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num)
});
val.MarkLabel(val2);
}
else
{
Debug.LogError((object)"IL hook failed for ElusiveAntlersPickup.FixedUpdate");
}
}
[HarmonyPatch(typeof(FogDamageController), "EvaluateTeam")]
[HarmonyILManipulator]
public static void FixFog(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: 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_00f2: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
int locTC = 0;
int locBody = 0;
ILLabel label = null;
ILCursor[] array = default(ILCursor[]);
if (val.TryGotoNext(new Func<Instruction, bool>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref locTC),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)AccessTools.PropertyGetter(typeof(TeamComponent), "body")),
(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref locBody)
}) && val.TryFindPrev(ref array, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchBr(x, ref label)
}))
{
val.Emit(OpCodes.Ldloc, locTC);
val.EmitOpImplicit();
val.Emit(OpCodes.Brfalse, (object)label);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchStloc(x, locBody)
});
val.Emit(OpCodes.Ldloc, locBody);
val.EmitOpImplicit();
val.Emit(OpCodes.Brfalse, (object)label);
}
else
{
Debug.LogError((object)"IL hook failed for FogDamageController.EvaluateTeam");
}
}
[HarmonyPatch(typeof(TetherVfxOrigin), "AddTether")]
[HarmonyILManipulator]
public static void FixTether(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_0118: Unknown result type (might be due to invalid IL or missing references)
//IL_0124: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[5]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<TetherVfxOrigin>(x, "onTetherAdded"),
(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<TetherAddDelegate>(x, "Invoke")
}))
{
ILLabel val2 = val.MarkLabel();
val.GotoPrev((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdfld<TetherVfxOrigin>(x, "onTetherAdded")
});
ILLabel val3 = val.DefineLabel();
val.Emit(OpCodes.Dup);
val.Emit(OpCodes.Brtrue, (object)val3);
val.Emit(OpCodes.Pop);
val.Emit(OpCodes.Br, (object)val2);
val.MarkLabel(val3);
}
else
{
Debug.LogError((object)"IL hook failed for TetherVfxOrigin.AddTether");
}
}
[HarmonyPatch(typeof(CharacterMaster), "TrueKill", new Type[]
{
typeof(GameObject),
typeof(GameObject),
typeof(DamageTypeCombo)
})]
[HarmonyILManipulator]
public static void FixKill(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_0136: Unknown result type (might be due to invalid IL or missing references)
//IL_0229: Unknown result type (might be due to invalid IL or missing references)
//IL_023b: Unknown result type (might be due to invalid IL or missing references)
//IL_0249: Unknown result type (might be due to invalid IL or missing references)
//IL_0255: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
ILLabel label = null;
ILLabel label2 = null;
FieldReference val4 = default(FieldReference);
ILCursor[] array = default(ILCursor[]);
if (val.TryGotoNext(new Func<Instruction, bool>[4]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterMaster>(x, "GetBody"),
(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, ref val4),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "HasBuff")
}) && val.TryFindNext(ref array, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref label)
}))
{
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterMaster>(x, "GetBody")
});
ILLabel val2 = val.DefineLabel();
val.Emit(OpCodes.Dup);
val.EmitOpImplicit();
val.Emit(OpCodes.Brtrue, (object)val2);
val.Emit(OpCodes.Pop);
val.Emit(OpCodes.Br, (object)label);
val.MarkLabel(val2);
}
else
{
Debug.LogError((object)"IL hook failed for CharacterMaster.TrueKill 1");
}
if (val.TryGotoNext(new Func<Instruction, bool>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterMaster>(x, "GetBody"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)AccessTools.PropertyGetter(typeof(CharacterBody), "equipmentSlot"))
}) && val.TryFindNext(ref array, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref label2)
}))
{
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterMaster>(x, "GetBody")
});
ILLabel val3 = val.DefineLabel();
val.Emit(OpCodes.Dup);
val.EmitOpImplicit();
val.Emit(OpCodes.Brtrue, (object)val3);
val.Emit(OpCodes.Pop);
val.Emit(OpCodes.Br, (object)label2);
val.MarkLabel(val3);
}
else
{
Debug.LogError((object)"IL hook failed for CharacterMaster.TrueKill 2");
}
}
[HarmonyPatch(typeof(DeathState), "FixedUpdate")]
[HarmonyILManipulator]
public static void FixExplode(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
ILCursor[] array = default(ILCursor[]);
if (new ILCursor(il).TryFindNext(ref array, new Func<Instruction, bool>[2]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<DeathState>(x, "FireExplosion"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<GameObject>(x, "SetActive")
}))
{
ILCursor obj = array[0];
ILCursor val = array[1];
int index = obj.Index;
obj.Index = index + 1;
obj.MoveAfterLabels();
index = val.Index;
val.Index = index + 1;
obj.Emit(OpCodes.Br, (object)val.MarkLabel());
val.Emit(OpCodes.Ldarg_0);
val.EmitDelegate<Action<DeathState>>((Action<DeathState>)delegate(DeathState self)
{
if (Object.op_Implicit((Object)(object)((EntityState)self).modelLocator) && Object.op_Implicit((Object)(object)((EntityState)self).modelLocator.modelTransform))
{
((Component)((EntityState)self).modelLocator.modelTransform).gameObject.SetActive(false);
}
});
}
else
{
Debug.LogError((object)"IL hook failed for DeathState.FixedUpdate");
}
}
[HarmonyPatch(typeof(MPEventSystem), "Update")]
[HarmonyILManipulator]
public static void FixThisFuckingBullshitGearbox(ILContext il)
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
ILCursor[] array = null;
if (new ILCursor(il).TryFindNext(ref array, new Func<Instruction, bool>[2]
{
(Instruction x) => ILPatternMatchingExt.MatchCall(x, (MethodBase)AccessTools.PropertyGetter(typeof(EventSystem), "current")),
(Instruction x) => ILPatternMatchingExt.MatchCall(x, (MethodBase)AccessTools.PropertySetter(typeof(EventSystem), "current"))
}))
{
array[0].Remove();
array[1].Remove();
}
else
{
Debug.LogError((object)"IL hook failed for MPEventSystem.Update");
}
}
[HarmonyPatch(typeof(Idle), "OnEnter")]
[HarmonyILManipulator]
public static void Spinny(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
int num = default(int);
if (val.TryGotoNext(new Func<Instruction, bool>[5]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)AccessTools.PropertyGetter(typeof(RouletteChestControllerBaseState), "rouletteChestController")),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<RouletteChestController>(x, "purchaseInteraction"),
(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)AccessTools.PropertySetter(typeof(PurchaseInteraction), "Networkavailable"))
}))
{
ILLabel val2 = val.DefineLabel();
val.Emit(OpCodes.Br, (object)val2);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)AccessTools.PropertySetter(typeof(PurchaseInteraction), "Networkavailable"))
});
val.MarkLabel(val2);
val.Emit(OpCodes.Ldarg_0);
val.EmitDelegate<Action<RouletteChestControllerBaseState>>((Action<RouletteChestControllerBaseState>)delegate(RouletteChestControllerBaseState ctrl)
{
if (Object.op_Implicit((Object)(object)ctrl.rouletteChestController) && Object.op_Implicit((Object)(object)ctrl.rouletteChestController.purchaseInteraction))
{
ctrl.rouletteChestController.purchaseInteraction.Networkavailable = true;
}
});
}
else
{
Debug.LogError((object)"IL hook failed for MPEventSystem.Update");
}
}
[HarmonyPatch(typeof(BaseSteamworks), "RunUpdateCallbacks")]
[HarmonyFinalizer]
public static Exception FixFacepunch(Exception __exception)
{
return null;
}
[HarmonyPatch(typeof(Idle), "FixedUpdate")]
[HarmonyPatch(typeof(VoidCampObjectiveTracker), "GenerateString")]
[HarmonyILManipulator]
public static void FixVoidSeed(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
if (val.TryGotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)AccessTools.PropertyGetter(typeof(ReadOnlyCollection<TeamComponent>), "Count"))
}))
{
val.Remove();
val.Emit(OpCodes.Call, (MethodBase)AccessTools.DeclaredMethod(typeof(FixVanilla), "GetRealCount", (Type[])null, (Type[])null));
}
else
{
Debug.LogError((object)"IL hook failed for EntityStates.VoidCamp.Idle");
}
}
[HarmonyPatch(typeof(Interactor), "FindBestInteractableObject")]
[HarmonyILManipulator]
public static void FixInteraction(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_006b: 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_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_010f: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_0138: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
int loc = 0;
ILLabel label = null;
if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchLdloca(x, ref loc),
(Instruction x) => ILPatternMatchingExt.MatchCall<EntityLocator>(x, "HasEntityLocator"),
(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref label)
}))
{
val.Emit(OpCodes.Ldloc, loc);
val.Emit<EntityLocator>(OpCodes.Ldfld, "entity");
val.EmitOpImplicit();
val.Emit(OpCodes.Brfalse, (object)label);
}
else
{
Debug.LogError((object)"IL hook failed for Interactor.FindBestInteractableObject");
}
int loc2 = 0;
ILLabel label2 = null;
if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchLdloca(x, ref loc2),
(Instruction x) => ILPatternMatchingExt.MatchCall<EntityLocator>(x, "HasEntityLocator"),
(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref label2)
}))
{
val.Emit(OpCodes.Ldloc, loc2);
val.Emit<EntityLocator>(OpCodes.Ldfld, "entity");
val.EmitOpImplicit();
val.Emit(OpCodes.Brfalse, (object)label2);
}
else
{
Debug.LogError((object)"IL hook failed for Interactor.FindBestInteractableObject2");
}
}
public static int GetRealCount(ReadOnlyCollection<TeamComponent> teamMembers)
{
int num = 0;
foreach (TeamComponent teamMember in teamMembers)
{
CharacterBody val = (Object.op_Implicit((Object)(object)teamMember) ? teamMember.body : null);
if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.master) && Object.op_Implicit((Object)(object)val.healthComponent) && val.healthComponent.alive)
{
num++;
}
}
return num;
}
}
internal static class GameFixes
{
[CompilerGenerated]
private static class <>O
{
public static Manipulator <0>__FixMercEvisAllyTargetting;
public static Manipulator <1>__FixPrinterDropEffect;
public static Manipulator <2>__FixParticleDetachOnDestroy;
public static Manipulator <3>__FixPositionIndicatorWithHiddenHud;
public static Manipulator <4>__FixIndicatorSetVisibleNRE;
public static Manipulator <5>__FixCrosshairOverrideOnDestroy;
public static Manipulator <6>__FixLobbyQuitEventSystem;
public static hook_RefreshJoystickAssignment <7>__FixNoRewiredInputOnQuit;
public static Func<HealthComponent, TeamIndex, bool> <8>__ShouldDirectHitProceed;
public static Manipulator <9>__EnterSkyLeap_OnEnter;
public static Manipulator <10>__ExitSkyLeap_OnEnter;
public static Manipulator <11>__HoldSkyLeap_OnEnter;
public static Manipulator <12>__HoldSkyLeap_OnExit;
public static Manipulator <13>__SpellChannelState_OnEnter;
public static Manipulator <14>__SpellChannelState_OnExit;
public static Manipulator <15>__Duplicating_DropDroplet;
public static Manipulator <16>__FireArrowSnipe_FireBullet;
public static Manipulator <17>__Hidden_OnEnter;
public static Manipulator <18>__Hidden_OnExit;
public static Manipulator <19>__ScrapperBaseState_OnEnter;
public static Manipulator <20>__BuffPassengerWhileSeated_OnDisable;
public static Manipulator <21>__BuffPassengerWhileSeated_OnEnable;
public static Manipulator <22>__DelusionChestController_ResetChestForDelusion;
public static Manipulator <23>__DelusionChestController_Start;
public static Manipulator <24>__DevotionInventoryController_Awake;
public static Manipulator <25>__MasterDropDroplet_DropItems;
public static Manipulator <26>__MinionGroup_AddMinion;
public static Manipulator <27>__MinionGroup_RemoveMinion;
public static Manipulator <28>__FixKinBodyIndexNotReseting;
public static Manipulator <29>__FixKinNotUpdatingPanel;
public static Manipulator <30>__FixFrolicTeleportWithoutAvailableNodes;
public static Manipulator <31>__FixBurnControllerDestroyDoT;
public static hook_Awake <32>__FixMeridianTestStateSpam;
public static hook_Awake <33>__FixMainMenuCameraDamageIndicator;
}
internal static void EmitOpImplicit(this ILCursor c)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
c.Emit<Object>(OpCodes.Call, "op_Implicit");
}
internal static bool MatchOpImplicit(this Instruction instr)
{
return ILPatternMatchingExt.MatchCallOrCallvirt<Object>(instr, "op_Implicit");
}
internal static bool MatchOpInequality(this Instruction instr)
{
return ILPatternMatchingExt.MatchCallOrCallvirt<Object>(instr, "op_Inequality");
}
internal static bool MatchAny(this Instruction instr, out Instruction instruction)
{
instruction = instr;
return true;
}
private static void ApplyManualILHook(Type type, string methodName, Manipulator manipulator)
{
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
BindingFlags bindingAttr = (BindingFlags)(-1);
new ILHook((MethodBase)type.GetMethods(bindingAttr).FirstOrDefault((MethodInfo t) => t.Name.Contains(methodName)), manipulator);
}
private static void LogError(string method)
{
Debug.LogError((object)("Failed to patch " + method));
}
private static void LogError(ILContext il)
{
LogError(((MemberReference)il.Method).Name);
}
internal static void Init()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Expected O, but got Unknown
//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_005b: Expected O, but got Unknown
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Expected O, but got Unknown
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Expected O, but got Unknown
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Expected O, but got Unknown
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Expected O, but got Unknown
//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Expected O, but got Unknown
object obj = <>O.<0>__FixMercEvisAllyTargetting;
if (obj == null)
{
Manipulator val = FixMercEvisAllyTargetting;
<>O.<0>__FixMercEvisAllyTargetting = val;
obj = (object)val;
}
EvisDash.FixedUpdate += (Manipulator)obj;
object obj2 = <>O.<1>__FixPrinterDropEffect;
if (obj2 == null)
{
Manipulator val2 = FixPrinterDropEffect;
<>O.<1>__FixPrinterDropEffect = val2;
obj2 = (object)val2;
}
Duplicating.DropDroplet += (Manipulator)obj2;
object obj3 = <>O.<2>__FixParticleDetachOnDestroy;
if (obj3 == null)
{
Manipulator val3 = FixParticleDetachOnDestroy;
<>O.<2>__FixParticleDetachOnDestroy = val3;
obj3 = (object)val3;
}
DetachParticleOnDestroyAndEndEmission.OnDisable += (Manipulator)obj3;
object obj4 = <>O.<3>__FixPositionIndicatorWithHiddenHud;
if (obj4 == null)
{
Manipulator val4 = FixPositionIndicatorWithHiddenHud;
<>O.<3>__FixPositionIndicatorWithHiddenHud = val4;
obj4 = (object)val4;
}
PositionIndicator.UpdatePositions += (Manipulator)obj4;
object obj5 = <>O.<4>__FixIndicatorSetVisibleNRE;
if (obj5 == null)
{
Manipulator val5 = FixIndicatorSetVisibleNRE;
<>O.<4>__FixIndicatorSetVisibleNRE = val5;
obj5 = (object)val5;
}
Indicator.SetVisibleInternal += (Manipulator)obj5;
object obj6 = <>O.<5>__FixCrosshairOverrideOnDestroy;
if (obj6 == null)
{
Manipulator val6 = FixCrosshairOverrideOnDestroy;
<>O.<5>__FixCrosshairOverrideOnDestroy = val6;
obj6 = (object)val6;
}
CrosshairOverrideBehavior.OnDestroy += (Manipulator)obj6;
object obj7 = <>O.<6>__FixLobbyQuitEventSystem;
if (obj7 == null)
{
Manipulator val7 = FixLobbyQuitEventSystem;
<>O.<6>__FixLobbyQuitEventSystem = val7;
obj7 = (object)val7;
}
RuleChoiceController.FindNetworkUser += (Manipulator)obj7;
object obj8 = <>O.<7>__FixNoRewiredInputOnQuit;
if (obj8 == null)
{
hook_RefreshJoystickAssignment val8 = FixNoRewiredInputOnQuit;
<>O.<7>__FixNoRewiredInputOnQuit = val8;
obj8 = (object)val8;
}
RewiredIntegrationManager.RefreshJoystickAssignment += (hook_RefreshJoystickAssignment)obj8;
FixServerMethodsCalledOnClient();
SotsFixes();
}
private static void FixMercEvisAllyTargetting(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_011a: Unknown result type (might be due to invalid IL or missing references)
//IL_012c: Unknown result type (might be due to invalid IL or missing references)
//IL_013d: Unknown result type (might be due to invalid IL or missing references)
//IL_0149: Unknown result type (might be due to invalid IL or missing references)
//IL_0169: Unknown result type (might be due to invalid IL or missing references)
//IL_0189: Unknown result type (might be due to invalid IL or missing references)
//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
int varIndex = 0;
ILLabel label = null;
if (!val.TryGotoNext(new Func<Instruction, bool>[2]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Component>(x, "GetComponent"),
(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref varIndex)
}) || !val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[6]
{
(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, varIndex),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<HurtBox>(x, "healthComponent"),
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)AccessTools.PropertyGetter(typeof(EntityState), "healthComponent")),
(Instruction x) => x.MatchOpInequality(),
(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref label)
}))
{
LogError(il);
return;
}
val.Emit(OpCodes.Ldloc, varIndex);
val.Emit<HurtBox>(OpCodes.Ldfld, "healthComponent");
val.Emit(OpCodes.Ldarg_0);
val.Emit(OpCodes.Call, (MethodBase)AccessTools.PropertyGetter(typeof(EntityState), "characterBody"));
val.Emit(OpCodes.Callvirt, (MethodBase)AccessTools.PropertyGetter(typeof(CharacterBody), "teamComponent"));
val.Emit(OpCodes.Callvirt, (MethodBase)AccessTools.PropertyGetter(typeof(TeamComponent), "teamIndex"));
val.EmitDelegate<Func<HealthComponent, TeamIndex, bool>>((Func<HealthComponent, TeamIndex, bool>)FriendlyFireManager.ShouldDirectHitProceed);
val.Emit(OpCodes.Brfalse_S, (object)label);
}
private static void FixPrinterDropEffect(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
ILCursor val = new ILCursor(il);
if (!val.TryGotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, typeof(EffectManager), "SimpleMuzzleFlash")
}))
{
LogError(il);
return;
}
val.Remove();
val.EmitDelegate<Action<GameObject, GameObject, string, bool>>((Action<GameObject, GameObject, string, bool>)delegate(GameObject effectPrefab, GameObject obj, string muzzleName, bool _)
{
//IL_004d: 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)
ModelLocator val2 = default(ModelLocator);
if (Object.op_Implicit((Object)(object)obj) && obj.TryGetComponent<ModelLocator>(ref val2) && Object.op_Implicit((Object)(object)val2.modelTransform))
{
ChildLocator component = ((Component)val2.modelTransform).GetComponent<ChildLocator>();
if (Object.op_Implicit((Object)(object)component))
{
int num = component.FindChildIndex(muzzleName);
Transform val3 = component.FindChild(num);
if (Object.op_Implicit((Object)(object)val3))
{
Object.Instantiate<GameObject>(effectPrefab, val3.position, Quaternion.identity, val3);
}
}
}
});
}
private static void FixParticleDetachOnDestroy(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: 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_010d: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
ILLabel returnLabel = null;
if (!val.TryGotoNext(new Func<Instruction, bool>[4]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<DetachParticleOnDestroyAndEndEmission>(x, "particleSystem"),
(Instruction x) => x.MatchOpImplicit(),
(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref returnLabel)
}) || !val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<ParticleSystem>(x, "Stop")
}))
{
LogError(il);
return;
}
val.Emit(OpCodes.Ldarg_0);
val.Emit<DetachParticleOnDestroyAndEndEmission>(OpCodes.Ldfld, "particleSystem");
val.Emit(OpCodes.Callvirt, (MethodBase)AccessTools.PropertyGetter(typeof(Component), "gameObject"));
val.Emit(OpCodes.Callvirt, (MethodBase)AccessTools.PropertyGetter(typeof(GameObject), "activeInHierarchy"));
val.Emit(OpCodes.Brfalse, (object)returnLabel);
}
private static void FixPositionIndicatorWithHiddenHud(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: 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_00fd: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
int locVarIndex = 0;
ILLabel nextLabel = null;
if (!val.TryGotoNext(new Func<Instruction, bool>[5]
{
(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref locVarIndex),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<PositionIndicator>(x, "alwaysVisibleObject"),
(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<GameObject>(x, "SetActive"),
(Instruction x) => ILPatternMatchingExt.MatchBr(x, ref nextLabel)
}))
{
LogError(il);
return;
}
val.Index += 2;
val.Emit<Object>(OpCodes.Call, "op_Implicit");
val.Emit(OpCodes.Brfalse, nextLabel.Target);
val.Emit(OpCodes.Ldloc, locVarIndex);
val.Emit<PositionIndicator>(OpCodes.Ldfld, "alwaysVisibleObject");
}
private static void FixIndicatorSetVisibleNRE(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
Instruction val2 = null;
Instruction nextInstr = null;
if (!val.TryGotoNext(new Func<Instruction, bool>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Renderer>(x, "set_enabled"),
(Instruction x) => x.MatchAny(out nextInstr)
}))
{
LogError(il);
return;
}
val2 = val.Next;
val.Emit(OpCodes.Dup);
val.Emit<Object>(OpCodes.Call, "op_Implicit");
val.Emit(OpCodes.Brtrue_S, val2);
val.Emit(OpCodes.Pop);
val.Emit(OpCodes.Br_S, nextInstr);
}
private static void FixCrosshairOverrideOnDestroy(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
ILCursor val = new ILCursor(il);
if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<CrosshairOverrideBehavior>(x, "requestList")
}))
{
LogError(il);
return;
}
val.EmitDelegate<Func<List<OverrideRequest>, List<OverrideRequest>>>((Func<List<OverrideRequest>, List<OverrideRequest>>)((List<OverrideRequest> requestList) => requestList.ToList()));
}
private static void FixNoRewiredInputOnQuit(orig_RefreshJoystickAssignment orig)
{
if (ReInput.initialized && ReInput.controllers != null)
{
orig.Invoke();
}
}
private static void FixLobbyQuitEventSystem(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Unknown result type (might be due to invalid IL or missing references)
//IL_0124: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
if (!val.TryGotoNext(new Func<Instruction, bool>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchPop(x),
(Instruction x) => ILPatternMatchingExt.MatchLdnull(x),
(Instruction x) => ILPatternMatchingExt.MatchRet(x)
}))
{
LogError(((MemberReference)il.Method).Name + " #1");
return;
}
Instruction next = val.Next;
if (!val.TryGotoPrev((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<EventSystem>(x, "get_current")
}))
{
LogError(((MemberReference)il.Method).Name + " #2");
return;
}
val.Remove();
val.Emit(OpCodes.Isinst, typeof(MPEventSystem));
val.Emit(OpCodes.Dup);
val.Emit<Object>(OpCodes.Call, "op_Implicit");
val.Emit(OpCodes.Brfalse, next);
}
internal static void FixServerMethodsCalledOnClient()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Expected O, but got Unknown
//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_005b: Expected O, but got Unknown
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Expected O, but got Unknown
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Expected O, but got Unknown
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Expected O, but got Unknown
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Expected O, but got Unknown
//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Expected O, but got Unknown
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_0115: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Expected O, but got Unknown
//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_013b: Expected O, but got Unknown
//IL_0150: Unknown result type (might be due to invalid IL or missing references)
//IL_0155: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: Expected O, but got Unknown
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_0175: Unknown result type (might be due to invalid IL or missing references)
//IL_017b: Expected O, but got Unknown
//IL_0190: Unknown result type (might be due to invalid IL or missing references)
//IL_0195: Unknown result type (might be due to invalid IL or missing references)
//IL_019b: Expected O, but got Unknown
//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
//IL_01bb: Expected O, but got Unknown
//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
//IL_01db: Expected O, but got Unknown
//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
//IL_01fb: Expected O, but got Unknown
//IL_0210: Unknown result type (might be due to invalid IL or missing references)
//IL_0215: Unknown result type (might be due to invalid IL or missing references)
//IL_021b: Expected O, but got Unknown
//IL_0230: Unknown result type (might be due to invalid IL or missing references)
//IL_0235: Unknown result type (might be due to invalid IL or missing references)
//IL_023b: Expected O, but got Unknown
//IL_0250: Unknown result type (might be due to invalid IL or missing references)
//IL_0255: Unknown result type (might be due to invalid IL or missing references)
//IL_025b: Expected O, but got Unknown
object obj = <>O.<9>__EnterSkyLeap_OnEnter;
if (obj == null)
{
Manipulator val = EnterSkyLeap_OnEnter;
<>O.<9>__EnterSkyLeap_OnEnter = val;
obj = (object)val;
}
EnterSkyLeap.OnEnter += (Manipulator)obj;
object obj2 = <>O.<10>__ExitSkyLeap_OnEnter;
if (obj2 == null)
{
Manipulator val2 = ExitSkyLeap_OnEnter;
<>O.<10>__ExitSkyLeap_OnEnter = val2;
obj2 = (object)val2;
}
ExitSkyLeap.OnEnter += (Manipulator)obj2;
object obj3 = <>O.<11>__HoldSkyLeap_OnEnter;
if (obj3 == null)
{
Manipulator val3 = HoldSkyLeap_OnEnter;
<>O.<11>__HoldSkyLeap_OnEnter = val3;
obj3 = (object)val3;
}
HoldSkyLeap.OnEnter += (Manipulator)obj3;
object obj4 = <>O.<12>__HoldSkyLeap_OnExit;
if (obj4 == null)
{
Manipulator val4 = HoldSkyLeap_OnExit;
<>O.<12>__HoldSkyLeap_OnExit = val4;
obj4 = (object)val4;
}
HoldSkyLeap.OnExit += (Manipulator)obj4;
object obj5 = <>O.<13>__SpellChannelState_OnEnter;
if (obj5 == null)
{
Manipulator val5 = SpellChannelState_OnEnter;
<>O.<13>__SpellChannelState_OnEnter = val5;
obj5 = (object)val5;
}
SpellChannelState.OnEnter += (Manipulator)obj5;
object obj6 = <>O.<14>__SpellChannelState_OnExit;
if (obj6 == null)
{
Manipulator val6 = SpellChannelState_OnExit;
<>O.<14>__SpellChannelState_OnExit = val6;
obj6 = (object)val6;
}
SpellChannelState.OnExit += (Manipulator)obj6;
object obj7 = <>O.<15>__Duplicating_DropDroplet;
if (obj7 == null)
{
Manipulator val7 = Duplicating_DropDroplet;
<>O.<15>__Duplicating_DropDroplet = val7;
obj7 = (object)val7;
}
Duplicating.DropDroplet += (Manipulator)obj7;
object obj8 = <>O.<16>__FireArrowSnipe_FireBullet;
if (obj8 == null)
{
Manipulator val8 = FireArrowSnipe_FireBullet;
<>O.<16>__FireArrowSnipe_FireBullet = val8;
obj8 = (object)val8;
}
FireArrowSnipe.FireBullet += (Manipulator)obj8;
object obj9 = <>O.<17>__Hidden_OnEnter;
if (obj9 == null)
{
Manipulator val9 = Hidden_OnEnter;
<>O.<17>__Hidden_OnEnter = val9;
obj9 = (object)val9;
}
Hidden.OnEnter += (Manipulator)obj9;
object obj10 = <>O.<18>__Hidden_OnExit;
if (obj10 == null)
{
Manipulator val10 = Hidden_OnExit;
<>O.<18>__Hidden_OnExit = val10;
obj10 = (object)val10;
}
Hidden.OnExit += (Manipulator)obj10;
object obj11 = <>O.<19>__ScrapperBaseState_OnEnter;
if (obj11 == null)
{
Manipulator val11 = ScrapperBaseState_OnEnter;
<>O.<19>__ScrapperBaseState_OnEnter = val11;
obj11 = (object)val11;
}
ScrapperBaseState.OnEnter += (Manipulator)obj11;
object obj12 = <>O.<20>__BuffPassengerWhileSeated_OnDisable;
if (obj12 == null)
{
Manipulator val12 = BuffPassengerWhileSeated_OnDisable;
<>O.<20>__BuffPassengerWhileSeated_OnDisable = val12;
obj12 = (object)val12;
}
BuffPassengerWhileSeated.OnDisable += (Manipulator)obj12;
object obj13 = <>O.<21>__BuffPassengerWhileSeated_OnEnable;
if (obj13 == null)
{
Manipulator val13 = BuffPassengerWhileSeated_OnEnable;
<>O.<21>__BuffPassengerWhileSeated_OnEnable = val13;
obj13 = (object)val13;
}
BuffPassengerWhileSeated.OnEnable += (Manipulator)obj13;
object obj14 = <>O.<22>__DelusionChestController_ResetChestForDelusion;
if (obj14 == null)
{
Manipulator val14 = DelusionChestController_ResetChestForDelusion;
<>O.<22>__DelusionChestController_ResetChestForDelusion = val14;
obj14 = (object)val14;
}
DelusionChestController.ResetChestForDelusion += (Manipulator)obj14;
object obj15 = <>O.<23>__DelusionChestController_Start;
if (obj15 == null)
{
Manipulator val15 = DelusionChestController_Start;
<>O.<23>__DelusionChestController_Start = val15;
obj15 = (object)val15;
}
DelusionChestController.Start += (Manipulator)obj15;
object obj16 = <>O.<24>__DevotionInventoryController_Awake;
if (obj16 == null)
{
Manipulator val16 = DevotionInventoryController_Awake;
<>O.<24>__DevotionInventoryController_Awake = val16;
obj16 = (object)val16;
}
DevotionInventoryController.Awake += (Manipulator)obj16;
object obj17 = <>O.<25>__MasterDropDroplet_DropItems;
if (obj17 == null)
{
Manipulator val17 = MasterDropDroplet_DropItems;
<>O.<25>__MasterDropDroplet_DropItems = val17;
obj17 = (object)val17;
}
MasterDropDroplet.DropItems += (Manipulator)obj17;
object obj18 = <>O.<26>__MinionGroup_AddMinion;
if (obj18 == null)
{
Manipulator val18 = MinionGroup_AddMinion;
<>O.<26>__MinionGroup_AddMinion = val18;
obj18 = (object)val18;
}
MinionGroup.AddMinion += (Manipulator)obj18;
object obj19 = <>O.<27>__MinionGroup_RemoveMinion;
if (obj19 == null)
{
Manipulator val19 = MinionGroup_RemoveMinion;
<>O.<27>__MinionGroup_RemoveMinion = val19;
obj19 = (object)val19;
}
MinionGroup.RemoveMinion += (Manipulator)obj19;
}
private static void EnterSkyLeap_OnEnter(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
Instruction nextInstr = null;
if (!val.TryGotoNext(new Func<Instruction, bool>[6]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<EntityState>(x, "get_characterBody"),
(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "ArmorBoost"),
(Instruction x) => ILPatternMatchingExt.MatchLdsfld<EnterSkyLeap>(x, "baseDuration"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "AddTimedBuff"),
(Instruction x) => x.MatchAny(out nextInstr)
}))
{
LogError(il);
return;
}
val.Emit<NetworkServer>(OpCodes.Call, "get_active");
val.Emit(OpCodes.Brfalse_S, nextInstr);
}
private static void ExitSkyLeap_OnEnter(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
Instruction nextInstr = null;
if (!val.TryGotoNext(new Func<Instruction, bool>[6]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<EntityState>(x, "get_characterBody"),
(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "ArmorBoost"),
(Instruction x) => ILPatternMatchingExt.MatchLdsfld<ExitSkyLeap>(x, "baseDuration"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "AddTimedBuff"),
(Instruction x) => x.MatchAny(out nextInstr)
}))
{
LogError(il);
return;
}
val.Emit<NetworkServer>(OpCodes.Call, "get_active");
val.Emit(OpCodes.Brfalse_S, nextInstr);
}
private static void HoldSkyLeap_OnEnter(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_00d5: 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_0196: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
Instruction nextInstr = null;
if (!val.TryGotoNext(new Func<Instruction, bool>[5]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<EntityState>(x, "get_characterBody"),
(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "HiddenInvincibility"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "AddBuff"),
(Instruction x) => x.MatchAny(out nextInstr)
}))
{
LogError(((MemberReference)il.Method).Name + " #1");
return;
}
val.Emit<NetworkServer>(OpCodes.Call, "get_active");
Instruction prev = val.Prev;
val.Emit(OpCodes.Brfalse_S, nextInstr);
if (!val.TryGotoPrev((MoveType)2, new Func<Instruction, bool>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<HoldSkyLeap>(x, "hurtboxGroup"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Object>(x, "op_Implicit")
}))
{
LogError(((MemberReference)il.Method).Name + " #2");
return;
}
val.Remove();
val.Emit(OpCodes.Brfalse_S, prev);
}
private static void HoldSkyLeap_OnExit(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_00d5: 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_0196: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
Instruction nextInstr = null;
if (!val.TryGotoNext(new Func<Instruction, bool>[5]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<EntityState>(x, "get_characterBody"),
(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "HiddenInvincibility"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "RemoveBuff"),
(Instruction x) => x.MatchAny(out nextInstr)
}))
{
LogError(((MemberReference)il.Method).Name + " #1");
return;
}
val.Emit<NetworkServer>(OpCodes.Call, "get_active");
Instruction prev = val.Prev;
val.Emit(OpCodes.Brfalse_S, nextInstr);
if (!val.TryGotoPrev((MoveType)2, new Func<Instruction, bool>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<HoldSkyLeap>(x, "hurtboxGroup"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Object>(x, "op_Implicit")
}))
{
LogError(((MemberReference)il.Method).Name + " #2");
return;
}
val.Remove();
val.Emit(OpCodes.Brfalse_S, prev);
}
private static void SpellChannelState_OnEnter(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_00d5: 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_0196: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
Instruction nextInstr = null;
if (!val.TryGotoNext(new Func<Instruction, bool>[5]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<EntityState>(x, "get_characterBody"),
(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "Immune"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "AddBuff"),
(Instruction x) => x.MatchAny(out nextInstr)
}))
{
LogError(((MemberReference)il.Method).Name + " #1");
return;
}
val.Emit<NetworkServer>(OpCodes.Call, "get_active");
Instruction prev = val.Prev;
val.Emit(OpCodes.Brfalse_S, nextInstr);
if (!val.TryGotoPrev((MoveType)2, new Func<Instruction, bool>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<SpellChannelState>(x, "spellChannelChildTransform"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Object>(x, "op_Implicit")
}))
{
LogError(((MemberReference)il.Method).Name + " #2");
return;
}
val.Remove();
val.Emit(OpCodes.Brfalse_S, prev);
}
private static void SpellChannelState_OnExit(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
Instruction nextInstr = null;
if (!val.TryGotoNext(new Func<Instruction, bool>[5]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<EntityState>(x, "get_characterBody"),
(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "Immune"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "RemoveBuff"),
(Instruction x) => x.MatchAny(out nextInstr)
}))
{
LogError(il);
return;
}
val.Emit<NetworkServer>(OpCodes.Call, "get_active");
val.Emit(OpCodes.Brfalse_S, nextInstr);
}
private static void Duplicating_DropDroplet(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
Instruction nextInstr = null;
if (!val.TryGotoNext(new Func<Instruction, bool>[4]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<EntityState>(x, "GetComponent"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<ShopTerminalBehavior>(x, "DropPickup"),
(Instruction x) => x.MatchAny(out nextInstr)
}))
{
LogError(il);
return;
}
val.Emit<NetworkServer>(OpCodes.Call, "get_active");
val.Emit(OpCodes.Brfalse_S, nextInstr);
}
private static void FireArrowSnipe_FireBullet(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_016d: Unknown result type (might be due to invalid IL or missing references)
//IL_017e: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
Instruction nextInstr = null;
float num = default(float);
if (!val.TryGotoNext(new Func<Instruction, bool>[10]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<EntityState>(x, "get_healthComponent"),
(Instruction x) => ILPatternMatchingExt.MatchLdarga(x, 1),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Ray>(x, "get_direction"),
(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Vector3>(x, "op_Multiply"),
(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1),
(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<HealthComponent>(x, "TakeDamageForce"),
(Instruction x) => x.MatchAny(out nextInstr)
}))
{
LogError(il);
return;
}
val.Emit<NetworkServer>(OpCodes.Call, "get_active");
val.Emit(OpCodes.Brfalse_S, nextInstr);
}
private static void Hidden_OnEnter(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
ILLabel nextLabel = null;
if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[4]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<Hidden>(x, "buffDef"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Object>(x, "op_Implicit"),
(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref nextLabel)
}))
{
LogError(il);
return;
}
val.Emit<NetworkServer>(OpCodes.Call, "get_active");
val.Emit(OpCodes.Brfalse_S, (object)nextLabel);
}
private static void Hidden_OnExit(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
ILLabel nextLabel = null;
if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[4]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<Hidden>(x, "buffDef"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Object>(x, "op_Implicit"),
(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref nextLabel)
}))
{
LogError(il);
return;
}
val.Emit<NetworkServer>(OpCodes.Call, "get_active");
val.Emit(OpCodes.Brfalse_S, (object)nextLabel);
}
private static void ScrapperBaseState_OnEnter(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
Instruction nextInstr = null;
if (!val.TryGotoNext(new Func<Instruction, bool>[6]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<ScrapperBaseState>(x, "pickupPickerController"),
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<ScrapperBaseState>(x, "get_enableInteraction"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<PickupPickerController>(x, "SetAvailable"),
(Instruction x) => x.MatchAny(out nextInstr)
}))
{
LogError(il);
return;
}
val.Emit<NetworkServer>(OpCodes.Call, "get_active");
val.Emit(OpCodes.Brfalse_S, nextInstr);
}
private static void BuffPassengerWhileSeated_OnDisable(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
ILLabel nextLabel = null;
if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[4]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<BuffPassengerWhileSeated>(x, "vehicleSeat"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Object>(x, "op_Implicit"),
(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref nextLabel)
}))
{
LogError(il);
return;
}
val.Emit<NetworkServer>(OpCodes.Call, "get_active");
val.Emit(OpCodes.Brfalse_S, (object)nextLabel);
}
private static void BuffPassengerWhileSeated_OnEnable(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
ILLabel nextLabel = null;
if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[4]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<BuffPassengerWhileSeated>(x, "vehicleSeat"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Object>(x, "op_Implicit"),
(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref nextLabel)
}))
{
LogError(il);
return;
}
val.Emit<NetworkServer>(OpCodes.Call, "get_active");
val.Emit(OpCodes.Brfalse_S, (object)nextLabel);
}
private static void DelusionChestController_ResetChestForDelusion(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
Instruction nextInstr = null;
int num = default(int);
if (!val.TryGotoNext(new Func<Instruction, bool>[5]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<DelusionChestController>(x, "_pickupPickerController"),
(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<PickupPickerController>(x, "SetAvailable"),
(Instruction x) => x.MatchAny(out nextInstr)
}))
{
LogError(il);
return;
}
val.Emit<NetworkServer>(OpCodes.Call, "get_active");
val.Emit(OpCodes.Brfalse_S, nextInstr);
}
private static void DelusionChestController_Start(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
Instruction nextInstr = null;
int num = default(int);
if (!val.TryGotoNext(new Func<Instruction, bool>[5]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<DelusionChestController>(x, "_pickupPickerController"),
(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<PickupPickerController>(x, "SetAvailable"),
(Instruction x) => x.MatchAny(out nextInstr)
}))
{
LogError(il);
return;
}
val.Emit<NetworkServer>(OpCodes.Call, "get_active");
val.Emit(OpCodes.Brfalse_S, nextInstr);
}
private static void DevotionInventoryController_Awake(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
Instruction nextInstr = null;
int num = default(int);
if (!val.TryGotoNext(new Func<Instruction, bool>[6]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<DevotionInventoryController>(x, "_devotionMinionInventory"),
(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Items), "LemurianHarness"),
(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GiveItem"),
(Instruction x) => x.MatchAny(out nextInstr)
}))
{
LogError(il);
return;
}
val.Emit<NetworkServer>(OpCodes.Call, "get_active");
val.Emit(OpCodes.Brfalse_S, nextInstr);
}
private static void MasterDropDroplet_DropItems(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0021: 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)
ILCursor val = new ILCursor(il);
Instruction val2 = val.Instrs[val.Instrs.Count - 1];
val.Emit<NetworkServer>(OpCodes.Call, "get_active");
val.Emit(OpCodes.Brfalse_S, val2);
}
private static void MinionGroup_AddMinion(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
ILLabel nextLabel = null;
if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 1),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Object>(x, "op_Implicit"),
(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref nextLabel)
}))
{
LogError(il);
return;
}
val.Emit<NetworkServer>(OpCodes.Call, "get_active");
val.Emit(OpCodes.Brfalse_S, (object)nextLabel);
}
private static void MinionGroup_RemoveMinion(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
ILLabel nextLabel = null;
if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Object>(x, "op_Implicit"),
(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref nextLabel)
}))
{
LogError(il);
return;
}
val.Emit<NetworkServer>(OpCodes.Call, "get_active");
val.Emit(OpCodes.Brfalse_S, (object)nextLabel);
}
private static void FixKinPanelPersisting()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Expected O, but got Unknown
object obj = <>O.<28>__FixKinBodyIndexNotReseting;
if (obj == null)
{
Manipulator val = FixKinBodyIndexNotReseting;
<>O.<28>__FixKinBodyIndexNotReseting = val;
obj = (object)val;
}
ClassicStageInfo.RebuildCards += (Manipulator)obj;
Type typeFromHandle = typeof(Stage);
object obj2 = <>O.<29>__FixKinNotUpdatingPanel;
if (obj2 == null)
{
Manipulator val2 = FixKinNotUpdatingPanel;
<>O.<29>__FixKinNotUpdatingPanel = val2;
obj2 = (object)val2;
}
ApplyManualILHook(typeFromHandle, "set_singleMonsterTypeBodyIndex", (Manipulator)obj2);
}
private static void FixKinBodyIndexNotReseting(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: 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_0127: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: 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)
ILCursor val = new ILCursor(il);
int varIndex = 0;
ILLabel nextLabel = null;
if (!val.TryGotoNext(new Func<Instruction, bool>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, typeof(Artifacts), "get_singleMonsterTypeArtifactDef"),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<RunArtifactManager>(x, "IsArtifactEnabled"),
(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref varIndex)
}) || !val.TryGotoNext(new Func<Instruction, bool>[2]
{
(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, varIndex),
(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref nextLabel)
}))
{
LogError(il);
return;
}
val.GotoLabel(nextLabel, (MoveType)0, false);
val.Emit(OpCodes.Br, nextLabel.Target);
val.Emit<Stage>(OpCodes.Call, "get_instance");
Instruction prev = val.Prev;
val.Emit<Object>(OpCodes.Call, "op_Implicit");
val.Emit(OpCodes.Brfalse, nextLabel.Target);
val.Emit<Stage>(OpCodes.Call, "get_instance");
val.Emit(OpCodes.Ldc_I4_M1);
val.Emit<Stage>(OpCodes.Callvirt, "set_singleMonsterTypeBodyIndex");
val.GotoPrev((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, varIndex)
});
val.Remove();
val.Emit(OpCodes.Brfalse, prev);
}
private static void FixKinNotUpdatingPanel(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Stage>(x, "set_Network_singleMonsterTypeBodyIndex")
}))
{
LogError(il);
}
else
{
val.Emit<EnemyInfoPanel>(OpCodes.Call, "RefreshAll");
}
}
internal static void SotsFixes()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Expected O, but got Unknown
//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_005b: Expected O, but got Unknown
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Expected O, but got Unknown
object obj = <>O.<30>__FixFrolicTeleportWithoutAvailableNodes;
if (obj == null)
{
Manipulator val = FixFrolicTeleportWithoutAvailableNodes;
<>O.<30>__FixFrolicTeleportWithoutAvailableNodes = val;
obj = (object)val;
}
Frolic.TeleportAroundPlayer += (Manipulator)obj;
object obj2 = <>O.<31>__FixBurnControllerDestroyDoT;
if (obj2 == null)
{
Manipulator val2 = FixBurnControllerDestroyDoT;
<>O.<31>__FixBurnControllerDestroyDoT = val2;
obj2 = (object)val2;
}
BurnEffectController.HandleDestroy += (Manipulator)obj2;
object obj3 = <>O.<32>__FixMeridianTestStateSpam;
if (obj3 == null)
{
hook_Awake val3 = FixMeridianTestStateSpam;
<>O.<32>__FixMeridianTestStateSpam = val3;
obj3 = (object)val3;
}
MeridianEventTriggerInteraction.Awake += (hook_Awake)obj3;
object obj4 = <>O.<33>__FixMainMenuCameraDamageIndicator;
if (obj4 == null)
{
hook_Awake val4 = FixMainMenuCameraDamageIndicator;
<>O.<33>__FixMainMenuCameraDamageIndicator = val4;
obj4 = (object)val4;
}
DamageIndicator.Awake += (hook_Awake)obj4;
FixSaleStarCollider();
}
private static void FixFrolicTeleportWithoutAvailableNodes(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: 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)
ILCursor val = new ILCursor(il);
int varIndex = 0;
if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<NodeGraph>(x, "FindNodesInRange"),
(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref varIndex)
}))
{
LogError(il);
return;
}
Instruction next = val.Next;
val.Emit(OpCodes.Ldloc, varIndex);
val.Emit<List<NodeIndex>>(OpCodes.Callvirt, "get_Count");
val.Emit(OpCodes.Ldc_I4_0);
val.Emit(OpCodes.Bgt_S, next);
val.Emit(OpCodes.Ret);
}
private static void FixBurnControllerDestroyDoT(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
Instruction destroyInstr = null;
if (!val.TryGotoNext(new Func<Instruction, bool>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Component>(x, "get_gameObject"),
(Instruction x) => x.MatchAny(out destroyInstr)
}))
{
LogError(il);
return;
}
val.Emit(OpCodes.Ldarg_0);
val.EmitOpImplicit();
val.Emit(OpCodes.Brfalse, destroyInstr);
}
private static void FixMeridianTestStateSpam(orig_Awake orig, MeridianEventTriggerInteraction self)
{
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
EntityStateMachine val = EntityStateMachine.FindByCustomName(((Component)self).gameObject, "");
if ((Object)(object)val != (Object)null)
{
val.initialStateType = new SerializableEntityStateType(typeof(Uninitialized));
((Behaviour)val).enabled = false;
}
orig.Invoke(self);
}
private static void FixMainMenuCameraDamageIndicator(orig_Awake orig, DamageIndicator self)
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)self.mat == (Object)null)
{
self.mat = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Core/matDamageIndicator.mat").WaitForCompletion();
}
orig.Invoke(self);
}
private static void FixSaleStarCollider()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
Transform obj = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC2/Items/LowerPricedChests/PickupSaleStar.prefab").WaitForCompletion().transform.Find("SaleStar");
MeshCollider val = ((obj != null) ? ((Component)obj).GetComponent<MeshCollider>() : null);
if ((Object)(object)val == (Object)null || val.convex)
{
LogError("Failed to modify collider of SaleStar");
}
else
{
val.convex = true;
}
}
}
[BepInPlugin("_score.MiscFixes", "MiscFixes", "1.2.8")]
public class MiscFixesPlugin : BaseUnityPlugin
{
public const string PluginGUID = "_score.MiscFixes";
public const string PluginAuthor = "score";
public const string PluginName = "MiscFixes";
public const string PluginVersion = "1.2.8";
private Harmony harm;
public void Awake()
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Expected O, but got Unknown
ReplaceDCCS();
harm = new Harmony("_score.MiscFixes");
harm.CreateClassProcessor(typeof(FixVanilla)).Patch();
GameFixes.Init();
}
private void ReplaceDCCS()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
AsyncOperationHandle<DirectorCardCategorySelection> val = Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/village/dccsVillageInteractablesDLC1.asset");
val.Completed += delegate(AsyncOperationHandle<DirectorCardCategorySelection> o)
{
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
DirectorCardCategorySelection result = o.Result;
if (Object.op_Implicit((Object)(object)result))
{
string format = "RoR2/Base/Drones/iscBroken{0}.asset";
for (int i = 0; i < result.categories.Length; i++)
{
if (result.categories[i].name == "Drones")
{
for (int j = 0; j < result.categories[i].cards.Length; j++)
{
DirectorCard val2 = result.categories[i].cards[j];
if (Object.op_Implicit((Object)(object)val2?.spawnCard) && ((Object)val2.spawnCard).name.StartsWith("csc"))
{
InteractableSpawnCard val3 = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)string.Format(format, ((Object)val2.spawnCard).name.Replace("csc", string.Empty))).WaitForCompletion();
if (Object.op_Implicit((Object)(object)val3))
{
((BaseUnityPlugin)this).Logger.LogDebug((object)("Replacing " + ((Object)val2.spawnCard).name + " with " + ((Object)val3).name));
val2.spawnCard = (SpawnCard)(object)val3;
}
}
}
}
}
}
};
}
}
}