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[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 4), (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "#") })) { val.Emit(OpCodes.Ldloc, 4); val.EmitDelegate>((Action)GetDefaultValue); if (val.TryGotoNext((MoveType)2, new Func[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)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 dictionary = defaultConfigValues[configFile]; if (!dictionary.ContainsKey(configDefinition)) { dictionary[configDefinition] = pendingDefaultValue; } } else { Dictionary value = new Dictionary { { 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 : INetworkConfig { public NetworkConfig enableConfig; public ConfigEntry 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 networkConfig2 = networkConfig as NetworkConfig; networkConfig2.Value = float.Parse(input); if (!NetworkServer.active) { ConfigEntry configEntry = networkConfig2.configEntry; configEntry.Value += 1f; ConfigEntry configEntry2 = networkConfig2.configEntry; configEntry2.Value -= 1f; } } if (networkConfig.parameterType == typeof(int)) { NetworkConfig networkConfig3 = networkConfig as NetworkConfig; networkConfig3.Value = int.Parse(input); if (!NetworkServer.active) { ConfigEntry configEntry3 = networkConfig3.configEntry; configEntry3.Value += 1; ConfigEntry configEntry4 = networkConfig3.configEntry; configEntry4.Value -= 1; } } if (networkConfig.parameterType == typeof(bool)) { NetworkConfig networkConfig4 = networkConfig as NetworkConfig; 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} <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> onHitGroundServerDictionary = new FixedConditionalWeakTable>(); public static bool riskOfOptionsLoaded = false; public static ConfigFile ConfigMain; public static Dictionary> modConfigs = new Dictionary>(); public static List activeSniperHurtboxTrackers = new List(); [Obsolete] private static Vector3 worldCrosshairPositionOverride = Vector3.zero; public static Dictionary _tokenKeywords = new Dictionary(); 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> defaultConfigValues = new Dictionary>(); private static List GetExtraKeepVelocityOnMovingDelegates = new List(); private static List GetExtraStrafeDelegates = new List(); public static List GetExtraBunnyHopDelegates = new List(); public static List GetExtraUseMaxAirVelocityDelegates = new List(); private static List GetExtraAirControlFromVelocityAddDelegates = new List(); private Harmony harmonyPatcher; private static bool useDynamicStats; public static bool useMoveSpeedDynamicStat; internal static Dictionary keyValuePairs1 = new Dictionary(); 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 networkConfigs = new List(); 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 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 onSniperHurtboxAdded; public static event Action 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(); NetworkingAPI.RegisterMessageType(); NetworkingAPI.RegisterMessageType(); NetworkingAPI.RegisterMessageType(); NetworkingAPI.RegisterMessageType(); NetworkingAPI.RegisterMessageType(); riskOfOptionsLoaded = Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); loadoutSectionButton = ((Component)PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((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(); RectTransform component = ((Component)loadoutSectionButton).gameObject.GetComponent(); 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[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref index), (Instruction x) => ILPatternMatchingExt.MatchCall(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}>((<>A{00000008})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[1] { (Instruction x) => ILPatternMatchingExt.MatchCall(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}>((<>A{00000008})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().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[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}>((<>A{00000001})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 action, Interactor interactor) { action(interactor); interactor.SetCharacterBody(((Component)interactor).GetComponent()); } private static void Inventory_Awake(Action action, Inventory inventory) { action(inventory); inventory.SetCharacterMaster(((Component)inventory).GetComponent()); } 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[1] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, i2) })) { c.Emit(OpCodes.Ldarg_1); c.Emit(OpCodes.Ldloc, i2); c.EmitDelegate>((Action)SetEffectInstance); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook " + i1 + " failed!")); } } } private static float DynamicAttackSpeedHook(Func orig, CharacterBody self) { float value = orig(self); if (useDynamicStats) { BrynzaAPI.GetDynamicAttackSpeed?.Invoke(self, ref value); } return value; } private static float DynamicMoveSpeedHook(Func orig, CharacterBody self) { float value = orig(self); if (useMoveSpeedDynamicStat) { BrynzaAPI.GetDynamicMoveSpeed?.Invoke(self, ref value); } return value; } private static float DynamicRegenHook(Func orig, CharacterBody self) { float value = orig(self); if (useDynamicStats) { BrynzaAPI.GetDynamicRegen?.Invoke(self, ref value); } return value; } private static bool CameraRigController_isControlAllowed(Func 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[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(x) })) { Instruction next = c.Next; Instruction next2 = c.Next.Next.Next.Next.Next; c.Emit(OpCodes.Ldarg_0); c.EmitDelegate>((Func)HasScale); c.Emit(OpCodes.Brfalse_S, next); c.Emit(OpCodes.Ldarg_0); c.EmitDelegate>((Func)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()); } 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[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)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[2] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(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)SetPitch); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 1 failed!")); } if (val.TryGotoNext((MoveType)0, new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "yawClipCycleEnd") })) { val.Remove(); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)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[2] { (Instruction x) => ILPatternMatchingExt.MatchNewobj(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref locid) })) { val.Emit(OpCodes.Ldloc, locid); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<<>A{00000008}>((<>A{00000008})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[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloca(x, ref locid), (Instruction x) => ILPatternMatchingExt.MatchInitobj(x) })) { val.Emit(OpCodes.Ldloca, locid); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<<>A{00000001}>((<>A{00000001})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[3] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "weapon"), (Instruction x) => ILPatternMatchingExt.MatchCall(x, "op_Implicit"), (Instruction x) => ILPatternMatchingExt.MatchBrtrue(x, ref iLLabel) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)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[6] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref locId), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "force"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 2), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 3), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(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)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)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[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "force") })) { val.Emit(OpCodes.Ldloc, num); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)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[2] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "fade") })) { Instruction next = val.Next; Instruction next2 = val.Next.Next.Next; val.Emit(OpCodes.Ldloc, 6); val.EmitDelegate>((Func)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[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[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(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[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "force") })) { val.Emit(OpCodes.Ldloca, 0); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<<>A{00000001}>((<>A{00000001})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[1] { (Instruction x) => ILPatternMatchingExt.MatchCall(x, "Write") })) { val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Action)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() : 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[1] { (Instruction x) => ILPatternMatchingExt.MatchNewobj(x) })) { val.Emit(OpCodes.Dup); val.EmitDelegate>((Action)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() : 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[1] { (Instruction x) => ILPatternMatchingExt.MatchNewobj(x) })) { val.Emit(OpCodes.Dup); val.Emit(OpCodes.Ldarg_3); val.EmitDelegate>((Action)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(); CanvasRenderer val2 = loadoutSectionHolder.AddComponent(); val2.cullTransparentMesh = false; HorizontalLayoutGroup val3 = loadoutSectionHolder.AddComponent(); 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(); 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 ignoredHealthComponents = self.GetIgnoredHealthComponents(); if (ignoredHealthComponents == null) { self.SetIgnoredHealthComponents(new List()); 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[5] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCall(x, "get_skillFamily"), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "get_defaultSkillDef"), (Instruction x) => ILPatternMatchingExt.MatchCall(x, "set_defaultSkillDef") })) { val.RemoveRange(5); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)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[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchCastclass(x), (Instruction x) => ILPatternMatchingExt.MatchCall(x, "op_Implicit"), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref iLLabel2) })) { val.Emit(OpCodes.Ldloc_1); val.EmitDelegate<<>F{00000001}>((<>F{00000001})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[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "rotation") })) { val.Remove(); val.EmitDelegate<<>F{00000001}>((<>F{00000001})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[3] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "overrideCam"), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref iLLabel) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)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[4] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "lerpCameraTime"), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchBltUn(x, ref iLLabel2) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)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) //IL_0008: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); Instruction val2 = null; if (val.TryGotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, -1), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 7) })) { val2 = val.Next; val.EmitDelegate>((Func)HasWorldCrosshairOverride); val.Emit(OpCodes.Brfalse_S, val2); val.Emit(OpCodes.Ldloc, 5); val.EmitDelegate>((Action)ReturnResults); val.Emit(OpCodes.Ldarg, 5); val.EmitDelegate>((Func)GetWorldCrosshairOverride); val.Emit(OpCodes.Stobj, typeof(Vector3)); val.Emit(OpCodes.Ret); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } static Vector3 GetWorldCrosshairOverride() { //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_0009: Unknown result type (might be due to invalid IL or missing references) return worldCrosshairPositionOverride; } static bool HasWorldCrosshairOverride() { //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) return !(worldCrosshairPositionOverride == Vector3.zero); } static void ReturnResults(RaycastHit[] raycastHits) { HGPhysics.ReturnResults(raycastHits); } } private static void CharacterBody_RecalculateStats(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Expected O, but got Unknown //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)ExtraStats); val = new ILCursor(il); if (val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f), (Instruction x) => ILPatternMatchingExt.MatchCall(x, "set_critHeal") })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)HasSkillOverride); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 1 failed!")); } val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCall(x, "set_moveSpeed") })) { val.Emit(OpCodes.Ldc_I4_1); val.Emit(OpCodes.Stsfld, AccessTools.Field(typeof(BrynzaAPI), "useMoveSpeedDynamicStat")); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 2 failed!")); } static void ExtraStats(CharacterBody characterBody) { characterBody.SetMaxWallJumpCount(characterBody.GetBaseWallJumpCount()); ExtraStatHookEventArgs args = new ExtraStatHookEventArgs(); if (BrynzaAPI._getExtraStatCoefficients != null) { Delegate[] invocationList = BrynzaAPI._getExtraStatCoefficients.GetInvocationList(); for (int i = 0; i < invocationList.Length; i++) { ExtraStatHookEventHandler extraStatHookEventHandler = (ExtraStatHookEventHandler)invocationList[i]; try { extraStatHookEventHandler(characterBody, args); } catch (Exception) { } } } } static void HasSkillOverride(CharacterBody characterBody) { if (Object.op_Implicit((Object)(object)characterBody.skillLocator)) { for (int i = 0; i < characterBody.skillLocator.allSkills.Length; i++) { GenericSkill val2 = characterBody.skillLocator.allSkills[i]; if (!((Object)(object)val2 == (Object)null)) { GenericSkill linkedSkill = val2.GetLinkedSkill(); if (!((Object)(object)linkedSkill == (Object)null)) { val2.cooldownScale = linkedSkill.cooldownScale; val2.finalRechargeInterval = linkedSkill.finalRechargeInterval; val2.SetBonusStockFromBody(linkedSkill.bonusStockFromBody); } } } } } } private static void CharacterMotor_OnLanded(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "jumpCount") })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)SetWallJumpCount); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 1 failed!")); } if (val.TryGotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 3), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 0) })) { val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldloc_3); val.EmitDelegate>((Action)InvokeOnLandedInterfaces); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 2 failed!")); } static void InvokeOnLandedInterfaces(CharacterMotor characterMotor, HitGroundInfo hitGroundInfo) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) IOnGroundHit[] components = ((Component)characterMotor).gameObject.GetComponents(); foreach (IOnGroundHit onGroundHit in components) { onGroundHit.OnGroundHit(characterMotor, hitGroundInfo); } } static void SetWallJumpCount(CharacterMotor characterMotor) { characterMotor.SetWallJumpCount(0); } } private static void GenericCharacterMain_ProcessJump_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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Expected O, but got Unknown //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Expected O, but got Unknown //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); Instruction val2 = null; Instruction val3 = null; Instruction val4 = null; Instruction val5 = null; ILLabel iLLabel = null; int count = il.Body.Variables.Count; il.Body.Variables.Add(new VariableDefinition(il.Import(typeof(bool)))); ILLabel val6 = default(ILLabel); if (val.TryGotoNext((MoveType)2, new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "hasCharacterMotor"), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val6) })) { val.Emit(OpCodes.Ldc_I4_0); val.Emit(OpCodes.Stloc, count); val = new ILCursor(il); if (val.TryGotoNext(new Func[8] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCall(x, "get_characterMotor"), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "jumpCount"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCall(x, "get_characterBody"), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "get_maxJumpCount"), (Instruction x) => ILPatternMatchingExt.MatchClt(x), (Instruction x) => ILPatternMatchingExt.MatchBr(x, ref iLLabel) })) { val2 = val.Next; val.GotoLabel(iLLabel, (MoveType)1, false); val3 = val.Prev; val.Goto(val2, (MoveType)0, false); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)WallJump); val4 = val.Emit(OpCodes.Brtrue_S, val3).Prev; ILCursor obj = val; int index = obj.Index; obj.Index = index - 1; val.Emit(OpCodes.Dup); val.Emit(OpCodes.Brfalse_S, val4); val.Emit(OpCodes.Ldc_I4_1); val.Emit(OpCodes.Stloc, count); val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[7] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCall(x, "get_characterMotor"), (Instruction x) => ILPatternMatchingExt.MatchDup(x), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "jumpCount"), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1), (Instruction x) => ILPatternMatchingExt.MatchAdd(x), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "jumpCount") })) { val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldloc, count); val.EmitDelegate>((Action)CountWallJump); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 3 failed!")); } } 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 CountWallJump(EntityState entityState, bool isWallJump) { if (isWallJump) { CharacterMotor characterMotor = entityState.characterMotor; characterMotor.SetWallJumpCount(characterMotor.GetWallJumpCount() + 1); characterMotor.jumpCount--; } } static bool WallJump(EntityState entityState) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) CharacterMotor characterMotor = entityState.characterMotor; KinematicCharacterMotor motor = ((BaseCharacterController)characterMotor).Motor; if (Object.op_Implicit((Object)(object)motor) && !entityState.characterMotor.isGrounded && characterMotor.GetWallJumpCount() < entityState.characterBody.GetMaxWallJumpCount() && motor.CharacterCollisionsOverlap(motor.TransientPosition, motor.TransientRotation, motor._internalProbedColliders, 0.1f, false) > 0) { return true; } return false; } } private static void HealthComponent_TakeDamageProcess(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Expected O, but got Unknown ILCursor val = new ILCursor(il); ILLabel val2 = null; int thatStructId = 0; FieldReference damageInfoField = null; FieldReference attackerBodyField = null; int num = 6; if (val.TryGotoNext((MoveType)0, new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref thatStructId), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, ref damageInfoField), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCall(x, "TakeDamageForce") })) { ILCursor obj = val; obj.Index += 2; val.RemoveRange(2); val.Emit(OpCodes.Ldloc, thatStructId); val.Emit(OpCodes.Ldfld, damageInfoField); val.EmitDelegate>((Func)SetAlwaysApply); val.Emit(OpCodes.Ldloc, thatStructId); val.Emit(OpCodes.Ldfld, damageInfoField); val.EmitDelegate>((Func)SetDisableAirControl); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 1 failed!")); } val = new ILCursor(il); int num2 = default(int); if (!val.TryGotoNext((MoveType)0, new Func[6] { (Instruction x) => ILPatternMatchingExt.MatchLdloca(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref thatStructId), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, ref damageInfoField), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "attacker"), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "GetComponent"), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, ref attackerBodyField) })) { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 2 failed!")); } static bool SetAlwaysApply(DamageInfo damageInfo) { return damageInfo.GetForceAlwaysApply(); } static bool SetDisableAirControl(DamageInfo damageInfo) { return damageInfo.GetForceDisableAirControlUntilCollision(); } } private static bool GenericSkill_CanApplyAmmoPack(orig_CanApplyAmmoPack orig, GenericSkill self) { if (Object.op_Implicit((Object)(object)self.skillDef)) { self.skillDef.CanApplyAmmoPack(); } return orig.Invoke(self); } internal static void OnSniperHurtboxAdded(GameObject sniperHurtboxTracker) { BrynzaAPI.onSniperHurtboxAdded?.Invoke(sniperHurtboxTracker); } internal static void OnSniperHurtboxRemoved(GameObject sniperHurtboxTracker) { BrynzaAPI.onSniperHurtboxRemoved?.Invoke(sniperHurtboxTracker); } private static void HurtBox_OnDisable(orig_OnDisable orig, HurtBox self) { orig.Invoke(self); Transform val = ((Component)self).transform.Find("SniperHurtboxTrackerObject"); if (Object.op_Implicit((Object)(object)val)) { Object.Destroy((Object)(object)((Component)val).gameObject); } } private static void HurtBox_OnEnable(orig_OnEnable orig, HurtBox self) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown orig.Invoke(self); if (self.isSniperTarget) { GameObject val = new GameObject("SniperHurtboxTrackerObject"); SniperHurtboxTracker sniperHurtboxTracker = val.AddComponent(); sniperHurtboxTracker.hurtBox = self; ((Component)sniperHurtboxTracker).transform.SetParent(((Component)self).transform, false); } } private static void FogDamageController_MyFixedUpdate(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_00ad: 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) ILCursor val = new ILCursor(il); Instruction val2 = null; int i = 6; if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "TakeDamage") })) { val2 = val.Next; if (val.TryGotoPrev(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref i), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "get_healthComponent") })) { int index = val.Index; val.Index = index + 1; val.Emit(OpCodes.Ldloc, i); val.EmitDelegate>((Func)CheckForBodyFlog); val.Emit(OpCodes.Brtrue_S, val2); } 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 bool CheckForBodyFlog(CharacterBody characterBody) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return CharacterBodyAPI.HasModdedBodyFlag(characterBody, Assets.ImmuneToVoidFog); } } private static void GlobalEventManager_OnCharacterHitGroundServer(orig_OnCharacterHitGroundServer orig, GlobalEventManager self, CharacterBody characterBody, HitGroundInfo hitGroundInfo) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) CharacterMotor characterMotor = characterBody.characterMotor; if ((Object)(object)characterMotor != (Object)null && onHitGroundServerDictionary.ContainsKey(characterMotor)) { List list = onHitGroundServerDictionary[characterMotor]; for (int i = 0; i < list.Count; i++) { list[i]?.Invoke(characterMotor, ref hitGroundInfo); } } orig.Invoke(self, characterBody, hitGroundInfo); IOnGroundHitServer[] components = ((Component)characterBody).gameObject.GetComponents(); if (components != null) { IOnGroundHitServer[] array = components; foreach (IOnGroundHitServer onGroundHitServer in array) { onGroundHitServer.OnGroundHitServer(characterBody, hitGroundInfo); } } } private static void GenericCharacterMain_ApplyJumpVelocity(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_010a: 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[1] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 2) })) { val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldloc_0); val.Emit(OpCodes.Ldarg_1); val.Emit(OpCodes.Ldarg_2); val.EmitDelegate>((Func)delegate(CharacterMotor cm, Vector3 vector, CharacterBody cb, float horizontalBonus) { bool bunnyHopEffective = cm.GetBunnyHopEffective(); float result = 1f; if (bunnyHopEffective) { Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(cm.velocity.x, 0f, cm.velocity.z); float num = ((Vector3)(ref vector)).sqrMagnitude * horizontalBonus * horizontalBonus; result = ((num != 0f) ? (MathF.Max(num - ((Vector3)(ref val3)).sqrMagnitude, 0f) / num) : 1f); } return result; }); val.Emit(OpCodes.Call, (MethodBase)AccessTools.Method(typeof(Vector3), "op_Multiply", new Type[2] { typeof(Vector3), typeof(float) }, (Type[])null)); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(CharacterMotor cm) { //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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) Vector3 result = Vector3.zero; if (cm.GetBunnyHopEffective()) { result = cm.velocity; } return result; }); val.Emit(OpCodes.Call, (MethodBase)AccessTools.Method(typeof(Vector3), "op_Addition", (Type[])null, (Type[])null)); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } } private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)new ContentPacks()); } private static void ProjectileExplosion_DetonateServer(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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[1] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "OnBlastAttackResult") })) { val.Index += 1; val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldloc_1); val.Emit(OpCodes.Ldloc_2); val.EmitDelegate>((Action)delegate(ProjectileExplosion pe, BlastAttack ba, Result bar) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) IOnProjectileExplosionDetonate[] components = ((Component)pe).GetComponents(); IOnProjectileExplosionDetonate[] array = components; foreach (IOnProjectileExplosionDetonate onProjectileExplosionDetonate in array) { onProjectileExplosionDetonate.OnProjectileExplosionDetonate(ba, bar); } }); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } } private static void CharacterMotor_PreMove(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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Expected O, but got Unknown //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Expected O, but got Unknown //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Expected O, but got Unknown //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel val2 = null; if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "velocity") })) { val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldloc_1); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Action)delegate(CharacterMotor cb, Vector3 wishDirection, float deltaTime) { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_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_0096: Unknown result type (might be due to invalid IL or missing references) if (cb.GetStrafeEffective()) { Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(cb.velocity.x, 0f, cb.velocity.z); float num = Vector3.Dot(((Vector3)(ref val3)).normalized, wishDirection); if ((double)num < 0.1) { cb.velocity += new Vector3(wishDirection.x * cb.walkSpeed * strafeMultiplier, 0f, wishDirection.z * cb.walkSpeed * strafeMultiplier) * deltaTime; } } Vector3 velocityOverride = cb.GetVelocityOverride(); if (velocityOverride != Vector3.zero) { cb.velocity = velocityOverride; } }); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 1 failed!")); } val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCall(x, "get_walkSpeed") })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)dumbFix); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 6 failed!")); } val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 2) })) { val.Emit(OpCodes.Ldloc_1); val.Emit(OpCodes.Ldloc_2); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)sus); val.Emit(OpCodes.Stloc_2); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 2 failed!")); } val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 0) })) { ILCursor obj = val; int index = obj.Index; obj.Index = index + 1; val.Emit(OpCodes.Ldloc_0); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)amogus); val.Emit(OpCodes.Stloc_0); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 3 failed!")); } val = new ILCursor(il); if (val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1), (Instruction x) => ILPatternMatchingExt.MatchMul(x) })) { ILCursor obj2 = val; int index = obj2.Index; obj2.Index = index + 1; val.Emit(OpCodes.Ldloc_1); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)amogus2); val.Emit(OpCodes.Mul); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 4 failed!")); } val = new ILCursor(il); if (val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 0) })) { ILCursor obj3 = val; int index = obj3.Index; obj3.Index = index + 1; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)amogus3); val.Emit(OpCodes.Add); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook 5 failed!")); } static float amogus(float originalAirControl, CharacterMotor characterMotor) { float consistentAcceleration = characterMotor.GetConsistentAcceleration(); return (consistentAcceleration != 0f) ? (consistentAcceleration * characterMotor.walkSpeed) : originalAirControl; } static float amogus2(Vector3 wishDirection, CharacterMotor characterMotor) { if (characterMotor.GetFluidMaxDistanceDelta()) { return 1f; } return 1f; } static float amogus3(CharacterMotor characterMotor) { //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) float airControlFromVelocityAddEffective = characterMotor.GetAirControlFromVelocityAddEffective(); if (airControlFromVelocityAddEffective == 0f) { return 0f; } Vector3 velocity = characterMotor.velocity; if (!characterMotor.isFlying) { velocity.y = 0f; } return airControlFromVelocityAddEffective * ((Vector3)(ref velocity)).magnitude; } static float dumbFix(float walkSpeed, CharacterMotor characterMotor) { return characterMotor.body.moveSpeed * characterMotor.walkSpeedPenaltyCoefficient; } static Vector3 sus(Vector3 wishDirection, Vector3 vector31, CharacterMotor characterMotor) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) if (characterMotor.isGrounded) { return vector31; } Vector3 velocity = characterMotor.velocity; if (!characterMotor.isFlying) { velocity.y = 0f; } if (characterMotor.GetKeepVelocityOnMovingEffective()) { Vector3 val3 = velocity + vector31; return ((Vector3)(ref val3)).normalized * MathF.Max(((Vector3)(ref velocity)).magnitude, ((Vector3)(ref vector31)).magnitude); } if (characterMotor.GetUseMaxAirVelocityEffective()) { float maxAirVelocity = characterMotor.GetMaxAirVelocity(); if (maxAirVelocity * maxAirVelocity < ((Vector3)(ref vector31)).sqrMagnitude) { return vector31; } return wishDirection * maxAirVelocity; } return vector31; } } private static void CharacterBody_RecalculateStats1(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); if (!Object.op_Implicit((Object)(object)self.skillLocator)) { return; } List list = new List(); if (self.skillLocator.allSkills != null) { list.AddRange(self.skillLocator.allSkills); } foreach (GenericSkill item in list) { if ((Object)(object)item != (Object)null) { GenericSkill linkedSkill = item.GetLinkedSkill(); if ((Object)(object)linkedSkill != (Object)null) { item.cooldownScale = linkedSkill.cooldownScale; item.flatCooldownReduction = linkedSkill.flatCooldownReduction; item.bonusStockFromBody = linkedSkill.bonusStockFromBody; item.RecalculateValues(); } } } } private static float GenericSkill_CalculateFinalRechargeInterval1(orig_CalculateFinalRechargeInterval orig, GenericSkill self) { List extraSkills = self.GetExtraSkills(); if (extraSkills != null && extraSkills.Count > 0) { foreach (GenericSkill item in extraSkills) { if (!((Object)(object)item == (Object)(object)self)) { item.cooldownScale = self.cooldownScale; item.flatCooldownReduction = self.flatCooldownReduction; item.temporaryCooldownPenalty = self.temporaryCooldownPenalty; item.CalculateFinalRechargeInterval(); } } } return orig.Invoke(self); } private static void GenericSkill_CalculateFinalRechargeInterval(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); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCall(x, "get_cooldownScale") })) { val.Remove(); val.EmitDelegate>((Func)delegate(GenericSkill cb) { GenericSkill linkedSkill = cb.GetLinkedSkill(); return ((Object)(object)linkedSkill != (Object)null) ? linkedSkill.cooldownScale : cb.cooldownScale; }); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCall(x, "get_flatCooldownReduction") })) { val.Remove(); val.EmitDelegate>((Func)delegate(GenericSkill cb) { GenericSkill linkedSkill = cb.GetLinkedSkill(); return ((Object)(object)linkedSkill != (Object)null) ? linkedSkill.flatCooldownReduction : cb.flatCooldownReduction; }); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCall(x, "get_temporaryCooldownPenalty") })) { val.Remove(); val.EmitDelegate>((Func)delegate(GenericSkill cb) { GenericSkill linkedSkill = cb.GetLinkedSkill(); return ((Object)(object)linkedSkill != (Object)null) ? linkedSkill.temporaryCooldownPenalty : cb.temporaryCooldownPenalty; }); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } } private static void GenericSkill_RecalculateMaxStock1(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); ILLabel val2 = null; if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "bonusStockFromBody") })) { val.Remove(); val.EmitDelegate>((Func)delegate(GenericSkill cb) { GenericSkill linkedSkill = cb.GetLinkedSkill(); return ((Object)(object)linkedSkill != (Object)null) ? linkedSkill.bonusStockFromBody : cb.bonusStockFromBody; }); } else { Log.LogError((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } } private static void GenericSkill_RecalculateMaxStock(orig_RecalculateMaxStock orig, GenericSkill self) { orig.Invoke(self); List extraSkills = self.GetExtraSkills(); if (extraSkills == null || extraSkills.Count <= 0) { return; } foreach (GenericSkill item in extraSkills) { if (!((Object)(object)item == (Object)(object)self)) { item.bonusStockFromBody = self.bonusStockFromBody; item.RecalculateMaxStock(); } } } private IEnumerator RoR2Application_OnLoad(orig_OnLoad orig, RoR2Application self) { SetConfigValues(); return orig.Invoke(self); } public static void CreateResetToDefaultButtonInRiskOfOptionsConfigMenu(string name, string category, string description, string buttonText) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown ModMetaData modMetaData = Assembly.GetCallingAssembly().GetModMetaData(); ModSettingsManager.AddOption((BaseOption)new GenericButtonOption(name, category, description, buttonText, new UnityAction(OnButtonPressed)), modMetaData.Guid, modMetaData.Name); void OnButtonPressed() { if (modConfigs.ContainsKey(modMetaData.Guid)) { foreach (INetworkConfig item in modConfigs[modMetaData.Guid]) { if (item.parameterType == typeof(float)) { NetworkConfig networkConfig = (NetworkConfig)item; networkConfig.configEntry.Value = networkConfig.DefaultValue; networkConfig.Value = networkConfig.DefaultValue; } if (item.parameterType == typeof(int)) { NetworkConfig networkConfig2 = (NetworkConfig)item; networkConfig2.configEntry.Value = networkConfig2.DefaultValue; networkConfig2.Value = networkConfig2.DefaultValue; } if (item.parameterType == typeof(bool)) { NetworkConfig networkConfig3 = (NetworkConfig)item; networkConfig3.configEntry.Value = networkConfig3.DefaultValue; networkConfig3.Value = networkConfig3.DefaultValue; } } } } } public static NetworkConfig CreateConfig(ConfigFile configFile, string section, string key, T defaultValue, string description, OnConfigApplied onConfigApplied = null, NetworkConfig enableConfig = null, bool generateRiskOfOptionsOption = true) { ConfigEntry configEntry = configFile.Bind(section, key, defaultValue, description); return CreateConfig(configEntry, onConfigApplied, enableConfig, generateRiskOfOptionsOption, Assembly.GetCallingAssembly()); } public static NetworkConfig CreateConfig(ConfigEntry configEntry, OnConfigApplied onConfigApplied = null, NetworkConfig enableConfig = null, bool generateRiskOfOptionsOption = true, Assembly assembly = null) { //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Expected O, but got Unknown //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Expected O, but got Unknown //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Expected O, but got Unknown NetworkConfig networkConfig = new NetworkConfig(); networkConfig.id = networkConfigs.Count; networkConfig.enableConfig = enableConfig; networkConfig.OnConfigApplied = onConfigApplied; networkConfig.configEntry = configEntry; networkConfig.configEntry.SettingChanged += ConfigEntry_SettingChanged; networkConfigs.Add(networkConfig); ModMetaData modMetaData = ((assembly == null) ? Assembly.GetCallingAssembly().GetModMetaData() : assembly.GetModMetaData()); if (modConfigs.ContainsKey(modMetaData.Guid)) { modConfigs[modMetaData.Guid].Add(networkConfig); } else { List list = new List(); list.Add(networkConfig); modConfigs.Add(modMetaData.Guid, list); } if (riskOfOptionsLoaded && generateRiskOfOptionsOption) { if (configEntry is ConfigEntry) { ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(networkConfig.configEntry as ConfigEntry), modMetaData.Guid, modMetaData.Name); } if (configEntry is ConfigEntry) { ModSettingsManager.AddOption((BaseOption)new IntFieldOption(networkConfig.configEntry as ConfigEntry), modMetaData.Guid, modMetaData.Name); } if (configEntry is ConfigEntry) { ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(networkConfig.configEntry as ConfigEntry), modMetaData.Guid, modMetaData.Name); } } return networkConfig; } private static void ConfigEntry_SettingChanged(object sender, EventArgs e) { SetConfigValues(); } private void Run_Start(orig_Start orig, Run self) { orig.Invoke(self); if (NetworkServer.active) { SetConfigValues(); } else { NetMessageExtensions.Send((INetMessage)(object)new RequestSyncConfigsNetMessage(), (NetworkDestination)2); } } public static void SetConfigValues() { if (!NetworkServer.active) { return; } foreach (INetworkConfig networkConfig in networkConfigs) { if (networkConfig.parameterType == typeof(float)) { NetMessageExtensions.Send((INetMessage)(object)new SyncConfigsNetMessage(networkConfigs.IndexOf(networkConfig), (networkConfig as NetworkConfig).configEntry.Value.ToString()), (NetworkDestination)1); } if (networkConfig.parameterType == typeof(int)) { NetMessageExtensions.Send((INetMessage)(object)new SyncConfigsNetMessage(networkConfigs.IndexOf(networkConfig), (networkConfig as NetworkConfig).configEntry.Value.ToString()), (NetworkDestination)1); } if (networkConfig.parameterType == typeof(bool)) { NetMessageExtensions.Send((INetMessage)(object)new SyncConfigsNetMessage(networkConfigs.IndexOf(networkConfig), (networkConfig as NetworkConfig).configEntry.Value.ToString()), (NetworkDestination)1); } } } } public class AddBuffNetMessage : INetMessage, ISerializableObject { private NetworkInstanceId instanceId; private int buffIndex; private int amount; private float buffTime; public AddBuffNetMessage(NetworkInstanceId networkInstanceId, int buffIndex, int amount, float buffTime) { //IL_0009: 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) instanceId = networkInstanceId; this.buffIndex = buffIndex; this.amount = amount; this.buffTime = buffTime; } public AddBuffNetMessage(NetworkInstanceId networkInstanceId, BuffIndex buffIndex, int amount, float buffTime) { //IL_0009: 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_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected I4, but got Unknown instanceId = networkInstanceId; this.buffIndex = (int)buffIndex; this.amount = amount; this.buffTime = buffTime; } public AddBuffNetMessage(NetworkInstanceId networkInstanceId, BuffDef buffDef, int amount, float buffTime) { //IL_0009: 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_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected I4, but got Unknown instanceId = networkInstanceId; buffIndex = (int)buffDef.buffIndex; this.amount = amount; this.buffTime = buffTime; } public AddBuffNetMessage() { } public void Deserialize(NetworkReader reader) { //IL_0003: 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) instanceId = reader.ReadNetworkId(); buffIndex = reader.ReadInt32(); amount = reader.ReadInt32(); buffTime = reader.ReadSingle(); } public void OnReceived() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } GameObject val = Util.FindNetworkObject(instanceId); if ((Object)(object)val == (Object)null) { return; } CharacterBody component = val.GetComponent(); if ((Object)(object)component == (Object)null) { return; } bool flag = amount <= 0; if (flag) { amount *= -1; } for (int i = 0; i < amount; i++) { if (flag) { component.RemoveBuff((BuffIndex)buffIndex); } else if (buffTime > 0f) { component.AddTimedBuff((BuffIndex)buffIndex, buffTime); } else { component.AddBuff((BuffIndex)buffIndex); } } } public void Serialize(NetworkWriter writer) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) writer.Write(instanceId); writer.Write(buffIndex); writer.Write(amount); writer.Write(buffTime); } } public class TimeScaleChangeNetMessage : INetMessage, ISerializableObject { public float timeScaleChangeAmount; public TimeScaleChangeNetMessage(float value) { timeScaleChangeAmount = value; } public TimeScaleChangeNetMessage() { } public void Deserialize(NetworkReader reader) { timeScaleChangeAmount = reader.ReadSingle(); } public void OnReceived() { Time.timeScale = timeScaleChangeAmount; } public void Serialize(NetworkWriter writer) { writer.Write(timeScaleChangeAmount); } } [AttributeUsage(AttributeTargets.Field)] public class SerializeProperty : PropertyAttribute { public string PropertyName { get; private set; } public SerializeProperty(string propertyName) { PropertyName = propertyName; } } public static class Assets { public struct EntityStateMachineAdditionInfo { public string entityStateMachineName; public Type initialStateType; public Type mainStateType; } public static ModdedBodyFlag SprintAllTime = CharacterBodyAPI.ReserveBodyFlag(); public static ModdedBodyFlag FirstPerson = CharacterBodyAPI.ReserveBodyFlag(); public static ModdedBodyFlag ImmuneToVoidFog = CharacterBodyAPI.ReserveBodyFlag(); public static BuffDef BunnyHopBuff; public static BuffDef StrafeBuff; public static BuffDef KeepVelocityBuff; public static BuffDef UseMaxAirVelocityBuff; } public class LanguageTokensToAddOnLoad : IDisposable { public static List languageTokensToAddOnLoad = new List(); public string language; public string token; public string output; public LanguageTokensToAddOnLoad(string token, string output, string language) { this.language = language; this.token = token; this.output = output; languageTokensToAddOnLoad.Add(this); } public void Dispose() { languageTokensToAddOnLoad.Remove(this); Utils.AddLanguageToken(token, output, language); } } public class Section : IDisposable { public static List
sections = new List
(); public static Dictionary sectionByName = new Dictionary(); public string name; public Color color; public HGButton button; public List rows = new List(); public Section(string sectionName, Color color) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown //IL_00bc: 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_00d0: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)BrynzaAPI.loadoutSectionHolder)) { name = sectionName; this.color = color; sections.Add(this); sectionByName.Add(name, this); button = Object.Instantiate(BrynzaAPI.loadoutSectionButton, BrynzaAPI.loadoutSectionHolder.transform); LanguageTextMeshController component = ((Component)button).gameObject.GetComponent(); component.token = name; ((UnityEvent)((Button)button).onClick).AddListener(new UnityAction(SelectSection)); ((MPButton)button).requiredTopLayer = null; ColorBlock colors = ((Selectable)button).colors; color.a = 0.2f; ((ColorBlock)(ref colors)).normalColor = color; ((ColorBlock)(ref colors)).highlightedColor = color; color.a = 0.5f; ((ColorBlock)(ref colors)).selectedColor = color; ((Selectable)button).colors = colors; } } public void Dispose() { if (sections.Contains(this)) { sections.Remove(this); } if (sectionByName.ContainsKey(name)) { sectionByName.Remove(name); } if ((Object)(object)button != (Object)null) { Object.Destroy((Object)(object)((Component)button).gameObject); } } public void SelectSection() { Utils.SelectRowsSection(name); } } public interface IOnProjectileExplosionDetonate { void OnProjectileExplosionDetonate(BlastAttack blastAttack, Result result); } public interface IProjectileMasterSummon { public delegate void OnMasterSummon(IProjectileMasterSummon projectileMasterSummon, CharacterMaster characterMaster); ProjectileController projectileController { get; } GameObject master { get; } DelegateHolder onMasterSummon { get; } void Spawn(Vector3 position) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown GameObject val = ((Object.op_Implicit((Object)(object)projectileController) && Object.op_Implicit((Object)(object)projectileController.owner)) ? projectileController.owner : null); CharacterBody val2 = (Object.op_Implicit((Object)(object)val) ? val.GetComponent() : null); MasterSummon val3 = new MasterSummon { ignoreTeamMemberLimit = true, masterPrefab = master, position = position, rotation = Quaternion.identity, summonerBodyObject = val, useAmbientLevel = true, teamIndexOverride = (Object.op_Implicit((Object)(object)val) ? ((TeamIndex?)null) : new TeamIndex?((TeamIndex)(-1))) }; CharacterMaster val4 = val3.Perform(); onMasterSummon?.InvokeAll(this, val4); } } public interface IOnGroundHitServer { void OnGroundHitServer(CharacterBody characterBody, HitGroundInfo hitGroundInfo); } public interface IOnGroundHit { void OnGroundHit(CharacterMotor characterMotor, HitGroundInfo hitGroundInfo); } public class RemoveBuffsOnGroundHitServer : MonoBehaviour, IOnGroundHitServer { public List buffDefs = new List(); public void OnGroundHitServer(CharacterBody characterBody, HitGroundInfo hitGroundInfo) { if (buffDefs == null || !Object.op_Implicit((Object)(object)characterBody)) { return; } foreach (BuffDef buffDef in buffDefs) { characterBody.RemoveBuff(buffDef); } Object.Destroy((Object)(object)this); } } [RequireComponent(typeof(ProjectileController))] public class ProjectileExplosionMasterSummon : MonoBehaviour, IOnProjectileExplosionDetonate, IProjectileMasterSummon { public ProjectileController controller; public CharacterMaster characterMaster; public DelegateHolder onMasterSummonEvent; public ProjectileController projectileController => controller; public GameObject master => ((Component)characterMaster).gameObject; public DelegateHolder onMasterSummon => onMasterSummonEvent; public void OnProjectileExplosionDetonate(BlastAttack blastAttack, Result result) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) ((IProjectileMasterSummon)this).Spawn(blastAttack.position); } } [RequireComponent(typeof(ProjectileExplosion))] public class RocketJumpComponent : MonoBehaviour, IOnProjectileExplosionDetonate { public delegate void OnRocketJumpApplied(RocketJumpComponent rocketJumpComponent, CharacterBody characterBody, Vector3 force); public class RocketJumpFailServerMessage : INetMessage, ISerializableObject { public uint id; public RocketJumpFailServerMessage() { } public RocketJumpFailServerMessage(uint id) { this.id = id; } public void Deserialize(NetworkReader reader) { id = reader.ReadUInt32(); } public void OnReceived() { if (pendingRocketJumps.ContainsKey(id)) { pendingRocketJumps.Remove(id); } } public void Serialize(NetworkWriter writer) { writer.Write(id); } } public class RocketJumpServerMessage : INetMessage, ISerializableObject { public NetworkIdentity bodyNetworkIdentity; public Vector3 force; public uint id; public RocketJumpServerMessage() { } public RocketJumpServerMessage(NetworkIdentity bodyNetworkIdentity, Vector3 force, uint id) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) this.bodyNetworkIdentity = bodyNetworkIdentity; this.force = force; this.id = id; } public void Deserialize(NetworkReader reader) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) bodyNetworkIdentity = reader.ReadNetworkIdentity(); force = reader.ReadVector3(); id = reader.ReadUInt32(); } public void OnReceived() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = ((Component)bodyNetworkIdentity).GetComponent(); if (Object.op_Implicit((Object)(object)component) && pendingRocketJumps.ContainsKey(id)) { PendingAfterRocketJump pendingAfterRocketJump = pendingRocketJumps[id]; pendingRocketJumps.Remove(id); AfterRocketJumping(component, pendingAfterRocketJump, force); } } public void Serialize(NetworkWriter writer) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) writer.Write(bodyNetworkIdentity); writer.Write(force); writer.Write(id); } } public class RocketJumpMessage : INetMessage, ISerializableObject { public NetworkIdentity bodyNetworkIdentity; public NetworkIdentity projectileNetworkIdentity; public Vector3 explosionPosition; public float radius; public uint id; public RocketJumpMessage() { } public RocketJumpMessage(NetworkIdentity bodyNetworkIdentity, NetworkIdentity projectileNetworkIdentity, Vector3 explosionPosition, float radius, uint id) { //IL_0017: 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) this.bodyNetworkIdentity = bodyNetworkIdentity; this.projectileNetworkIdentity = projectileNetworkIdentity; this.explosionPosition = explosionPosition; this.radius = radius; this.id = id; } public void Deserialize(NetworkReader reader) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) bodyNetworkIdentity = reader.ReadNetworkIdentity(); projectileNetworkIdentity = reader.ReadNetworkIdentity(); explosionPosition = reader.ReadVector3(); radius = reader.ReadSingle(); id = reader.ReadUInt32(); } public void OnReceived() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) if (!Util.HasEffectiveAuthority(bodyNetworkIdentity)) { return; } CharacterBody component = ((Component)bodyNetworkIdentity).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { NetMessageExtensions.Send((INetMessage)(object)new RocketJumpFailServerMessage(id), (NetworkDestination)2); return; } RocketJumpComponent component2 = ((Component)projectileNetworkIdentity).GetComponent(); if (!Object.op_Implicit((Object)(object)component2)) { NetMessageExtensions.Send((INetMessage)(object)new RocketJumpFailServerMessage(id), (NetworkDestination)2); } else { component2.ApplyForce(component, explosionPosition, radius, id); } } public void Serialize(NetworkWriter writer) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) writer.Write(bodyNetworkIdentity); writer.Write(projectileNetworkIdentity); writer.Write(explosionPosition); writer.Write(radius); writer.Write(id); } } public enum RocketJumpFiltering { OnlySelf, OnlyTeammates, Everyone } public struct PendingAfterRocketJump { public List buffsWhileMidair; public DelegateHolder onRocketJumpApplied; } public struct RocketJumpApplyInfo { public float force; public AnimationCurve falloff; public AnimationCurve verticalForceReduction; public bool resetNegativeVerticalVelocity; public float radiusMultiplier; public PhysForceFlags physForceFlags; public List clientBuffsWhileMidair; } public static Dictionary pendingRocketJumps = new Dictionary(); public NetworkIdentity networkIdentity; public float force = 3000f; public AnimationCurve falloff = AnimationCurve.EaseInOut(0f, 1f, 1f, 1f); public AnimationCurve verticalForceReduction = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f); public bool resetNegativeVerticalVelocity = true; public float radiusMultiplier = 1.25f; public PhysForceFlags physForceFlags = (PhysForceFlags)3; public List buffsWhileMidair = new List(); public List clientBuffsWhileMidair = new List(); public RocketJumpFiltering rocketJumpFiltering; public DelegateHolder onRocketJumpApplied; public DelegateHolder onRocketJumpAppliedAuthority; public void Awake() { if (!Object.op_Implicit((Object)(object)networkIdentity)) { networkIdentity = ((Component)this).GetComponent(); } } public void OnProjectileExplosionDetonate(BlastAttack blastAttack, Result result) { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: 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_027a: Unknown result type (might be due to invalid IL or missing references) //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_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) if (force == 0f) { return; } List list = new List(); List list2 = new List(); foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { CharacterMaster master = instance.master; if (Object.op_Implicit((Object)(object)master)) { CharacterBody body = master.GetBody(); if (Object.op_Implicit((Object)(object)body)) { list2.Add((Component)(object)body); } } } float num = blastAttack.radius * radiusMultiplier; Component[] array = (Component[])(object)Physics.OverlapSphere(blastAttack.position, num, LayerMask.op_Implicit(CommonMasks.characterBodiesOrDefault), (QueryTriggerInteraction)0); Component[] collection = array; list2.AddRange(collection); foreach (Component item in list2) { if (list.Contains(item.gameObject)) { continue; } list.Add(item.gameObject); CharacterBody val = (CharacterBody)(((object)((item is CharacterBody) ? item : null)) ?? ((object)item.GetComponent())); if (!Object.op_Implicit((Object)(object)val)) { continue; } bool flag = false; switch (rocketJumpFiltering) { case RocketJumpFiltering.Everyone: flag = true; break; case RocketJumpFiltering.OnlyTeammates: if (Object.op_Implicit((Object)(object)val.teamComponent) && val.teamComponent.teamIndex == blastAttack.teamIndex) { flag = true; } break; case RocketJumpFiltering.OnlySelf: if (Object.op_Implicit((Object)(object)blastAttack.attacker) && (Object)(object)((Component)val).gameObject == (Object)(object)blastAttack.attacker) { flag = true; } break; } if (!flag) { continue; } NetworkInstanceId netId; if (val.hasEffectiveAuthority) { Vector3 position = blastAttack.position; netId = networkIdentity.netId; ApplyForce(val, position, num, ((NetworkInstanceId)(ref netId)).Value); continue; } Dictionary dictionary = pendingRocketJumps; netId = networkIdentity.netId; if (dictionary.ContainsKey(((NetworkInstanceId)(ref netId)).Value)) { Dictionary dictionary2 = pendingRocketJumps; netId = networkIdentity.netId; dictionary2[((NetworkInstanceId)(ref netId)).Value] = new PendingAfterRocketJump { buffsWhileMidair = buffsWhileMidair, onRocketJumpApplied = onRocketJumpApplied }; } else { Dictionary dictionary3 = pendingRocketJumps; netId = networkIdentity.netId; dictionary3.Add(((NetworkInstanceId)(ref netId)).Value, new PendingAfterRocketJump { buffsWhileMidair = buffsWhileMidair, onRocketJumpApplied = onRocketJumpApplied }); } NetworkIdentity bodyNetworkIdentity = val.networkIdentity; NetworkIdentity projectileNetworkIdentity = networkIdentity; Vector3 position2 = blastAttack.position; netId = networkIdentity.netId; NetMessageExtensions.Send((INetMessage)(object)new RocketJumpMessage(bodyNetworkIdentity, projectileNetworkIdentity, position2, num, ((NetworkInstanceId)(ref netId)).Value), (NetworkDestination)1); } } public static void AfterRocketJumping(CharacterBody characterBody, PendingAfterRocketJump pendingAfterRocketJump, Vector3 force) { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)characterBody.characterMotor) && !characterBody.characterMotor.isGrounded && pendingAfterRocketJump.buffsWhileMidair != null && pendingAfterRocketJump.buffsWhileMidair.Count > 0) { RemoveBuffsOnGroundHitServer orAddComponent = ((Component)characterBody).gameObject.GetOrAddComponent(); orAddComponent.buffDefs.AddRange(pendingAfterRocketJump.buffsWhileMidair); foreach (BuffDef item in pendingAfterRocketJump.buffsWhileMidair) { characterBody.AddBuff(item); } } pendingAfterRocketJump.onRocketJumpApplied?.InvokeAll(null, characterBody, force); } public void AfterRocketJumping(CharacterBody characterBody, Vector3 force) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) AfterRocketJumping(characterBody, new PendingAfterRocketJump { buffsWhileMidair = buffsWhileMidair, onRocketJumpApplied = onRocketJumpApplied }, force); } public void ApplyForce(CharacterBody characterBody, Vector3 explosionPosition, float radius, uint id) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: 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_00dc: 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) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Expected I4, but got Unknown //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: 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_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Expected O, but got Unknown Vector3 val = characterBody.corePosition - explosionPosition; if (((Vector3)(ref val)).sqrMagnitude > radius * radius) { NetMessageExtensions.Send((INetMessage)(object)new RocketJumpFailServerMessage(id), (NetworkDestination)2); return; } float num = falloff.Evaluate(((Vector3)(ref val)).sqrMagnitude / (radiusMultiplier * radiusMultiplier)); ((Vector3)(ref val)).Normalize(); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(val.x, 0f, val.z); float num2 = Vector3.Angle(val, val2); float num3 = num2 / 90f; val.y *= verticalForceReduction.Evaluate(num3); val = ((Vector3)(ref val)).normalized * force * num; PhysForceInfo val3 = new PhysForceInfo { force = val, _flags = (int)physForceFlags }; CharacterMotor characterMotor = characterBody.characterMotor; if (Object.op_Implicit((Object)(object)characterMotor)) { if (resetNegativeVerticalVelocity && characterMotor.velocity.y < 0f) { characterMotor.velocity.y = 0f; } characterMotor.ApplyForceImpulse(ref val3); if (!characterMotor.isGrounded && clientBuffsWhileMidair != null && clientBuffsWhileMidair.Count > 0) { characterMotor.onHitGroundAuthority += new HitGroundDelegate(CharacterMotor_onHitGroundAuthority); foreach (BuffDef item in clientBuffsWhileMidair) { characterBody.AddClientBuff(item); } } } else if (Object.op_Implicit((Object)(object)characterBody.rigidbody)) { if (resetNegativeVerticalVelocity && characterBody.rigidbody.velocity.y < 0f) { Vector3 velocity = characterBody.rigidbody.velocity; velocity.y = 0f; characterBody.rigidbody.velocity = velocity; } RigidBodyExtensions.AddForceWithInfo(characterBody.rigidbody, val3); } onRocketJumpAppliedAuthority?.InvokeAll(null, characterBody, val); if (NetworkServer.active) { AfterRocketJumping(characterBody, val); } else { NetMessageExtensions.Send((INetMessage)(object)new RocketJumpServerMessage(characterBody.networkIdentity, val, id), (NetworkDestination)2); } void CharacterMotor_onHitGroundAuthority(ref HitGroundInfo hitGroundInfo) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown foreach (BuffDef item2 in clientBuffsWhileMidair) { characterBody.RemoveClientBuff(item2); } characterMotor.onHitGroundAuthority -= new HitGroundDelegate(CharacterMotor_onHitGroundAuthority); } } } [RequireComponent(typeof(ProjectileController))] [RequireComponent(typeof(Rigidbody))] public class GuidedProjectile : MonoBehaviour { public Rigidbody rigidbody; public ProjectileController projectileController; public float guidingPower = 15f; [HideInInspector] public InputBankTest inputBankTest; public void Awake() { if ((Object)(object)rigidbody == (Object)null) { rigidbody = ((Component)this).GetComponent(); } if ((Object)(object)projectileController == (Object)null) { projectileController = ((Component)this).GetComponent(); } } public void Start() { ProjectileController obj = projectileController; inputBankTest = ((obj != null) ? obj.owner.GetComponent() : null); } public void FixedUpdate() { //IL_002b: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)inputBankTest) && Object.op_Implicit((Object)(object)rigidbody)) { Vector3 val = inputBankTest.aimDirection; RaycastHit val2 = default(RaycastHit); if (inputBankTest.GetAimRaycast(1024f, ref val2)) { val = ((RaycastHit)(ref val2)).point - ((Component)this).transform.position; } rigidbody.velocity = Vector3.RotateTowards(rigidbody.velocity, val, 0.2631579f, 0f); } } } [CreateAssetMenu(menuName = "BrynzaAPI/DelegateDef/RocketJumpDelegateDef")] public class RocketJumpDelegateDef : DelegateDef { } [CreateAssetMenu(menuName = "BrynzaAPI/DelegateDef/OnMasterSummonToGiveItemsDelegateDef")] public class OnMasterSummonToGiveItemsDelegateDef : OnMasterSummonDelegateDef { public GiveItemsDelegateDef giveItemsDelegateDef; public OnMasterSummonToGiveItemsDelegateDef() { @delegate = GiveItems; } public void GiveItems(IProjectileMasterSummon projectileMasterSummon, CharacterMaster characterMaster) { if (Object.op_Implicit((Object)(object)characterMaster) && Object.op_Implicit((Object)(object)giveItemsDelegateDef)) { Inventory inventory = characterMaster.inventory; if (Object.op_Implicit((Object)(object)inventory)) { giveItemsDelegateDef.@delegate?.Invoke(inventory); } } } } [CreateAssetMenu(menuName = "BrynzaAPI/DelegateDef/OnMasterSummonDelegateDef")] public class OnMasterSummonDelegateDef : DelegateDef { } [CreateAssetMenu(menuName = "BrynzaAPI/DelegateDef/GiveItemsDelegateDef")] public class GiveItemsDelegateDef : DelegateDef { public delegate void GiveItems(Inventory inventory); [Serializable] public struct Item { public AddressReferencedItemDef itemDef; public int amount; } public Item[] items; public GiveItemsDelegateDef() { @delegate = GiveItemsMethod; } public void GiveItemsMethod(Inventory inventory) { if (!Object.op_Implicit((Object)(object)inventory)) { return; } for (int i = 0; i < items.Length; i++) { ref Item reference = ref items[i]; if (AddressReferencedItemDef.op_Implicit(reference.itemDef) && !Object.op_Implicit((Object)(object)((AddressReferencedAsset)(object)reference.itemDef).Asset)) { inventory.GiveItemPermanent(((AddressReferencedAsset)(object)reference.itemDef).Asset, reference.amount); } } } } public abstract class BaseSpawnCardMirror : ScriptableObject where T : SpawnCard { public string targetPrefabName; public GameObject prefab; public float costMultiplier; public bool overrideHullSize; public HullClassification hullSize; public bool overrideNodeGraphType; public GraphType nodeGrapthType; public bool overrideRequiredFlags; public NodeFlags requiredFlags; public bool overrideForbiddenFlags; public NodeFlags forbiddenFlags; public bool overrideEliteRules; public EliteRules eliteRules; public Dictionary spawnCardOriginalToMirrored = new Dictionary(); public Dictionary directorCardOriginalToMirrored = new Dictionary(); public virtual DirectorCard GetDirectorCard(DirectorCard originalDirectorCard) { //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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown if (!directorCardOriginalToMirrored.TryGetValue(originalDirectorCard, out var value)) { value = new DirectorCard { selectionWeight = originalDirectorCard.selectionWeight, spawnDistance = originalDirectorCard.spawnDistance, preventOverhead = originalDirectorCard.preventOverhead, minimumStageCompletions = originalDirectorCard.minimumStageCompletions, requiredUnlockableDef = originalDirectorCard.requiredUnlockableDef, forbiddenUnlockableDef = originalDirectorCard.forbiddenUnlockableDef }; directorCardOriginalToMirrored.Add(originalDirectorCard, value); } return value; } public virtual T GetSpawnCard(T originalSpawnCard) { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //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_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) if (spawnCardOriginalToMirrored.TryGetValue(originalSpawnCard, out var value)) { return value; } value = ScriptableObject.CreateInstance(); ((SpawnCard)value).prefab = prefab; ((Object)(object)value).name = ((Object)this).name; ((SpawnCard)value).directorCreditCost = (int)((float)((SpawnCard)originalSpawnCard).directorCreditCost * costMultiplier); if (overrideEliteRules) { ((SpawnCard)value).eliteRules = eliteRules; } else { ((SpawnCard)value).eliteRules = ((SpawnCard)originalSpawnCard).eliteRules; } if (overrideRequiredFlags) { ((SpawnCard)value).requiredFlags = requiredFlags; } else { ((SpawnCard)value).requiredFlags = ((SpawnCard)originalSpawnCard).requiredFlags; } if (overrideHullSize) { ((SpawnCard)value).hullSize = hullSize; } else { ((SpawnCard)value).hullSize = ((SpawnCard)originalSpawnCard).hullSize; } if (overrideNodeGraphType) { ((SpawnCard)value).nodeGraphType = nodeGrapthType; } else { ((SpawnCard)value).nodeGraphType = ((SpawnCard)originalSpawnCard).nodeGraphType; } if (overrideForbiddenFlags) { ((SpawnCard)value).forbiddenFlags = forbiddenFlags; } else { ((SpawnCard)value).forbiddenFlags = ((SpawnCard)originalSpawnCard).forbiddenFlags; } return value; } public void Init() { BrynzaAPI.keyValuePairs1.Add(targetPrefabName, this); } public void UpdateDirectorCreditCostForMirroredSpawnCards(float newCostMultiplier) { costMultiplier = newCostMultiplier; foreach (KeyValuePair item in spawnCardOriginalToMirrored) { T key = item.Key; if (Object.op_Implicit((Object)(object)key)) { T value = item.Value; if (Object.op_Implicit((Object)(object)value)) { ((SpawnCard)value).directorCreditCost = (int)((float)((SpawnCard)key).directorCreditCost * costMultiplier); } } } } } [CreateAssetMenu(menuName = "BrynzaAPI/SpawnCardMirror")] public class SpawnCardMirror : BaseSpawnCardMirror { } [CreateAssetMenu(menuName = "BrynzaAPI/CharacterSpawnCardMirror")] public class CharacterSpawnCardMirror : BaseSpawnCardMirror { public bool overrideNoElites; public bool noElites; public bool overrideForbiddenAsBoss; public bool forbiddenAsBoss; public SerializableLoadout loadout; public bool overrideEquipmentToGrant; public EquipmentDef[] equipmentToGrant = Array.Empty(); public bool overrideItemsToGrant; public ItemCountPair[] itemsToGrant = Array.Empty(); public override CharacterSpawnCard GetSpawnCard(CharacterSpawnCard originalSpawnCard) { if (spawnCardOriginalToMirrored.ContainsKey(originalSpawnCard)) { return base.GetSpawnCard(originalSpawnCard); } CharacterSpawnCard spawnCard = base.GetSpawnCard(originalSpawnCard); if (overrideForbiddenAsBoss) { spawnCard.forbiddenAsBoss = forbiddenAsBoss; } else { spawnCard.forbiddenAsBoss = originalSpawnCard.forbiddenAsBoss; } if (overrideNoElites) { spawnCard.noElites = noElites; } else { spawnCard.noElites = originalSpawnCard.noElites; } if (overrideEquipmentToGrant) { spawnCard.equipmentToGrant = equipmentToGrant; } else { spawnCard.equipmentToGrant = originalSpawnCard.equipmentToGrant; } if (overrideItemsToGrant) { spawnCard.itemsToGrant = itemsToGrant; } else { spawnCard.itemsToGrant = originalSpawnCard.itemsToGrant; } return spawnCard; } } public class BrynzaMusicTrackController : MonoBehaviour { public delegate void MusicAction(object cookie, AkCallbackType type, object info); public static BrynzaMusicTrackController _instance; private uint eventId; private Dictionary PlayMusicToUINT = new Dictionary(); public static BrynzaMusicTrackController instance { get { //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_instance)) { _instance = new GameObject("BrynzaMusicTrackController").AddComponent(); Object.DontDestroyOnLoad((Object)(object)_instance); } return _instance; } } public static event MusicAction OnMusicAction; public void Awake() { } public void Add(BrynzaMusicTrackDef cIMusicTrackDef) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_003f: Expected I4, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (!PlayMusicToUINT.ContainsKey(cIMusicTrackDef.playEvent)) { eventId = AkSoundEngine.PostEvent(cIMusicTrackDef.playEvent, ((Component)this).gameObject, (uint)(int)cIMusicTrackDef.callbackType, new EventCallback(MusicCallback), (object)this); AkSoundEngine.SetRTPCValueByPlayingID("Volume_MSX", 0f, eventId); PlayMusicToUINT.Add(cIMusicTrackDef.playEvent, eventId); } } public void Remove(BrynzaMusicTrackDef cIMusicTrackDef) { if (PlayMusicToUINT.ContainsKey(cIMusicTrackDef.playEvent)) { AkSoundEngine.CancelEventCallback(eventId); PlayMusicToUINT.Remove(cIMusicTrackDef.playEvent); } } private void MusicCallback(object in_cookie, AkCallbackType in_type, object in_info) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) BrynzaMusicTrackController.OnMusicAction?.Invoke(in_cookie, in_type, in_info); } } [CreateAssetMenu(menuName = "BrynzaAPI/BrynzaMusicTrackDef")] public class BrynzaMusicTrackDef : MusicTrackDef { public string soundbankName; public string playEvent; public AkCallbackType callbackType; public uint groupID; public uint stateID; public override void Preload() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (!string.IsNullOrWhiteSpace(soundbankName)) { uint num = default(uint); AkSoundEngine.LoadBank(soundbankName, ref num); } } public override void Play() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) AkSoundEngine.SetState(groupID, stateID); BrynzaMusicTrackController.instance.Add(this); } public override void Stop() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) AkSoundEngine.SetState(groupID, 0u); BrynzaMusicTrackController.instance.Remove(this); } } public class DetachedOhject : MonoBehaviour { public Transform detachedObjectTransform; public bool destroyDetachedObjectOnDestroy; public void Awake() { if (Object.op_Implicit((Object)(object)detachedObjectTransform)) { detachedObjectTransform.SetParent((Transform)null, true); } } public void FixedUpdate() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)detachedObjectTransform)) { detachedObjectTransform.position = ((Component)this).transform.position; } } public void OnDestroy() { if (destroyDetachedObjectOnDestroy && Object.op_Implicit((Object)(object)detachedObjectTransform)) { Object.Destroy((Object)(object)((Component)detachedObjectTransform).gameObject); } } } public class MusicZone : MonoBehaviour { [SerializeField] private MusicTrackDef _musicTrackDef; [SerializeField] private int _priority; private MusicTrackOverride musicTrackOverride; public MusicTrackDef musicTrackDef { get { return _musicTrackDef; } set { _musicTrackDef = value; if (Object.op_Implicit((Object)(object)musicTrackOverride)) { musicTrackOverride.track = value; } } } public int priority { get { return _priority; } set { _priority = value; if (Object.op_Implicit((Object)(object)musicTrackOverride)) { musicTrackOverride.priority = value; } } } public void OnTriggerEnter(Collider collider) { if (!Object.op_Implicit((Object)(object)musicTrackOverride)) { CharacterBody component = ((Component)collider).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.isPlayerControlled && component.hasEffectiveAuthority) { musicTrackOverride = ((Component)component).gameObject.AddComponent(); musicTrackOverride.track = musicTrackDef; musicTrackOverride.priority = priority; } } } public void OnTriggerExit(Collider collider) { if (Object.op_Implicit((Object)(object)musicTrackOverride)) { CharacterBody component = ((Component)collider).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.isPlayerControlled && component.hasEffectiveAuthority) { Object.Destroy((Object)(object)musicTrackOverride); musicTrackOverride = null; } } } public void OnDestroy() { if (Object.op_Implicit((Object)(object)musicTrackOverride)) { Object.Destroy((Object)(object)musicTrackOverride); } } } [Serializable] public class DelegateDef : ScriptableObject where T : Delegate { public T @delegate; } [Serializable] public class DelegateHolder where T : Delegate { [SerializeField] public List> delegateDefs = new List>(); public List delegates = new List(); public void InvokeAll(params object[] parameters) { foreach (DelegateDef delegateDef in delegateDefs) { if ((Object)(object)delegateDef != (Object)null && delegateDef.@delegate != null) { delegateDef.@delegate.DynamicInvoke(parameters); } } foreach (T @delegate in delegates) { @delegate?.DynamicInvoke(parameters); } } public static DelegateHolder operator +(DelegateHolder delegateHolder, DelegateDef delegateDef) { delegateHolder.delegateDefs.Add(delegateDef); return delegateHolder; } public static DelegateHolder operator -(DelegateHolder delegateHolder, DelegateDef delegateDef) { delegateHolder.delegateDefs.Remove(delegateDef); return delegateHolder; } public static DelegateHolder operator +(DelegateHolder delegateHolder, T @delegate) { delegateHolder.delegates.Add(@delegate); return delegateHolder; } public static DelegateHolder operator -(DelegateHolder delegateHolder, T @delegate) { delegateHolder.delegates.Remove(@delegate); return delegateHolder; } } public class BodyMusicMover : MonoBehaviour { public delegate void MusicMoveCue(string cueName, float speedCoefficient, float duration); public class MusicMove { public Vector3 moveVector; public float time; } private static int _instanceCount; private static bool eventAdded; public CharacterMotor characterMotor; public RigidbodyMotor rigidbodyMotor; public float speedCoefficient = 1f; public float durationCoefficient = 1f; private List musicMoves = new List(); private static int instanceCount { get { return _instanceCount; } set { _instanceCount = value; if (value > 0) { if (!eventAdded) { BrynzaMusicTrackController.OnMusicAction += StaticMusicCallback; eventAdded = true; } } else if (eventAdded) { BrynzaMusicTrackController.OnMusicAction -= StaticMusicCallback; eventAdded = false; } } } private static event MusicMoveCue _OnMusicMoveCue; public static event MusicMoveCue OnMusicMoveCue { add { instanceCount++; _OnMusicMoveCue += value; } remove { _OnMusicMoveCue -= value; instanceCount--; } } public void OnEnable() { OnMusicMoveCue += AddMove; } public void OnDisable() { OnMusicMoveCue -= AddMove; } private static void StaticMusicCallback(object in_cookie, AkCallbackType in_type, object in_info) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Invalid comparison between Unknown and I4 AkMusicSyncCallbackInfo val = (AkMusicSyncCallbackInfo)((in_info is AkMusicSyncCallbackInfo) ? in_info : null); if (val == null || (int)val.musicSyncType != 8192) { return; } string userCueName = val.userCueName; if (userCueName == null || !userCueName.StartsWith("Move")) { return; } bool flag = false; bool flag2 = false; string text = ""; string text2 = ""; string text3 = userCueName; for (int i = 0; i < text3.Length; i++) { char c = text3[i]; if (c == '/') { flag2 = true; } else if (flag) { if (flag2) { text2 += c; } else { text += c; } } if (c == 'e') { flag = true; } } if (float.TryParse(text, out var result) && float.TryParse(text2, out var result2)) { BodyMusicMover._OnMusicMoveCue?.Invoke(userCueName, result, result2); } } public void FixedUpdate() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < musicMoves.Count; i++) { MusicMove musicMove = musicMoves[i]; if (Object.op_Implicit((Object)(object)characterMotor)) { CharacterMotor obj = characterMotor; obj.rootMotion += musicMove.moveVector * Time.fixedDeltaTime; } if (Object.op_Implicit((Object)(object)rigidbodyMotor)) { RigidbodyMotor obj2 = rigidbodyMotor; obj2.rootMotion += musicMove.moveVector * Time.fixedDeltaTime; } musicMove.time -= Time.fixedDeltaTime; if (musicMove.time < 0f) { musicMoves.RemoveAt(i); } } } public void AddMove(string cueName, float speedCoefficient, float duration) { //IL_0065: 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: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) CharacterBody val = null; if (Object.op_Implicit((Object)(object)characterMotor)) { val = characterMotor.body; } else if (Object.op_Implicit((Object)(object)rigidbodyMotor)) { val = rigidbodyMotor.characterBody; } if (Object.op_Implicit((Object)(object)val) && val.hasEffectiveAuthority) { musicMoves.Add(new MusicMove { moveVector = Random.onUnitSphere * val.moveSpeed * speedCoefficient, time = duration * durationCoefficient }); } } } public class DestroyOnParticleEndAndNoParticles : MonoBehaviour { [SerializeField] [Tooltip("Set this if you want to specify which particle system is tracked. Otherwise it will automatically grab the first one it finds.")] public ParticleSystem trackedParticleSystem; private EffectManagerHelper efh; public void Start() { if ((Object)(object)trackedParticleSystem == (Object)null) { trackedParticleSystem = ((Component)this).GetComponentInChildren(); } if (!Object.op_Implicit((Object)(object)efh)) { efh = ((Component)this).GetComponent(); } } public void Update() { if (Object.op_Implicit((Object)(object)trackedParticleSystem) && !trackedParticleSystem.IsAlive() && trackedParticleSystem.particleCount <= 0) { if (Object.op_Implicit((Object)(object)efh) && efh.OwningPool != null) { ((GenericPool)(object)efh.OwningPool).ReturnObject(efh); } else { Object.Destroy((Object)(object)((Component)this).gameObject); } } } } public class SniperHurtboxTracker : MonoBehaviour { [HideInInspector] public HurtBox hurtBox; [HideInInspector] public NetworkUser networkUser; [HideInInspector] public GameObject currentTrackerPrefab; public void Awake() { if (Object.op_Implicit((Object)(object)Run.instance) && NetworkUser.readOnlyInstancesList != null && NetworkUser.readOnlyInstancesList.Count > 0) { networkUser = NetworkUser.readOnlyInstancesList[0]; } } public void OnEnable() { BrynzaAPI.onSniperHurtboxAdded += UpdateTracker; BrynzaAPI.onSniperHurtboxRemoved += UpdateTracker; } public void UpdateTracker(GameObject obj) { if (Object.op_Implicit((Object)(object)currentTrackerPrefab)) { Object.Destroy((Object)(object)currentTrackerPrefab); } GameObject val = null; if (BrynzaAPI.activeSniperHurtboxTrackers.Count > 0) { foreach (GameObject activeSniperHurtboxTracker in BrynzaAPI.activeSniperHurtboxTrackers) { val = activeSniperHurtboxTracker; } } if ((Object)(object)val != (Object)null) { CameraRigController val2 = networkUser?.cameraRigController; if ((Object)(object)val2 != (Object)null) { GameObject mainContainer = val2.hud.mainContainer; currentTrackerPrefab = Object.Instantiate(val, mainContainer.transform); } } } public void Update() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)hurtBox == (Object)null) && !((Object)(object)currentTrackerPrefab == (Object)null) && !((Object)(object)networkUser == (Object)null)) { CameraRigController cameraRigController = networkUser.cameraRigController; Camera sceneCam = cameraRigController.sceneCam; Camera uiCam = cameraRigController.uiCam; if (!((Object)(object)sceneCam == (Object)null) && !((Object)(object)uiCam == (Object)null)) { Vector3 val = sceneCam.WorldToViewportPoint(((Component)this).transform.position); Vector3 val2 = uiCam.ViewportToScreenPoint(val); Transform transform = cameraRigController.hud.mainContainer.transform; Vector2 val3 = default(Vector2); RectTransformUtility.ScreenPointToLocalPointInRectangle((RectTransform)(object)((transform is RectTransform) ? transform : null), Vector2.op_Implicit(val2), uiCam, ref val3); currentTrackerPrefab.transform.localPosition = Vector2.op_Implicit(val3); } } } public void OnDisable() { BrynzaAPI.onSniperHurtboxAdded -= UpdateTracker; BrynzaAPI.onSniperHurtboxRemoved -= UpdateTracker; } } public static class Utils { public static void AddLanguageToken(string token, string output, string language = "en") { if (RoR2Application.loadFinished) { Language orCreateLanguage = Language.GetOrCreateLanguage(language); if (orCreateLanguage != null) { if (orCreateLanguage.stringsByToken.ContainsKey(token)) { orCreateLanguage.stringsByToken[token] = output; } else { orCreateLanguage.stringsByToken.Add(token, output); } } } else { LanguageTokensToAddOnLoad languageTokensToAddOnLoad = new LanguageTokensToAddOnLoad(token, output, language); } } public static void SelectRowsSection(string sectionName) { //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) foreach (Section section3 in Section.sections) { if (section3 == null) { continue; } List rows = section3.rows; if (rows == null) { continue; } foreach (Row item in rows) { GameObject val = ((item != null && Object.op_Implicit((Object)(object)item.rowPanelTransform)) ? ((Component)item.rowPanelTransform).gameObject : null); if (!((Object)(object)val == (Object)null)) { if (sectionName == section3.name) { val.SetActive(true); } else { val.SetActive(false); } } } } Section section = Section.sectionByName[sectionName]; int count = section.rows.Count; for (int i = 0; i < count; i++) { Row val2 = section.rows[i]; int count2 = val2.rowData.Count; for (int j = 0; j < count2; j++) { MPButton button = val2.rowData[j].button; Navigation navigation = ((Selectable)button).navigation; ((Navigation)(ref navigation)).mode = (Mode)4; ((Navigation)(ref navigation)).selectOnLeft = null; ((Navigation)(ref navigation)).selectOnRight = null; ((Navigation)(ref navigation)).selectOnUp = (Selectable)(object)section.button; ((Navigation)(ref navigation)).selectOnDown = null; if (count2 > 1) { int index = (j + count2 - 1) % count2; ((Navigation)(ref navigation)).selectOnLeft = (Selectable)(object)section.rows[i].rowData[index].button; int index2 = (j + count2 + 1) % count2; ((Navigation)(ref navigation)).selectOnRight = (Selectable)(object)section.rows[i].rowData[index2].button; } if (count > 1) { if (i != 0) { int num = section.rows[i - 1].rowData.Count - 1; int index3 = ((num < j) ? num : j); ((Navigation)(ref navigation)).selectOnUp = (Selectable)(object)section.rows[i - 1].rowData[index3].button; } if (i != count - 1) { int num2 = section.rows[i + 1].rowData.Count - 1; int index4 = ((num2 < j) ? num2 : j); ((Navigation)(ref navigation)).selectOnDown = (Selectable)(object)section.rows[i + 1].rowData[index4].button; } } ((Selectable)button).navigation = navigation; } } int count3 = Section.sections.Count; MPButton button2 = section.rows[0].rowData[0].button; for (int k = 0; k < count3; k++) { Section section2 = Section.sections[k]; HGButton button3 = section2.button; Navigation navigation2 = ((Selectable)button3).navigation; ((Navigation)(ref navigation2)).mode = (Mode)4; ((Navigation)(ref navigation2)).selectOnLeft = (Selectable)(object)((k - 1 < 0) ? Section.sections[count3 - 1].button : Section.sections[k - 1].button); ((Navigation)(ref navigation2)).selectOnRight = (Selectable)(object)((k + 1 < count3) ? Section.sections[k + 1].button : Section.sections[0].button); ((Navigation)(ref navigation2)).selectOnDown = (Selectable)(object)button2; ((Selectable)button3).navigation = navigation2; } ((Selectable)button2).Select(); } public static BuffDef CreateBuff(string name, Sprite icon, Color color, bool canStack, bool isDebuff, bool isCooldown, bool isHidden, bool ignoreGrowthNectar) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) BuffDef val = ScriptableObject.CreateInstance(); ((Object)val).name = name; val.buffColor = color; val.canStack = canStack; val.isDebuff = isDebuff; val.ignoreGrowthNectar = ignoreGrowthNectar; val.iconSprite = icon; val.isHidden = isHidden; val.isCooldown = isCooldown; ContentPacks.buffs.Add(val); return val; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int SuperRoll(float chance) { int num = (int)MathF.Floor(chance / 100f); if (Util.CheckRoll(chance - (float)(num * 100), 0f, (CharacterMaster)null)) { num++; } return num; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float ConvertAmplificationPercentageIntoReductionPercentage(float amplificationPercentage, float maxChance) { return (1f - maxChance / (maxChance + amplificationPercentage)) * maxChance; } public static EntityStateMachine AddEntityStateMachine(CharacterBody characterBody, Assets.EntityStateMachineAdditionInfo entityStateMachineAdditionInfo) { //IL_0062: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) NetworkStateMachine component = ((Component)characterBody).GetComponent(); List list = (Object.op_Implicit((Object)(object)component) ? component.stateMachines.ToList() : null); EntityStateMachine val = ((Component)characterBody).gameObject.AddComponent(); SerializableEntityStateType mainStateType = default(SerializableEntityStateType); ((SerializableEntityStateType)(ref mainStateType))..ctor(entityStateMachineAdditionInfo.mainStateType ?? typeof(Idle)); SerializableEntityStateType initialStateType = default(SerializableEntityStateType); ((SerializableEntityStateType)(ref initialStateType))..ctor(entityStateMachineAdditionInfo.initialStateType ?? typeof(Idle)); val.mainStateType = mainStateType; val.initialStateType = initialStateType; val.customName = entityStateMachineAdditionInfo.entityStateMachineName; if (Object.op_Implicit((Object)(object)component)) { list.Add(val); val.networkIndex = component.stateMachines.Length; val.networker = component; val.networkIdentity = component.networkIdentity; } if (Object.op_Implicit((Object)(object)component)) { component.stateMachines = list.ToArray(); } return val; } public static List AddEntityStateMachines(CharacterBody characterBody, List entityStateMachineAdditionInfos) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) NetworkStateMachine component = ((Component)characterBody).GetComponent(); List list = (Object.op_Implicit((Object)(object)component) ? component.stateMachines.ToList() : null); List list2 = new List(); SerializableEntityStateType mainStateType = default(SerializableEntityStateType); SerializableEntityStateType initialStateType = default(SerializableEntityStateType); foreach (Assets.EntityStateMachineAdditionInfo entityStateMachineAdditionInfo in entityStateMachineAdditionInfos) { EntityStateMachine val = ((Component)characterBody).gameObject.AddComponent(); ((SerializableEntityStateType)(ref mainStateType))..ctor(entityStateMachineAdditionInfo.mainStateType ?? typeof(Idle)); ((SerializableEntityStateType)(ref initialStateType))..ctor(entityStateMachineAdditionInfo.initialStateType ?? typeof(Idle)); val.mainStateType = mainStateType; val.initialStateType = initialStateType; val.customName = entityStateMachineAdditionInfo.entityStateMachineName; list2.Add(val); if (Object.op_Implicit((Object)(object)component)) { list.Add(val); val.networkIndex = component.stateMachines.Length; val.networker = component; val.networkIdentity = component.networkIdentity; } } if (Object.op_Implicit((Object)(object)component)) { component.stateMachines = list.ToArray(); } return list2; } public static void ChangeTimescaleForAllClients(float value) { NetMessageExtensions.Send((INetMessage)(object)new TimeScaleChangeNetMessage(value), (NetworkDestination)1); } public static void AddSniperHurtboxTracker(GameObject sniperHurtboxTracker) { BrynzaAPI.activeSniperHurtboxTrackers.Add(sniperHurtboxTracker); BrynzaAPI.OnSniperHurtboxAdded(sniperHurtboxTracker); } public static void RemoveSniperHurtboxTracker(GameObject sniperHurtboxTracker) { BrynzaAPI.activeSniperHurtboxTrackers.Remove(sniperHurtboxTracker); BrynzaAPI.OnSniperHurtboxRemoved(sniperHurtboxTracker); } } public class ContentPacks : IContentPackProvider { internal ContentPack contentPack = new ContentPack(); public static List bodies = new List(); public static List buffs = new List(); public static List skills = new List(); public static List skillFamilies = new List(); public static List projectiles = new List(); public static List networkPrefabs = new List(); public static List survivors = new List(); public static List states = new List(); public static List sounds = new List(); public static List unlockableDefs = new List(); public static List masters = new List(); public static List items = new List(); public static List equipments = new List(); public static List elites = new List(); public string identifier => "com.brynzananas.brynzaapi.ContentProvider"; public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(contentPack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { contentPack.identifier = identifier; contentPack.skillDefs.Add(skills.ToArray()); contentPack.skillFamilies.Add(skillFamilies.ToArray()); contentPack.bodyPrefabs.Add(bodies.ToArray()); contentPack.buffDefs.Add(buffs.ToArray()); contentPack.projectilePrefabs.Add(projectiles.ToArray()); contentPack.survivorDefs.Add(survivors.ToArray()); contentPack.entityStateTypes.Add(states.ToArray()); contentPack.networkSoundEventDefs.Add(sounds.ToArray()); contentPack.networkedObjectPrefabs.Add(networkPrefabs.ToArray()); contentPack.unlockableDefs.Add(unlockableDefs.ToArray()); contentPack.masterPrefabs.Add(masters.ToArray()); contentPack.itemDefs.Add(items.ToArray()); contentPack.equipmentDefs.Add(equipments.ToArray()); contentPack.eliteDefs.Add(elites.ToArray()); yield break; } } public static class Extensions { public static void AddExtraSkill(this GenericSkill skill, GenericSkill extraSkill) { BrynzaInterop.AddExtraSkill(skill, extraSkill); } public static List GetExtraSkills(this GenericSkill skill) { return BrynzaInterop.GetExtraSkills(skill); } public static void RemoveExtraSkill(this GenericSkill skill, GenericSkill extraSkill) { BrynzaInterop.RemoveExtraSkill(skill, extraSkill); } public static void LinkSkill(this GenericSkill genericSkill, GenericSkill linkSKill) { BrynzaInterop.LinkSkill(genericSkill, (object)linkSKill); } public static GenericSkill GetLinkedSkill(this GenericSkill genericSkill) { return BrynzaInterop.GetLinkedSkill(genericSkill); } public static void AddBonusSkill(this SkillLocator skillLocator, GenericSkill bonusSkill) { BrynzaInterop.AddBonusSkill(skillLocator, bonusSkill); } public static void RemoveBonusSkill(this SkillLocator skillLocator, GenericSkill bonusSkill) { BrynzaInterop.RemoveBonusSkill(skillLocator, bonusSkill); } public static List GetBonusSkills(this SkillLocator skillLocator) { return BrynzaInterop.GetBonusSkills(skillLocator); } public static void SetVelocityOverride(this CharacterMotor characterMotor, Vector3 vector3) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) BrynzaInterop.SetVelocityOverride(characterMotor, vector3); } public static Vector3 GetVelocityOverride(this CharacterMotor characterMotor) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return BrynzaInterop.GetVelocityOverride(characterMotor); } public static void SetMaxAirVelocity(this CharacterMotor characterMotor, float value) { BrynzaInterop.SetMaxAirVelocity(characterMotor, value); } public static Vector3 GetPositionDelta(this CharacterMotor characterMotor) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return BrynzaInterop.GetPositionDelta(characterMotor); } public static void SetPositionDelta(this CharacterMotor characterMotor, Vector3 vector3) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) BrynzaInterop.SetPositionDelta(characterMotor, vector3); } public static float GetMaxAirVelocity(this CharacterMotor characterMotor) { return BrynzaInterop.GetMaxAirVelocity(characterMotor); } public static void SetUseMaxAirVelocity(this CharacterMotor characterMotor, bool flag) { BrynzaInterop.SetUseMaxAirVelocity(characterMotor, flag); } public static bool GetUseMaxAirVelocity(this CharacterMotor characterMotor) { return BrynzaInterop.GetUseMaxAirVelocity(characterMotor); } public static bool GetUseMaxAirVelocityEffective(this CharacterMotor characterMotor) { return characterMotor.GetUseMaxAirVelocity() || (Object.op_Implicit((Object)(object)characterMotor) && Object.op_Implicit((Object)(object)characterMotor.body) && characterMotor.body.GetBuffCount(Assets.UseMaxAirVelocityBuff) + characterMotor.body.GetClientBuffCount(Assets.UseMaxAirVelocityBuff) > 0) || BrynzaAPI.InvokeExtraUseMaxAirVelocityDelegates(characterMotor); } public static void SetKeepVelocityOnMoving(this CharacterMotor characterMotor, bool flag) { BrynzaInterop.SetKeepVelocityOnMoving(characterMotor, flag); } public static bool GetKeepVelocityOnMovingEffective(this CharacterMotor characterMotor) { return characterMotor.GetKeepVelocityOnMoving() || (Object.op_Implicit((Object)(object)characterMotor) && Object.op_Implicit((Object)(object)characterMotor.body) && characterMotor.body.GetBuffCount(Assets.KeepVelocityBuff) + characterMotor.body.GetClientBuffCount(Assets.KeepVelocityBuff) > 0) || BrynzaAPI.InvokeExtraKeepVelocityOnMovingDelegates(characterMotor); } public static bool GetKeepVelocityOnMoving(this CharacterMotor characterMotor) { return BrynzaInterop.GetKeepVelocityOnMoving(characterMotor); } public static void SetConsistentAcceleration(this CharacterMotor characterMotor, float value) { BrynzaInterop.SetConsistentAcceleration(characterMotor, value); } public static float GetConsistentAcceleration(this CharacterMotor characterMotor) { return BrynzaInterop.GetConsistentAcceleration(characterMotor); } public static float GetAirControlFromVelocityAddEffective(this CharacterMotor characterMotor) { return characterMotor.GetAirControlFromVelocityAdd() + BrynzaAPI.InvokeExtraAirControlFromVelocityAddDelegates(characterMotor); } public static float GetAirControlFromVelocityAdd(this CharacterMotor characterMotor) { return BrynzaInterop.GetAirControlFromVelocityAdd(characterMotor); } public static void SetAirControlFromVelocityAdd(this CharacterMotor characterMotor, float value) { BrynzaInterop.SetAirControlFromVelocityAdd(characterMotor, value); } [Obsolete("Doesn't work as intended", true)] public static void SetFluidMaxDistanceDelta(this CharacterMotor characterMotor, bool flag) { BrynzaInterop.SetFluidMaxDistanceDelta(characterMotor, flag); } public static bool GetFluidMaxDistanceDelta(this CharacterMotor characterMotor) { return BrynzaInterop.GetFluidMaxDistanceDelta(characterMotor); } public static void SetStrafe(this CharacterMotor characterMotor, bool flag) { BrynzaInterop.SetStrafe(characterMotor, flag); } public static bool GetStrafe(this CharacterMotor characterMotor) { return BrynzaInterop.GetStrafe(characterMotor); } public static bool GetStrafeEffective(this CharacterMotor characterMotor) { return characterMotor.GetStrafe() || (Object.op_Implicit((Object)(object)characterMotor) && Object.op_Implicit((Object)(object)characterMotor.body) && characterMotor.body.GetBuffCount(Assets.StrafeBuff) + characterMotor.body.GetClientBuffCount(Assets.StrafeBuff) > 0) || BrynzaAPI.InvokeExtraStrafeDelegates(characterMotor); } public static void SetBunnyHop(this CharacterMotor characterMotor, bool flag) { BrynzaInterop.SetBunnyHop(characterMotor, flag); } public static bool GetBunnyHop(this CharacterMotor characterMotor) { return BrynzaInterop.GetBunnyHop(characterMotor); } public static bool GetBunnyHopEffective(this CharacterMotor characterMotor) { return characterMotor.GetBunnyHop() || (Object.op_Implicit((Object)(object)characterMotor) && Object.op_Implicit((Object)(object)characterMotor.body) && characterMotor.body.GetBuffCount(Assets.BunnyHopBuff) + characterMotor.body.GetClientBuffCount(Assets.BunnyHopBuff) > 0) || BrynzaAPI.InvokeExtraBunnyHopDelegates(characterMotor); } public static void SetBaseWallJumpCount(this CharacterBody characterBody, int count) { BrynzaInterop.SetBaseWallJumpCount(characterBody, count); } public static int GetBaseWallJumpCount(this CharacterBody characterBody) { return BrynzaInterop.GetBaseWallJumpCount(characterBody); } public static void SetMaxWallJumpCount(this CharacterBody characterBody, int count) { BrynzaInterop.SetMaxWallJumpCount(characterBody, count); } public static int GetMaxWallJumpCount(this CharacterBody characterBody) { return BrynzaInterop.GetMaxWallJumpCount(characterBody); } public static void SetWallJumpCount(this CharacterMotor characterMotor, int count) { BrynzaInterop.SetWallJumpCount(characterMotor, count); } public static int GetWallJumpCount(this CharacterMotor characterMotor) { return BrynzaInterop.GetWallJumpCount(characterMotor); } public static bool CanApplyAmmoPack(this SkillDef skillDef) { return BrynzaInterop.CanApplyAmmoPack(skillDef); } public static List GetIgnoredHealthComponents(this BulletAttack bulletAttack) { return BrynzaInterop.GetIgnoredHealthComponents(bulletAttack); } public static void SetIgnoredHealthComponents(this BulletAttack bulletAttack, List list) { BrynzaInterop.SetIgnoredHealthComponents(bulletAttack, list); } public static bool GetIgnoreHitTargets(this BulletAttack bulletAttack) { return BrynzaInterop.GetIgnoreHitTargets(bulletAttack); } public static void SetIgnoreHitTargets(this BulletAttack bulletAttack, bool flag) { BrynzaInterop.SetIgnoreHitTargets(bulletAttack, flag); } public static string GetSection(this Row row) { return BrynzaInterop.GetSection(row); } public static void SetSection(this Row row, string section) { BrynzaInterop.SetSection(row, section); } public static string GetSection(this GenericSkill genericSkill) { return BrynzaInterop.GetSection(genericSkill); } public static void SetSection(this GenericSkill genericSkill, string section) { BrynzaInterop.SetSection(genericSkill, section); } public static List GetSections(this LoadoutPanelController loadoutPanelController) { return BrynzaInterop.GetSections(loadoutPanelController); } public static void SetSections(this LoadoutPanelController loadoutPanelController, List sections) { BrynzaInterop.SetSections(loadoutPanelController, sections); } public static bool GetDontFadeWhenNearCamera(this ref RendererInfo rendererInfo) { return BrynzaInterop.GetDontFadeWhenNearCamera(ref rendererInfo); } public static void SetDontFadeWhenNearCamera(this ref RendererInfo rendererInfo, bool flag) { BrynzaInterop.SetDontFadeWhenNearCamera(ref rendererInfo, flag); } [Obsolete("use PhysForceInfo instead")] public static void SetForceMassIsOne(this BulletAttack bulletAttack, bool flag) { BrynzaInterop.SetForceMassIsOne(bulletAttack, flag); } [Obsolete("use PhysForceInfo instead")] public static bool GetForceMassIsOne(this BulletAttack bulletAttack) { return BrynzaInterop.GetForceMassIsOne(bulletAttack); } [Obsolete("use PhysForceInfo instead")] public static void SetForceMassIsOne(this BlastAttack blastAttack, bool flag) { BrynzaInterop.SetForceMassIsOne(blastAttack, flag); } [Obsolete("use PhysForceInfo instead")] public static bool GetForceMassIsOne(this BlastAttack blastAttack) { return BrynzaInterop.GetForceMassIsOne(blastAttack); } [Obsolete("use PhysForceInfo instead")] public static void SetForceMassIsOne(this ref BlastAttackDamageInfo blastAttackDamageInfo, bool flag) { BrynzaInterop.SetForceMassIsOne(ref blastAttackDamageInfo, flag); } [Obsolete("use PhysForceInfo instead")] public static bool GetForceMassIsOne(this ref BlastAttackDamageInfo blastAttackDamageInfo) { return BrynzaInterop.GetForceMassIsOne(ref blastAttackDamageInfo); } [Obsolete("use PhysForceInfo instead")] public static void SetForceMassIsOne(this DamageInfo damageInfo, bool flag) { BrynzaInterop.SetForceMassIsOne(damageInfo, flag); } [Obsolete("use PhysForceInfo instead")] public static bool GetForceMassIsOne(this DamageInfo damageInfo) { return BrynzaInterop.GetForceMassIsOne(damageInfo); } [Obsolete("use PhysForceInfo instead")] public static void SetForceAlwaysApply(this BulletAttack bulletAttack, bool value) { BrynzaInterop.SetForceAlwaysApply(bulletAttack, value); } [Obsolete("use PhysForceInfo instead")] public static bool GetForceAlwaysApply(this BulletAttack bulletAttack) { return BrynzaInterop.GetForceAlwaysApply(bulletAttack); } [Obsolete("use PhysForceInfo instead")] public static void SetForceAlwaysApply(this BlastAttack blastAttack, bool value) { BrynzaInterop.SetForceAlwaysApply(blastAttack, value); } [Obsolete("use PhysForceInfo instead")] public static bool GetForceAlwaysApply(this BlastAttack blastAttack) { return BrynzaInterop.GetForceAlwaysApply(blastAttack); } [Obsolete("use PhysForceInfo instead")] public static void SetForceAlwaysApply(this ref BlastAttackDamageInfo blastAttackDamageInfo, bool value) { BrynzaInterop.SetForceAlwaysApply(ref blastAttackDamageInfo, value); } [Obsolete("use PhysForceInfo instead")] public static bool GetForceAlwaysApply(this ref BlastAttackDamageInfo blastAttackDamageInfo) { return BrynzaInterop.GetForceAlwaysApply(ref blastAttackDamageInfo); } [Obsolete("use PhysForceInfo instead")] public static void SetForceAlwaysApply(this DamageInfo damageInfo, bool value) { BrynzaInterop.SetForceAlwaysApply(damageInfo, value); } [Obsolete("use PhysForceInfo instead")] public static bool GetForceAlwaysApply(this DamageInfo damageInfo) { return BrynzaInterop.GetForceAlwaysApply(damageInfo); } [Obsolete("use PhysForceInfo instead")] public static void SetForceDisableAirControlUntilCollision(this BulletAttack bulletAttack, bool value) { BrynzaInterop.SetForceDisableAirControlUntilCollision(bulletAttack, value); } [Obsolete("use PhysForceInfo instead")] public static bool GetForceDisableAirControlUntilCollision(this BulletAttack bulletAttack) { return BrynzaInterop.GetForceDisableAirControlUntilCollision(bulletAttack); } [Obsolete("use PhysForceInfo instead")] public static void SetForceDisableAirControlUntilCollision(this BlastAttack blastAttack, bool value) { BrynzaInterop.SetForceDisableAirControlUntilCollision(blastAttack, value); } [Obsolete("use PhysForceInfo instead")] public static bool GetForceDisableAirControlUntilCollision(this BlastAttack blastAttack) { return BrynzaInterop.GetForceDisableAirControlUntilCollision(blastAttack); } [Obsolete("use PhysForceInfo instead")] public static void SetForceDisableAirControlUntilCollision(this ref BlastAttackDamageInfo blastAttackDamageInfo, bool value) { BrynzaInterop.SetForceDisableAirControlUntilCollision(ref blastAttackDamageInfo, value); } [Obsolete("use PhysForceInfo instead")] public static bool GetForceDisableAirControlUntilCollision(this ref BlastAttackDamageInfo blastAttackDamageInfo) { return BrynzaInterop.GetForceDisableAirControlUntilCollision(ref blastAttackDamageInfo); } [Obsolete("use PhysForceInfo instead")] public static void SetForceDisableAirControlUntilCollision(this DamageInfo damageInfo, bool value) { BrynzaInterop.SetForceDisableAirControlUntilCollision(damageInfo, value); } [Obsolete("use PhysForceInfo instead")] public static bool GetForceDisableAirControlUntilCollision(this DamageInfo damageInfo) { return BrynzaInterop.GetForceAlwaysApply(damageInfo); } public static void SetBonusForce(this BulletAttack bulletAttack, Vector3 bonusForce) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) BrynzaInterop.SetBonusForce(bulletAttack, bonusForce); } public static Vector3 GetBonusForce(this BulletAttack bulletAttack) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return BrynzaInterop.GetBonusForce(bulletAttack); } public static void SetNoWeaponIfOwner(this BulletAttack bulletAttack, bool value) { BrynzaInterop.SetNoWeaponIfOwner(bulletAttack, value); } public static bool GetNoWeaponIfOwner(this BulletAttack bulletAttack) { return BrynzaInterop.GetNoWeaponIfOwner(bulletAttack); } public static float GetYawClipCycleStart(this AimAnimator aimAnimator) { return BrynzaInterop.GetYawClipCycleStart(aimAnimator); } public static void SetYawClipCycleStart(this AimAnimator aimAnimator, float value) { BrynzaInterop.SetYawClipCycleStart(aimAnimator, value); } public static float GetPitchClipCycleStart(this AimAnimator aimAnimator) { return BrynzaInterop.GetPitchClipCycleStart(aimAnimator); } public static void SetPitchClipCycleStart(this AimAnimator aimAnimator, float value) { BrynzaInterop.SetPitchClipCycleStart(aimAnimator, value); } public static FixedTimeStamp GetLastJumpTime(this CharacterBody characterBody) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return BrynzaInterop.GetLastJumpTime(characterBody); } public static void SetLastJumpTime(this CharacterBody characterBody, FixedTimeStamp value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) BrynzaInterop.SetLastJumpTime(characterBody, value); } public static int[] GetClientBuffs(this CharacterBody characterBody) { return BrynzaInterop.GetClientBuffs(characterBody); } public static int GetClientBuffCount(this CharacterBody characterBody, BuffDef buffDef) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return characterBody.GetClientBuffCount(buffDef.buffIndex); } public static int GetClientBuffCount(this CharacterBody characterBody, BuffIndex buffIndex) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return characterBody.GetClientBuffs()[buffIndex]; } public static void SetClientBuffs(this CharacterBody characterBody, int[] value) { BrynzaInterop.SetClientBuffs(characterBody, value); } public static void SetClientBuffCount(this CharacterBody characterBody, BuffIndex buffIndex, int count) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) characterBody.GetClientBuffs()[buffIndex] = count; } public static void SetClientBuffCount(this CharacterBody characterBody, BuffDef buffDef, int count) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) characterBody.SetClientBuffCount(buffDef.buffIndex, count); } public static void AddClientBuff(this CharacterBody characterBody, BuffIndex buffIndex, int count = 1) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) characterBody.SetClientBuffCount(buffIndex, characterBody.GetClientBuffCount(buffIndex) + count); } public static void AddClientBuff(this CharacterBody characterBody, BuffDef buffDef, int count = 1) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) characterBody.AddClientBuff(buffDef.buffIndex, count); } public static void RemoveClientBuff(this CharacterBody characterBody, BuffIndex buffIndex, int count = 1) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) characterBody.AddClientBuff(buffIndex, -count); } public static void RemoveClientBuff(this CharacterBody characterBody, BuffDef buffDef, int count = 1) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) characterBody.AddClientBuff(buffDef.buffIndex, -count); } public static Vector3? GetScale(this EffectData effectData) { return BrynzaInterop.GetScale(effectData); } public static void SetScale(this EffectData effectData, Vector3? scale) { BrynzaInterop.SetScale(effectData, scale); } public static EffectComponent GetEffectInstance(this EffectData effectData) { return BrynzaInterop.GetEffectInstance(effectData); } public static void SetEffectInstance(this EffectData effectData, EffectComponent effectComponent) { BrynzaInterop.SetEffectInstance(effectData, effectComponent); } public static CharacterBody GetCharacterBody(this Interactor interactor) { return BrynzaInterop.GetCharacterBody(interactor); } public static void SetCharacterBody(this Interactor interactor, CharacterBody characterBody) { BrynzaInterop.SetCharacterBody(interactor, characterBody); } public static bool GetAppliedChanges(this DccsPool dccsPool) { return BrynzaInterop.GetAppliedChanges(dccsPool); } public static void SetAppliedChanges(this DccsPool dccsPool, bool value) { BrynzaInterop.SetAppliedChanges(dccsPool, value); } public static CharacterMaster GetCharacterMaster(this Inventory inventory) { return BrynzaInterop.GetCharacterMaster(inventory); } public static void SetCharacterMaster(this Inventory inventory, CharacterMaster characterMaster) { BrynzaInterop.SetCharacterMaster(inventory, characterMaster); } public static void SetSprint(this GenericSkill genericSkill, bool value) { BrynzaInterop.SetSprint(genericSkill, value); } public static bool GetSprint(this GenericSkill genericSkill) { return BrynzaInterop.GetSprint(genericSkill); } public static void SetSprintSkill(this SkillLocator skillLocator, GenericSkill value) { BrynzaInterop.SetSprintSkill(skillLocator, value); } public static GenericSkill GetSprintSkill(this SkillLocator skillLocator) { return BrynzaInterop.GetSprintSkill(skillLocator); } public static void ResetIgnoredHealthComponents(this BulletAttack bulletAttack) { if (bulletAttack.GetIgnoredHealthComponents() != null) { bulletAttack.GetIgnoredHealthComponents().Clear(); } } public static void SetStateToMain(this EntityStateMachine entityStateMachine) { entityStateMachine.SetState(EntityStateCatalog.InstantiateState(((SerializableEntityStateType)(ref entityStateMachine.mainStateType)).stateType)); } public static void AddOnHitGroundServerDelegate(this CharacterMotor characterMotor, BrynzaAPI.OnHitGroundServerDelegate hitGroundServerDelegate) { if (BrynzaAPI.onHitGroundServerDictionary.ContainsKey(characterMotor)) { BrynzaAPI.onHitGroundServerDictionary[characterMotor].Add(hitGroundServerDelegate); return; } List list = new List(1) { hitGroundServerDelegate }; BrynzaAPI.onHitGroundServerDictionary.Add(characterMotor, list); } public static void RemoveOnHitGroundServerDelegate(this CharacterMotor characterMotor, BrynzaAPI.OnHitGroundServerDelegate hitGroundServerDelegate) { if (BrynzaAPI.onHitGroundServerDictionary.ContainsKey(characterMotor)) { BrynzaAPI.onHitGroundServerDictionary[characterMotor].Remove(hitGroundServerDelegate); if (BrynzaAPI.onHitGroundServerDictionary[characterMotor].Count <= 0) { BrynzaAPI.onHitGroundServerDictionary.Remove(characterMotor); } } } public static T CopyComponent(this GameObject destination, T original) where T : Component { Type type = ((object)original).GetType(); Component val = destination.AddComponent(type); FieldInfo[] fields = type.GetFields(); FieldInfo[] array = fields; foreach (FieldInfo fieldInfo in array) { fieldInfo.SetValue(val, fieldInfo.GetValue(original)); } return (T)(object)((val is T) ? val : null); } public static T GetOrAddComponent(this GameObject gameObject) where T : Component { return gameObject.GetComponent() ?? gameObject.AddComponent(); } public static T GetOrAddComponent(this Component component) where T : Component { return component.gameObject.GetOrAddComponent(); } public static T GetOrAddComponent(this Transform transform) where T : Component { return ((Component)transform).gameObject.GetOrAddComponent(); } public static void AddBuffAuthotiry(this CharacterBody characterBody, BuffDef buffDef, int amount) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) characterBody.AddBuffAuthotiry(buffDef.buffIndex, amount); } public static void AddBuffAuthotiry(this CharacterBody characterBody, BuffIndex buffIndex, int amount) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) characterBody.AddOrRemoveBuffAuthotiry(buffIndex, amount); } public static void RemoveBuffAuthotiry(this CharacterBody characterBody, BuffDef buffDef, int amount) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) characterBody.RemoveBuffAuthotiry(buffDef.buffIndex, amount); } public static void RemoveBuffAuthotiry(this CharacterBody characterBody, BuffIndex buffIndex, int amount) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) characterBody.AddOrRemoveBuffAuthotiry(buffIndex, -amount); } public static void AddBuffAuthotiry(this CharacterBody characterBody, BuffDef buffDef) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) characterBody.AddBuffAuthotiry(buffDef.buffIndex); } public static void AddBuffAuthotiry(this CharacterBody characterBody, BuffIndex buffIndex) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) characterBody.AddOrRemoveBuffAuthotiry(buffIndex, 1); } public static void RemoveBuffAuthotiry(this CharacterBody characterBody, BuffDef buffDef) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) characterBody.RemoveBuffAuthotiry(buffDef.buffIndex); } public static void RemoveBuffAuthotiry(this CharacterBody characterBody, BuffIndex buffIndex) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) characterBody.AddOrRemoveBuffAuthotiry(buffIndex, -1); } public static void AddOrRemoveBuffAuthotiry(this CharacterBody characterBody, BuffDef buffDef, int amount) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) characterBody.AddOrRemoveBuffAuthotiry(buffDef.buffIndex, amount); } public static void AddOrRemoveBuffAuthotiry(this CharacterBody characterBody, BuffIndex buffIndex, int amount) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) NetMessageExtensions.Send((INetMessage)(object)new AddBuffNetMessage(((NetworkBehaviour)characterBody).netId, buffIndex, amount, -1f), (NetworkDestination)2); } public static void AddTimedBuffAuthotiry(this CharacterBody characterBody, BuffDef buffDef, int amount, float duration) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) characterBody.AddTimedBuffAuthotiry(buffDef.buffIndex, amount, duration); } public static void AddTimedBuffAuthotiry(this CharacterBody characterBody, BuffIndex buffIndex, int amount, float duration) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) NetMessageExtensions.Send((INetMessage)(object)new AddBuffNetMessage(((NetworkBehaviour)characterBody).netId, buffIndex, amount, duration), (NetworkDestination)2); } public static void ChangeTimescaleForAllClients(this Time time, float value) { Utils.ChangeTimescaleForAllClients(value); } public static bool MatchStfldOut(this Instruction instr, string name, out ILLabel iLLabel) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown FieldReference val = default(FieldReference); if (ILPatternMatchingExt.MatchStfld(instr, ref val)) { iLLabel = (ILLabel)instr.Operand; return Extensions.Is((MemberReference)(object)val, typeof(T), name); } iLLabel = null; return false; } public static void AddValueToListInDictionary(this Dictionary> keyValuePairs, T1 t1, T2 t2) { if (keyValuePairs.ContainsKey(t1)) { keyValuePairs[t1].Add(t2); return; } List value = new List(1) { t2 }; keyValuePairs.Add(t1, value); } public static void RemoveValueFromListInDictionary(this Dictionary> keyValuePairs, T1 t1, T2 t2) { if (keyValuePairs.ContainsKey(t1)) { keyValuePairs[t1].Remove(t2); if (keyValuePairs[t1].Count <= 0) { keyValuePairs.Remove(t1); } } } internal static BrynzaAPI.ModMetaData GetModMetaData(this Assembly assembly) { BrynzaAPI.ModMetaData result = default(BrynzaAPI.ModMetaData); Type[] exportedTypes = assembly.GetExportedTypes(); Type[] array = exportedTypes; foreach (Type element in array) { BepInPlugin customAttribute = ((MemberInfo)element).GetCustomAttribute(); if (customAttribute != null) { result.Guid = customAttribute.GUID; result.Name = customAttribute.Name; } } return result; } } public static class ModCompatibilities { public static class ProjectilesConfiguratorCompatibility { [CompilerGenerated] private static class <>O { public static ConfigureProjectileAsync <0>__ConfigureProjectiles; } public const string GUID = "com.brynzananas.projectilesconfigurator"; public static void Init() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown ConfigureProjectileAsync getProjectileCustomConfigsAsync = ProjectilesConfiguratorPlugin.GetProjectileCustomConfigsAsync; object obj = <>O.<0>__ConfigureProjectiles; if (obj == null) { ConfigureProjectileAsync val = ConfigureProjectiles; <>O.<0>__ConfigureProjectiles = val; obj = (object)val; } ProjectilesConfiguratorPlugin.GetProjectileCustomConfigsAsync = (ConfigureProjectileAsync)Delegate.Combine((Delegate?)(object)getProjectileCustomConfigsAsync, (Delegate?)obj); } private static void ConfigureProjectiles(ParallelCoroutine parallelCoroutine, GameObject projectile, string sectionName) { parallelCoroutine.Add(ConfigureProjectilesAsync(projectile, sectionName)); } private static IEnumerator ConfigureProjectilesAsync(GameObject projectile, string sectionName) { RocketJumpComponent rocketJumpComponent = projectile.GetComponent(); ConfigEntry rjForce = null; ConfigEntry rjRadiusMultiplier = null; ConfigEntry rjPhysForceFlags = null; ConfigEntry rjRocketJumpFiltering = null; GuidedProjectile guidedProjectile = projectile.GetComponent(); ConfigEntry gGuidingPower = null; yield return null; if (Object.op_Implicit((Object)(object)rocketJumpComponent)) { rjForce = ProjectilesConfiguratorPlugin.CreateConfig(sectionName, "Rocket Jump Force", rocketJumpComponent.force, ""); rjForce.SettingChanged += OnSettingChanged; yield return null; rjRadiusMultiplier = ProjectilesConfiguratorPlugin.CreateConfig(sectionName, "Rocket Jump Radius Multiplier", rocketJumpComponent.radiusMultiplier, ""); rjRadiusMultiplier.SettingChanged += OnSettingChanged; yield return null; rjPhysForceFlags = ProjectilesConfiguratorPlugin.CreateConfig(sectionName, "Rocket Jump Phys Force Flags", rocketJumpComponent.physForceFlags, "", false); rjPhysForceFlags.SettingChanged += OnSettingChanged; yield return null; rjRocketJumpFiltering = ProjectilesConfiguratorPlugin.CreateConfig(sectionName, "Rocket Jump Filtering", rocketJumpComponent.rocketJumpFiltering, ""); rjRocketJumpFiltering.SettingChanged += OnSettingChanged; yield return null; } if (Object.op_Implicit((Object)(object)guidedProjectile)) { gGuidingPower = ProjectilesConfiguratorPlugin.CreateConfig(sectionName, "Guiding Power", guidedProjectile.guidingPower, ""); gGuidingPower.SettingChanged += OnSettingChanged; yield return null; } UpdateProjectile(); void OnSettingChanged(object sender, EventArgs e) { UpdateProjectile(); } void UpdateProjectile() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)rocketJumpComponent)) { rocketJumpComponent.force = rjForce.Value; rocketJumpComponent.radiusMultiplier = rjRadiusMultiplier.Value; rocketJumpComponent.physForceFlags = rjPhysForceFlags.Value; rocketJumpComponent.rocketJumpFiltering = rjRocketJumpFiltering.Value; } if (Object.op_Implicit((Object)(object)guidedProjectile)) { guidedProjectile.guidingPower = gGuidingPower.Value; } } } } } }