Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Brynza API v1.9.0
patchers/BrynzaPatcher.dll
Decompiled 4 days agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using Microsoft.CodeAnalysis; using Mono.Cecil; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("BrynzaPatcher")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+ff1acb874f34e124c94dc0d426746dc8ac20e4f3")] [assembly: AssemblyProduct("BrynzaPatcher")] [assembly: AssemblyTitle("BrynzaPatcher")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace BrynzaAPI { internal static class Ror2Patcher { [CompilerGenerated] private sealed class <get_TargetDLLs>d__1 : IEnumerable<string>, IEnumerable, IEnumerator<string>, IEnumerator, IDisposable { private int <>1__state; private string <>2__current; private int <>l__initialThreadId; string IEnumerator<string>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <get_TargetDLLs>d__1(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = "RoR2.dll"; <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator<string> IEnumerable<string>.GetEnumerator() { if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; return this; } return new <get_TargetDLLs>d__1(0); } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable<string>)this).GetEnumerator(); } } public static IEnumerable<string> TargetDLLs { [IteratorStateMachine(typeof(<get_TargetDLLs>d__1))] get { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <get_TargetDLLs>d__1(-2); } } public static void Patch(AssemblyDefinition assembly) { PatchGenericSkill(assembly); PatchCharacterMotor(assembly); PatchProjectileExplosion(assembly); PatchBulletAttack(assembly); PatchCharacterBody(assembly); PatchCharacterModel(assembly); PatchRow(assembly); PatchLoadoutPanelController(assembly); PatchAimAnimator(assembly); PatchEffectDef(assembly); } private static void PatchCharacterBody(AssemblyDefinition assembly) { //IL_0055: 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_008b: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown TypeDefinition type = assembly.MainModule.GetType("RoR2", "CharacterBody"); TypeDefinition type2 = assembly.MainModule.GetType("RoR2.Run/FixedTimeStamp"); if (type != null) { type.Fields.Add(new FieldDefinition("bapi_baseWallJumpCount", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(int)))); type.Fields.Add(new FieldDefinition("bapi_maxWallJumpCount", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(int)))); type.Fields.Add(new FieldDefinition("bapi_clientBuffs", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(int[])))); type.Fields.Add(new FieldDefinition("bapi_lastJumpTime", (FieldAttributes)6, assembly.MainModule.ImportReference((TypeReference)(object)type2))); } } private static void PatchAimAnimator(AssemblyDefinition assembly) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown TypeDefinition type = assembly.MainModule.GetType("RoR2", "AimAnimator"); if (type != null) { type.Fields.Add(new FieldDefinition("bapi_pitchClipCycleStart", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(float)))); type.Fields.Add(new FieldDefinition("bapi_yawClipCycleStart", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(float)))); } } private static void PatchEffectDef(AssemblyDefinition assembly) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown TypeDefinition type = assembly.MainModule.GetType("RoR2", "EffectData"); TypeDefinition type2 = assembly.MainModule.GetType("RoR2", "EffectComponent"); if (type != null) { type.Fields.Add(new FieldDefinition("bapi_scale", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(Vector3?)))); if (type2 != null) { type.Fields.Add(new FieldDefinition("bapi_effectInstance", (FieldAttributes)6, assembly.MainModule.ImportReference((TypeReference)(object)type2))); } } } private static void PatchCharacterModel(AssemblyDefinition assembly) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown TypeDefinition type = assembly.MainModule.GetType("RoR2.CharacterModel/RendererInfo"); if (type != null) { type.Fields.Add(new FieldDefinition("bapi_dontFadeCloseOn", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(bool)))); } } private static void PatchEntityStateMachine(AssemblyDefinition assembly) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown TypeDefinition type = assembly.MainModule.GetType("RoR2", "EntityStateMachine"); if (type != null) { type.Methods.Add(new MethodDefinition("bapi_SetStateToMain", (MethodAttributes)6, assembly.MainModule.ImportReference(typeof(void)))); } } private static void PatchSkillDef(AssemblyDefinition assembly) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown TypeDefinition type = assembly.MainModule.GetType("RoR2.Skills", "SkillDef"); if (type != null) { type.Methods.Add(new MethodDefinition("bapi_CanApplyAmmoPack", (MethodAttributes)64, assembly.MainModule.ImportReference(typeof(bool)))); } } private static void PatchBulletAttack(AssemblyDefinition assembly) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown TypeDefinition type = assembly.MainModule.GetType("RoR2", "BulletAttack"); if (type != null) { type.Fields.Add(new FieldDefinition("bapi_ignoredHealthComponentList", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(List<object>)))); type.Fields.Add(new FieldDefinition("bapi_ignoreHitTargets", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(bool)))); type.Fields.Add(new FieldDefinition("bapi_bonusForce", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(Vector3)))); type.Fields.Add(new FieldDefinition("bapi_noWeaponIfOwner", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(bool)))); } } private static void PatchBlastAttack(AssemblyDefinition assembly) { //IL_0055: 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_008b: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Expected O, but got Unknown //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Expected O, but got Unknown TypeDefinition type = assembly.MainModule.GetType("RoR2", "BlastAttack"); TypeDefinition type2 = assembly.MainModule.GetType("RoR2.BlastAttack/BlastAttackDamageInfo"); if (type != null) { type.Fields.Add(new FieldDefinition("bapi_forceMassIsOne", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(bool)))); type.Fields.Add(new FieldDefinition("bapi_forceAlwaysApply", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(bool)))); type.Fields.Add(new FieldDefinition("bapi_forceDisableAirControlUntilCollision", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(bool)))); type2.Fields.Add(new FieldDefinition("bapi_forceMassIsOne", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(bool)))); type2.Fields.Add(new FieldDefinition("bapi_forceAlwaysApply", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(bool)))); type2.Fields.Add(new FieldDefinition("bapi_forceDisableAirControlUntilCollision", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(bool)))); } } private static void PatchDamageInfo(AssemblyDefinition assembly) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown TypeDefinition type = assembly.MainModule.GetType("RoR2", "DamageInfo"); if (type != null) { type.Fields.Add(new FieldDefinition("bapi_forceMassIsOne", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(bool)))); type.Fields.Add(new FieldDefinition("bapi_forceAlwaysApply", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(bool)))); type.Fields.Add(new FieldDefinition("bapi_forceDisableAirControlUntilCollision", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(bool)))); } } private static void PatchProjectileExplosion(AssemblyDefinition assembly) { } private static void PatchGenericSkill(AssemblyDefinition assembly) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown TypeDefinition type = assembly.MainModule.GetType("RoR2", "GenericSkill"); if (type != null) { type.Fields.Add(new FieldDefinition("bapi_extraSkills", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(List<object>)))); type.Fields.Add(new FieldDefinition("bapi_linkedSkill", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(object)))); type.Fields.Add(new FieldDefinition("bapi_section", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(string)))); } } private static void PatchRow(AssemblyDefinition assembly) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown TypeDefinition type = assembly.MainModule.GetType("RoR2.UI.LoadoutPanelController/Row"); if (type != null) { type.Fields.Add(new FieldDefinition("bapi_section", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(string)))); } } private static void PatchLoadoutPanelController(AssemblyDefinition assembly) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown TypeDefinition type = assembly.MainModule.GetType("RoR2.UI", "LoadoutPanelController"); if (type != null) { type.Fields.Add(new FieldDefinition("bapi_sections", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(List<string>)))); } } private static void PatchSkillLocator(AssemblyDefinition assembly) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown TypeDefinition type = assembly.MainModule.GetType("RoR2", "SkillLocator"); if (type != null) { type.Fields.Add(new FieldDefinition("bapi_bonusSkills", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(List<object>)))); } } private static void PatchCharacterMotor(AssemblyDefinition assembly) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Expected O, but got Unknown //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Expected O, but got Unknown //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Expected O, but got Unknown //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Expected O, but got Unknown //IL_01a4: 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_01da: Expected O, but got Unknown TypeDefinition type = assembly.MainModule.GetType("RoR2", "CharacterMotor"); if (type != null) { type.Fields.Add(new FieldDefinition("bapi_velocityOverride", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(Vector3)))); type.Fields.Add(new FieldDefinition("bapi_keepVelocityOnMoving", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(bool)))); type.Fields.Add(new FieldDefinition("bapi_consistentAcceleration", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(float)))); type.Fields.Add(new FieldDefinition("bapi_fluidMaxDistanceDelta", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(bool)))); type.Fields.Add(new FieldDefinition("bapi_strafe", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(bool)))); type.Fields.Add(new FieldDefinition("bapi_bunnyHop", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(bool)))); type.Fields.Add(new FieldDefinition("bapi_wallJumpCount", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(int)))); type.Fields.Add(new FieldDefinition("bapi_airControlFromVelocityAdd", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(float)))); type.Fields.Add(new FieldDefinition("bapi_useMaxAirVelocity", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(bool)))); type.Fields.Add(new FieldDefinition("bapi_maxAirVelocity", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(float)))); } } private static void PatchConfigEntry(ref AssemblyDefinition assembly) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown TypeDefinition type = assembly.MainModule.GetType("BepInEx.Configuration", "ConfigEntryBase"); if (type != null) { type.Fields.Add(new FieldDefinition("bapi_isServerConfig", (FieldAttributes)6, assembly.MainModule.ImportReference(typeof(bool)))); } } } }
plugins/BrynzaAPI.dll
Decompiled 4 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; 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 BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using BrynzaAPI.Interop; using EntityStates; using Grumpy; using HG.Coroutines; using HG.Reflection; using HarmonyLib; using IL.EntityStates; using IL.RoR2; using IL.RoR2.CameraModes; using IL.RoR2.Projectile; using IL.RoR2.UI; using KinematicCharacterController; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using MonoMod.Utils; using On.EntityStates; using On.RoR2; using On.RoR2.UI; using ProjectilesConfigurator; using R2API; using R2API.AddressReferencedAssets; using R2API.Networking; using R2API.Networking.Interfaces; using R2API.Utils; using Rewired; using RiskOfOptions; using RiskOfOptions.Options; using RoR2; using RoR2.CameraModes; using RoR2.ContentManagement; using RoR2.Navigation; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using RoR2BepInExPack.Utilities; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("BrynzaAPI")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+422cc0f706246324fd1eeb1ca6d19a9312564a37")] [assembly: AssemblyProduct("BrynzaAPI")] [assembly: AssemblyTitle("BrynzaAPI")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 BrynzaAPI { [Serializable] [BepInPlugin("com.brynzananas.brynzaapi", "Brynza API", "1.9.0")] [BepInDependency("com.bepis.r2api", "5.2.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class BrynzaAPI : BaseUnityPlugin { public delegate void OnHitGroundServerDelegate(CharacterMotor characterMotor, ref HitGroundInfo hitGroundInfo); public delegate bool ExtraKeepVelocityOnMoving(CharacterMotor characterMotor); public delegate bool ExtraStrafe(CharacterMotor characterMotor); public delegate bool ExtraBunnyHop(CharacterMotor characterMotor); public delegate bool ExtraUseMaxAirVelocity(CharacterMotor characterMotor); public delegate float ExtraAirControlFromVelocityAdd(CharacterMotor characterMotor); public delegate void DynamicFloatStat(CharacterBody characterBody, ref float value); public delegate void PickupCreated(CreatePickupInfo createPickupInfo, GameObject pickup); public delegate void TestDelegate(); [HarmonyPatch] private class Patches { [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyILManipulator] private static void ConfigFile_Reload(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 4), (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "#") })) { val.Emit(OpCodes.Ldloc, 4); val.EmitDelegate<Action<string>>((Action<string>)GetDefaultValue); if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 8), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 7) })) { val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldloc, 8); val.EmitDelegate<Action<ConfigFile, ConfigDefinition>>((Action<ConfigFile, ConfigDefinition>)SetDefaultValue); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 2 failed!")); } } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 1 failed!")); } static void GetDefaultValue(string line) { if (line.Contains("# Default value:")) { pendingDefaultValue = line.Replace("# Default value: ", ""); } } static void SetDefaultValue(ConfigFile configFile, ConfigDefinition configDefinition) { if (pendingDefaultValue != null) { if (defaultConfigValues.ContainsKey(configFile)) { Dictionary<ConfigDefinition, string> dictionary = defaultConfigValues[configFile]; if (!dictionary.ContainsKey(configDefinition)) { dictionary[configDefinition] = pendingDefaultValue; } } else { Dictionary<ConfigDefinition, string> value = new Dictionary<ConfigDefinition, string> { { configDefinition, pendingDefaultValue } }; defaultConfigValues.Add(configFile, value); } } } } } public class ExtraStatHookEventArgs : EventArgs { public int wallJumpAdd = 0; public float wallJumpMult = 1f; } public delegate void ExtraStatHookEventHandler(CharacterBody sender, ExtraStatHookEventArgs args); public struct ModMetaData { public string Guid; public string Name; } public delegate void OnConfigApplied(int configId, INetworkConfig networkConfig); public interface INetworkConfig { int id { get; set; } OnConfigApplied OnConfigApplied { get; set; } Type parameterType { get; } object Value { get; set; } } public class NetworkConfig<T> : INetworkConfig { public NetworkConfig<bool> enableConfig; public ConfigEntry<T> configEntry; private T configValue; private OnConfigApplied onConfigApplied; public int configId; public T Value { get { if (enableConfig != null && !enableConfig.Value) { return DefaultValue; } if (takeServerConfigValues) { return configValue; } return configEntry.Value; } set { configValue = value; } } public T DefaultValue => (T)((ConfigEntryBase)configEntry).DefaultValue; public Type parameterType => typeof(T); public OnConfigApplied OnConfigApplied { get { return onConfigApplied; } set { onConfigApplied = value; } } public int id { get { return configId; } set { configId = value; } } object INetworkConfig.Value { get { return Value; } set { Value = (T)value; } } } public class RequestSyncConfigsNetMessage : INetMessage, ISerializableObject { public void Deserialize(NetworkReader reader) { } public void OnReceived() { SetConfigValues(); } public void Serialize(NetworkWriter writer) { } } public class SyncConfigsNetMessage : INetMessage, ISerializableObject { private int configId; private string input; public SyncConfigsNetMessage(int id, string input) { configId = id; this.input = input; } public SyncConfigsNetMessage() { } public void Deserialize(NetworkReader reader) { configId = reader.ReadInt32(); input = reader.ReadString(); } public void OnReceived() { INetworkConfig networkConfig = networkConfigs[configId]; if (networkConfig.parameterType == typeof(float)) { NetworkConfig<float> networkConfig2 = networkConfig as NetworkConfig<float>; networkConfig2.Value = float.Parse(input); if (!NetworkServer.active) { ConfigEntry<float> configEntry = networkConfig2.configEntry; configEntry.Value += 1f; ConfigEntry<float> configEntry2 = networkConfig2.configEntry; configEntry2.Value -= 1f; } } if (networkConfig.parameterType == typeof(int)) { NetworkConfig<int> networkConfig3 = networkConfig as NetworkConfig<int>; networkConfig3.Value = int.Parse(input); if (!NetworkServer.active) { ConfigEntry<int> configEntry3 = networkConfig3.configEntry; configEntry3.Value += 1; ConfigEntry<int> configEntry4 = networkConfig3.configEntry; configEntry4.Value -= 1; } } if (networkConfig.parameterType == typeof(bool)) { NetworkConfig<bool> networkConfig4 = networkConfig as NetworkConfig<bool>; networkConfig4.Value = bool.Parse(input); if (!NetworkServer.active) { networkConfig4.configEntry.Value = !networkConfig4.configEntry.Value; networkConfig4.configEntry.Value = !networkConfig4.configEntry.Value; } } networkConfig.OnConfigApplied?.Invoke(configId, networkConfig); } public void Serialize(NetworkWriter writer) { writer.Write(configId); writer.Write(input); } } [CompilerGenerated] private static class <>O { public static Manipulator <0>__CameraModePlayerBasic_CollectLookInputInternal; public static Manipulator <1>__GenericSkill_Awake; public static Manipulator <2>__CharacterMotor_PreMove; public static Manipulator <3>__ProjectileExplosion_DetonateServer; public static Manipulator <4>__GenericCharacterMain_ApplyJumpVelocity; public static hook_OnCharacterHitGroundServer <5>__GlobalEventManager_OnCharacterHitGroundServer; public static hook_OnEnable <6>__CharacterSelectController_OnEnable; public static Manipulator <7>__FogDamageController_MyFixedUpdate; public static Manipulator <8>__GenericCharacterMain_ProcessJump_bool; public static Manipulator <9>__CharacterMotor_OnLanded; public static Manipulator <10>__CharacterBody_RecalculateStats; public static Manipulator <11>__CameraRigController_LateUpdate; public static hook_ProcessHit <12>__BulletAttack_ProcessHit; public static Manipulator <13>__Row_FromSkillSlot; public static hook_DestroyRows <14>__LoadoutPanelController_DestroyRows; public static hook_FinishSetup <15>__Row_FinishSetup; public static Manipulator <16>__Row_FromSkin; public static hook_UpdateRendererMaterials <17>__CharacterModel_UpdateRendererMaterials; public static Manipulator <18>__CharacterModel_UpdateMaterials; public static <>A{00000008}<GameObject, CreatePickupInfo> <19>__HandlePickupStuff; public static EventHandler <20>__ConfigEntry_SettingChanged; } public const string ModGuid = "com.brynzananas.brynzaapi"; public const string ModName = "Brynza API"; public const string ModVer = "1.9.0"; public static FixedConditionalWeakTable<CharacterMotor, List<OnHitGroundServerDelegate>> onHitGroundServerDictionary = new FixedConditionalWeakTable<CharacterMotor, List<OnHitGroundServerDelegate>>(); public static bool riskOfOptionsLoaded = false; public static ConfigFile ConfigMain; public static Dictionary<string, List<INetworkConfig>> modConfigs = new Dictionary<string, List<INetworkConfig>>(); public static List<GameObject> activeSniperHurtboxTrackers = new List<GameObject>(); [Obsolete] private static Vector3 worldCrosshairPositionOverride = Vector3.zero; public static Dictionary<string, string> _tokenKeywords = new Dictionary<string, string>(); private static string[] tokenKeywordsKeys = new string[0]; public static HGButton loadoutSectionButton; public static GameObject loadoutSectionHolder; public const string LoadoutMainSectionToken = "LOADOUT_SECTION_MAIN"; public static Dictionary<ConfigFile, Dictionary<ConfigDefinition, string>> defaultConfigValues = new Dictionary<ConfigFile, Dictionary<ConfigDefinition, string>>(); private static List<ExtraKeepVelocityOnMoving> GetExtraKeepVelocityOnMovingDelegates = new List<ExtraKeepVelocityOnMoving>(); private static List<ExtraStrafe> GetExtraStrafeDelegates = new List<ExtraStrafe>(); public static List<ExtraBunnyHop> GetExtraBunnyHopDelegates = new List<ExtraBunnyHop>(); public static List<ExtraUseMaxAirVelocity> GetExtraUseMaxAirVelocityDelegates = new List<ExtraUseMaxAirVelocity>(); private static List<ExtraAirControlFromVelocityAdd> GetExtraAirControlFromVelocityAddDelegates = new List<ExtraAirControlFromVelocityAdd>(); private Harmony harmonyPatcher; private static bool useDynamicStats; public static bool useMoveSpeedDynamicStat; internal static Dictionary<string, object> keyValuePairs1 = new Dictionary<string, object>(); private bool hooksEnabled = false; private static string pendingDefaultValue; private static ExtraStatHookEventArgs ExtraStatMods; public static float strafeMultiplier = 15f; public static float maxAirVelocityReduceValue = 6f; public static List<INetworkConfig> networkConfigs = new List<INetworkConfig>(); public static bool proejctilesConfiguratorEnabled { get; private set; } private static bool takeServerConfigValues { get { //IL_000d: 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) int result; if (!Object.op_Implicit((Object)(object)Run.instance)) { Scene activeScene = SceneManager.GetActiveScene(); result = ((((Scene)(ref activeScene)).name == "lobby") ? 1 : 0); } else { result = 1; } return (byte)result != 0; } } public static Dictionary<string, string> tokenKeywords { get { return _tokenKeywords; } set { tokenKeywordsKeys = value.Keys.ToArray(); _tokenKeywords = value; } } public static BaseUnityPlugin instance { get; private set; } public static ManualLogSource Log { get; private set; } public static event Action<GameObject> onSniperHurtboxAdded; public static event Action<GameObject> onSniperHurtboxRemoved; public static event ExtraKeepVelocityOnMoving GetExtraKeepVelocityOnMoving { add { GetExtraKeepVelocityOnMovingDelegates.Add(value); } remove { GetExtraKeepVelocityOnMovingDelegates.Remove(value); } } public static event ExtraStrafe GetExtraStrafe { add { GetExtraStrafeDelegates.Add(value); } remove { GetExtraStrafeDelegates.Remove(value); } } public static event ExtraBunnyHop GetExtraBunnyHop { add { GetExtraBunnyHopDelegates.Add(value); } remove { GetExtraBunnyHopDelegates.Remove(value); } } public static event ExtraUseMaxAirVelocity GetExtraUseMaxAirVelocity { add { GetExtraUseMaxAirVelocityDelegates.Add(value); } remove { GetExtraUseMaxAirVelocityDelegates.Remove(value); } } public static event ExtraAirControlFromVelocityAdd GetExtraAirControlFromVelocityAdd { add { GetExtraAirControlFromVelocityAddDelegates.Add(value); } remove { GetExtraAirControlFromVelocityAddDelegates.Remove(value); } } public static event DynamicFloatStat GetDynamicRegen; public static event DynamicFloatStat GetDynamicMoveSpeed; public static event DynamicFloatStat GetDynamicAttackSpeed; public static event PickupCreated OnPickupCreated; private static event ExtraStatHookEventHandler _getExtraStatCoefficients; public static event ExtraStatHookEventHandler GetExtraStatCoefficients { add { _getExtraStatCoefficients += value; } remove { _getExtraStatCoefficients -= value; } } public static bool InvokeExtraKeepVelocityOnMovingDelegates(CharacterMotor characterMotor) { foreach (ExtraKeepVelocityOnMoving getExtraKeepVelocityOnMovingDelegate in GetExtraKeepVelocityOnMovingDelegates) { if (getExtraKeepVelocityOnMovingDelegate(characterMotor)) { return true; } } return false; } public static bool InvokeExtraStrafeDelegates(CharacterMotor characterMotor) { foreach (ExtraStrafe getExtraStrafeDelegate in GetExtraStrafeDelegates) { if (getExtraStrafeDelegate(characterMotor)) { return true; } } return false; } public static bool InvokeExtraBunnyHopDelegates(CharacterMotor characterMotor) { foreach (ExtraBunnyHop getExtraBunnyHopDelegate in GetExtraBunnyHopDelegates) { if (getExtraBunnyHopDelegate(characterMotor)) { return true; } } return false; } public static bool InvokeExtraUseMaxAirVelocityDelegates(CharacterMotor characterMotor) { foreach (ExtraUseMaxAirVelocity getExtraUseMaxAirVelocityDelegate in GetExtraUseMaxAirVelocityDelegates) { if (getExtraUseMaxAirVelocityDelegate(characterMotor)) { return true; } } return false; } public static float InvokeExtraAirControlFromVelocityAddDelegates(CharacterMotor characterMotor) { float num = 0f; foreach (ExtraAirControlFromVelocityAdd getExtraAirControlFromVelocityAddDelegate in GetExtraAirControlFromVelocityAddDelegates) { num += getExtraAirControlFromVelocityAddDelegate(characterMotor); } return num; } public void Awake() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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_0139: Unknown result type (might be due to invalid IL or missing references) instance = (BaseUnityPlugin)(object)this; Log = ((BaseUnityPlugin)this).Logger; ConfigMain = ((BaseUnityPlugin)this).Config; proejctilesConfiguratorEnabled = Chainloader.PluginInfos.ContainsKey("com.brynzananas.projectilesconfigurator"); if (proejctilesConfiguratorEnabled) { ModCompatibilities.ProjectilesConfiguratorCompatibility.Init(); } Assets.BunnyHopBuff = Utils.CreateBuff("bapiBunnyHop", null, Color.white, canStack: false, isDebuff: false, isCooldown: false, isHidden: true, ignoreGrowthNectar: true); Assets.StrafeBuff = Utils.CreateBuff("bapiStrafing", null, Color.white, canStack: false, isDebuff: false, isCooldown: false, isHidden: true, ignoreGrowthNectar: true); Assets.KeepVelocityBuff = Utils.CreateBuff("bapiKeepVelocity", null, Color.white, canStack: false, isDebuff: false, isCooldown: false, isHidden: true, ignoreGrowthNectar: true); Assets.UseMaxAirVelocityBuff = Utils.CreateBuff("bapiUseMaxAirVelocity", null, Color.white, canStack: false, isDebuff: false, isCooldown: false, isHidden: true, ignoreGrowthNectar: true); NetworkingAPI.RegisterMessageType<SyncConfigsNetMessage>(); NetworkingAPI.RegisterMessageType<RequestSyncConfigsNetMessage>(); NetworkingAPI.RegisterMessageType<TimeScaleChangeNetMessage>(); NetworkingAPI.RegisterMessageType<RocketJumpComponent.RocketJumpMessage>(); NetworkingAPI.RegisterMessageType<RocketJumpComponent.RocketJumpServerMessage>(); NetworkingAPI.RegisterMessageType<RocketJumpComponent.RocketJumpFailServerMessage>(); riskOfOptionsLoaded = Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); loadoutSectionButton = ((Component)PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/UI/CharacterSelectUIMain.prefab").WaitForCompletion(), "LoadoutSectionButton", false).transform.Find("SafeArea/LeftHandPanel (Layer: Main)/SurvivorInfoPanel, Active (Layer: Secondary)/SubheaderPanel (Overview, Skills, Loadout)/GenericMenuButton (Overview)")).gameObject.GetComponent<HGButton>(); RectTransform component = ((Component)loadoutSectionButton).gameObject.GetComponent<RectTransform>(); component.sizeDelta = new Vector2(64f, 64f); ((UnityEventBase)((Button)loadoutSectionButton).onClick).RemoveAllListeners(); Utils.AddLanguageToken("LOADOUT_SECTION_MAIN", "Main"); Utils.AddLanguageToken("LOADOUT_SECTION_MAIN", "Основной", "ru"); Utils.AddLanguageToken("LOADOUT_SECTION_MAIN", "主要", "zh-CN"); Utils.AddLanguageToken("LOADOUT_SECTION_MAIN", "Principale", "fr"); Utils.AddLanguageToken("LOADOUT_SECTION_MAIN", "Wichtigsten", "de"); Utils.AddLanguageToken("LOADOUT_SECTION_MAIN", "Principale", "it"); Utils.AddLanguageToken("LOADOUT_SECTION_MAIN", "メイン", "ja"); Utils.AddLanguageToken("LOADOUT_SECTION_MAIN", "주요", "ko"); Utils.AddLanguageToken("LOADOUT_SECTION_MAIN", "Principal", "pt-BR"); Utils.AddLanguageToken("LOADOUT_SECTION_MAIN", "Ana", "tr"); Utils.AddLanguageToken("LOADOUT_SECTION_MAIN", "Principal", "es"); SetHooks(); } public void OnDestroy() { UnsetHooks(); } private void SetHooks() { //IL_0029: 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) //IL_0034: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Expected O, but got Unknown //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Expected O, but got Unknown //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown //IL_0125: 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_0130: Expected O, but got Unknown //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Expected O, but got Unknown //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Expected O, but got Unknown //IL_0188: 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) //IL_0193: Expected O, but got Unknown //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Expected O, but got Unknown //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_01d5: Expected O, but got Unknown //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Expected O, but got Unknown //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Expected O, but got Unknown //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Expected O, but got Unknown //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Expected O, but got Unknown //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Expected O, but got Unknown //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Expected O, but got Unknown //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Expected O, but got Unknown //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Expected O, but got Unknown //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Expected O, but got Unknown //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Expected O, but got Unknown //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Expected O, but got Unknown //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Expected O, but got Unknown //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Expected O, but got Unknown //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Expected O, but got Unknown //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Expected O, but got Unknown //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Expected O, but got Unknown //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Expected O, but got Unknown //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Expected O, but got Unknown //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Expected O, but got Unknown //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Expected O, but got Unknown //IL_0472: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Expected O, but got Unknown //IL_047f: Unknown result type (might be due to invalid IL or missing references) //IL_0489: Expected O, but got Unknown //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Expected O, but got Unknown //IL_04c4: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Expected O, but got Unknown //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Expected O, but got Unknown //IL_0544: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Expected O, but got Unknown //IL_0575: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Expected O, but got Unknown //IL_05a6: Unknown result type (might be due to invalid IL or missing references) //IL_05ad: Expected O, but got Unknown //IL_05d7: Unknown result type (might be due to invalid IL or missing references) //IL_05de: Expected O, but got Unknown //IL_05e5: Unknown result type (might be due to invalid IL or missing references) //IL_05ef: Expected O, but got Unknown //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_0601: Expected O, but got Unknown //IL_0609: Unknown result type (might be due to invalid IL or missing references) //IL_0613: Expected O, but got Unknown //IL_061b: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Expected O, but got Unknown //IL_064c: Unknown result type (might be due to invalid IL or missing references) //IL_0656: Expected O, but got Unknown //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Expected O, but got Unknown if (!hooksEnabled) { hooksEnabled = true; object obj = <>O.<0>__CameraModePlayerBasic_CollectLookInputInternal; if (obj == null) { Manipulator val = CameraModePlayerBasic_CollectLookInputInternal; <>O.<0>__CameraModePlayerBasic_CollectLookInputInternal = val; obj = (object)val; } CameraModePlayerBasic.CollectLookInputInternal += (Manipulator)obj; object obj2 = <>O.<1>__GenericSkill_Awake; if (obj2 == null) { Manipulator val2 = GenericSkill_Awake; <>O.<1>__GenericSkill_Awake = val2; obj2 = (object)val2; } GenericSkill.Awake += (Manipulator)obj2; object obj3 = <>O.<2>__CharacterMotor_PreMove; if (obj3 == null) { Manipulator val3 = CharacterMotor_PreMove; <>O.<2>__CharacterMotor_PreMove = val3; obj3 = (object)val3; } CharacterMotor.PreMove += (Manipulator)obj3; object obj4 = <>O.<3>__ProjectileExplosion_DetonateServer; if (obj4 == null) { Manipulator val4 = ProjectileExplosion_DetonateServer; <>O.<3>__ProjectileExplosion_DetonateServer = val4; obj4 = (object)val4; } ProjectileExplosion.DetonateServer += (Manipulator)obj4; object obj5 = <>O.<4>__GenericCharacterMain_ApplyJumpVelocity; if (obj5 == null) { Manipulator val5 = GenericCharacterMain_ApplyJumpVelocity; <>O.<4>__GenericCharacterMain_ApplyJumpVelocity = val5; obj5 = (object)val5; } GenericCharacterMain.ApplyJumpVelocity += (Manipulator)obj5; object obj6 = <>O.<5>__GlobalEventManager_OnCharacterHitGroundServer; if (obj6 == null) { hook_OnCharacterHitGroundServer val6 = GlobalEventManager_OnCharacterHitGroundServer; <>O.<5>__GlobalEventManager_OnCharacterHitGroundServer = val6; obj6 = (object)val6; } GlobalEventManager.OnCharacterHitGroundServer += (hook_OnCharacterHitGroundServer)obj6; ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders); Run.Start += new hook_Start(Run_Start); RoR2Application.OnLoad += new hook_OnLoad(RoR2Application_OnLoad); object obj7 = <>O.<6>__CharacterSelectController_OnEnable; if (obj7 == null) { hook_OnEnable val7 = CharacterSelectController_OnEnable; <>O.<6>__CharacterSelectController_OnEnable = val7; obj7 = (object)val7; } CharacterSelectController.OnEnable += (hook_OnEnable)obj7; object obj8 = <>O.<7>__FogDamageController_MyFixedUpdate; if (obj8 == null) { Manipulator val8 = FogDamageController_MyFixedUpdate; <>O.<7>__FogDamageController_MyFixedUpdate = val8; obj8 = (object)val8; } FogDamageController.MyFixedUpdate += (Manipulator)obj8; object obj9 = <>O.<8>__GenericCharacterMain_ProcessJump_bool; if (obj9 == null) { Manipulator val9 = GenericCharacterMain_ProcessJump_bool; <>O.<8>__GenericCharacterMain_ProcessJump_bool = val9; obj9 = (object)val9; } GenericCharacterMain.ProcessJump_bool += (Manipulator)obj9; object obj10 = <>O.<9>__CharacterMotor_OnLanded; if (obj10 == null) { Manipulator val10 = CharacterMotor_OnLanded; <>O.<9>__CharacterMotor_OnLanded = val10; obj10 = (object)val10; } CharacterMotor.OnLanded += (Manipulator)obj10; object obj11 = <>O.<10>__CharacterBody_RecalculateStats; if (obj11 == null) { Manipulator val11 = CharacterBody_RecalculateStats; <>O.<10>__CharacterBody_RecalculateStats = val11; obj11 = (object)val11; } CharacterBody.RecalculateStats += (Manipulator)obj11; object obj12 = <>O.<11>__CameraRigController_LateUpdate; if (obj12 == null) { Manipulator val12 = CameraRigController_LateUpdate; <>O.<11>__CameraRigController_LateUpdate = val12; obj12 = (object)val12; } CameraRigController.LateUpdate += (Manipulator)obj12; object obj13 = <>O.<12>__BulletAttack_ProcessHit; if (obj13 == null) { hook_ProcessHit val13 = BulletAttack_ProcessHit; <>O.<12>__BulletAttack_ProcessHit = val13; obj13 = (object)val13; } BulletAttack.ProcessHit += (hook_ProcessHit)obj13; object obj14 = <>O.<13>__Row_FromSkillSlot; if (obj14 == null) { Manipulator val14 = Row_FromSkillSlot; <>O.<13>__Row_FromSkillSlot = val14; obj14 = (object)val14; } Row.FromSkillSlot += (Manipulator)obj14; object obj15 = <>O.<14>__LoadoutPanelController_DestroyRows; if (obj15 == null) { hook_DestroyRows val15 = LoadoutPanelController_DestroyRows; <>O.<14>__LoadoutPanelController_DestroyRows = val15; obj15 = (object)val15; } LoadoutPanelController.DestroyRows += (hook_DestroyRows)obj15; object obj16 = <>O.<15>__Row_FinishSetup; if (obj16 == null) { hook_FinishSetup val16 = Row_FinishSetup; <>O.<15>__Row_FinishSetup = val16; obj16 = (object)val16; } Row.FinishSetup += (hook_FinishSetup)obj16; object obj17 = <>O.<16>__Row_FromSkin; if (obj17 == null) { Manipulator val17 = Row_FromSkin; <>O.<16>__Row_FromSkin = val17; obj17 = (object)val17; } Row.FromSkin += (Manipulator)obj17; Hook val18 = new Hook((MethodBase)typeof(LoadoutPanelController).GetMethod("Rebuild", BindingFlags.Instance | BindingFlags.NonPublic), typeof(BrynzaAPI).GetMethod("LoadoutPanelController_Rebuild", BindingFlags.Static | BindingFlags.NonPublic), new HookConfig { Priority = int.MaxValue }); Hook val19 = new Hook((MethodBase)typeof(LoadoutPanelController).GetMethod("Awake", BindingFlags.Instance | BindingFlags.NonPublic), typeof(BrynzaAPI).GetMethod("LoadoutPanelController_Awake", BindingFlags.Static | BindingFlags.NonPublic), new HookConfig { Priority = int.MaxValue }); object obj18 = <>O.<17>__CharacterModel_UpdateRendererMaterials; if (obj18 == null) { hook_UpdateRendererMaterials val20 = CharacterModel_UpdateRendererMaterials; <>O.<17>__CharacterModel_UpdateRendererMaterials = val20; obj18 = (object)val20; } CharacterModel.UpdateRendererMaterials += (hook_UpdateRendererMaterials)obj18; object obj19 = <>O.<18>__CharacterModel_UpdateMaterials; if (obj19 == null) { Manipulator val21 = CharacterModel_UpdateMaterials; <>O.<18>__CharacterModel_UpdateMaterials = val21; obj19 = (object)val21; } CharacterModel.UpdateMaterials += (Manipulator)obj19; BulletAttack.DefaultHitCallbackImplementation += new Manipulator(BulletAttack_DefaultHitCallbackImplementation); AimAnimator.UpdateAnimatorParameters += new Manipulator(AimAnimator_UpdateAnimatorParameters); PlayerCharacterMasterController.PollButtonInput += new Manipulator(PlayerCharacterMasterController_PollButtonInput); CharacterBody.TriggerJumpEventGlobally += new hook_TriggerJumpEventGlobally(CharacterBody_TriggerJumpEventGlobally); CharacterBody.Awake += new hook_Awake(CharacterBody_Awake); EffectData.Copy += new hook_Copy(EffectData_Copy); EffectData.Reset += new hook_Reset(EffectData_Reset); EffectData.Serialize += new hook_Serialize(EffectData_Serialize); EffectData.Deserialize += new hook_Deserialize(EffectData_Deserialize); EffectComponent.Reset += new Manipulator(EffectComponent_Reset); EffectManager.SpawnEffect_EffectIndex_EffectData_bool += new Manipulator(EffectManager_SpawnEffect_EffectIndex_EffectData_bool); Hook val22 = new Hook((MethodBase)Reflection.GetPropertyGetter(typeof(CameraRigController), "isControlAllowed"), typeof(BrynzaAPI).GetMethod("CameraRigController_isControlAllowed", BindingFlags.Static | BindingFlags.NonPublic)); Hook val23 = new Hook((MethodBase)Reflection.GetPropertyGetter(typeof(CameraRigController), "isHudAllowed"), typeof(BrynzaAPI).GetMethod("CameraRigController_isControlAllowed", BindingFlags.Static | BindingFlags.NonPublic)); CharacterMotor.FixedUpdate += new hook_FixedUpdate(CharacterMotor_FixedUpdate); Hook val24 = new Hook((MethodBase)AccessTools.Method(typeof(Interactor), "Awake", (Type[])null, (Type[])null), typeof(BrynzaAPI).GetMethod("Interactor_Awake", BindingFlags.Static | BindingFlags.NonPublic)); CharacterMotor.FixedUpdate += new Manipulator(CharacterMotor_FixedUpdate1); Hook val25 = new Hook((MethodBase)typeof(ClassicStageInfo).GetMethod("RebuildCards", BindingFlags.Instance | BindingFlags.NonPublic), typeof(BrynzaAPI).GetMethod("ClassicStageInfo_RebuildCards", BindingFlags.Static | BindingFlags.NonPublic), new HookConfig { Priority = int.MaxValue }); Hook val26 = new Hook((MethodBase)AccessTools.Method(typeof(Inventory), "Awake", (Type[])null, (Type[])null), typeof(BrynzaAPI).GetMethod("Inventory_Awake", BindingFlags.Static | BindingFlags.NonPublic)); Hook val27 = new Hook((MethodBase)Reflection.GetPropertyGetter(typeof(CharacterBody), "regen"), typeof(BrynzaAPI).GetMethod("DynamicRegenHook", BindingFlags.Static | BindingFlags.NonPublic)); Hook val28 = new Hook((MethodBase)Reflection.GetPropertyGetter(typeof(CharacterBody), "attackSpeed"), typeof(BrynzaAPI).GetMethod("DynamicAttackSpeedHook", BindingFlags.Static | BindingFlags.NonPublic)); Hook val29 = new Hook((MethodBase)Reflection.GetPropertyGetter(typeof(CharacterBody), "moveSpeed"), typeof(BrynzaAPI).GetMethod("DynamicMoveSpeedHook", BindingFlags.Static | BindingFlags.NonPublic)); CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats2); GenericPickupController.CreatePickup += new Manipulator(GenericPickupController_CreatePickup); GenericCharacterMain.PerformInputs += new hook_PerformInputs(GenericCharacterMain_PerformInputs); CharacterBodyAPI.AddAlwaysSprintCondition(new CanAlwaysSprint(AlwaysSprint)); RoR2Application.onLoadFinished = (Action)Delegate.Combine(RoR2Application.onLoadFinished, new Action(OnRoR2Loaded)); harmonyPatcher = new Harmony("com.brynzananas.brynzaapi"); harmonyPatcher.CreateClassProcessor(typeof(Patches)).Patch(); } } private bool AlwaysSprint(CharacterBody characterBody) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return CharacterBodyAPI.HasModdedBodyFlag(characterBody, Assets.SprintAllTime); } private void GenericPickupController_CreatePickup(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int index = 0; if (!val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref index), (Instruction x) => ILPatternMatchingExt.MatchCall<NetworkServer>(x, "Spawn") })) { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 1 failed!")); return; } val.Emit(OpCodes.Ldloc, index); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<<>A{00000008}<GameObject, CreatePickupInfo>>((<>A{00000008}<GameObject, CreatePickupInfo>)HandlePickupStuff); } private void GenericCharacterMain_PerformInputs(orig_PerformInputs orig, GenericCharacterMain self) { orig.Invoke(self); if (((EntityState)self).isAuthority && Object.op_Implicit((Object)(object)((EntityState)self).skillLocator) && Object.op_Implicit((Object)(object)((EntityState)self).skillLocator.GetSprintSkill())) { self.HandleSkill(((EntityState)self).skillLocator.GetSprintSkill(), ref ((EntityState)self).inputBank.sprint); } } private void PickupDropletController_CreatePickupDroplet_CreatePickupInfo_Vector3_Vector3(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (!val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchCall<NetworkServer>(x, "Spawn") })) { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 1 failed!")); return; } val.Emit(OpCodes.Dup); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<<>A{00000008}<GameObject, CreatePickupInfo>>((<>A{00000008}<GameObject, CreatePickupInfo>)HandlePickupStuff); } private static void HandlePickupStuff(GameObject gameObject, ref CreatePickupInfo createPickupInfo) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) BrynzaAPI.OnPickupCreated?.Invoke(createPickupInfo, gameObject); } private void CharacterBody_RecalculateStats2(orig_RecalculateStats orig, CharacterBody self) { useDynamicStats = false; useMoveSpeedDynamicStat = false; orig.Invoke(self); useDynamicStats = true; } private static void ClassicStageInfo_RebuildCards(orig_RebuildCards orig, ClassicStageInfo self, DirectorCardCategorySelection forcedMonsterCategory, DirectorCardCategorySelection forcedInteractableCategory) { try { if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.monsterDccsPool) && !self.monsterDccsPool.GetAppliedChanges()) { Category[] poolCategories = self.monsterDccsPool.poolCategories; foreach (Category val in poolCategories) { PoolEntry[] alwaysIncluded = val.alwaysIncluded; foreach (PoolEntry poolEntry in alwaysIncluded) { HandlePoolEntry(poolEntry); } ConditionalPoolEntry[] includedIfConditionsMet = val.includedIfConditionsMet; for (int k = 0; k < includedIfConditionsMet.Length; k++) { PoolEntry poolEntry2 = (PoolEntry)(object)includedIfConditionsMet[k]; HandlePoolEntry(poolEntry2); } PoolEntry[] includedIfNoConditionsMet = val.includedIfNoConditionsMet; foreach (PoolEntry poolEntry3 in includedIfNoConditionsMet) { HandlePoolEntry(poolEntry3); } } self.monsterDccsPool.SetAppliedChanges(value: true); } } catch (Exception ex) { Log.LogError((object)"Go tell Brynzananas in #tech-support that his smartass auto director card generator broke"); Log.LogError((object)ex); } orig.Invoke(self, forcedMonsterCategory, forcedInteractableCategory); } private static void HandlePoolEntry(PoolEntry poolEntry) { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) DirectorCardCategorySelection dccs = poolEntry.dccs; if (!Object.op_Implicit((Object)(object)dccs)) { return; } for (int i = 0; i < dccs.categories.Length; i++) { ref Category reference = ref dccs.categories[i]; ref DirectorCard[] cards = ref reference.cards; if (cards == null || cards.Length == 0) { continue; } DirectorCard[] array = cards; foreach (DirectorCard val in array) { SpawnCard val2 = val.spawnCard; if (!Object.op_Implicit((Object)(object)val2) && val.spawnCardReference != null) { val2 = (SpawnCard)(Object.op_Implicit(((AssetReference)val.spawnCardReference).Asset) ? ((object)/*isinst with value type is only supported in some contexts*/) : ((object)((AssetReference)val.spawnCardReference).LoadAssetAsync<SpawnCard>().WaitForCompletion())); } if (!Object.op_Implicit((Object)(object)val2) || !Object.op_Implicit((Object)(object)val2.prefab)) { continue; } CharacterSpawnCard val3 = (CharacterSpawnCard)(object)((val2 is CharacterSpawnCard) ? val2 : null); if (Object.op_Implicit((Object)(object)val3) && keyValuePairs1.TryGetValue(((Object)val2.prefab).name, out var value)) { CharacterSpawnCardMirror characterSpawnCardMirror = value as CharacterSpawnCardMirror; if (Object.op_Implicit((Object)(object)characterSpawnCardMirror)) { DirectorCard directorCard = characterSpawnCardMirror.GetDirectorCard(val); directorCard.spawnCard = (SpawnCard)(object)characterSpawnCardMirror.GetSpawnCard(val3); int num = reference.cards.Length; Array.Resize(ref reference.cards, num + 1); reference.cards[num] = directorCard; } } } } } private void CharacterMotor_FixedUpdate1(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchCall(x, (MethodBase)Reflection.GetPropertyGetter(typeof(Vector3), "sqrMagnitude")) })) { val.Emit(OpCodes.Dup); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<<>A{00000001}<Vector3, CharacterMotor>>((<>A{00000001}<Vector3, CharacterMotor>)IShouldPasteMethodsWithAccessToolsInteadOfThis); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } static void IShouldPasteMethodsWithAccessToolsInteadOfThis(ref Vector3 vector3, CharacterMotor characterMotor) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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) characterMotor.SetPositionDelta(vector3 * -1f / Time.fixedDeltaTime); } } private static void Interactor_Awake(Action<Interactor> action, Interactor interactor) { action(interactor); interactor.SetCharacterBody(((Component)interactor).GetComponent<CharacterBody>()); } private static void Inventory_Awake(Action<Inventory> action, Inventory inventory) { action(inventory); inventory.SetCharacterMaster(((Component)inventory).GetComponent<CharacterMaster>()); } private void CharacterMotor_FixedUpdate(orig_FixedUpdate orig, CharacterMotor self) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (self.isGrounded) { self.SetMaxAirVelocity(0f); return; } Vector3 velocity = self.velocity; if (!self.isFlying) { velocity.y = 0f; } if (((Vector3)(ref velocity)).sqrMagnitude > self.GetMaxAirVelocity() * self.GetMaxAirVelocity()) { self.SetMaxAirVelocity(((Vector3)(ref velocity)).magnitude); } } private void EffectManager_SpawnEffect_EffectIndex_EffectData_bool(ILContext il) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown ILCursor c = new ILCursor(il); ilhook(1, 6); ilhook(2, 7); static void SetEffectInstance(EffectData effectData, EffectComponent effectComponent) { effectData.SetEffectInstance(effectComponent); } void ilhook(int i1, int i2) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (c.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, i2) })) { c.Emit(OpCodes.Ldarg_1); c.Emit(OpCodes.Ldloc, i2); c.EmitDelegate<Action<EffectData, EffectComponent>>((Action<EffectData, EffectComponent>)SetEffectInstance); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook " + i1 + " failed!")); } } } private static float DynamicAttackSpeedHook(Func<CharacterBody, float> orig, CharacterBody self) { float value = orig(self); if (useDynamicStats) { BrynzaAPI.GetDynamicAttackSpeed?.Invoke(self, ref value); } return value; } private static float DynamicMoveSpeedHook(Func<CharacterBody, float> orig, CharacterBody self) { float value = orig(self); if (useMoveSpeedDynamicStat) { BrynzaAPI.GetDynamicMoveSpeed?.Invoke(self, ref value); } return value; } private static float DynamicRegenHook(Func<CharacterBody, float> orig, CharacterBody self) { float value = orig(self); if (useDynamicStats) { BrynzaAPI.GetDynamicRegen?.Invoke(self, ref value); } return value; } private static bool CameraRigController_isControlAllowed(Func<CameraRigController, bool> orig, CameraRigController self) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)self.targetBody) && CharacterBodyAPI.HasModdedBodyFlag(self.targetBody, Assets.FirstPerson)) { return true; } return orig(self); } private void EffectComponent_Reset(ILContext il) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown ILCursor c = new ILCursor(il); ilhook(1); ilhook(2); static Vector3 GetScale(EffectComponent effectComponent) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) return effectComponent.effectData.GetScale().Value; } static bool HasScale(EffectComponent effectComponent) { return effectComponent.effectData != null && effectComponent.effectData.GetScale().HasValue; } void ilhook(int i) { //IL_00d5: 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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) int num = default(int); if (c.TryGotoNext((MoveType)0, new Func<Instruction, bool>[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchNewobj<Vector3>(x) })) { Instruction next = c.Next; Instruction next2 = c.Next.Next.Next.Next.Next; c.Emit(OpCodes.Ldarg_0); c.EmitDelegate<Func<EffectComponent, bool>>((Func<EffectComponent, bool>)HasScale); c.Emit(OpCodes.Brfalse_S, next); c.Emit(OpCodes.Ldarg_0); c.EmitDelegate<Func<EffectComponent, Vector3>>((Func<EffectComponent, Vector3>)GetScale); c.Emit(OpCodes.Br_S, next2); c.Goto(next2, (MoveType)0, false); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook " + i + " failed!")); } } } private void EffectData_Deserialize(orig_Deserialize orig, EffectData self, NetworkReader reader) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, reader); if (reader.ReadBoolean()) { self.SetScale(reader.ReadVector3()); } } private void EffectData_Serialize(orig_Serialize orig, EffectData self, NetworkWriter writer) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, writer); bool hasValue = self.GetScale().HasValue; writer.Write(hasValue); if (hasValue) { writer.Write(self.GetScale().Value); } } private void EffectData_Reset(orig_Reset orig, EffectData self) { orig.Invoke(self); self.SetScale(null); } private void EffectData_Copy(orig_Copy orig, EffectData src, EffectData dest) { orig.Invoke(src, dest); dest.SetScale(src.GetScale()); } private void CharacterBody_Awake(orig_Awake orig, CharacterBody self) { orig.Invoke(self); self.SetClientBuffs(BuffCatalog.GetPerBuffBuffer<int>()); } private void UnsetHooks() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_004b: 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_0056: Expected O, but got Unknown //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_0077: Expected O, but got Unknown //IL_008d: 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_0098: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Expected O, but got Unknown //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Expected O, but got Unknown //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Expected O, but got Unknown //IL_00cf: 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_00da: Expected O, but got Unknown //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Expected O, but got Unknown //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown //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_0173: Expected O, but got Unknown //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Expected O, but got Unknown //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Expected O, but got Unknown //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Expected O, but got Unknown //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Expected O, but got Unknown //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Expected O, but got Unknown //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Expected O, but got Unknown //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Expected O, but got Unknown //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Expected O, but got Unknown //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Expected O, but got Unknown //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Expected O, but got Unknown //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Expected O, but got Unknown //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Expected O, but got Unknown //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Expected O, but got Unknown //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Expected O, but got Unknown //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Expected O, but got Unknown //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Expected O, but got Unknown //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Expected O, but got Unknown //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Expected O, but got Unknown //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Expected O, but got Unknown //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Expected O, but got Unknown if (hooksEnabled) { hooksEnabled = false; object obj = <>O.<0>__CameraModePlayerBasic_CollectLookInputInternal; if (obj == null) { Manipulator val = CameraModePlayerBasic_CollectLookInputInternal; <>O.<0>__CameraModePlayerBasic_CollectLookInputInternal = val; obj = (object)val; } CameraModePlayerBasic.CollectLookInputInternal -= (Manipulator)obj; object obj2 = <>O.<1>__GenericSkill_Awake; if (obj2 == null) { Manipulator val2 = GenericSkill_Awake; <>O.<1>__GenericSkill_Awake = val2; obj2 = (object)val2; } GenericSkill.Awake -= (Manipulator)obj2; object obj3 = <>O.<2>__CharacterMotor_PreMove; if (obj3 == null) { Manipulator val3 = CharacterMotor_PreMove; <>O.<2>__CharacterMotor_PreMove = val3; obj3 = (object)val3; } CharacterMotor.PreMove -= (Manipulator)obj3; object obj4 = <>O.<3>__ProjectileExplosion_DetonateServer; if (obj4 == null) { Manipulator val4 = ProjectileExplosion_DetonateServer; <>O.<3>__ProjectileExplosion_DetonateServer = val4; obj4 = (object)val4; } ProjectileExplosion.DetonateServer -= (Manipulator)obj4; object obj5 = <>O.<4>__GenericCharacterMain_ApplyJumpVelocity; if (obj5 == null) { Manipulator val5 = GenericCharacterMain_ApplyJumpVelocity; <>O.<4>__GenericCharacterMain_ApplyJumpVelocity = val5; obj5 = (object)val5; } GenericCharacterMain.ApplyJumpVelocity -= (Manipulator)obj5; object obj6 = <>O.<5>__GlobalEventManager_OnCharacterHitGroundServer; if (obj6 == null) { hook_OnCharacterHitGroundServer val6 = GlobalEventManager_OnCharacterHitGroundServer; <>O.<5>__GlobalEventManager_OnCharacterHitGroundServer = val6; obj6 = (object)val6; } GlobalEventManager.OnCharacterHitGroundServer -= (hook_OnCharacterHitGroundServer)obj6; ContentManager.collectContentPackProviders -= new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders); Run.Start -= new hook_Start(Run_Start); RoR2Application.OnLoad -= new hook_OnLoad(RoR2Application_OnLoad); object obj7 = <>O.<6>__CharacterSelectController_OnEnable; if (obj7 == null) { hook_OnEnable val7 = CharacterSelectController_OnEnable; <>O.<6>__CharacterSelectController_OnEnable = val7; obj7 = (object)val7; } CharacterSelectController.OnEnable -= (hook_OnEnable)obj7; object obj8 = <>O.<7>__FogDamageController_MyFixedUpdate; if (obj8 == null) { Manipulator val8 = FogDamageController_MyFixedUpdate; <>O.<7>__FogDamageController_MyFixedUpdate = val8; obj8 = (object)val8; } FogDamageController.MyFixedUpdate -= (Manipulator)obj8; object obj9 = <>O.<8>__GenericCharacterMain_ProcessJump_bool; if (obj9 == null) { Manipulator val9 = GenericCharacterMain_ProcessJump_bool; <>O.<8>__GenericCharacterMain_ProcessJump_bool = val9; obj9 = (object)val9; } GenericCharacterMain.ProcessJump_bool -= (Manipulator)obj9; object obj10 = <>O.<9>__CharacterMotor_OnLanded; if (obj10 == null) { Manipulator val10 = CharacterMotor_OnLanded; <>O.<9>__CharacterMotor_OnLanded = val10; obj10 = (object)val10; } CharacterMotor.OnLanded -= (Manipulator)obj10; object obj11 = <>O.<10>__CharacterBody_RecalculateStats; if (obj11 == null) { Manipulator val11 = CharacterBody_RecalculateStats; <>O.<10>__CharacterBody_RecalculateStats = val11; obj11 = (object)val11; } CharacterBody.RecalculateStats -= (Manipulator)obj11; object obj12 = <>O.<12>__BulletAttack_ProcessHit; if (obj12 == null) { hook_ProcessHit val12 = BulletAttack_ProcessHit; <>O.<12>__BulletAttack_ProcessHit = val12; obj12 = (object)val12; } BulletAttack.ProcessHit -= (hook_ProcessHit)obj12; object obj13 = <>O.<13>__Row_FromSkillSlot; if (obj13 == null) { Manipulator val13 = Row_FromSkillSlot; <>O.<13>__Row_FromSkillSlot = val13; obj13 = (object)val13; } Row.FromSkillSlot -= (Manipulator)obj13; object obj14 = <>O.<14>__LoadoutPanelController_DestroyRows; if (obj14 == null) { hook_DestroyRows val14 = LoadoutPanelController_DestroyRows; <>O.<14>__LoadoutPanelController_DestroyRows = val14; obj14 = (object)val14; } LoadoutPanelController.DestroyRows -= (hook_DestroyRows)obj14; object obj15 = <>O.<15>__Row_FinishSetup; if (obj15 == null) { hook_FinishSetup val15 = Row_FinishSetup; <>O.<15>__Row_FinishSetup = val15; obj15 = (object)val15; } Row.FinishSetup -= (hook_FinishSetup)obj15; object obj16 = <>O.<16>__Row_FromSkin; if (obj16 == null) { Manipulator val16 = Row_FromSkin; <>O.<16>__Row_FromSkin = val16; obj16 = (object)val16; } Row.FromSkin -= (Manipulator)obj16; object obj17 = <>O.<17>__CharacterModel_UpdateRendererMaterials; if (obj17 == null) { hook_UpdateRendererMaterials val17 = CharacterModel_UpdateRendererMaterials; <>O.<17>__CharacterModel_UpdateRendererMaterials = val17; obj17 = (object)val17; } CharacterModel.UpdateRendererMaterials -= (hook_UpdateRendererMaterials)obj17; object obj18 = <>O.<18>__CharacterModel_UpdateMaterials; if (obj18 == null) { Manipulator val18 = CharacterModel_UpdateMaterials; <>O.<18>__CharacterModel_UpdateMaterials = val18; obj18 = (object)val18; } CharacterModel.UpdateMaterials -= (Manipulator)obj18; BulletAttack.DefaultHitCallbackImplementation -= new Manipulator(BulletAttack_DefaultHitCallbackImplementation); AimAnimator.UpdateAnimatorParameters -= new Manipulator(AimAnimator_UpdateAnimatorParameters); PlayerCharacterMasterController.PollButtonInput -= new Manipulator(PlayerCharacterMasterController_PollButtonInput); CharacterBody.TriggerJumpEventGlobally -= new hook_TriggerJumpEventGlobally(CharacterBody_TriggerJumpEventGlobally); CharacterBody.Awake -= new hook_Awake(CharacterBody_Awake); EffectData.Copy -= new hook_Copy(EffectData_Copy); EffectData.Reset -= new hook_Reset(EffectData_Reset); EffectData.Serialize -= new hook_Serialize(EffectData_Serialize); EffectData.Deserialize -= new hook_Deserialize(EffectData_Deserialize); EffectComponent.Reset -= new Manipulator(EffectComponent_Reset); EffectManager.SpawnEffect_EffectIndex_EffectData_bool -= new Manipulator(EffectManager_SpawnEffect_EffectIndex_EffectData_bool); RoR2Application.onLoadFinished = (Action)Delegate.Remove(RoR2Application.onLoadFinished, new Action(OnRoR2Loaded)); } } private void OnRoR2Loaded() { ((MonoBehaviour)this).StartCoroutine(AddLanguageTokens()); } private IEnumerator AddLanguageTokens() { while (LanguageTokensToAddOnLoad.languageTokensToAddOnLoad.Count > 0) { LanguageTokensToAddOnLoad.languageTokensToAddOnLoad[0].Dispose(); yield return null; } } private void CharacterBody_TriggerJumpEventGlobally(orig_TriggerJumpEventGlobally orig, CharacterBody self) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); self.SetLastJumpTime(FixedTimeStamp.now); } private void PlayerCharacterMasterController_PollButtonInput(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 16), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 6) })) { int index = val.Index; val.Index = index + 1; Instruction next = val.Next; Instruction next2 = val.Next.Next; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Func<PlayerCharacterMasterController, bool>>((Func<PlayerCharacterMasterController, bool>)GetFlag); val.Emit(OpCodes.Brfalse_S, next); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldloc, 13); val.Emit(OpCodes.Ldc_I4, 18); val.Emit(OpCodes.Callvirt, (MethodBase)AccessTools.Method(typeof(Player), "GetButton", new Type[1] { typeof(int) }, (Type[])null)); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 1 failed!")); } static bool GetFlag(PlayerCharacterMasterController playerCharacterMasterController) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return CharacterBodyAPI.HasModdedBodyFlag(playerCharacterMasterController.body, Assets.SprintAllTime); } } private void AimAnimator_UpdateAnimatorParameters(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdfld<AimAnimator>(x, "pitchClipCycleEnd"), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f) })) { int index = val.Index; val.Index = index + 1; val.Remove(); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Func<AimAnimator, float>>((Func<AimAnimator, float>)SetPitch); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 1 failed!")); } if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld<AimAnimator>(x, "yawClipCycleEnd") })) { val.Remove(); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Func<AimAnimator, float>>((Func<AimAnimator, float>)SetYaw); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 2 failed!")); } static float SetPitch(AimAnimator aimAnimator) { return aimAnimator.GetPitchClipCycleStart(); } static float SetYaw(AimAnimator aimAnimator) { return aimAnimator.GetYawClipCycleStart(); } } private static void BlastAttackDamageInfo_Write(orig_Write orig, ref BlastAttackDamageInfo self, NetworkWriter writer) { orig.Invoke(ref self, writer); writer.Write(self.GetForceMassIsOne()); writer.Write(self.GetForceAlwaysApply()); writer.Write(self.GetForceDisableAirControlUntilCollision()); } private static void BlastAttackDamageInfo_Read(orig_Read orig, ref BlastAttackDamageInfo self, NetworkReader reader) { orig.Invoke(ref self, reader); self.SetForceMassIsOne(reader.ReadBoolean()); self.SetForceAlwaysApply(reader.ReadBoolean()); self.SetForceDisableAirControlUntilCollision(reader.ReadBoolean()); } private static void BlastAttack_PerformDamageServer(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel val2 = null; int locid = 9; if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchNewobj<DamageInfo>(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref locid) })) { val.Emit(OpCodes.Ldloc, locid); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<<>A{00000008}<DamageInfo, BlastAttackDamageInfo>>((<>A{00000008}<DamageInfo, BlastAttackDamageInfo>)SetBlastAttackForce); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 1 failed!")); } static void SetBlastAttackForce(DamageInfo damageInfo, ref BlastAttackDamageInfo blastAttackDamageInfo) { damageInfo.SetForceMassIsOne(blastAttackDamageInfo.GetForceMassIsOne()); damageInfo.SetForceAlwaysApply(blastAttackDamageInfo.GetForceAlwaysApply()); damageInfo.SetForceDisableAirControlUntilCollision(blastAttackDamageInfo.GetForceDisableAirControlUntilCollision()); } } private static void BlastAttack_HandleHits(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel val2 = null; int locid = 9; if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloca(x, ref locid), (Instruction x) => ILPatternMatchingExt.MatchInitobj<BlastAttackDamageInfo>(x) })) { val.Emit(OpCodes.Ldloca, locid); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<<>A{00000001}<BlastAttackDamageInfo, BlastAttack>>((<>A{00000001}<BlastAttackDamageInfo, BlastAttack>)SetBlastAttackForce); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 1 failed!")); } static void SetBlastAttackForce(ref BlastAttackDamageInfo blastAttackDamageInfo, BlastAttack blastAttack) { blastAttackDamageInfo.SetForceMassIsOne(blastAttack.GetForceMassIsOne()); blastAttackDamageInfo.SetForceAlwaysApply(blastAttack.GetForceAlwaysApply()); blastAttackDamageInfo.SetForceDisableAirControlUntilCollision(blastAttack.GetForceDisableAirControlUntilCollision()); } } private static void BulletAttack_Fire(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel iLLabel = null; if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdfld<BulletAttack>(x, "weapon"), (Instruction x) => ILPatternMatchingExt.MatchCall<Object>(x, "op_Implicit"), (Instruction x) => ILPatternMatchingExt.MatchBrtrue(x, ref iLLabel) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Func<BulletAttack, bool>>((Func<BulletAttack, bool>)GetNoWeaponIfOwner); val.Emit(OpCodes.Brtrue_S, (object)iLLabel); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 1 failed!")); } static bool GetNoWeaponIfOwner(BulletAttack bulletAttack) { return bulletAttack.GetNoWeaponIfOwner(); } } private static void HealthComponent_TakeDamageForce_DamageInfo_bool_bool(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0129: 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_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int locId = 3; if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[6] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref locId), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1), (Instruction x) => ILPatternMatchingExt.MatchLdfld<DamageInfo>(x, "force"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 2), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 3), (Instruction x) => ILPatternMatchingExt.MatchCallvirt<CharacterMotor>(x, "ApplyForce") })) { Instruction next = val.Next.Next.Next.Next.Next.Next.Next; Instruction next2 = val.Next.Next; int index = val.Index; val.Index = index + 1; val.Emit(OpCodes.Ldarg_1); val.EmitDelegate<Func<DamageInfo, bool>>((Func<DamageInfo, bool>)HasIsMassIsOne); val.Emit(OpCodes.Brfalse_S, next2); val.Emit(OpCodes.Ldarg_1); val.Emit(OpCodes.Ldarg_2); val.Emit(OpCodes.Ldarg_3); val.EmitDelegate<Action<CharacterMotor, DamageInfo, bool, bool>>((Action<CharacterMotor, DamageInfo, bool, bool>)ApplyForce); val.Emit(OpCodes.Br, next); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } static void ApplyForce(CharacterMotor characterMotor, DamageInfo damageInfo, bool awlaysApply, bool disableAirControlUntilCollision) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_0036: 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) PhysForceInfo val2 = default(PhysForceInfo); ((PhysForceInfo)(ref val2)).disableAirControlUntilCollision = disableAirControlUntilCollision; ((PhysForceInfo)(ref val2)).ignoreGroundStick = awlaysApply; val2.force = damageInfo.force; ((PhysForceInfo)(ref val2)).massIsOne = damageInfo.GetForceMassIsOne(); PhysForceInfo val3 = val2; characterMotor.ApplyForceImpulse(ref val3); } static bool HasIsMassIsOne(DamageInfo damageInfo) { return damageInfo.GetForceMassIsOne(); } } private DamageInfo NetworkExtensions_ReadDamageInfo(orig_ReadDamageInfo orig, NetworkReader reader) { DamageInfo val = orig.Invoke(reader); val.SetForceMassIsOne(reader.ReadBoolean()); val.SetForceAlwaysApply(reader.ReadBoolean()); val.SetForceDisableAirControlUntilCollision(reader.ReadBoolean()); return val; } private void NetworkExtensions_Write_NetworkWriter_DamageInfo(orig_Write_NetworkWriter_DamageInfo orig, NetworkWriter writer, DamageInfo damageInfo) { orig.Invoke(writer, damageInfo); writer.Write(damageInfo.GetForceMassIsOne()); writer.Write(damageInfo.GetForceAlwaysApply()); writer.Write(damageInfo.GetForceDisableAirControlUntilCollision()); } private void BulletAttack_DefaultHitCallbackImplementation(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003f: 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) ILCursor val = new ILCursor(il); int num = 3; if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld<DamageInfo>(x, "force") })) { val.Emit(OpCodes.Ldloc, num); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Action<DamageInfo, BulletAttack>>((Action<DamageInfo, BulletAttack>)SetBonusForce); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } static void SetBonusForce(DamageInfo damageInfo, BulletAttack bulletAttack) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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_0012: Unknown result type (might be due to invalid IL or missing references) damageInfo.force += bulletAttack.GetBonusForce(); } } private static void CharacterModel_UpdateMaterials(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld<CharacterModel>(x, "fade") })) { Instruction next = val.Next; Instruction next2 = val.Next.Next.Next; val.Emit(OpCodes.Ldloc, 6); val.EmitDelegate<Func<RendererInfo, bool>>((Func<RendererInfo, bool>)FixFading); val.Emit(OpCodes.Brfalse_S, next); val.Emit(OpCodes.Ldc_R4, 1f); val.Emit(OpCodes.Br_S, next2); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } static bool FixFading(RendererInfo rendererInfo) { //IL_0010: 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 (rendererInfo.GetDontFadeWhenNearCamera()) { return true; } Material val2 = (Object.op_Implicit((Object)(object)rendererInfo.renderer) ? rendererInfo.renderer.material : null); if (!Object.op_Implicit((Object)(object)val2) || !val2.HasInt("_FadeCloseOn")) { return false; } return val2.GetInt("_FadeCloseOn") == 0; } } private static void CharacterModel_UpdateRendererMaterials(orig_UpdateRendererMaterials orig, CharacterModel self, Renderer renderer, Material defaultMaterial, bool ignoreOverlays) { ParticleSystemRenderer val = (ParticleSystemRenderer)(object)((renderer is ParticleSystemRenderer) ? renderer : null); bool flag = false; if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.trailMaterial)) { flag = true; } orig.Invoke(self, renderer, defaultMaterial, ignoreOverlays); if (flag) { val.trailMaterial = defaultMaterial; } } private static void Util_BuildPrefabTransformPath(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); string text = default(string); MethodReference val2 = default(MethodReference); if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[7] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCall(x, typeof(Object), "op_Implicit"), (Instruction x) => ILPatternMatchingExt.MatchBrtrue(x, ref val2), (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, ref text), (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, ref text), (Instruction x) => ILPatternMatchingExt.MatchNewobj(x, ref val2), (Instruction x) => ILPatternMatchingExt.MatchThrow(x) })) { val.RemoveRange(15); int num = default(int); if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[12] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 1), (Instruction x) => ILPatternMatchingExt.MatchCall(x, typeof(Object), "op_Implicit"), (Instruction x) => ILPatternMatchingExt.MatchBrtrue(x, ref val2), (Instruction x) => ILPatternMatchingExt.MatchLdloca(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchCall(x, ref val2), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 2), (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, ref text), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 2), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCall<string>(x, "Format"), (Instruction x) => ILPatternMatchingExt.MatchNewobj(x, ref val2), (Instruction x) => ILPatternMatchingExt.MatchThrow(x) })) { val.RemoveRange(12); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 2 failed!")); } } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 1 failed!")); } } private static void GeneratedNetworkCode__ReadPhysForceInfo_None(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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.MatchStfld<PhysForceInfo>(x, "force") })) { val.Emit(OpCodes.Ldloca, 0); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<<>A{00000001}<PhysForceInfo, NetworkReader>>((<>A{00000001}<PhysForceInfo, NetworkReader>)Pissbox); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } static void Pissbox(ref PhysForceInfo physForceInfo, NetworkReader networkReader) { ((PhysForceInfo)(ref physForceInfo)).ignoreGroundStick = networkReader.ReadBoolean(); ((PhysForceInfo)(ref physForceInfo)).disableAirControlUntilCollision = networkReader.ReadBoolean(); } } private static void GeneratedNetworkCode__WritePhysForceInfo_None(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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.MatchCall<NetworkWriter>(x, "Write") })) { val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate<Action<NetworkWriter, PhysForceInfo>>((Action<NetworkWriter, PhysForceInfo>)Hopoopoo); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } static void Hopoopoo(NetworkWriter networkWriter, PhysForceInfo physForceInfo) { networkWriter.Write(((PhysForceInfo)(ref physForceInfo)).ignoreGroundStick); networkWriter.Write(((PhysForceInfo)(ref physForceInfo)).disableAirControlUntilCollision); } } private static void LoadoutPanelController_Rebuild(orig_Rebuild orig, LoadoutPanelController self) { orig.Invoke(self); int count = Section.sections.Count; if (count <= 0) { return; } if (count == 1) { ClearSections(); return; } LayoutElement val = (Object.op_Implicit((Object)(object)loadoutSectionHolder) ? loadoutSectionHolder.GetComponent<LayoutElement>() : null); loadoutSectionHolder.transform.SetAsFirstSibling(); if ((Object)(object)val != (Object)null) { val.minHeight = 32f; val.preferredHeight = 48f; val.flexibleHeight = 0f; } Utils.SelectRowsSection("LOADOUT_SECTION_MAIN"); } private static void Row_FromSkin(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003d: 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.MatchNewobj<Row>(x) })) { val.Emit(OpCodes.Dup); val.EmitDelegate<Action<Row>>((Action<Row>)SetSection); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } static void SetSection(Row row) { string sectionName = "LOADOUT_SECTION_MAIN"; CreateSection(row, sectionName); } } private static void CreateSection(Row row, string sectionName) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) if (Section.sectionByName.ContainsKey(sectionName)) { Section section = Section.sectionByName[sectionName]; section.rows.Add(row); } else { Section section2 = new Section(sectionName, row.primaryColor); section2.rows.Add(row); } } private static void Row_FinishSetup(orig_FinishSetup orig, Row self, bool addWIPIcons) { orig.Invoke(self, addWIPIcons); } private static void ClearSections() { while (Section.sections.Count > 0) { Section.sections[0].Dispose(); } LayoutElement val = (Object.op_Implicit((Object)(object)loadoutSectionHolder) ? loadoutSectionHolder.GetComponent<LayoutElement>() : null); if ((Object)(object)val != (Object)null) { val.minHeight = 0f; val.preferredHeight = 0f; } } private static void LoadoutPanelController_DestroyRows(orig_DestroyRows orig, LoadoutPanelController self) { ClearSections(); orig.Invoke(self); } private static void Row_FromSkillSlot(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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.MatchNewobj<Row>(x) })) { val.Emit(OpCodes.Dup); val.Emit(OpCodes.Ldarg_3); val.EmitDelegate<Action<Row, GenericSkill>>((Action<Row, GenericSkill>)SetSection); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } static void SetSection(Row row, GenericSkill genericSkill) { string text = genericSkill.GetSection(); if (text == null || text == "") { text = "LOADOUT_SECTION_MAIN"; } CreateSection(row, text); } } private static void LoadoutPanelController_Awake(orig_Awake orig, LoadoutPanelController self) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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) orig.Invoke(self); if (!(((Object)self).name != "LoadoutPanel") && !Object.op_Implicit((Object)(object)loadoutSectionHolder)) { loadoutSectionHolder = new GameObject("SectionHolder"); Transform transform = loadoutSectionHolder.transform; loadoutSectionHolder.transform.SetParent(((Component)self).transform); transform.localScale = Vector3.one; transform.localRotation = Quaternion.identity; transform.localPosition = Vector3.zero; RectTransform val = loadoutSectionHolder.AddComponent<RectTransform>(); CanvasRenderer val2 = loadoutSectionHolder.AddComponent<CanvasRenderer>(); val2.cullTransparentMesh = false; HorizontalLayoutGroup val3 = loadoutSectionHolder.AddComponent<HorizontalLayoutGroup>(); RectOffset padding = ((LayoutGroup)val3).padding; padding.right = 6; padding.left = 6; padding.top = 6; padding.bottom = 6; ((HorizontalOrVerticalLayoutGroup)val3).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)val3).childControlWidth = true; LayoutElement val4 = loadoutSectionHolder.AddComponent<LayoutElement>(); val4.minHeight = 32f; val4.preferredHeight = 48f; val4.flexibleHeight = 0f; } } private static bool BulletAttack_ProcessHit(orig_ProcessHit orig, BulletAttack self, ref BulletHit hitInfo) { if (hitInfo != null && Object.op_Implicit((Object)(object)hitInfo.hitHurtBox) && Object.op_Implicit((Object)(object)hitInfo.hitHurtBox.healthComponent) && self.GetIgnoreHitTargets()) { List<object> ignoredHealthComponents = self.GetIgnoredHealthComponents(); if (ignoredHealthComponents == null) { self.SetIgnoredHealthComponents(new List<object>()); ignoredHealthComponents = self.GetIgnoredHealthComponents(); } if (ignoredHealthComponents.Contains(hitInfo.hitHurtBox.healthComponent)) { return false; } ignoredHealthComponents.Add(hitInfo.hitHurtBox.healthComponent); } return orig.Invoke(self, ref hitInfo); } private static void CharacterSelectController_OnEnable(orig_OnEnable orig, CharacterSelectController self) { orig.Invoke(self); SetConfigValues(); } private static void GenericSkill_Awake(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel val2 = null; if (val.TryGotoNext(new Func<Instruction, bool>[5] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCall<GenericSkill>(x, "get_skillFamily"), (Instruction x) => ILPatternMatchingExt.MatchCallvirt<SkillFamily>(x, "get_defaultSkillDef"), (Instruction x) => ILPatternMatchingExt.MatchCall<GenericSkill>(x, "set_defaultSkillDef") })) { val.RemoveRange(5); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Action<GenericSkill>>((Action<GenericSkill>)delegate(GenericSkill cb) { cb.defaultSkillDef = (Object.op_Implicit((Object)(object)cb.skillFamily) ? cb.skillFamily.defaultSkillDef : null); }); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } } private static void CameraModePlayerBasic_CollectLookInputInternal(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int num = 1; ILLabel iLLabel2 = null; int num2 = default(int); if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchCastclass<Object>(x), (Instruction x) => ILPatternMatchingExt.MatchCall<Object>(x, "op_Implicit"), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref iLLabel2) })) { val.Emit(OpCodes.Ldloc_1); val.EmitDelegate<<>F{00000001}<CameraInfo, bool>>((<>F{00000001}<CameraInfo, bool>)HasFlag); val.Emit(OpCodes.Brtrue_S, (object)iLLabel2); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 1 failed!")); } static bool HasFlag(ref CameraInfo cameraInfo) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) return Object.op_Implicit((Object)(object)cameraInfo.cameraRigController) && Object.op_Implicit((Object)(object)cameraInfo.cameraRigController.targetBody) && CharacterBodyAPI.HasModdedBodyFlag(cameraInfo.cameraRigController.targetBody, Assets.FirstPerson); } } private static void CameraRigController_SetCameraState1(orig_SetCameraState orig, CameraRigController self, CameraState cameraState) { //IL_0003: 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) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, cameraState); if (!(worldCrosshairPositionOverride == Vector3.zero)) { ((Component)self).transform.rotation = Quaternion.LookRotation(worldCrosshairPositionOverride - ((Component)self).transform.position); } } private void CameraRigController_SetCameraState(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); Instruction val2 = null; if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld<CameraState>(x, "rotation") })) { val.Remove(); val.EmitDelegate<<>F{00000001}<CameraState, Quaternion>>((<>F{00000001}<CameraState, Quaternion>)SetOverrideWorldCrosshairPosition); } else { Debug.LogError((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } static Quaternion SetOverrideWorldCrosshairPosition(ref CameraState cameraState) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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) //IL_0012: 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_002f: 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) return (worldCrosshairPositionOverride == Vector3.zero) ? cameraState.rotation : Quaternion.LookRotation(worldCrosshairPositionOverride - cameraState.position); } } private static void CameraRigController_LateUpdate(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel iLLabel = null; if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld<CameraRigController>(x, "overrideCam"), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref iLLabel) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Func<CameraRigController, bool>>((Func<CameraRigController, bool>)HasFlag); val.Emit(OpCodes.Brtrue_S, (object)iLLabel); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 1 failed!")); } ILLabel iLLabel2 = null; float num = default(float); if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[4] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld<CameraRigController>(x, "lerpCameraTime"), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchBltUn(x, ref iLLabel2) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Func<CameraRigController, bool>>((Func<CameraRigController, bool>)HasFlag2); val.Emit(OpCodes.Brtrue_S, (object)iLLabel2); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 2 failed!")); } static bool HasFlag(CameraRigController cameraRigController) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) return Object.op_Implicit((Object)(object)cameraRigController.targetBody) && CharacterBodyAPI.HasModdedBodyFlag(cameraRigController.targetBody, Assets.FirstPerson); } static bool HasFlag2(CameraRigController cameraRigController) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) return Object.op_Implicit((Object)(object)cameraRigController.targetBody) && CharacterBodyAPI.HasModdedBodyFlag(cameraRigController.targetBody, Assets.FirstPerson); } } private static void CameraModePlayerBasic_UpdateCrosshair(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //
plugins/BrynzaInterop.dll
Decompiled 4 days agousing System; using System.Collections.Generic; 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 Microsoft.CodeAnalysis; using RoR2; using RoR2.Skills; using RoR2.UI; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: InternalsVisibleTo("BrynzaAPI")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("BrynzaInterop")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+ff1acb874f34e124c94dc0d426746dc8ac20e4f3")] [assembly: AssemblyProduct("BrynzaInterop")] [assembly: AssemblyTitle("BrynzaInterop")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace BrynzaAPI.Interop { public static class BrynzaInterop { public static List<GenericSkill> GetExtraSkills(GenericSkill genericSkill) { GenericSkill genericSkill2 = genericSkill; return (genericSkill2.bapi_extraSkills != null) ? (from i in Enumerable.Range(0, genericSkill2.bapi_extraSkills.Count) select (GenericSkill)((genericSkill2.bapi_extraSkills[i] is GenericSkill) ? /*isinst with value type is only supported in some contexts*/: null)).ToList() : null; } public static void SetExtraSkills(GenericSkill genericSkill, List<object> list) { genericSkill.bapi_extraSkills = list; } public static void AddExtraSkill(GenericSkill genericSkill, GenericSkill obj) { if (genericSkill.bapi_extraSkills != null) { genericSkill.bapi_extraSkills.Add(obj); return; } genericSkill.bapi_extraSkills = new List<object>(); genericSkill.bapi_extraSkills.Add(obj); } public static void RemoveExtraSkill(GenericSkill genericSkill, GenericSkill obj) { if (genericSkill.bapi_extraSkills != null && genericSkill.bapi_extraSkills.Contains(obj)) { genericSkill.bapi_extraSkills.Remove(obj); } } public static void LinkSkill(GenericSkill genericSkil, object obj) { genericSkil.bapi_linkedSkill = obj; } public static GenericSkill GetLinkedSkill(GenericSkill genericSkil) { return (GenericSkill)((genericSkil.bapi_linkedSkill != null && genericSkil.bapi_linkedSkill is GenericSkill) ? /*isinst with value type is only supported in some contexts*/: null); } public static void AddBonusSkill(SkillLocator skillLocator, GenericSkill genericSkill) { if (skillLocator.bapi_bonusSkills != null) { skillLocator.bapi_bonusSkills.Add(genericSkill); return; } skillLocator.bapi_bonusSkills = new List<object>(); skillLocator.bapi_bonusSkills.Add(genericSkill); } public static void RemoveBonusSkill(SkillLocator skillLocator, GenericSkill genericSkill) { if (skillLocator.bapi_bonusSkills != null && skillLocator.bapi_bonusSkills.Contains(genericSkill)) { skillLocator.bapi_bonusSkills.Remove(genericSkill); } } public static List<GenericSkill> GetBonusSkills(SkillLocator skillLocator) { SkillLocator skillLocator2 = skillLocator; return (skillLocator2.bapi_bonusSkills != null) ? (from i in Enumerable.Range(0, skillLocator2.bapi_bonusSkills.Count) select (GenericSkill)((skillLocator2.bapi_bonusSkills[i] is GenericSkill) ? /*isinst with value type is only supported in some contexts*/: null)).ToList() : null; } public static Vector3 GetVelocityOverride(CharacterMotor characterMotor) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return characterMotor.bapi_velocityOverride; } public static void SetVelocityOverride(CharacterMotor characterMotor, Vector3 value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) characterMotor.bapi_velocityOverride = value; } public static float GetMaxAirVelocity(CharacterMotor characterMotor) { return characterMotor.bapi_maxAirVelocity; } public static void SetMaxAirVelocity(CharacterMotor characterMotor, float value) { characterMotor.bapi_maxAirVelocity = value; } public static bool GetKeepVelocityOnMoving(CharacterMotor characterMotor) { return characterMotor.bapi_keepVelocityOnMoving; } public static void SetKeepVelocityOnMoving(CharacterMotor characterMotor, bool value) { characterMotor.bapi_keepVelocityOnMoving = value; } public static bool GetUseMaxAirVelocity(CharacterMotor characterMotor) { return characterMotor.bapi_useMaxAirVelocity; } public static void SetUseMaxAirVelocity(CharacterMotor characterMotor, bool value) { characterMotor.bapi_useMaxAirVelocity = value; } public static float GetConsistentAcceleration(CharacterMotor characterMotor) { return characterMotor.bapi_consistentAcceleration; } public static void SetConsistentAcceleration(CharacterMotor characterMotor, float value) { characterMotor.bapi_consistentAcceleration = value; } public static float GetAirControlFromVelocityAdd(CharacterMotor characterMotor) { return characterMotor.bapi_airControlFromVelocityAdd; } public static void SetAirControlFromVelocityAdd(CharacterMotor characterMotor, float value) { characterMotor.bapi_airControlFromVelocityAdd = value; } public static bool GetFluidMaxDistanceDelta(CharacterMotor characterMotor) { return characterMotor.bapi_fluidMaxDistanceDelta; } public static void SetFluidMaxDistanceDelta(CharacterMotor characterMotor, bool value) { characterMotor.bapi_fluidMaxDistanceDelta = value; } public static bool GetStrafe(CharacterMotor characterMotor) { return characterMotor.bapi_strafe; } public static void SetStrafe(CharacterMotor characterMotor, bool value) { characterMotor.bapi_strafe = value; } public static bool GetBunnyHop(CharacterMotor characterMotor) { return characterMotor.bapi_bunnyHop; } public static void SetBunnyHop(CharacterMotor characterMotor, bool value) { characterMotor.bapi_bunnyHop = value; } public static int GetBaseWallJumpCount(CharacterBody characterBody) { return characterBody.bapi_baseWallJumpCount; } public static void SetBaseWallJumpCount(CharacterBody characterBody, int value) { characterBody.bapi_baseWallJumpCount = value; } public static int GetMaxWallJumpCount(CharacterBody characterBody) { return characterBody.bapi_maxWallJumpCount; } public static void SetMaxWallJumpCount(CharacterBody characterBody, int value) { characterBody.bapi_maxWallJumpCount = value; } public static int GetWallJumpCount(CharacterMotor characterMotor) { return characterMotor.bapi_wallJumpCount; } public static void SetWallJumpCount(CharacterMotor characterMotor, int value) { characterMotor.bapi_wallJumpCount = value; } public static bool CanApplyAmmoPack(SkillDef skillDef) { return skillDef.bapi_CanApplyAmmoPack(); } public static void SetStateToMain(EntityStateMachine entityStateMachine) { entityStateMachine.bapi_SetStateToMain(); } public static List<object> GetIgnoredHealthComponents(BulletAttack bulletAttack) { return bulletAttack.bapi_ignoredHealthComponentList; } public static void SetIgnoredHealthComponents(BulletAttack bulletAttack, List<object> value) { bulletAttack.bapi_ignoredHealthComponentList = value; } public static bool GetIgnoreHitTargets(BulletAttack bulletAttack) { return bulletAttack.bapi_ignoreHitTargets; } public static void SetForceMassIsOne(BulletAttack bulletAttack, bool value) { } public static bool GetForceMassIsOne(BulletAttack bulletAttack) { return false; } public static void SetForceMassIsOne(BlastAttack blastAttack, bool value) { } public static bool GetForceMassIsOne(BlastAttack blastAttack) { return false; } public static void SetForceMassIsOne(ref BlastAttackDamageInfo blastAttackDamageInfo, bool value) { } public static bool GetForceMassIsOne(ref BlastAttackDamageInfo blastAttackDamageInfo) { return false; } public static void SetForceMassIsOne(DamageInfo damageInfo, bool value) { } public static bool GetForceMassIsOne(DamageInfo damageInfo) { return false; } public static void SetForceAlwaysApply(BulletAttack bulletAttack, bool value) { } public static bool GetForceAlwaysApply(BulletAttack bulletAttack) { return false; } public static void SetForceAlwaysApply(BlastAttack blastAttack, bool value) { } public static bool GetForceAlwaysApply(BlastAttack blastAttack) { return false; } public static void SetForceAlwaysApply(ref BlastAttackDamageInfo blastAttackDamageInfo, bool value) { } public static bool GetForceAlwaysApply(ref BlastAttackDamageInfo blastAttackDamageInfo) { return false; } public static void SetForceAlwaysApply(DamageInfo damageInfo, bool value) { } public static bool GetForceAlwaysApply(DamageInfo damageInfo) { return false; } public static void SetForceDisableAirControlUntilCollision(BulletAttack bulletAttack, bool value) { } public static bool GetForceDisableAirControlUntilCollision(BulletAttack bulletAttack) { return false; } public static void SetForceDisableAirControlUntilCollision(BlastAttack blastAttack, bool value) { } public static bool GetForceDisableAirControlUntilCollision(BlastAttack blastAttack) { return false; } public static void SetForceDisableAirControlUntilCollision(ref BlastAttackDamageInfo blastAttackDamageInfo, bool value) { } public static bool GetForceDisableAirControlUntilCollision(ref BlastAttackDamageInfo blastAttackDamageInfo) { return false; } public static void SetForceDisableAirControlUntilCollision(DamageInfo damageInfo, bool value) { } public static bool GetForceDisableAirControlUntilCollision(DamageInfo damageInfo) { return false; } public static void SetBonusForce(BulletAttack bulletAttack, Vector3 value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) bulletAttack.bapi_bonusForce = value; } public static Vector3 GetBonusForce(BulletAttack bulletAttack) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return bulletAttack.bapi_bonusForce; } public static void SetIgnoreHitTargets(BulletAttack bulletAttack, bool value) { bulletAttack.bapi_ignoreHitTargets = value; } public static string GetSection(Row row) { return row.bapi_section; } public static void SetSection(Row row, string value) { row.bapi_section = value; } public static string GetSection(GenericSkill genericSkill) { return genericSkill.bapi_section; } public static void SetSection(GenericSkill genericSkill, string value) { genericSkill.bapi_section = value; } public static List<string> GetSections(LoadoutPanelController loadoutPanelController) { return loadoutPanelController.bapi_sections; } public static void SetSections(LoadoutPanelController loadoutPanelController, List<string> value) { loadoutPanelController.bapi_sections = value; } public static bool GetDontFadeWhenNearCamera(ref RendererInfo rendererInfo) { return rendererInfo.bapi_dontFadeCloseOn; } public static void SetDontFadeWhenNearCamera(ref RendererInfo rendererInfo, bool value) { rendererInfo.bapi_dontFadeCloseOn = value; } public static void SetNoWeaponIfOwner(BulletAttack bulletAttack, bool value) { bulletAttack.bapi_noWeaponIfOwner = value; } public static bool GetNoWeaponIfOwner(BulletAttack bulletAttack) { return bulletAttack.bapi_noWeaponIfOwner; } public static float GetPitchClipCycleStart(AimAnimator aimAnimator) { return aimAnimator.bapi_pitchClipCycleStart; } public static void SetPitchClipCycleStart(AimAnimator aimAnimator, float value) { aimAnimator.bapi_pitchClipCycleStart = value; } public static float GetYawClipCycleStart(AimAnimator aimAnimator) { return aimAnimator.bapi_yawClipCycleStart; } public static void SetYawClipCycleStart(AimAnimator aimAnimator, float value) { aimAnimator.bapi_yawClipCycleStart = value; } public static FixedTimeStamp GetLastJumpTime(CharacterBody characterBody) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return characterBody.bapi_lastJumpTime; } public static void SetLastJumpTime(CharacterBody characterBody, FixedTimeStamp value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) characterBody.bapi_lastJumpTime = value; } public static void SetClientBuffs(CharacterBody characterBody, int[] value) { characterBody.bapi_clientBuffs = value; } public static int[] GetClientBuffs(CharacterBody characterBody) { return characterBody.bapi_clientBuffs; } public static void SetScale(EffectData effectData, Vector3? value) { effectData.bapi_scale = value; } public static Vector3? GetScale(EffectData effectData) { return effectData.bapi_scale; } public static void SetEffectInstance(EffectData effectData, EffectComponent effectComponent) { effectData.bapi_effectInstance = effectComponent; } public static EffectComponent GetEffectInstance(EffectData effectData) { return effectData.bapi_effectInstance; } } }