using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Logging; using GameConsole; using HarmonyLib; using Sandbox; using Straymode.IdentifierCode; using Straymode.InGameCode; using Straymode.InGameCode.CustomProjectiles; using Straymode.WeaponCode; using TMPro; using ULTRAKILL.Cheats; using ULTRAKILL.Portal; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets.ResourceLocators; using UnityEngine.Animations.Rigging; using UnityEngine.Audio; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.ResourceManagement.ResourceProviders; using UnityEngine.SceneManagement; using UnityEngine.UI; using plog; using plog.Models; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("Straymode")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("plonk")] [assembly: AssemblyProduct("Straymode")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("5711e2a0-d5a7-4ddf-b8d4-00f355fe9397")] [assembly: AssemblyFileVersion("3.0.0.0")] [assembly: NeutralResourcesLanguage("en-FI")] [assembly: TargetFramework(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("3.0.0.0")] [module: UnverifiableCode] namespace UnityEngine.Animations.Rigging { [ExecuteInEditMode] [AddComponentMenu("Animation Rigging/Setup/Bone Renderer")] [HelpURL("https://docs.unity3d.com/Packages/com.unity.animation.rigging@1.2/manual/RiggingWorkflow.html#bone-renderer-component")] public class BoneRenderer : MonoBehaviour { public enum BoneShape { Line, Pyramid, Box } public BoneShape boneShape = BoneShape.Pyramid; public bool drawBones = true; public bool drawTripods; [Range(0.01f, 5f)] public float boneSize = 1f; [Range(0.01f, 5f)] public float tripodSize = 1f; public Color boneColor = new Color(0f, 0f, 1f, 0.5f); [SerializeField] private Transform[] m_Transforms; public Transform[] transforms => m_Transforms; } public interface IRigEffectorHolder { } [DisallowMultipleComponent] [AddComponentMenu("Animation Rigging/Setup/Rig")] [HelpURL("https://docs.unity3d.com/Packages/com.unity.animation.rigging@1.2/manual/RiggingWorkflow.html#rig-component")] public class Rig : MonoBehaviour, IRigEffectorHolder { } } namespace Straymode { public class DebugLog : ICommand { public string Name => "straymode-devmode"; public string Description => ""; public string Command => "straymode-devmode"; public void Execute(Console con, string[] args) { MainCode.Debugging = !MainCode.Debugging; MainCode.Log("Debugging " + (MainCode.Debugging ? "Enabled" : "Disabled"), 0, plog: true); } } public class RefreshCat : ICommand { public string Name => "straymode-refresh"; public string Description => ""; public string Command => "straymode-refresh"; public void Execute(Console con, string[] args) { MainCode.RefreshCatalogExperimental(); MainCode.Log("Trying to refresh catalogs...", 2, plog: true); } } public class AnchorJiggle : MonoBehaviour { public bool active = true; public bool moveDirector = true; public Transform parent; public Transform director; private Vector3 origRot; private void Start() { //IL_0007: 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) origRot = ((Component)this).transform.localEulerAngles; } private void Update() { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_0099: Unknown result type (might be due to invalid IL or missing references) if (active) { ((Component)this).transform.LookAt(((Component)this).transform.position - director.up, parent.up); ((Component)this).transform.localRotation = Quaternion.Euler(new Vector3(((Component)this).transform.localEulerAngles.x, ((Component)this).transform.localEulerAngles.y, 0f)); if (moveDirector) { director.rotation = Quaternion.Lerp(director.rotation, Quaternion.identity, 0.1f); } } else { ((Component)this).transform.localRotation = Quaternion.Euler(origRot); } } } public class PlySCBeam : MonoBehaviour { private GameObject hitParticle; public bool active = true; public Vector3 hitPosition; public Quaternion hitRotation; private void Start() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown hitParticle = new GameObject(); } private void Update() { //IL_0007: 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_001c: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_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_004e: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_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) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) hitPosition = ((Component)this).transform.position + ((Component)this).transform.forward * 100f; Vector3 forward = ((Component)this).transform.forward * -1f; LayerMask val = LayerMaskDefaults.Get((LMD)3); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(((Component)this).transform.position, ((Component)this).transform.forward, ref val2, 100f, LayerMask.op_Implicit(val), (QueryTriggerInteraction)1)) { hitPosition = ((RaycastHit)(ref val2)).point; forward = ((RaycastHit)(ref val2)).normal; } hitParticle.transform.position = hitPosition; hitParticle.transform.forward = forward; hitRotation = hitParticle.transform.rotation; } } internal class Portal : MonoBehaviour { public Transform endpoint; private void OnTriggerEnter(Collider other) { //IL_0027: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_0087: 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_00b1: Unknown result type (might be due to invalid IL or missing references) if (((Component)other).gameObject.CompareTag("Player")) { NewMovement instance = MonoSingleton.Instance; ((Component)instance).transform.position = endpoint.position; Vector3 forward = endpoint.forward; Vector3 velocity = instance.rb.velocity; instance.Launch(forward, ((Vector3)(ref velocity)).magnitude / 1000f * 1.1f, true); ((Component)instance.cc).transform.localRotation = Quaternion.Euler(endpoint.eulerAngles.x, 0f, 0f); ((Component)instance).transform.rotation = Quaternion.Euler(0f, endpoint.eulerAngles.y, 0f); } Portal portal = default(Portal); if (((Component)other).gameObject.TryGetComponent(ref portal)) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public static class SMPluginInfo { public const string guid = "plonk.straymode"; public const string modName = "Straymode2"; public const string ver = "3.0.6"; } [BepInPlugin("plonk.straymode", "Straymode2", "3.0.6")] public class MainCode : BaseUnityPlugin { [Serializable] public class Charge { public float amt; public float target; public float speed; public bool autoRegen; public bool resetToZero; public float resetTo; public Charge cannotAutoWithout; public Charge(float amt, float target, float speed, bool autoRegen, bool resetToZero = false, float resetTo = -1f) { this.amt = amt; this.target = target; this.speed = speed; this.autoRegen = autoRegen; this.resetToZero = resetToZero; this.resetTo = resetTo; } public void SetTo(float percentage) { amt = Mathf.Lerp(0f, target, percentage / 100f); } public void SetToValue(float val) { amt = val; } public void Run() { if ((cannotAutoWithout == null || !(cannotAutoWithout.GetPercentage() < 95f)) && autoRegen) { amt = Mathf.MoveTowards(amt, target, Time.deltaTime * speed); } } public float GetPercentage() { return Mathf.Abs(amt / target) * 100f; } public void Reset(bool noCooldown = false) { if (resetTo == -1f) { if (resetToZero && !noCooldown) { SetTo(0f); } else { SetTo(100f); } } else { SetToValue(resetTo); } } } [HarmonyPatch] public class Patches { public class DualWieldNewIcon : MonoBehaviour { } [HarmonyPrefix] [HarmonyPatch(typeof(NewMovement), "Update")] public static bool RemoveDashingIfSuperDashing(NewMovement __instance) { if (!tcenabled) { return true; } if (MonoSingleton.Instance.InputSource.Dodge.WasPerformedThisFrame) { SuperDash instance = MonoSingleton.Instance; if (instance == null || !(instance.charge >= 100f)) { SuperDash instance2 = MonoSingleton.Instance; if (instance2 == null || !instance2.Dashing) { goto IL_0051; } } return false; } goto IL_0051; IL_0051: return true; } [HarmonyPostfix] [HarmonyPatch(typeof(Cannonball), "Bounce")] public static void BouncePatch(Cannonball __instance) { //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) //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_0049: 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) if (tcenabled) { Vector3 val = new Vector3(Random.Range(-1f, 1f), Random.Range(-1f, 1f), Random.Range(-1f, 1f)); Vector3 normalized = ((Vector3)(ref val)).normalized; __instance.rb.angularVelocity = normalized * 5f; AudioSource component = ((Component)((Component)__instance).transform.GetChild(0)).GetComponent(); component.pitch += 1f; } } [HarmonyPostfix] [HarmonyPatch(typeof(Cannonball), "Launch")] public static void LaunchPatch(Cannonball __instance) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (tcenabled) { __instance.rb.angularVelocity = Vector3.zero; } } [HarmonyPostfix] [HarmonyPatch(typeof(RoomCubemap), "Awake")] public static void FuckYouFuckYouFuckYou(RoomCubemap __instance) { if (SceneHelper.CurrentScene == "CreditsMuseum2") { __instance.cam.useOcclusionCulling = false; } } [HarmonyPrefix] [HarmonyPatch(typeof(RoomCubemap), "UpdateCubemap")] public static bool FuckYouFuckYouFuckYou2(RoomCubemap __instance) { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) if (SceneHelper.CurrentScene != "CreditsMuseum2" || !tcenabled) { return true; } __instance.cam.RenderToCubemap(__instance.cubemap); if (museumRoomObjects == null || museumRoomObjects.Length == 0) { museumRoomObjects = ((Component)__instance.room).GetComponentsInChildren(true); } if (__instance.roomObjects == null || __instance.roomObjects.Length == 0) { __instance.roomObjects = museumRoomObjects; } for (int i = 0; i < __instance.roomObjects.Length; i++) { MeshRenderer obj = __instance.roomObjects[i]; ((Renderer)obj).GetPropertyBlock(__instance.propertyBlock); __instance.propertyBlock.SetTexture("_CubeTex", (Texture)(object)__instance.cubemap); __instance.propertyBlock.SetFloat("_CubeMode", (float)__instance.cubemapMode); __instance.propertyBlock.SetFloat("_ReflectionStrength", __instance.cubemapStrength); ((Renderer)obj).SetPropertyBlock(__instance.propertyBlock); } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(NewMovement), "Dodge")] public static bool SuperDashDahPatch(NewMovement __instance) { if (!tcenabled) { return true; } if (!Object.op_Implicit((Object)(object)MonoSingleton.Instance)) { return true; } if (MonoSingleton.Instance.Dashing) { return false; } return true; } [HarmonyPrefix] [HarmonyPatch(typeof(StaminaMeter), "Update")] public static bool SuperDashMeterPatch(StaminaMeter __instance) { //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0312: 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_0300: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled) { return true; } StraymodeWeaponID straymodeWeaponID = default(StraymodeWeaponID); if (!((Component)__instance).TryGetComponent(ref straymodeWeaponID)) { return true; } __instance.UpdateColors(); if (__instance.intro) { __instance.stamina = Mathf.MoveTowards(__instance.stamina, MonoSingleton.Instance.charge + 200f, Time.deltaTime * ((MonoSingleton.Instance.charge + 200f - __instance.stamina) * 5f + 10f)); if (__instance.stamina >= MonoSingleton.Instance.charge + 200f) { __instance.intro = false; } } else if (__instance.stamina < MonoSingleton.Instance.charge + 200f) { __instance.stamina = Mathf.MoveTowards(__instance.stamina, MonoSingleton.Instance.charge + 200f, Time.deltaTime * ((MonoSingleton.Instance.charge + 200f - __instance.stamina) * 25f + 25f)); } else if (__instance.stamina > MonoSingleton.Instance.charge + 200f) { __instance.stamina = Mathf.MoveTowards(__instance.stamina, MonoSingleton.Instance.charge + 200f, Time.deltaTime * ((__instance.stamina - (MonoSingleton.Instance.charge + 200f)) * 25f + 25f)); } if (__instance.alwaysUpdate || (Object.op_Implicit((Object)(object)__instance.parentCanvas) && ((Behaviour)__instance.parentCanvas).enabled)) { if ((Object)(object)__instance.stm != (Object)null) { __instance.stm.value = __instance.stamina; if (__instance.stm.value >= __instance.stm.maxValue && !__instance.full) { __instance.full = true; ((Graphic)__instance.staminaBar).color = __instance.origColor; __instance.Flash(false); } if (__instance.flashColor.a > 0f) { if (__instance.flashColor.a - Time.deltaTime > 0f) { __instance.flashColor.a = __instance.flashColor.a - Time.deltaTime; } else { __instance.flashColor.a = 0f; } ((Graphic)__instance.staminaFlash).color = __instance.flashColor; } if (__instance.stm.value < __instance.stm.maxValue) { __instance.full = false; ((Graphic)__instance.staminaBar).color = __instance.emptyColor; } } if ((Object)(object)__instance.stmText != (Object)null) { if (__instance.lastStamina != __instance.stamina) { __instance.stmText.text = (__instance.stamina / 100f).ToString("0.00"); } __instance.lastStamina = __instance.stamina; if (__instance.changeTextColor) { if (__instance.stamina < 100f) { ((Graphic)__instance.stmText).color = Color.red; return false; } ((Graphic)__instance.stmText).color = MonoSingleton.Instance.GetHudColor((HudColorType)5); return false; } if (__instance.normalTextColor == Color.white) { if (__instance.stamina < 100f) { ((Graphic)__instance.stmText).color = Color.red; return false; } ((Graphic)__instance.stmText).color = MonoSingleton.Instance.GetHudColor((HudColorType)4); } } } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(StaminaMeter), "UpdateColors")] public static bool SuperDashMeterColorPatch(StaminaMeter __instance) { //IL_001c: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_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) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_011e: 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_012c: 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_0145: 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_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled) { return true; } StraymodeWeaponID straymodeWeaponID = default(StraymodeWeaponID); if (!((Component)__instance).TryGetComponent(ref straymodeWeaponID)) { return true; } Color staminaColor = MonoSingleton.Instance.staminaColor; ((Color)(ref staminaColor))..ctor(Mathf.Max(0.5f, 1f - staminaColor.r), Mathf.Max(0.5f, 1f - staminaColor.g), Mathf.Max(0.5f, 1f - staminaColor.b), staminaColor.a); Color staminaEmptyColor = MonoSingleton.Instance.staminaEmptyColor; ((Color)(ref staminaEmptyColor))..ctor(Mathf.Max(0.1f, 1f - staminaEmptyColor.r), Mathf.Max(0.1f, 1f - staminaEmptyColor.g), Mathf.Max(0.1f, 1f - staminaEmptyColor.b), staminaEmptyColor.a); Color staminaChargingColor = MonoSingleton.Instance.staminaChargingColor; ((Color)(ref staminaChargingColor))..ctor(Mathf.Max(0.25f, 1f - staminaChargingColor.r), Mathf.Max(0.25f, 1f - staminaChargingColor.g), Mathf.Max(0.25f, 1f - staminaChargingColor.b), staminaChargingColor.a); __instance.origColor = staminaColor; if (__instance.redEmpty) { __instance.emptyColor = staminaEmptyColor; } else { __instance.emptyColor = staminaChargingColor; } if (Object.op_Implicit((Object)(object)__instance.staminaBar)) { if (__instance.full) { ((Graphic)__instance.staminaBar).color = __instance.origColor; return false; } ((Graphic)__instance.staminaBar).color = __instance.emptyColor; } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(NewMovement), "GetHurt")] public static bool DashIFrames(NewMovement __instance, bool invincible, float scoreLossMultiplier = 1f, bool explosion = false, bool instablack = false, float hardDamageMultiplier = 0.35f, bool ignoreInvincibility = false) { if (!tcenabled) { return true; } if (ignoreInvincibility) { return true; } if ((Object)(object)MonoSingleton.instance == (Object)null) { return true; } if ((Object)(object)MonoSingleton.instance != (Object)null && MonoSingleton.instance.hasIFrames) { return false; } if (telefragging) { return false; } return true; } [HarmonyPrefix] [HarmonyPatch(typeof(NewMovement), "Jump")] public static void CancelDash(NewMovement __instance) { if ((Object)(object)MonoSingleton.instance != (Object)null) { MonoSingleton.instance.CancelDash(); } } [HarmonyPrefix] [HarmonyPatch(typeof(AlwaysLookAtCamera), "LateUpdate")] public static void ReplacedualWieldIcon(AlwaysLookAtCamera __instance) { if (!tcenabled) { return; } SpriteRenderer val = default(SpriteRenderer); DualWieldNewIcon dualWieldNewIcon = default(DualWieldNewIcon); SpriteRenderer val2 = default(SpriteRenderer); DualWieldNewIcon dualWieldNewIcon2 = default(DualWieldNewIcon); if (((Component)((Component)__instance).transform).TryGetComponent(ref val) && !((Component)((Component)__instance).transform).TryGetComponent(ref dualWieldNewIcon)) { if ((Object)(object)val.sprite != (Object)null && ((Object)val.sprite).name == "dualwieldpowerup") { val.sprite = MainCode.FetchFromBundle("Textures/dualwieldpowerup.png", autofill: true); ((Component)__instance).gameObject.AddComponent(); } } else if (((Component)__instance).transform.childCount > 0 && ((Component)((Component)__instance).transform.GetChild(0)).TryGetComponent(ref val2) && !((Component)((Component)__instance).transform.GetChild(0)).TryGetComponent(ref dualWieldNewIcon2) && (Object)(object)val2.sprite != (Object)null && ((Object)val2.sprite).name == "dualwieldpowerup") { val2.sprite = MainCode.FetchFromBundle("Textures/dualwieldpowerup.png", autofill: true); ((Component)((Component)__instance).transform.GetChild(0)).gameObject.AddComponent(); } } [HarmonyPrefix] [HarmonyPatch(typeof(DifficultyTitle), "Check")] public static bool addStrayModeToDifficulty(DifficultyTitle __instance) { if (!tcenabled) { return true; } int @int = MonoSingleton.Instance.GetInt("difficulty", 0); string text = ""; if (__instance.lines) { text += "-- "; } if (@int < 5) { text += "STRAYMODE "; } switch (@int) { case 0: text += "HARMLESS"; break; case 1: text += "LENIENT"; break; case 2: text += "STANDARD"; break; case 3: text += "VIOLENT"; break; case 4: text += "BRUTAL"; break; case 5: text += "STRAYMODE MUST DIE"; break; } if (__instance.lines) { text += " --"; } if (!Object.op_Implicit((Object)(object)__instance.txt2)) { __instance.txt2 = ((Component)__instance).GetComponent(); } if (Object.op_Implicit((Object)(object)__instance.txt2)) { __instance.txt2.text = text; return false; } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(LevelSelectPanel), "Setup")] public static void SetLevelIcons(LevelSelectPanel __instance) { if (tcenabled) { bool flag = false; if ((Object)(object)__instance.origSprite == (Object)null) { __instance.origSprite = ((Component)((Component)__instance).transform.Find("Image")).GetComponent().sprite; } switch (((Object)__instance.origSprite).name) { case "4-4 Clair de Soleil": flag = true; break; case "2-4 Court of the Corpse King": flag = true; break; case "1-4 Clair de Lune": flag = true; break; } if (flag) { __instance.origSprite = MainCode.FetchFromBundle("MapMods/MapIcons/" + ((Object)__instance.origSprite).name + ".png", autofill: true); } } } [HarmonyPostfix] [HarmonyPatch(typeof(SaveSlotMenu), "ReloadMenu")] [HarmonyPatch(typeof(SaveSlotMenu), "SelectSlot")] [HarmonyPatch(typeof(SaveSlotMenu), "ConfirmReload")] [HarmonyPatch(typeof(SaveSlotMenu), "ConfirmWipe")] [HarmonyPatch(typeof(SaveSlotMenu), "OnEnable")] private static void ResetMenu() { updatedMenu = false; DisplayMenuPopup = false; } [HarmonyPostfix] [HarmonyPatch(typeof(SaveSlotMenu), "OnEnable")] private static void GabeSlotMaker(SaveSlotMenu __instance) { //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown //IL_0110: Unknown result type (might be due to invalid IL or missing references) updatedMenu = false; DisplayMenuPopup = false; bool flag = false; for (int i = 0; i < __instance.slots.Length; i++) { if (__instance.slots[i].slotNumberLabel.text == "STRAYMODE") { flag = true; } } if (!flag) { SlotRowPanel newRow = Object.Instantiate(__instance.templateRow, ((Component)__instance.templateRow).transform.parent); newRow.slotIndex = 1015064006; ((Component)newRow).gameObject.SetActive(true); __instance.UpdateSlotState(newRow, GetSlot(1015064006)); ((UnityEvent)newRow.selectButton.onClick).AddListener((UnityAction)delegate { __instance.SelectSlot(newRow.slotIndex); }); ((UnityEvent)newRow.deleteButton.onClick).AddListener((UnityAction)delegate { __instance.ClearSlot(newRow.slotIndex); }); ((Graphic)newRow.slotNumberLabel).color = Color.yellow; newRow.slotNumberLabel.text = "STRAYMODE"; List list = new List(); list.AddRange(__instance.slots); list.Add(newRow); __instance.slots = list.ToArray(); } } [HarmonyPostfix] [HarmonyPatch(typeof(NewMovement), "Start")] private static void MovementSoundPatch(NewMovement __instance) { //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) if (MonoSingleton.Instance.GetInt("selectedSaveSlot", 0) == 1015064006) { GameProgressMoneyAndGear generalProgress = GameProgressSaver.GetGeneralProgress(); generalProgress.revalt = 0; generalProgress.sho2 = 0; generalProgress.rev1 = 0; generalProgress.nai2 = 0; generalProgress.nai3 = 0; generalProgress.naialt = 0; if (Debugging) { generalProgress.beam0 = 0; } generalProgress.beam1 = 0; generalProgress.beam2 = 0; generalProgress.beam3 = 0; generalProgress.rai1 = 0; generalProgress.rai3 = 0; generalProgress.rock2 = 0; generalProgress.rock3 = 0; generalProgress.shoalt = 0; GameProgressSaver.WriteFile(GameProgressSaver.generalProgressPath, (object)generalProgress); switch (SceneHelper.CurrentScene) { case "Level 0-S": __instance.cc.cam.useOcclusionCulling = false; break; case "Level 1-4": __instance.cc.cam.useOcclusionCulling = false; break; case "CreditsMuseum2": __instance.cc.cam.useOcclusionCulling = false; break; } ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (2)/Filler/Health Slider")).GetComponent().maxValue = 80f; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (2)/Filler/AntiHealth Slider")).GetComponent().minValue = 19f; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (2)/Filler/Supercharge Slider")).GetComponent().minValue = 80f; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (2)/Filler/Supercharge Slider")).GetComponent().maxValue = 160f; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 3")).gameObject.SetActive(false); ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 2/Fill Area/Fill")).GetComponent().sprite = ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 3/Fill Area/Fill")).GetComponent().sprite; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 2/Fill Area/Fill/ReadyFlash")).GetComponent().sprite = ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 3/Fill Area/Fill")).GetComponent().sprite; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 2/Background")).GetComponent().sprite = ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 3/Fill Area/Fill")).GetComponent().sprite; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 2/Fill Area/Fill")).GetComponent().pixelsPerUnitMultiplier = 5.4f; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 2/Fill Area/Fill")).GetComponent().type = (Type)1; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 2/Fill Area/Fill")).GetComponent().fillCenter = true; ((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)").localPosition = new Vector3(46.6357f, -18f, 0f); ((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)").localScale = new Vector3(1.5f, 1f, 1f); ((Behaviour)((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)")).GetComponent()).enabled = false; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/RailcannonChargePanel/Panel")).GetComponent().sprite = MainCode.FetchFromBundle("Textures/UI/lightningboltbigvector.png", autofill: true); ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/RailcannonChargePanel/Panel (2)")).GetComponent().sprite = MainCode.FetchFromBundle("Textures/UI/lightningboltbigvector.png", autofill: true); ReplaceLevels(); CheckSuperDashEquipped(); } } [HarmonyPrefix] [HarmonyPatch(typeof(HealthBar), "Update")] private static bool HealthBarUpdate(HealthBar __instance) { //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: 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_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled) { return true; } if (__instance.hp < (float)__instance.nmov.hp) { __instance.hp = Mathf.MoveTowards(__instance.hp, (float)__instance.nmov.hp, Time.deltaTime * (((float)__instance.nmov.hp - __instance.hp) * 5f + 5f)); } else if (__instance.hp > (float)__instance.nmov.hp) { __instance.hp = __instance.nmov.hp; } if (__instance.hpSliders.Length != 0) { Slider[] hpSliders = __instance.hpSliders; foreach (Slider val in hpSliders) { if (val.value != __instance.hp) { val.value = __instance.hp; } } } if (__instance.afterImageSliders != null) { Slider[] hpSliders = __instance.afterImageSliders; foreach (Slider val2 in hpSliders) { if (val2.value < __instance.hp) { val2.value = __instance.hp; } else if (val2.value > __instance.hp) { val2.value = Mathf.MoveTowards(val2.value, __instance.hp, Time.deltaTime * ((val2.value - __instance.hp) * 5f + 5f)); } } } if ((Object)(object)__instance.antiHpSlider != (Object)null) { if (__instance.antiHpSlider.value != __instance.nmov.antiHp) { __instance.antiHpSlider.value = Mathf.MoveTowards(__instance.antiHpSlider.value, __instance.nmov.antiHp, Time.deltaTime * (Mathf.Abs(__instance.antiHpSlider.value - __instance.nmov.antiHp) * 5f + 5f)); } if ((Object)(object)__instance.antiHpSliderFill != (Object)null) { ((Behaviour)__instance.antiHpSliderFill).enabled = __instance.antiHpSlider.value > 0f; } } if ((Object)(object)__instance.hpText != (Object)null) { if (!__instance.antiHpText) { if (__instance.lastHP != __instance.hp) { __instance.hpText.text = __instance.hp.ToString("F0"); __instance.lastHP = __instance.hp; } if (__instance.changeTextColor) { if (__instance.hp <= 30f) { ((Graphic)__instance.hpText).color = Color.red; return false; } if (__instance.hp <= 50f && __instance.yellowColor) { ((Graphic)__instance.hpText).color = Color.yellow; return false; } ((Graphic)__instance.hpText).color = __instance.normalTextColor; return false; } if (__instance.normalTextColor == Color.white) { if (__instance.hp <= 40f) { ((Graphic)__instance.hpText).color = Color.red; return false; } ((Graphic)__instance.hpText).color = __instance.colorBlindSettings.GetHudColor((HudColorType)4); return false; } } else { if (__instance.difficulty == 0) { __instance.hpText.text = "/160"; return false; } __instance.antiHp = Mathf.MoveTowards(__instance.antiHp, __instance.nmov.antiHp, Time.deltaTime * (Mathf.Abs(__instance.antiHp - __instance.nmov.antiHp) * 5f + 5f)); __instance.antiHp = Mathf.Clamp(__instance.antiHp, 20f, 80f); float num = 100f - __instance.antiHp; if (__instance.lastAntiHP != num) { __instance.hpText.text = "/" + num.ToString("F0"); __instance.lastAntiHP = num; } } } return false; } [HarmonyPostfix] [HarmonyPatch(typeof(Punch), "ParryProjectile")] private static void CustomParries(Punch __instance, Projectile proj) { CustomParryProjectile customParryProjectile = default(CustomParryProjectile); if (((Component)proj).TryGetComponent(ref customParryProjectile)) { customParryProjectile.GetParried(); } } [HarmonyPrefix] [HarmonyPatch(typeof(WeaponPickUp), "GotActivated")] public static void FixPickups(WeaponPickUp __instance) { if (!tcenabled) { return; } GameObject[] array = null; GameObject val = null; if ((Object)(object)__instance.weapon != (Object)null) { string name = ((Object)__instance.weapon).name; if (name != null) { if (name.Contains("Shotgun") && !name.Contains("ShotgunWeapon")) { string text = ((Object)__instance.weapon).name.Replace("Shotgun ", ""); if (text != null) { if (text.Contains("Grenade")) { array = GetWeapon("LaserCore"); } else if (text.Contains("Pump")) { array = GetWeapon("LaserOC"); } } } else if (name.Contains("Nailgun")) { string text2 = ((Object)__instance.weapon).name.Replace("Nailgun ", ""); if (text2 != null) { if (text2.Contains("Magnet")) { array = GetWeapon("SwordC"); } else if (text2.Contains("Overheat")) { array = GetWeapon("SwordT"); } } } else if (name.Contains("ShotgunWeapon")) { array = GetWeapon("VDC"); } else if (name.Contains("Railcannon")) { string text3 = ((Object)__instance.weapon).name.Replace("Railcannon ", ""); if (text3 != null) { if (text3.Contains("Electric")) { array = GetWeapon("VDC"); } else if (text3.Contains("Malicious")) { array = GetWeapon("MDC"); } } } else if (name.Contains("Revolver") && SceneHelper.CurrentScene != "Level 0-1") { string text4 = ((Object)__instance.weapon).name.Replace("Revolver ", ""); if (text4 != null) { if (text4.Contains("Pierce")) { array = GetWeapon("ArmPierce"); } else if (text4.Contains("Ricochet")) { array = GetWeapon("ArmMarks"); } } } } } if (array != null) { val = ((!((Object)__instance.weapon).name.Contains("Alter")) ? array[0] : array[1]); if ((Object)(object)val != (Object)null) { __instance.weapon = val; } } } [HarmonyPrefix] [HarmonyPatch(typeof(Bonus), "OnTriggerEnter")] public static bool FixOverheal(Bonus __instance, Collider other) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Invalid comparison between Unknown and I4 //IL_00ee: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled) { return true; } if (((Component)other).gameObject.CompareTag("Player") && !__instance.activated) { if (!__instance.ghost) { __instance.activated = true; MonoSingleton.Instance.ParryFlash(); StyleHUD instance = MonoSingleton.Instance; StatsManager instance2 = MonoSingleton.Instance; Object.Instantiate(__instance.breakEffect, ((Component)__instance).transform.position, Quaternion.identity); instance.AddPoints(0, "ultrakill.secret", (GameObject)null, (EnemyIdentifier)null, -1, "", ""); instance2.secrets++; instance2.SecretFound(__instance.secretNumber); Object.Destroy((Object)(object)((Component)__instance).gameObject); } else { if (__instance.tutorial) { MonoSingleton.Instance.ParryFlash(); } Object.Instantiate(__instance.breakEffect, ((Component)__instance).transform.position, Quaternion.identity); Object.Destroy((Object)(object)((Component)__instance).gameObject); } if (__instance.superCharge) { if ((int)MonoSingleton.Instance.playerType == 0) { overhealed = true; MonoSingleton.Instance.hp = 160; } else { MonoSingleton.Instance.AddExtraHit(2); } if (!MonoSingleton.Instance.GetBool("hideSuperChargePopup", false)) { MonoSingleton.Instance.SetBool("hideSuperChargePopup", true); MonoSingleton.Instance.SendHudMessage("RED SOUL ORBS give 200 HEALTH. \nOverheal cannot be regained with blood.", "", "", 1, false, false, true); } } else if ((int)MonoSingleton.Instance.playerType == 1) { MonoSingleton.Instance.AddExtraHit(1); } } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(IntroTextController), "Awake")] public static void replaceTutorialText(IntroTextController __instance) { } [HarmonyPostfix] [HarmonyPatch(typeof(GunControl), "UpdateWeaponList")] public static void ReplaceWeaponsCaller(GunControl __instance) { _ = tcenabled; } [HarmonyPrefix] [HarmonyPatch(typeof(GunSetter), "ResetWeapons")] public static bool WeaponOverride(GunSetter __instance, bool firstTime = false) { if (!tcenabled) { return true; } if ((Object)(object)__instance.gunc == (Object)null) { __instance.gunc = ((Component)__instance).GetComponent(); } int num = 5; for (int i = 0; i < Mathf.Min(__instance.gunc.slots.Count, num); i++) { List list = __instance.gunc.slots[i]; foreach (GameObject item in list) { Object.Destroy((Object)(object)item); } list.Clear(); } List list2 = __instance.CheckWeaponOrder("rev"); for (int j = 1; j < 5; j++) { switch (list2.IndexOf(j)) { case 0: __instance.CheckWeapon("rev0", __instance.gunc.slot1, GetWeapon("ArmPierce")); break; case 2: __instance.CheckWeapon("rev2", __instance.gunc.slot1, GetWeapon("ArmMarks")); break; case 1: __instance.CheckWeapon("rev1", __instance.gunc.slot1, GetWeapon("Arm3")); break; } } list2 = __instance.CheckWeaponOrder("sho"); for (int k = 1; k < 5; k++) { switch (list2.IndexOf(k)) { case 0: __instance.CheckWeapon("sho0", __instance.gunc.slot2, GetWeapon("LaserCore")); break; case 1: __instance.CheckWeapon("sho1", __instance.gunc.slot2, GetWeapon("LaserOC")); break; case 2: __instance.CheckWeapon("sho2", __instance.gunc.slot2, GetWeapon("Laser3")); break; } } list2 = __instance.CheckWeaponOrder("nai"); for (int l = 1; l < 5; l++) { switch (list2.IndexOf(l)) { case 0: __instance.CheckWeapon("nai0", __instance.gunc.slot3, GetWeapon("SwordC")); break; case 1: __instance.CheckWeapon("nai1", __instance.gunc.slot3, GetWeapon("SwordT")); break; case 2: __instance.CheckWeapon("nai2", __instance.gunc.slot3, GetWeapon("Sword3")); break; } } list2 = __instance.CheckWeaponOrder("rai"); for (int m = 1; m < 5; m++) { switch (list2.IndexOf(m)) { case 0: __instance.CheckWeapon("rai0", __instance.gunc.slot4, GetWeapon("VDC")); break; case 1: __instance.CheckWeapon("rai1", __instance.gunc.slot4, AddressablesExtensions.ToAssets(__instance.railHarpoon)); break; case 2: __instance.CheckWeapon("rai2", __instance.gunc.slot4, GetWeapon("MDC")); break; } } list2 = __instance.CheckWeaponOrder("rock"); for (int n = 1; n < 5; n++) { switch (list2.IndexOf(n)) { case 0: __instance.CheckWeapon("rock0", __instance.gunc.slot5, GetWeapon("Anch")); break; case 1: __instance.CheckWeapon("rock1", __instance.gunc.slot5, GetWeapon("Anch2")); break; case 2: __instance.CheckWeapon("rock2", __instance.gunc.slot5, AddressablesExtensions.ToAssets(__instance.rocketRed)); break; } } __instance.gunc.UpdateWeaponList(firstTime); if ((Object)(object)__instance.gunc.currentWeapon == (Object)null && ((Component)__instance.gunc).transform.childCount > 0 && !MonoSingleton.Instance.shopping) { __instance.gunc.ForceWeapon(((Component)((Component)__instance.gunc).transform.GetChild(0)).gameObject, true); __instance.gunc.UpdateWeaponIcon(false); } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(StyleHUD), "Update")] public static void NullFreshnessFix(StyleHUD __instance) { if (!tcenabled) { return; } Dictionary dictionary = new Dictionary(); foreach (KeyValuePair item in __instance.weaponFreshness) { if ((Object)(object)item.Key == (Object)null) { dictionary.Add(item.Key, item.Value); } } foreach (KeyValuePair item2 in dictionary) { __instance.weaponFreshness.Remove(item2.Key); } } [HarmonyPrefix] [HarmonyPatch(typeof(GunSetter), "ForceWeapon")] public static bool ForceWeaponOverride(GunSetter __instance, string weaponName) { if (!tcenabled) { return true; } if ((Object)(object)__instance.gunc == (Object)null) { __instance.gunc = ((Component)__instance).GetComponent(); } int num = 0; if (MonoSingleton.Instance.GetInt("weapon." + weaponName, 0) == 2) { num = 1; } switch (weaponName) { case "rev0": __instance.gunc.ForceWeapon(GetWeapon("ArmPierce")[num], true); break; case "rev2": __instance.gunc.ForceWeapon(GetWeapon("ArmMarks")[num], true); break; case "rev1": __instance.gunc.ForceWeapon(AddressablesExtensions.ToAsset(__instance.revolverTwirl[num]), true); break; case "sho0": __instance.gunc.ForceWeapon(GetWeapon("LaserCore")[num], true); break; case "sho1": __instance.gunc.ForceWeapon(GetWeapon("LaserOC")[num], true); break; case "sho2": __instance.gunc.ForceWeapon(AddressablesExtensions.ToAsset(__instance.shotgunRed[num]), true); break; case "nai0": __instance.gunc.ForceWeapon(GetWeapon("SwordC")[num], true); break; case "nai1": __instance.gunc.ForceWeapon(GetWeapon("SwordT")[num], true); break; case "nai2": __instance.gunc.ForceWeapon(AddressablesExtensions.ToAsset(__instance.nailRed[num]), true); break; case "rai0": __instance.gunc.ForceWeapon(GetWeapon("VDC")[num], true); break; case "rai1": __instance.gunc.ForceWeapon(AddressablesExtensions.ToAsset(__instance.railHarpoon[num]), true); break; case "rai2": __instance.gunc.ForceWeapon(GetWeapon("MDC")[num], true); break; case "rock0": __instance.gunc.ForceWeapon(GetWeapon("Anch")[num], true); break; case "rock1": __instance.gunc.ForceWeapon(GetWeapon("Anch2")[num], true); break; case "rock2": __instance.gunc.ForceWeapon(AddressablesExtensions.ToAsset(__instance.rocketRed[num]), true); break; } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(ShopZone), "TurnOff")] public static void FixRevolverAnomaly() { if (tcenabled && Object.op_Implicit((Object)(object)MonoSingleton.Instance)) { MonoSingleton.Instance.ResetWeapons(false); } } [HarmonyPrefix] [HarmonyPatch(typeof(FistControl), "ResetFists")] public static bool resetFistsPatch(FistControl __instance) { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Invalid comparison between Unknown and I4 //IL_007a: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled) { return true; } if (__instance.spawnedArms.Count > 0) { for (int i = 0; i < __instance.spawnedArms.Count; i++) { Object.Destroy((Object)(object)__instance.spawnedArms[i]); } __instance.spawnedArms.Clear(); __instance.spawnedArmNums.Clear(); } if ((MonoSingleton.Instance.GetInt("weapon.arm0", 1) == 1 && (__instance.forcedLoadout == null || (int)__instance.forcedLoadout.arm.blueVariant == 0)) || (__instance.forcedLoadout != null && (int)__instance.forcedLoadout.arm.blueVariant == 1)) { GameObject item = Object.Instantiate(bluearm, ((Component)__instance).transform); __instance.spawnedArms.Add(item); __instance.spawnedArmNums.Add(0); } __instance.CheckFist("arm1"); __instance.CheckFist("arm2"); __instance.CheckFist("arm3"); if (__instance.spawnedArms.Count <= 1 || !MonoSingleton.Instance.GetBool("armIcons", false)) { GameObject[] fistPanels = __instance.fistPanels; for (int j = 0; j < fistPanels.Length; j++) { fistPanels[j].SetActive(false); } } else { GameObject[] fistPanels2 = __instance.fistPanels; for (int k = 0; k < fistPanels2.Length; k++) { fistPanels2[k].SetActive(true); } } __instance.ForceArm(__instance.currentVarNum, false); __instance.UpdateFistIcon(); return false; } [HarmonyPrefix] [HarmonyPatch(typeof(FistControl), "CheckFist")] public static bool checkFistsPatch(FistControl __instance, string name) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Invalid comparison between Unknown and I4 //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Invalid comparison between Unknown and I4 //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Invalid comparison between Unknown and I4 //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 if (!tcenabled) { return true; } if (__instance.forcedLoadout != null) { if (!(name == "arm2")) { if (name == "arm1") { if ((int)__instance.forcedLoadout.arm.redVariant == 1) { __instance.spawnedArmNums.Add(1); GameObject val = Object.Instantiate(redarm, ((Component)__instance).transform); val.AddComponent(); __instance.spawnedArms.Add(val); return false; } if ((int)__instance.forcedLoadout.arm.redVariant == 2) { return false; } } } else { if ((int)__instance.forcedLoadout.arm.greenVariant == 1) { MonoSingleton.Instance.equipped = true; return false; } if ((int)__instance.forcedLoadout.arm.greenVariant == 2) { return false; } } } if (MonoSingleton.Instance.GetInt("weapon." + name, 1) == 1 && GameProgressSaver.CheckGear(name) == 1) { GameObject val2 = null; switch (name) { case "arm1": val2 = Object.Instantiate(redarm, ((Component)__instance).transform); val2.AddComponent(); __instance.spawnedArmNums.Add(1); break; case "arm2": MonoSingleton.Instance.equipped = true; break; case "arm3": val2 = Object.Instantiate(AddressablesExtensions.ToAsset(__instance.goldArm), ((Component)__instance).transform); __instance.spawnedArmNums.Add(3); break; } if ((Object)(object)val2 != (Object)null) { __instance.spawnedArms.Add(val2); } } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(MenuActSelect), "OnEnable")] public static void RemoveAct3(MenuActSelect __instance) { if (tcenabled && ((Object)((Component)__instance).transform).name == "Act III") { __instance.forceOff = true; } } [HarmonyPrefix] [HarmonyPatch(typeof(MenuActSelect), "OnEnable")] public static void UnlockEncores(MenuActSelect __instance) { if (tcenabled && ((Object)((Component)__instance).transform).name.ToLower().Contains("encore")) { __instance.requiredLevels = 20; } } [HarmonyPrefix] [HarmonyPatch(typeof(LayerSelect), "Awake")] public static void RemoveHeresy(LayerSelect __instance) { if (tcenabled && ((Object)((Component)__instance).transform).name == "Layer 6 Heresy" && SceneHelper.CurrentScene == "Main Menu") { ((Component)((Component)__instance).transform.Find("Level Row/1-2 Panel")).gameObject.SetActive(false); if (__instance.childLeaderboards != null && __instance.childLeaderboards.Length != 0) { __instance.childLeaderboards = (LevelSelectLeaderboard[])(object)new LevelSelectLeaderboard[1] { __instance.childLeaderboards[0] }; } __instance.levelAmount = 1; } } [HarmonyPrefix] [HarmonyPatch(typeof(MenuActSelect), "OnEnable")] public static void RemoveHeresy2(MenuActSelect __instance) { if (tcenabled && ((Object)((Component)__instance).transform).name == "Act II" && SceneHelper.CurrentScene == "Main Menu") { __instance.requiredLevels = 14; } } [HarmonyPrefix] [HarmonyPatch(typeof(LeaderboardController), "SubmitLevelScore")] [HarmonyPatch(typeof(LeaderboardController), "SubmitCyberGrindScore")] private static bool DisableLeaderboardSubmissions() { return false; } [HarmonyPostfix] [HarmonyPatch(typeof(NewMovement), "Respawn")] public static void ResetWeaponsStuff() { if (tcenabled) { ResetAllAmmos(ResetWeaponsToo: true, resetShoCharge: true); } } [HarmonyPostfix] [HarmonyPatch(typeof(WeaponCharges), "MaxCharges")] public static void ResetWeaponsStuff2() { if (tcenabled) { ResetAllAmmos(ResetWeaponsToo: false); } } public static void ResetAllAmmos(bool ResetWeaponsToo = true, bool resetShoCharge = false) { if (charges.ContainsKey("anc1charge") && !NoWeaponCooldown.NoCooldown) { charges["anc1charge"].amt = 6f; freezeAnchors = false; } foreach (KeyValuePair charge in charges) { charge.Value.Reset(NoWeaponCooldown.NoCooldown); } if (!ResetWeaponsToo) { return; } foreach (StrayGun armgun in armguns) { armgun.Reset(); } foreach (StrayLaserGun lasergun in laserguns) { lasergun.Reset(); } foreach (Anchor anchor in anchors) { anchor.Reset(); } if (Object.FindObjectsOfType() != null) { Anchor_PhysicsSim[] array = Object.FindObjectsOfType(); for (int i = 0; i < array.Length; i++) { array[i].Pull(); } } } [HarmonyPrefix] [HarmonyPatch(typeof(PlayerActivator), "OnTriggerEnter")] public static void Skip01Thing(PlayerActivator __instance, Collider other) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (tcenabled && ((Component)other).gameObject.CompareTag("Player")) { if (SceneHelper.CurrentScene == "Level 0-1" && !__instance.activated && canTeleportPlayer) { ((Component)MonoSingleton.instance).transform.position = new Vector3(40f, 0f, 380f); canTeleportPlayer = false; } if (SceneHelper.CurrentScene == "Tutorial" && !__instance.activated) { MonoSingleton.instance.SetInt("ShoUseTut", 0); } if (SceneHelper.CurrentScene == "Level 4-1" && !__instance.activated) { MonoSingleton.instance.SetInt("DualRageTut", 0); } } } [HarmonyPrefix] [HarmonyPatch(typeof(RevolverAnimationReceiver), "Click")] public static bool ClickFix(RevolverAnimationReceiver __instance) { if (!tcenabled) { return true; } StraymodeWeaponID straymodeWeaponID = default(StraymodeWeaponID); if (((Component)__instance).TryGetComponent(ref straymodeWeaponID)) { if (Object.op_Implicit((Object)(object)__instance.click)) { AudioSource component = Object.Instantiate(__instance.click).GetComponent(); component.pitch += Random.Range(-0.075f, 0.075f); } return false; } return true; } [HarmonyPrefix] [HarmonyPatch(typeof(GunControl), "ForceWeapon")] public static bool WeaponScriptsAdder(GunControl __instance, GameObject weapon, bool setActive = true) { if (!tcenabled) { return true; } new List(); foreach (List slot in __instance.slots) { for (int i = 0; i < slot.Count; i++) { if (((Object)slot[i]).name == ((Object)weapon).name + "(Clone)" || ((Object)slot[i]).name == ((Object)weapon).name) { if ((Object)(object)__instance.currentWeapon != (Object)null) { __instance.currentWeapon.SetActive(false); } __instance.currentSlotIndex = __instance.slots.IndexOf(slot) + 1; __instance.currentVariationIndex = i; __instance.RetainVariation(__instance.currentSlotIndex - 1, __instance.currentVariationIndex); __instance.currentWeapon = slot[__instance.currentVariationIndex]; if (setActive) { __instance.currentWeapon.SetActive(true); } __instance.aud.Play(); break; } } } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(CoinActivated), "OnTriggerEnter")] public static void Fix11Thing(CoinActivated __instance, Collider other) { ItemIdentifier val = default(ItemIdentifier); if (tcenabled && ((Object)((Component)other).transform).name.Contains("Coin") && ((Component)other).TryGetComponent(ref val)) { __instance.events.Invoke(""); ((Component)other).gameObject.SetActive(false); ((Component)__instance).GetComponent().enabled = false; } } } [HarmonyPatch] public class TerminalPatches { public static int gabrielsPlaceInTheSpawnerArmMenu; public static SpawnableObject gabe; public static void ReplaceWeaponIconAndDesc(Transform t, string name, string desc, WeaponDescriptor icon, int var, float newFontSize = -1f) { ((Component)t.GetChild(2)).GetComponent(); Transform child = t.GetChild(1); Transform parent = t.parent.parent.parent; ((Component)child).GetComponent().sprite = icon.icon; string text = ""; switch (var) { case 0: text = "Blue"; break; case 1: text = "Green"; break; case 2: text = "Red"; break; } Transform val = parent.Find("Variation Info (" + text + ")").Find("Panel"); ((TMP_Text)((Component)parent.Find("Variation Info (" + text + ")/Title")).GetComponent()).text = name; ((TMP_Text)((Component)val.Find("Name")).GetComponent()).text = name; ((TMP_Text)((Component)val.Find("Description")).GetComponent()).text = desc; if (newFontSize != -1f) { ((TMP_Text)((Component)val.Find("Description")).GetComponent()).fontSize = newFontSize; } ((Component)val.Find("Icon Inset/Icon")).GetComponent().sprite = ((Component)child).GetComponent().sprite; } public static void ReplaceWeaponInfo(Transform t, string name, string desc, GameObject newModel = null) { Transform parent = t.parent.parent.parent; Transform val = parent.Find("Info Screen"); Transform obj = parent.Find("Variation Screen"); ((TMP_Text)((Component)val.Find("Title")).GetComponent()).text = name + " Info"; ((TMP_Text)((Component)obj.Find("Title")).GetComponent()).text = name; Transform obj2 = val.Find("Main Window"); ((TMP_Text)((Component)obj2.Find("Name")).GetComponent()).text = name; ((TMP_Text)((Component)obj2.Find("Scroll View/Viewport/Text")).GetComponent()).text = desc; ((Component)obj2.Find("Preview Window/Weapon Model")).gameObject.SetActive(false); } public static void ApplyModificationToIcon(Transform t, string name = "???", Transform descTransform = null, Sprite icon = null, string desc = "") { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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_00fd: Unknown result type (might be due to invalid IL or missing references) ((Component)t.Find("Equipment")).GetComponent().offsetMax = new Vector2(-255f, -10f); ((Component)t.Find("Equipment")).GetComponent().SetSizeWithCurrentAnchors((Axis)0, 70f); ((TMP_Text)((Component)t.Find("Variation Name")).GetComponent()).text = name; ((Component)t.Find("Weapon Icon")).gameObject.SetActive(false); ((Component)descTransform).GetComponent().offsetMin = new Vector2(212.5f, 0f); ((Component)descTransform.Find("Panel/Icon Inset")).gameObject.SetActive(false); ((Component)descTransform.Find("Panel/Name")).GetComponent().offsetMin = new Vector2(0f, -10f); ((Component)descTransform.Find("Panel/Description")).GetComponent().offsetMin = new Vector2(0f, -10f); ((Component)descTransform.Find("Panel/Description")).GetComponent().offsetMax = new Vector2(0f, -65f); ((TMP_Text)((Component)descTransform.Find("Panel/Name")).GetComponent()).text = name; ((TMP_Text)((Component)descTransform.Find("Title")).GetComponent()).text = name; ((TMP_Text)((Component)descTransform.Find("Panel/Description")).GetComponent()).text = desc; ((Component)descTransform.Find("Panel/Purchase Button")).gameObject.SetActive(false); } [HarmonyPrefix] [HarmonyPatch(typeof(ShopZone), "Start")] public static void WaresPatch(ShopZone __instance) { //IL_0092: 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_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Expected O, but got Unknown //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Expected O, but got Unknown //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Expected O, but got Unknown if (!tcenabled || GameProgressSaver.CheckGear("beam0") == 0) { return; } Transform obj = ((Component)__instance).transform.Find("Canvas/Background/Main Panel/Weapons/Weapons Panel/Buttons/ArmButton"); GameObject val = ((obj != null) ? ((Component)obj).gameObject : null); if (!Object.op_Implicit((Object)(object)val)) { return; } RectTransform component = ((Component)((Component)__instance).transform.Find("Canvas/Background/Main Panel/Weapons/Weapons Panel/Buttons")).GetComponent(); ShopButton component2 = Object.Instantiate(val, val.transform.parent).GetComponent(); Object.Destroy((Object)(object)((Component)component2).GetComponent()); ((Component)component2).gameObject.SetActive(true); RectTransform component3 = ((Component)component2).GetComponent(); component.offsetMax = new Vector2(-10f, -95f); component3.anchoredPosition = new Vector2(0f, -210f); ((TMP_Text)((Component)component2).GetComponentInChildren()).text = "Wares"; GameObject gameObject = ((Component)((Component)__instance).transform.Find("Canvas/Background/Main Panel/Weapons/Arm Window")).gameObject; GameObject val2 = Object.Instantiate(gameObject, gameObject.transform.parent); ShopButton[] componentsInChildren = ((Component)component).GetComponentsInChildren(true); foreach (ShopButton val3 in componentsInChildren) { if (!((Object)(object)val3 == (Object)(object)component2)) { List list = val3.toDeactivate.ToList(); list.Add(val2); val3.toDeactivate = list.ToArray(); } } component2.toActivate[0] = val2; ((Object)val2.transform.Find("Variation Screen/Variations/Arm Panel (Blue)")).name = "Ware Panel (Blue)"; ((Object)val2.transform.Find("Variation Screen/Variations/Arm Panel (Red)")).name = "Ware Panel (Red)"; ((Object)val2.transform.Find("Variation Screen/Variations/Arm Panel (Green)")).name = "Ware Panel (Green)"; ((Component)val2.transform.Find("Variation Screen/Variations/Arm Panel (Gold)")).gameObject.SetActive(false); ((Component)val2.transform.Find("Variation Screen/Variations/Ware Panel (Blue)")).GetComponent().weaponName = "beam0"; ((Component)val2.transform.Find("Variation Screen/Variations/Ware Panel (Blue)/Equipment/Equipment Status")).GetComponent().onPressed.AddListener(new UnityAction(CheckSuperDash1Equipped)); ((Component)val2.transform.Find("Variation Screen/Variations/Ware Panel (Blue)/Equipment/Buttons/Previous Button")).GetComponent().onPressed.AddListener(new UnityAction(CheckSuperDash1Equipped)); ((Component)val2.transform.Find("Variation Screen/Variations/Ware Panel (Blue)/Equipment/Buttons/Next Button")).GetComponent().onPressed.AddListener(new UnityAction(CheckSuperDash1Equipped)); ((Component)val2.transform.Find("Variation Screen/Variations/Ware Panel (Red)")).GetComponent().weaponName = "beam1"; ((Component)val2.transform.Find("Variation Screen/Variations/Ware Panel (Green)")).GetComponent().weaponName = "beam2"; ApplyModificationToIcon(val2.transform.Find("Variation Screen/Variations/Ware Panel (Blue)"), "Withered Cloak", val2.transform.Find("Arm Info (Blue)"), null, "Third dash. 0.34 seconds of invincibility during dash. 2 second cooldown."); ApplyModificationToIcon(val2.transform.Find("Variation Screen/Variations/Ware Panel (Green)"), "???", val2.transform.Find("Arm Info (Green)")); ApplyModificationToIcon(val2.transform.Find("Variation Screen/Variations/Ware Panel (Red)"), "???", val2.transform.Find("Arm Info (Red)")); } [HarmonyPostfix] [HarmonyPatch(typeof(VariationInfo), "Start")] public static void ChangeWeaponDescriptions(VariationInfo __instance) { if (!new List { "rev", "sho", "nai", "rai", "rock", "arm" }.Contains(__instance.weaponName.Replace("0", "").Replace("1", "").Replace("2", "") .Replace("3", "")) || !tcenabled) { return; } ReplaceWeaponName(((Component)((Component)__instance).transform.GetChild(2)).GetComponent()); ReplaceWeaponName(((Component)((Component)__instance).transform.parent.parent.Find("Title")).GetComponent()); if (__instance.weaponName.Contains("rev")) { string weaponName = __instance.weaponName; if (weaponName != null) { if (weaponName.Contains("0")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "PIERCING", "Primary fire: Hold to fire. \r\nAlt fire: Fire a bouncy, penetrating beam.", MainCode.FetchFromBundle("Weapons/Descriptors/StrayPistol.asset", autofill: true), 0); } else if (weaponName.Contains("2")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "REFLECTOR", "Alt fire to charge the last fired orb to make it reflect and boost projectiles shot into it. Charged orbs becomes supercharged for a short time, allowing for more combo potential.", MainCode.FetchFromBundle("Weapons/Descriptors/StrayPistol Electric.asset", autofill: true), 1); } else if (weaponName.Contains("1")) { if (GameProgressSaver.CheckGear(__instance.weaponName) > 0) { __instance.ChangeEquipment(0); MonoSingleton.Instance.UpdateWeaponList(false); } ((Component)__instance).gameObject.SetActive(false); } } Log("Replaced Revolver Image!"); } if (__instance.weaponName.Contains("sho")) { string weaponName2 = __instance.weaponName; if (weaponName2 != null) { if (weaponName2.Contains("0")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "ENERGY GRENADE", "PRIMARY FIRE: Fire shotgun pellets in a triangular pattern.\r\nALTERNATE FIRE: Launch a volley of three grenades using 75 ammo.", MainCode.FetchFromBundle("Weapons/Descriptors/StrayLaserGun Alt.asset", autofill: true), 0); } else if (weaponName2.Contains("1")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "OVERCHARGE", "Shoot to slowly charge Alt fire.\nAlt fire fires a powerful, penetrating electricity beam.", MainCode.FetchFromBundle("Weapons/Descriptors/StrayLaserGun Green Alt.asset", autofill: true), 1); } else if (weaponName2.Contains("2")) { if (GameProgressSaver.CheckGear(__instance.weaponName) > 0) { __instance.ChangeEquipment(0); MonoSingleton.Instance.UpdateWeaponList(false); } ((Component)__instance).gameObject.SetActive(false); } } Log("Replaced Shotgun Image!"); } if (__instance.weaponName.Contains("nai")) { string weaponName3 = __instance.weaponName; if (weaponName3 != null) { if (weaponName3.Contains("0")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "CHAINSWORD", "Primary fire: Slash enemies.\r\nDamage is higher with your speed when hitting an enemy.\nSecondary fire: Throw the sword. Thrown swords get stuck in Heavy enemies.", MainCode.FetchFromBundle("Weapons/Descriptors/StraySword.asset", autofill: true), 0); } else if (weaponName3.Contains("1")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "TELEFRAG", "Alt Fire (While looking at an enemy): Teleport into the enemy and slash them, dealing damage.", MainCode.FetchFromBundle("Weapons/Descriptors/StraySword Tele.asset", autofill: true), 1); } else if (weaponName3.Contains("2")) { if (GameProgressSaver.CheckGear(__instance.weaponName) > 0) { __instance.ChangeEquipment(0); MonoSingleton.Instance.UpdateWeaponList(false); } ((Component)__instance).gameObject.SetActive(false); } } Log("Replaced Sword Image!"); } if (__instance.weaponName.Contains("rai")) { string weaponName4 = __instance.weaponName; if (weaponName4 != null) { if (weaponName4.Contains("0")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "V.D.C. CONFIG", "Primary fire: Fire a powerful ball of energy. Projectile explodes on contact with terrain. Recharges even when not equipped.", MainCode.FetchFromBundle("Weapons/Descriptors/StrayCannon.asset", autofill: true), 0); } else if (weaponName4.Contains("2")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "M.D.C. CONFIG", "Primary fire: Fire a powerful, explosive ball of energy. Projectile explodes on contact with objects. Recharges even when not equipped.", MainCode.FetchFromBundle("Weapons/Descriptors/StrayCannon Green.asset", autofill: true), 2); } else if (weaponName4.Contains("1")) { if (GameProgressSaver.CheckGear(__instance.weaponName) > 0) { __instance.ChangeEquipment(0); MonoSingleton.Instance.UpdateWeaponList(false); } ((Component)__instance).gameObject.SetActive(false); } } Log("Replaced Rail Image!"); } if (__instance.weaponName.Contains("rock")) { string weaponName5 = __instance.weaponName; if (weaponName5 != null) { if (weaponName5.Contains("0")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "FREEZEFRAME", "Primary fire: Throw the Anchor. Hold to charge for more velocity. Indirect hits launch enemies. Explodes only on contact with airborne enemies.\r\nSecondary fire: Freeze the Anchor. Multiple frozen Anchors can be active at once.", MainCode.FetchFromBundle("Weapons/Descriptors/StrayAnchor.asset", autofill: true), 0, 18f); } else if (weaponName5.Contains("1")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "S.C.S.", "Secondary fire: Hold to charge. Release to throw a supercharged anchor.", MainCode.FetchFromBundle("Weapons/Descriptors/StrayAnchor Green.asset", autofill: true), 1); } else if (weaponName5.Contains("2")) { if (GameProgressSaver.CheckGear(__instance.weaponName) > 0) { __instance.ChangeEquipment(0); MonoSingleton.Instance.UpdateWeaponList(false); } ((Component)__instance).gameObject.SetActive(false); } } Log("Replaced Rock Image!"); } if (__instance.weaponName.Contains("arm")) { string weaponName6 = __instance.weaponName; if (weaponName6 != null && !weaponName6.Contains("0")) { if (weaponName6.Contains("1")) { ((TMP_Text)((Component)((Component)__instance).transform.parent.parent.parent.Find("Arm Info (Red)").Find("Panel/Description")).GetComponent()).text = "Slow punch with high damage and knockback.\r\n\r\nHold Punch to launch the hammer forward, causing a shockwave that knocks surrounding enemies away."; ((TMP_Text)((Component)((Component)__instance).transform.parent.parent.parent.Find("Arm Info (Red)").Find("Panel/Name")).GetComponent()).text = "PILEDRIVER"; ((TMP_Text)((Component)((Component)__instance).transform.parent.parent.parent.Find("Arm Info (Red)").Find("Title")).GetComponent()).text = "PILEDRIVER"; ((TMP_Text)((Component)((Component)__instance).transform.Find("Variation Name")).GetComponent()).text = "PILEDRIVER"; } else { weaponName6.Contains("2"); } } Log("Replaced Arms Image!"); } bool flag = false; if (!GetWeaponName(__instance.weaponName, shortname: true)) { flag = true; } if (__instance.weaponName.Contains("rev") && __instance.weaponName.Contains("1")) { flag = true; } if (__instance.weaponName.Contains("rai") && __instance.weaponName.Contains("1")) { flag = true; } if (!__instance.weaponName.Contains("rev") && !__instance.weaponName.Contains("rai") && !__instance.weaponName.Contains("arm") && __instance.weaponName.Contains("2")) { flag = true; } if (flag && !Debugging) { if (GameProgressSaver.CheckGear(__instance.weaponName) > 0) { __instance.ChangeEquipment(0); MonoSingleton.Instance.UpdateWeaponList(false); } ((Component)__instance).gameObject.SetActive(false); } if (!__instance.weaponName.Contains("arm")) { ((Component)((Component)__instance).transform.parent.Find("Info and Color Panel/ColorButton")).gameObject.SetActive(false); } switch (__instance.weaponName.Replace("0", "").Replace("1", "").Replace("2", "") .Replace("3", "")) { case "rev": { string desc4 = "DATA:\r\nThe arm of a Stray, with cybernetically modified internals as to allow for carrying more weight. Due to prolonged contact with Hell energy, the flesh on the hand has withered away over time, revealing the bone.\r\nSTRATEGY:\r\n- Primary fire throws fast orbs which pierce up to 3 enemies\r\n- Primary fire orbs can be projectile boosted, turning them into a hitscan beam\r\nPIERCING:\r\n- Alt fire throws a multi-hit beam which can pierce enemies infinitely and bounces off the environment\r\nREFLECTOR\r\n- Alt fire requires at least one primary fire orb to currently be active\r\n- Charges the last fired orb, turning it into a stationary Reflector orb, with similar mechanics to a Coin\r\n- Reflector orbs briefly flash, indicating their Split window, during which shooting at them will split orbs or increase the damage of powerful projectiles"; ReplaceWeaponInfo(((Component)__instance).transform, "Stray Arm", desc4); break; } case "sho": { string desc3 = "DATA:\r\nA crude device created from the corpses of Sentries, left by Machines who were only seeking their legs. Due to being salvaged from damaged parts, combined with parts of old War weapons, the weapon's batteries do not hold enough charge to continuously fire like the Revolvers can.\r\nSTRATEGY:\r\n- Fires projectiles in a triangular spread, dealing a maximum of 2 damage per shot\r\n- Has a limited ammo pool, which recharges over time when not firing, even when not equipped\r\nENERGY GRENADE\r\n- Alt fire fires a burst of three grenades, drawing from the ammo pool\r\n- Grenades can be shot with any hitscan attack\r\n- Grenades can be used in combos with the Reflector\r\nOVERCHARGE\r\n- Primary fire does not draw from ammo pool, but fires slower if Alt fire is ready to be used\r\n- Alt fire charged by firing 6 shots or 3 shots\r\n- Alt fire, when used, expends one battery\r\n- Two batteries are available, both of which recharge over time\r\n- Alt fire fires a piercing, multi-hit electric beam"; ReplaceWeaponInfo(((Component)__instance).transform, "Machineshotgun", desc3); break; } case "nai": { string text = "DATA:\r\nChainsaw sword created by an unknown scraphead, and modified by the Swordscleaner to allow for it to teleport back into its arsenal during and after combat. Through unknown means, it was reprogrammed to instead recall to The Stray.\r\n"; BestiaryData instance = MonoSingleton.Instance; if (instance != null && instance.GetEnemy((EnemyType)8) <= 0) { text = "DATA:\r\nUNKNOWN. NO DATA\r\n"; } text += "STRATEGY:\r\nCHAINSWORD:\r\n- Primary fire does damage depending on speed, but has a cooldown to match; 2.5:6:9 at 20:40:60 u/s, with a cooldown of 0:3.5:7 seconds.\r\n- Secondary fire throws the sword forward, with an 8 second cooldown.\r\n- Thrown swords pierce LIGHT enemies, and embed into HEAVY enemies.\r\n- Embedded swords do 8 damage over 8 seconds in intervals of 0.1 seconds, and can be manually recalled for an extra 2 damage.\r\nTELEFRAG:\r\n- Secondary fire teleports into the enemy you are aiming at, doing 2 damage plus 1 damage for every 10 units of initial distance to the enemy.\r\nADVANCED STRATEGY:\r\nTELEFRAG:\r\n- Teleporting into enemies can be used to get out of sticky situations, such as if falling off the Cybergrind arena.\r\n- Teleporting into enemies can PARRY them."; ReplaceWeaponInfo(((Component)__instance).transform, "Sword", text); break; } case "rai": { string desc2 = "DATA:\r\nUnder construction\r\nSTRATEGY:\r\n- Primary fire shoots a powerful PIERCING/EXPLOSIVE projectile, dealing 10 damage.\r\n- 16 second cooldown for firing.\r\nADVANCED STRATEGY:\r\n- Projectile can be shot into REFLECTOR orbs, REFLECTING FOR MORE DAMAGE or CREATING AN 11 DAMAGE EXPLOSION"; ReplaceWeaponInfo(((Component)__instance).transform, "Displacement Cannon", desc2); break; } case "rock": { string desc = "DATA:\r\nAnchor, wrapped with leather for a stronger grip, wielded by the Young Ferryman and his group. Appears heavily worn from years of combat.\r\nSTRATEGY:\r\nFREEZEFRAME:\r\nHold Primary fire to charge for higher velocity. Release to fire for 4 damage. Alt fire freezes all active Anchors, and allows for throwing multiple. Frozen anchors get supercharged, dealing a 7 damage red explosion upon hitting enemies.\r\nAnchors that hit the ground launch enemies into the air. Anchors that hit falling enemies create a 7 damage explosion.'\r\nS.C.S:\r\n Hold Alt fire to charge for higher velocity. Release to fire an ENERGY anchor for 6 damage. Energy anchors are destroyed when hitting the environment, and bounce off enemies.\r\nADVANCED STRATEGY:\r\nS.C.S' Energy anchors can be shot with hitscans to create an explosion or whiplashed to pull them towards you. Energy anchors can be whiplashed or punched after bouncing off an enemy, allowing for 6 more damage."; ReplaceWeaponInfo(((Component)__instance).transform, "Anchor", desc); break; } } } public static void ReplaceWeaponName(TextMeshProUGUI nameText) { if (!tcenabled) { return; } string text = ((TMP_Text)nameText).text; if (text == null) { return; } switch (text.Length) { case 8: switch (text[0]) { case 'M': if (text == "MARKSMAN") { ((TMP_Text)nameText).text = "REFLECTOR"; } break; case 'S': if (text == "SAWED-ON") { ((TMP_Text)nameText).text = "INDEV"; } break; case 'O': if (text == "OVERHEAT") { ((TMP_Text)nameText).text = "TELEFRAG"; } break; case 'E': if (text == "ELECTRIC") { ((TMP_Text)nameText).text = "V.D.C. CONFIG"; } break; } break; case 11: switch (text[1]) { case 'U': if (text == "PUMP CHARGE") { ((TMP_Text)nameText).text = "OVERCHARGE"; } break; case 'C': if (text == "SCREWDRIVER") { ((TMP_Text)nameText).text = "INDEV"; } break; case 'R': if (text == "FREEZEFRAME") { ((TMP_Text)nameText).text = "FREEZEFRAME"; } break; case 'I': if (text == "FIRESTARTER") { ((TMP_Text)nameText).text = "INDEV"; } break; } break; case 9: switch (text[0]) { case 'A': if (text == "ATTRACTOR") { ((TMP_Text)nameText).text = "CHAINSWORD"; } break; case 'J': if (text == "JUMPSTART") { ((TMP_Text)nameText).text = "INDEV"; } break; case 'M': if (text == "MALICIOUS") { ((TMP_Text)nameText).text = "M.D.C. CONFIG"; } break; } break; case 7: if (text == "PIERCER") { ((TMP_Text)nameText).text = "PIERCING"; } break; case 12: if (text == "SHARPSHOOTER") { ((TMP_Text)nameText).text = "INDEV"; } break; case 10: if (text == "CORE EJECT") { ((TMP_Text)nameText).text = "ENERGY GRENADE"; } break; case 13: if (text == "S.R.S. CANNON") { ((TMP_Text)nameText).text = "S.C.S. ANCHOR"; } break; } } [HarmonyPostfix] [HarmonyPatch(typeof(ShopCategory), "CheckGear")] public static void ChangeCategoryNames(ShopCategory __instance) { if (!tcenabled) { return; } if (!GetWeaponName(__instance.weaponName, shortname: true)) { if (!Debugging) { ((Component)__instance).gameObject.SetActive(false); } } else if (__instance.weaponName.Contains("rev")) { ((TMP_Text)((Component)__instance).GetComponentInChildren()).text = "STRAY ARM"; } else if (__instance.weaponName.Contains("sho")) { ((TMP_Text)((Component)__instance).GetComponentInChildren()).text = "MACHINE SHOTGUN"; } else if (__instance.weaponName.Contains("nai")) { ((TMP_Text)((Component)__instance).GetComponentInChildren()).text = "SWORD"; } else if (__instance.weaponName.Contains("rai")) { ((TMP_Text)((Component)__instance).GetComponentInChildren()).text = "DISPLACEMENT CANNON"; } else if (__instance.weaponName.Contains("rock")) { ((TMP_Text)((Component)__instance).GetComponentInChildren()).text = "ANCHOR"; } } [HarmonyPrefix] [HarmonyPatch(typeof(EnemyInfoPage), "Start")] public static void UpdateInfoThingy(EnemyInfoPage __instance) { SpawnableObjectsDatabase objects = __instance.objects; bool flag = true; SpawnableObject[] enemies = objects.enemies; for (int i = 0; i < enemies.Length; i++) { if ((Object)(object)enemies[i] == (Object)(object)MainCode.FetchFromBundle("PlayerStray_Terminal.asset", autofill: true)) { flag = false; } } if (flag) { SpawnableObject[] array = (SpawnableObject[])(object)new SpawnableObject[objects.enemies.Length + 1]; for (int j = 0; j < array.Length; j++) { if (j < 2) { array[j] = objects.enemies[j]; } if (j == 2) { array[j] = MainCode.FetchFromBundle("PlayerStray_Terminal.asset", autofill: true); } if (j > 2) { array[j] = objects.enemies[j - 1]; } } objects.enemies = array; Log("Injected the Stray into Terminal!"); } if (!tcenabled) { return; } objects.enemies.ToList(); for (int k = 0; k < objects.enemies.Length; k++) { switch (objects.enemies[k].identifier) { case "ultrakill.v2": objects.enemies[k] = MainCode.FetchFromBundle("Enemies/Swordscleaner/V2Straymode.asset", autofill: true); break; case "ultrakill.v2_2": objects.enemies[k] = MainCode.FetchFromBundle("Enemies/Swordscleaner/V2StraymodeSecond.asset", autofill: true); break; case "ultrakill.gabriel": objects.enemies[k] = MainCode.FetchFromBundle("Enemies/Leph/leph.asset", autofill: true); break; } } } [HarmonyPrefix] [HarmonyPatch(typeof(SpawnMenu), "CreateButtons")] public static void ReplaceThings(SpawnMenu __instance, ref SpawnableObject[] list) { bool flag = false; int index = 0; for (int i = 0; i < list.Length; i++) { SpawnableObject val = list[i]; if ((Object)(object)val == (Object)null) { continue; } if (tcenabled) { if (val.identifier == "ultrakill.v2") { list[i] = MainCode.FetchFromBundle("Enemies/Swordscleaner/V2Straymode.asset", autofill: true); flag = true; } if (val.identifier == "ultrakill.v2_2") { list[i] = MainCode.FetchFromBundle("Enemies/Swordscleaner/V2StraymodeSecond.asset", autofill: true); flag = true; } } else { if (val.identifier == "straymode.swordscleaner") { list[i] = Fetch("Assets/Data/Sandbox/Enemies/Machine/V2.asset"); flag = true; } if (val.identifier == "straymode.swordscleaner2") { list[i] = Fetch("Assets/Data/Sandbox/Enemies/Machine/V2 2nd.asset"); flag = true; } } if (val.identifier == "ultrakill.gabriel") { index = (gabrielsPlaceInTheSpawnerArmMenu = i); gabe = val; flag = true; } } if (!flag) { return; } List list2 = list.ToList(); if (Debugging) { Log("pre List: " + string.Join("\r\n ", list2.Select((SpawnableObject obj) => $"{list2.IndexOf(obj)}: identifier: {obj.identifier}"))); } if (tcenabled) { list2.RemoveAt(index); } if (Debugging) { Log("post List: " + string.Join("\r\n ", list2.Select((SpawnableObject obj) => $"{list2.IndexOf(obj)}: identifier: {obj.identifier}"))); } if (!tcenabled) { list2.Add(MainCode.FetchFromBundle("Enemies/Swordscleaner/V2StraymodeSecond.asset", autofill: true)); list2.Add(MainCode.FetchFromBundle("Enemies/Swordscleaner/V2Straymode.asset", autofill: true)); if (!list2.Contains(gabe) && (Object)(object)gabe != (Object)null) { list2.Insert(gabrielsPlaceInTheSpawnerArmMenu, gabe); } } list = list2.ToArray(); } } [HarmonyPatch] public class TipsOfTheDay { public static List newTexts = new List { "The Piercing arm deals locational damage.\r\n\r\nA headshot deals 2x damage.\r\n", "Machine Shotgun mobility:\nThe Machine Shotguns knock you back when firing.\nUse it to your advantage.", "Shooting SHOTGUN CORES at SUPERCHARGED REFLECTOR PROJECTILES makes them explode.", "THROWN SWORDS can get STUCK in Heavy Enemies.", "HITSCAN weapons can be used to hit the machine-shotgun's GRENADES in mid-air to increase damage and blast radius.", "The Machine shotgun's grenade attack can be cancelled by swapping weapons, wasting less ammo.", "If blown too far off the arena, OVERCHARGE's alt-fire is a good way to get back." }; [HarmonyPostfix] [HarmonyPatch(typeof(ShopZone), "Start")] public static void TipsFix(ShopZone __instance) { if (!tcenabled || !((Object)(object)((Component)__instance).transform.Find("Canvas/Background/Main Panel/Tip of the Day/Panel/Text Inset/TipText") != (Object)null)) { return; } TextMeshProUGUI component = ((Component)((Component)__instance).transform.Find("Canvas/Background/Main Panel/Tip of the Day/Panel/Text Inset/TipText")).GetComponent(); string currentScene = SceneHelper.CurrentScene; if (currentScene == null) { return; } switch (currentScene.Length) { case 9: switch (currentScene[8]) { case '2': if (!(currentScene == "Level 0-2")) { if (currentScene == "Level 1-2") { ((TMP_Text)component).text = newTexts[2]; } } else { ((TMP_Text)component).text = newTexts[0]; } break; case '4': switch (currentScene) { case "Level 0-4": ((TMP_Text)component).text = newTexts[1]; break; case "Level 1-4": ((TMP_Text)component).text = newTexts[3]; break; case "Level 4-4": ((TMP_Text)component).text = newTexts[5]; break; } break; case '1': if (currentScene == "Level 4-1") { ((TMP_Text)component).text = newTexts[4]; } break; case '3': break; } break; case 7: if (currentScene == "Endless") { ((TMP_Text)component).text = newTexts[6]; } break; } } } public class StraymodeTargetable : MonoBehaviour { public EnemyIdentifier eid; public BlackHole hole; public Grenade gren; public Collider col; public bool targetable = true; public bool onlyCertainWeapons; public List targetableWeapons = new List(); private CameraController cc; public void FixedUpdate() { //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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) //IL_0141: 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) bool flag = true; if (onlyCertainWeapons && (!targetableWeapons.Contains(((Object)MonoSingleton.Instance.currentWeapon).name.ToLower().Replace("(clone)", "")) || 1 == 0)) { targetable = false; return; } Transform val = ((Component)this).transform; if ((Object)(object)eid != (Object)null) { val = ((!((Object)(object)eid.weakPoint != (Object)null)) ? eid.GetCenter() : eid.weakPoint.transform); } if ((Object)(object)col == (Object)null && !((Component)val).TryGetComponent(ref col)) { if ((Object)(object)((Component)val).GetComponentInChildren() != (Object)null) { col = ((Component)val).GetComponentInChildren(); } else if ((Object)(object)((Component)val).transform.parent != (Object)null && (Object)(object)((Component)val).GetComponentInParent() != (Object)null) { col = ((Component)val).GetComponentInParent(); } } Vector3 position = ((Component)cc).transform.position; Vector3 val2 = val.position - ((Component)cc).transform.position; RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(position, ((Vector3)(ref val2)).normalized, ref val3, Vector3.Distance(((Component)cc).transform.position, val.position), LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)1)))) { if ((Object)(object)((RaycastHit)(ref val3)).transform == (Object)(object)((Component)this).transform || (Object)(object)((RaycastHit)(ref val3)).transform == (Object)(object)((Component)val).transform) { targetable = true; } else { targetable = false; } } else { targetable = true; } } public void AddToTargetables() { if (!allTargetables.Contains(this)) { allTargetables.Add(this); } } public void RemoveFromTargetables() { if (allTargetables.Contains(this)) { allTargetables.Remove(this); } } public void OnEnable() { cc = MonoSingleton.Instance; AddToTargetables(); } public void Start() { AddToTargetables(); } public void OnDisable() { AddToTargetables(); } public void OnDestroy() { AddToTargetables(); } } [HarmonyPatch] public class AutoAimPatches { public enum TargetType { None, BlackHole, Enemy, Grenade } [HarmonyPrefix] [HarmonyPatch(typeof(CameraFrustumTargeter), "Update")] public static bool CFTUpdate(CameraFrustumTargeter __instance) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00b5: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled) { return true; } if (!CameraFrustumTargeter.isEnabled || __instance.maxHorAim == 0f) { __instance.CurrentTarget = null; __instance.IsAutoAimed = false; return false; } Collider currentTarget = null; TargetType targetType = TargetType.None; float num = 999f; float num2 = 999f; float defaultFov = MonoSingleton.Instance.defaultFov; foreach (StraymodeTargetable allTargetable in allTargetables) { if (!allTargetable.targetable || (Object)(object)allTargetable.col == (Object)null) { continue; } float num3 = Vector3.Angle(((Component)allTargetable.col).transform.position - ((Component)__instance.camera).transform.position, ((Component)__instance.camera).transform.forward); if ((Object)(object)allTargetable.hole != (Object)null && num3 < num2 && num3 < __instance.maxHorAim * defaultFov) { num = num3; num2 = num3; currentTarget = allTargetable.col; targetType = TargetType.BlackHole; } if (targetType != TargetType.BlackHole) { if ((Object)(object)allTargetable.eid != (Object)null && !allTargetable.eid.dead && num3 < num && num3 < __instance.maxHorAim * defaultFov) { num = num3; currentTarget = allTargetable.col; targetType = TargetType.Enemy; } if (targetType != TargetType.Enemy && (Object)(object)allTargetable.gren != (Object)null && num3 < num && num3 < __instance.maxHorAim * defaultFov) { num = num3; currentTarget = allTargetable.col; targetType = TargetType.Grenade; } } } __instance.CurrentTarget = currentTarget; __instance.IsAutoAimed = true; return false; } [HarmonyPrefix] [HarmonyPatch(typeof(EnemyIdentifier), "Start")] public static void AutoAimThing(EnemyIdentifier __instance) { if (!tcenabled) { return; } ComponentExtensions.GetOrAddComponent((Component)(object)__instance).eid = __instance; if (__instance.weaknesses == null || __instance.weaknesses.Length == 0) { return; } List list = __instance.weaknesses.ToList(); __instance.weaknessMultipliers.ToList(); for (int i = 0; i < list.Count; i++) { switch (list[i]) { case "nail": list[i] = "straydrill"; break; case "railcannon": list[i] = "vdcBall"; break; case "hammer": list[i] = "straysword"; break; case "hammerzone": if (!list.Contains("shotgunzone")) { list[i] = "shotgunzone"; } else { list[i] = "there's already a fucking shotgunzone weakness lmao fuck you"; } break; } } } [HarmonyPrefix] [HarmonyPatch(typeof(Grenade), "Start")] public static void AutoAimThing(Grenade __instance) { if (tcenabled) { ComponentExtensions.GetOrAddComponent((Component)(object)__instance).gren = __instance; } } [HarmonyPrefix] [HarmonyPatch(typeof(EnemyIdentifier), "Death")] [HarmonyPatch(new Type[] { typeof(bool) })] public static void Pooop(EnemyIdentifier __instance) { if (tcenabled) { if ((Object)(object)((Component)__instance).GetComponentInChildren() != (Object)null && !__instance.dead) { ((Component)__instance).GetComponentInChildren().Pull(); } StraymodeTargetable straymodeTargetable = default(StraymodeTargetable); if (((Component)__instance).TryGetComponent(ref straymodeTargetable)) { Object.Destroy((Object)(object)straymodeTargetable); } } } } [HarmonyPatch] public class EnemyPatches { public class FuckingFerrymanMaterialSetter : MonoBehaviour { private SkinnedMeshRenderer meshrenderer; private Dictionary mats = new Dictionary { { "Ferryman", MainCode.FetchFromBundle("Enemies/Ferry2/Ferryman.mat", autofill: true) }, { "Oar", MainCode.FetchFromBundle("Enemies/Ferry2/Oar.mat", autofill: true) } }; public void Start() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) meshrenderer = ((Component)this).GetComponent(); if ((Object)(object)((Component)this).transform.parent.Find("Armature/Root/Spine_01/Spine_02/Spine_03/Head/Head_End/SkullRed") == (Object)null) { GameObject obj = Object.Instantiate(MainCode.FetchFromBundle("Enemies/Ferry2/SkullRed.prefab", autofill: true), ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform.parent.Find("Armature/Root/Spine_01/Spine_02/Spine_03/Head/Head_End")); ((Object)obj).name = "SkullRed"; obj.transform.localPosition = new Vector3(-0.000245f, 0f, 0f); obj.transform.localRotation = Quaternion.Euler(-110f, 90f, -90f); } } public void FixedUpdate() { for (int i = 0; i < ((Renderer)meshrenderer).materials.Length; i++) { if (!((Object)((Renderer)meshrenderer).materials[i]).name.ToLower().Contains("simplified")) { if (((Object)((Renderer)meshrenderer).materials[i]).name.Contains("Ferryman") && !((Object)((Renderer)meshrenderer).materials[i]).name.Contains("Oar") && (Object)(object)((Renderer)meshrenderer).materials[i].GetTexture("_MainTex") != (Object)(object)mats["Ferryman"].GetTexture("_MainTex")) { ((Renderer)meshrenderer).materials[i].SetTexture("_MainTex", mats["Ferryman"].GetTexture("_MainTex")); Log("Replaced Material for " + (object)((Component)meshrenderer).gameObject); } if (((Object)((Renderer)meshrenderer).materials[i]).name.Contains("Oar") && (Object)(object)((Renderer)meshrenderer).materials[i].GetTexture("_MainTex") != (Object)(object)mats["Oar"].GetTexture("_MainTex")) { ((Renderer)meshrenderer).materials[i].SetTexture("_MainTex", mats["Oar"].GetTexture("_MainTex")); Log("Replaced Material for " + (object)((Component)meshrenderer).gameObject); } } } } } public class FerrymanCloakPickUp : MonoBehaviour { public void Start() { if (GameProgressSaver.CheckGear("beam0") > 0) { Object.Destroy((Object)(object)((Component)this).gameObject); } } public void OnTriggerEnter(Collider other) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (((Component)other).CompareTag("Player") && GameProgressSaver.CheckGear("beam0") == 0) { GameProgressSaver.AddGear("beam0"); if (MonoSingleton.Instance.GetInt("weapon.beam0", 0) == 0) { MonoSingleton.Instance.SetInt("weapon.beam0", 1); } Object.Destroy((Object)(object)((Component)((Component)this).transform.parent.Find("Ferryman")).gameObject); Object.Instantiate(Fetch("Assets/Particles/Breaks/VirtueShatterExplosionless.prefab"), ((Component)this).transform.position, Quaternion.identity); SendHudMessage("WITHERED CLOAK: Press [Dash] for powerful directional lunge.", 1); CheckSuperDashEquipped(); Object.Destroy((Object)(object)((Component)this).gameObject); } } } [HarmonyPrefix] [HarmonyPatch(typeof(EnemyIdentifier), "DeliverDamage")] public static bool DualDamageFix(EnemyIdentifier __instance, GameObject target, Vector3 force, Vector3 hitPoint, float multiplier, bool tryForExplode, float critMultiplier = 0f, GameObject sourceWeapon = null, bool ignoreTotalDamageTakenMultiplier = false, bool fromExplosion = false) { //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Invalid comparison between Unknown and I4 //IL_0450: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Invalid comparison between Unknown and I4 //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Invalid comparison between Unknown and I4 //IL_04f4: Unknown result type (might be due to invalid IL or missing references) //IL_04f7: Invalid comparison between Unknown and I4 //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Invalid comparison between Unknown and I4 //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Invalid comparison between Unknown and I4 //IL_04fc: Unknown result type (might be due to invalid IL or missing references) //IL_04ff: Invalid comparison between Unknown and I4 //IL_045d: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Invalid comparison between Unknown and I4 //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Invalid comparison between Unknown and I4 //IL_05b5: Unknown result type (might be due to invalid IL or missing references) //IL_05f3: Unknown result type (might be due to invalid IL or missing references) //IL_05f8: Unknown result type (might be due to invalid IL or missing references) //IL_05fa: Unknown result type (might be due to invalid IL or missing references) //IL_060d: Expected I4, but got Unknown //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Unknown result type (might be due to invalid IL or missing references) //IL_0643: Unknown result type (might be due to invalid IL or missing references) //IL_064a: Unknown result type (might be due to invalid IL or missing references) //IL_0650: Unknown result type (might be due to invalid IL or missing references) //IL_06e0: Unknown result type (might be due to invalid IL or missing references) //IL_06e7: Unknown result type (might be due to invalid IL or missing references) //IL_06ed: Unknown result type (might be due to invalid IL or missing references) //IL_07de: Unknown result type (might be due to invalid IL or missing references) //IL_07e3: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_0578: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled) { return true; } new string[3] { "strayswordtele", "vdcball", "railcannon" }.Contains(__instance.hitter.ToLower()); _ = EnemyIdentifierDebug.Active; if ((Object)(object)target == (Object)(object)((Component)__instance).gameObject) { EnemyIdentifierIdentifier componentInChildren = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { target = ((Component)componentInChildren).gameObject; } } if ((Object)(object)sourceWeapon != (Object)null) { if (__instance.prioritizeEnemiesUnlessAttacked) { __instance.prioritizeEnemiesUnlessAttacked = false; } if (!__instance.IgnorePlayer && ((__instance.target != null && !__instance.target.isPlayer) || __instance.target == null)) { __instance.target = EnemyTarget.TrackPlayer(); __instance.HandleTargetCheats(); } } if (!ignoreTotalDamageTakenMultiplier) { multiplier *= __instance.totalDamageTakenMultiplier; } multiplier /= __instance.totalHealthModifier; if (__instance.isBoss && __instance.difficulty >= 4) { multiplier = ((__instance.difficulty != 5) ? (multiplier / 1.5f) : (multiplier / 2f)); } if (__instance.weaknesses.Length != 0) { for (int i = 0; i < __instance.weaknesses.Length; i++) { if (__instance.hitter == __instance.weaknesses[i] || (__instance.hitterAttributes.Contains((HitterAttribute)2) && __instance.weaknesses[i] == "electricity")) { multiplier *= __instance.weaknessMultipliers[i]; } } } if (__instance.getFireDamageMultiplier && __instance.burners.Count > 0 && __instance.hitter != "fire" && __instance.hitter != "explosion" && __instance.hitter != "ffexplosion") { multiplier *= 1.5f; } multiplier *= (float)rageCount + 1f; if (__instance.nails.Count > 10) { for (int j = 0; j < __instance.nails.Count - 10; j++) { if ((Object)(object)__instance.nails[j] != (Object)null) { Object.Destroy((Object)(object)((Component)__instance.nails[j]).gameObject); } __instance.nails.RemoveAt(j); } } if (!__instance.beingZapped && __instance.hitterAttributes.Contains((HitterAttribute)2) && __instance.hitter != "aftershock" && (__instance.nailsAmount > 0 || __instance.stuckMagnets.Count > 0 || __instance.touchingWaters.Count > 0)) { __instance.beingZapped = true; foreach (Nail nail in __instance.nails) { if ((Object)(object)nail != (Object)null) { nail.Zap(); } } if (__instance.hitter == "zapper" && multiplier > __instance.health) { multiplier = __instance.health - 0.001f; } __instance.afterShockSourceWeapon = sourceWeapon; __instance.waterOnlyAftershock = __instance.nailsAmount == 0 && __instance.stuckMagnets.Count == 0; if (__instance.hitter == "zap") { __instance.afterShockFromZap = true; } ((MonoBehaviour)__instance).Invoke("AfterShock", 0.5f); } if (__instance.pulledByMagnet && __instance.hitter != "deathzone") { __instance.pulledByMagnet = false; } bool flag = false; EnemyType enemyType = __instance.enemyType; if ((int)enemyType <= 9) { if ((int)enemyType == 1) { goto IL_0585; } if ((int)enemyType != 4) { if ((int)enemyType == 9) { goto IL_0585; } } else { if ((Object)(object)__instance.spider == (Object)null) { __instance.spider = ((Component)__instance).GetComponent(); } if ((Object)(object)__instance.spider == (Object)null) { return false; } bool dead = __instance.dead; if ((__instance.hitter != "explosion" && __instance.hitter != "ffexplosion") || __instance.isGasolined) { __instance.spider.spider.GetHurt(target, force, multiplier, critMultiplier, hitPoint, sourceWeapon, false); } if (__instance.spider.spider.health <= 0f && !dead) { __instance.ProcessDeath(false); } __instance.health = __instance.spider.spider.health; flag = true; } } else if ((int)enemyType <= 21) { if ((int)enemyType != 10) { if ((int)enemyType == 21) { __instance.idol = (Object.op_Implicit((Object)(object)__instance.idol) ? __instance.idol : ((Component)__instance).GetComponent()); if (__instance.HitterCanKillIdol(__instance.hitter)) { Idol idol = __instance.idol; if (!((Object)(object)idol == (Object)null)) { idol.Death(); } } } } else { if ((Object)(object)__instance.wicked == (Object)null) { __instance.wicked = ((Component)__instance).GetComponent(); } if ((Object)(object)__instance.wicked == (Object)null) { return false; } __instance.wicked.GetHit(); flag = true; } } else { if ((int)enemyType == 38) { goto IL_0585; } if ((int)enemyType == 39) { __instance.dcatch = (Object.op_Implicit((Object)(object)__instance.dcatch) ? __instance.dcatch : ((Component)__instance).GetComponent()); if (__instance.HitterCanKillIdol(__instance.hitter) && Object.op_Implicit((Object)(object)__instance.dcatch)) { if (__instance.dcatch.active) { __instance.dcatch.Death(); } else { Object.Instantiate(MonoSingleton.Instance.ineffectiveSound, ((Component)__instance).transform.position, Quaternion.identity); } } } } goto IL_05ec; IL_0585: if ((Object)(object)__instance.drone == (Object)null) { __instance.drone = ((Component)__instance).GetComponent(); } if ((Object)(object)__instance.drone == (Object)null) { return false; } __instance.drone.GetHurt(force, multiplier, sourceWeapon, fromExplosion); __instance.health = __instance.drone.Enemy.health; if (__instance.health <= 0f) { __instance.Death(); } flag = true; goto IL_05ec; IL_05ec: if (!flag) { EnemyClass enemyClass = __instance.enemyClass; switch ((int)enemyClass) { case 0: if ((Object)(object)__instance.zombie == (Object)null) { __instance.zombie = ((Component)__instance).GetComponent(); } if ((Object)(object)__instance.zombie == (Object)null) { return false; } __instance.zombie.GetHurt(target, force, multiplier, critMultiplier, default(Vector3), sourceWeapon, fromExplosion); if (tryForExplode && __instance.zombie.health <= 0f && !__instance.exploded) { __instance.Explode(fromExplosion); } if (__instance.zombie.health <= 0f) { __instance.Death(); } __instance.health = __instance.zombie.health; break; case 1: if ((Object)(object)__instance.machine == (Object)null) { __instance.machine = ((Component)__instance).GetComponent(); } if ((Object)(object)__instance.machine == (Object)null) { return false; } __instance.machine.GetHurt(target, force, multiplier, critMultiplier, default(Vector3), sourceWeapon, fromExplosion); if (tryForExplode && __instance.machine.health <= 0f && ((Object)(object)__instance.machine.symbiote == (Object)null || __instance.machine.symbiote.health <= 0f) && !__instance.machine.dontDie && !__instance.exploded) { __instance.Explode(fromExplosion); } if (__instance.machine.health <= 0f && ((Object)(object)__instance.machine.symbiote == (Object)null || __instance.machine.symbiote.health <= 0f)) { __instance.Death(); } __instance.health = __instance.machine.health; break; case 2: if ((Object)(object)__instance.statue == (Object)null) { __instance.statue = ((Component)__instance).GetComponent(); } if ((Object)(object)__instance.statue == (Object)null) { return false; } __instance.statue.GetHurt(target, force, multiplier, critMultiplier, hitPoint, sourceWeapon, fromExplosion); if (tryForExplode && __instance.statue.health <= 0f && !__instance.exploded) { __instance.Explode(fromExplosion); } if (__instance.statue.health <= 0f) { __instance.Death(); } __instance.health = __instance.statue.health; break; } } __instance.hitterAttributes.Clear(); return false; } [HarmonyPrefix] [HarmonyPatch(typeof(V2), "LateUpdate")] private static bool LateUpdateFix(V2 __instance) { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: 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_01ef: 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_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_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_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_027d: 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_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) bool flag = ((Object)((Component)__instance).transform).name.Contains("Streetcleaner Enemy Nonboss Variant") || ((Object)((Component)__instance).transform).name.Contains("Streetcleaner Enemy Second Nonboss"); if (!tcenabled && !flag) { return true; } if (__instance.eid.overrideFullName != "SWORDSCLEANER") { return true; } if (__instance.target == null) { return false; } if ((__instance.active && __instance.aiming) || __instance.escaping) { if (__instance.difficulty <= 1) { __instance.predictAmount = 0f; } Vector3 position = __instance.target.position; if (__instance.target.isPlayer) { position = ((Component)MonoSingleton.Instance).transform.position; } Rigidbody val = __instance.eid.target.rigidbody; if (__instance.escaping) { __instance.predictAmount = 0f; position = __instance.escapeTarget.position; } else if (Object.op_Implicit((Object)(object)__instance.overrideTarget)) { __instance.predictAmount = 0.05f * (Vector3.Distance(__instance.overrideTarget.position, ((Component)__instance).transform.position) / 20f); position = __instance.overrideTarget.position; val = __instance.overrideTargetRb; } else if (Vector3.Distance(((Component)__instance).transform.position, __instance.targetPos) < 8f) { __instance.predictAmount *= 0.2f; } try { if (__instance.aimAtTarget.Length == 1 && __instance.aimAtGround) { __instance.aimAtTarget[0].LookAt(position + val.velocity * (Vector3.Distance(position, __instance.aimAtTarget[0].position) * (__instance.predictAmount / 10f))); } else { __instance.aimAtTarget[0].LookAt(position + val.velocity * (Vector3.Distance(position, __instance.aimAtTarget[0].position) * (__instance.predictAmount / 10f))); } } catch { Debug.Log((object)"aaa"); throw; } if (__instance.aimAtTarget.Length > 1) { Quaternion rotation = ((!__instance.aimAtGround) ? Quaternion.LookRotation(position + val.velocity * __instance.predictAmount - __instance.aimAtTarget[1].position, Vector3.up) : Quaternion.LookRotation(((Component)val).transform.position + val.velocity * __instance.predictAmount - __instance.aimAtTarget[1].position, Vector3.up)); __instance.aimAtTarget[1].rotation = rotation; } } return false; } [HarmonyPostfix] [HarmonyPatch(typeof(V2), "Awake")] private static void ReplaceFuckingModelBecauseICantReplaceTheStupidFuckingRoomInFuckingFourDashFourClairDesoleilLevelIFuckingHateMakingUltrakillModsPleaseFuckingKillMe(V2 __instance) { //IL_00a2: 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) EnemyIdentifier val = default(EnemyIdentifier); bool flag = ((Object)((Component)__instance).transform).name.Contains("Streetcleaner Enemy Second Nonboss") && ((Component)__instance).TryGetComponent(ref val) && val.overrideFullName == "SWORDSCLEANER" && __instance.secondEncounter; if ((tcenabled || flag) && (SceneHelper.CurrentScene == "Level 4-4" || flag)) { if (Object.op_Implicit((Object)(object)((Component)__instance).transform.Find("Streetcleaner Enemy Rig Second Fight(Clone)"))) { Object.Destroy((Object)(object)((Component)((Component)__instance).transform.Find("Streetcleaner Enemy Rig Second Fight(Clone)")).gameObject); } GameObject val2 = Object.Instantiate(MainCode.FetchFromBundle("Enemies/Swordscleaner/Streetcleaner Enemy Rig Second Fight.prefab", autofill: true), ((Component)__instance).transform.position, ((Component)__instance).transform.rotation, ((Component)__instance).transform); ((Component)__instance).GetComponent().overrideCenter = val2.transform.Find("Armature/spine1"); ((Component)__instance).GetComponent().overrideFullName = "SWORDSCLEANER"; __instance.aimAtTarget = (Transform[])(object)new Transform[2] { val2.transform.Find("Armature/spine1/spine2"), val2.transform.Find("Armature/spine1/spine2/spine3/clavicle.R/upperarm.R/lowerarm.R/hand.R/Guns") }; __instance.weapons = (GameObject[])(object)new GameObject[3] { ((Component)val2.transform.Find("Armature/spine1/spine2/spine3/clavicle.R/upperarm.R/lowerarm.R/hand.R/Guns/Revolver")).gameObject, ((Component)val2.transform.Find("Armature/spine1/spine2/spine3/clavicle.R/upperarm.R/lowerarm.R/hand.R/Guns/Shotgun")).gameObject, ((Component)val2.transform.Find("Armature/spine1/spine2/spine3/clavicle.R/upperarm.R/lowerarm.R/hand.R/Guns/Revolver (1)")).gameObject }; BossHealthBar val3 = default(BossHealthBar); if (((Component)__instance).TryGetComponent(ref val3)) { val3.bossName = "SWORDSCLEANER"; } ((Enemy)((Component)__instance).GetComponent()).chest = ((Component)val2.transform.Find("Armature/spine1/spine2/spine3")).gameObject; if (!flag) { ((Component)((Component)__instance).transform.Find("v2_GreenArm")).gameObject.SetActive(false); } ((Component)__instance).GetComponent().weakPoint = ((Component)val2.transform.Find("Armature/spine1/spine2/spine3/neck")).gameObject; __instance.anim = val2.GetComponent(); ((Enemy)((Component)__instance).GetComponent()).anim = val2.GetComponent(); } } [HarmonyPostfix] [HarmonyPatch(typeof(V2), "Start")] public static void InstantlyFuckingEnrageV2InFourDashFourClairDeSoleilBecauseIFuckingHatePeopleEnjoyingMyMod(V2 __instance) { if (tcenabled && SceneHelper.CurrentScene == "Level 4-4") { __instance.Enrage(); } } [HarmonyPrefix] [HarmonyPatch(typeof(EnemyRevolver), "Update")] public static bool RocketLauncherPitchFix(EnemyRevolver __instance) { //IL_0098: 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_00ad: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled) { return true; } if (((Object)((Component)__instance).transform).name != "SwordsCleaner Revolver") { return true; } if (__instance.charging) { float num = 2f; if (__instance.difficulty == 1) { num = 1.5f; } if (__instance.difficulty == 0) { num = 1f; } __instance.chargeAmount = Mathf.MoveTowards(__instance.chargeAmount, 1f, Time.deltaTime * num * __instance.speedMultiplier); __instance.altChargeAud.pitch = __instance.chargeAmount * 1.5f; __instance.altCharge.transform.localScale = Vector3.one * __instance.chargeAmount * 10f; } return false; } [HarmonyPostfix] [HarmonyPatch(typeof(MinosBoss), "Start")] private static void phase2Start(MinosBoss __instance) { if (tcenabled && SceneHelper.CurrentScene == "Level 2-4") { __instance.ShutEye(0); __instance.ShutEye(1); __instance.phase = 2; __instance.SpawnParasites(); } } [HarmonyPrefix] [HarmonyPatch(typeof(MinosBoss), "PhaseChange")] private static bool phaseChangeChange(MinosBoss __instance, int targetPhase) { if (!tcenabled) { return true; } if (SceneHelper.CurrentScene == "Level 2-4" && targetPhase == 3) { __instance.phase = 3; Animator anim = __instance.anim; anim.speed *= 1.2f; __instance.inPhaseChange = false; __instance.inAction = true; __instance.anim.Play("PhaseParasite"); ((Component)MapModificationsLoaderProxy.GetMod("2-4 Mods").transform.Find("StencilApplier")).gameObject.SetActive(true); return false; } return true; } [HarmonyPostfix] [HarmonyPatch(typeof(MinosBoss), "Update")] private static void UpdatePatchForMinos(MinosBoss __instance) { if (!tcenabled || SceneHelper.CurrentScene != "Level 2-4") { return; } if (Object.op_Implicit((Object)(object)__instance.stat) && __instance.stat.health < __instance.originalHealth / 2f && __instance.phase < 3 && !__instance.anim.IsInTransition(0)) { __instance.inPhaseChange = true; __instance.PhaseChange(3); } if (__instance.phase == 3) { ParticleSystem[] componentsInChildren = ((Component)MapModificationsLoaderProxy.GetMod("2-4 Mods").transform).GetComponentsInChildren(); foreach (ParticleSystem obj in componentsInChildren) { obj.emissionRate = Mathf.MoveTowards(obj.emissionRate, 30f, Time.deltaTime * 15f); } ((Component)MapModificationsLoaderProxy.GetMod("2-4 Mods").transform.Find("WeatherEffect")).GetComponent().volume = Mathf.MoveTowards(((Component)MapModificationsLoaderProxy.GetMod("2-4 Mods").transform.Find("WeatherEffect")).GetComponent().volume, 0.5f, Time.deltaTime); } } [HarmonyPostfix] [HarmonyPatch(typeof(ScatterRigidbodies), "Start")] public static void ThisIsAStupidFuckingPatch() { if (tcenabled && SceneHelper.CurrentScene == "Level 2-4") { ((Component)MapModificationsLoaderProxy.GetMod("2-4 Mods").transform.Find("WeatherEffect")).gameObject.SetActive(true); ((Component)MapModificationsLoaderProxy.GetMod("2-4 Mods").transform.Find("StencilApplier")).GetComponent().masterShader = MainShader; ((Component)MapModificationsLoaderProxy.GetMod("2-4 Mods").transform.Find("StencilApplier")).GetComponent().Start(); ((Component)MapModificationsLoaderProxy.GetMod("2-4 Mods").transform.Find("StencilApplier")).GetComponent().LateStart(); ((Component)MapModificationsLoaderProxy.GetMod("2-4 Mods").transform.Find("StencilApplier")).GetComponent().EnableRain(true); } } [HarmonyPrefix] [HarmonyPatch(typeof(Ferryman), "OnEnable")] public static void DelayEnd(Ferryman __instance) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown if (tcenabled && SceneHelper.CurrentScene == "Level 5-2" && (Object)(object)((Component)__instance).transform.parent.parent.Find("FightEnd") != (Object)null) { ((Component)((Component)__instance).transform).GetComponent().onDeath.RemoveListener(new UnityAction(((Component)((Component)__instance).transform.parent.parent.Find("Arena 2")).GetComponent().Activate)); } } [HarmonyPrefix] [HarmonyPatch(typeof(Ferryman), "OnDeath")] public static void MakeDeathCutsceneThing(Ferryman __instance) { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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) if (tcenabled) { if (SceneHelper.CurrentScene == "Level 5-2") { ((Component)((Component)__instance).transform.parent.parent.Find("Arena 2")).GetComponent().ActivateDelayed(4.44f); FindObjectEvenIfDisabled("8 - Ship", "Ship Nonstuff/Music/BossMusic 3").SetActive(false); FindObjectEvenIfDisabled("8 - Ship", "Ship Nonstuff/Music/BossMusic 2").SetActive(false); FindObjectEvenIfDisabled("8 - Ship", "Ship Nonstuff/Music/BossMusic 1").SetActive(false); GameObject obj = Object.Instantiate(MainCode.FetchFromBundle("Enemies/Ferry2/FakeFerryman.prefab", autofill: true), ((Component)__instance).transform.position, ((Component)__instance).transform.rotation, ((Component)__instance).transform.parent); ((Component)obj.GetComponentInChildren(true)).gameObject.AddComponent(); obj.transform.rotation = ((Component)__instance).transform.rotation; Object.Destroy((Object)(object)((Component)__instance).gameObject); } } } } [HarmonyPatch] public static class StylePatches { [HarmonyPrefix] [HarmonyPatch(typeof(StyleCalculator), "HitCalculator")] public static bool HitCalcPatch(StyleCalculator __instance, string hitter, string enemyType, string hitLimb, bool dead, EnemyIdentifier eid = null, GameObject sourceWeapon = null) { if (!tcenabled) { return true; } if (!MonoSingleton.Instance.idNameDict.ContainsKey("straymode.revhit")) { MonoSingleton.Instance.idNameDict.Add("straymode.revhit", ""); MonoSingleton.Instance.idNameDict.Add("straymode.swordhit", ""); MonoSingleton.Instance.idNameDict.Add("straymode.drillpull", ""); MonoSingleton.Instance.idNameDict.Add("straymode.drillhit", ""); MonoSingleton.Instance.idNameDict.Add("straymode.swordkilltf", "TELEFRAG"); MonoSingleton.Instance.idNameDict.Add("straymode.anchorkill", "MOOR"); MonoSingleton.Instance.idNameDict.Add("straymode.anchorhit", ""); } switch (hitter) { default: if (hitter == null) { break; } if (!hitter.Contains("punch")) { switch (hitter) { case "vdcBall": __instance.enemiesShot = true; if (dead) { if (enemyType == "spider") { __instance.AddPoints(100, "ultrakill.bigkill", eid, sourceWeapon); } else { __instance.AddPoints(45, "ultrakill.kill", eid, sourceWeapon); } __instance.gc.AddKill(); } else { __instance.AddPoints(40, "ultrakill.explosionhit", eid, sourceWeapon); } break; case "projectile": if (dead) { __instance.AddPoints(250, "ultrakill.friendlyfire", eid, sourceWeapon); __instance.gc.AddKill(); } else { __instance.AddPoints(200, "ultrakill.friendlyfire", eid, sourceWeapon); } break; case "ffexplosion": if (dead) { __instance.AddPoints(250, "ultrakill.friendlyfire", eid, sourceWeapon); __instance.AddPoints(0, "ultrakill.exploded", eid, sourceWeapon); __instance.gc.AddKill(); } else { __instance.AddPoints(200, "ultrakill.friendlyfire", eid, sourceWeapon); } break; case "explosion": if (dead) { __instance.AddPoints(45, "ultrakill.exploded", eid, sourceWeapon); __instance.gc.AddKill(); } else { __instance.AddPoints(15, "ultrakill.explosionhit", eid, sourceWeapon); } break; case "explosionNuke": if (dead) { __instance.AddPoints(60, "ultrakill.exploded", eid, sourceWeapon); __instance.gc.AddKill(); } else { __instance.AddPoints(30, "ultrakill.explosionhit", eid, sourceWeapon); } break; case "fire": if (dead) { __instance.AddPoints(20, "FRIED", eid, sourceWeapon); __instance.gc.AddKill(); } else { __instance.AddPoints(2, "ultrakill.firehit", eid, sourceWeapon); } break; case "railcannon": __instance.enemiesShot = true; if (dead) { if (enemyType == "spider") { __instance.AddPoints(100, "ultrakill.bigkill", eid, sourceWeapon); } else { __instance.AddPoints(45, "ultrakill.kill", eid, sourceWeapon); } __instance.gc.AddKill(); } else { __instance.AddPoints(15, "", eid, sourceWeapon); } break; case "strayanch": __instance.enemiesShot = true; if (dead) { if (enemyType == "spider") { __instance.AddPoints(100, "straymode.anchorkill", eid, sourceWeapon); } else { __instance.AddPoints(45, "ultrakill.kill", eid, sourceWeapon); } __instance.gc.AddKill(); } else { __instance.AddPoints(25, "straymode.anchorhit", eid, sourceWeapon); } break; } break; } __instance.enemiesShot = true; if (dead) { if (hitLimb == "head" || hitLimb == "limb") { __instance.AddPoints(60, "ultrakill.criticalpunch", eid, sourceWeapon); } else if (enemyType == "spider") { __instance.AddPoints(150, "ultrakill.bigfistkill", eid, sourceWeapon); } else { __instance.AddPoints(30, "ultrakill.kill", eid, sourceWeapon); } __instance.gc.AddKill(); } else if (enemyType == "spider") { __instance.AddPoints(60, "ultrakill.disrespect", eid, sourceWeapon); } else { __instance.AddPoints(20, "", eid, sourceWeapon); } break; case "shotgun": __instance.enemiesShot = true; if (dead) { if (enemyType == "spider") { __instance.AddPoints(100, "ultrakill.bigkill", eid, sourceWeapon); } else { __instance.AddPoints(45, "ultrakill.kill", eid, sourceWeapon); } __instance.gc.AddKill(); } else { __instance.AddPoints(5, "ultrakill.shotgunhit", eid, sourceWeapon); } break; case "revolver": __instance.enemiesShot = true; if (dead) { if (enemyType == "spider") { __instance.AddPoints(100, "ultrakill.bigkill", eid, sourceWeapon); } else { __instance.AddPoints(45, "ultrakill.kill", eid, sourceWeapon); } __instance.gc.AddKill(); } else { if (!MonoSingleton.Instance.freshnessDecayMultiplierDict.ContainsKey("straymode.revhit")) { MonoSingleton.Instance.freshnessDecayMultiplierDict.Add("straymode.revhit", 1.2f); } __instance.AddPoints(60, "straymode.revhit", eid, sourceWeapon); } break; case "straysword": __instance.enemiesShot = true; if (dead) { if (enemyType == "spider") { __instance.AddPoints(100, "ultrakill.bigkill", eid, sourceWeapon); } else { __instance.AddPoints(45, "ultrakill.kill", eid, sourceWeapon); } __instance.gc.AddKill(); } else { if (!MonoSingleton.Instance.freshnessDecayMultiplierDict.ContainsKey("straymode.swordhit")) { MonoSingleton.Instance.freshnessDecayMultiplierDict.Add("straymode.swordhit", 1f); } __instance.AddPoints(40, "straymode.swordhit", eid, sourceWeapon); } break; case "strayswordtele": __instance.enemiesShot = true; if (dead) { if (enemyType == "spider") { __instance.AddPoints(100, "ultrakill.bigkill", eid, sourceWeapon); } else { __instance.AddPoints(45, "ultrakill.kill", eid, sourceWeapon); } if (!MonoSingleton.Instance.freshnessDecayMultiplierDict.ContainsKey("straymode.swordkilltf")) { MonoSingleton.Instance.freshnessDecayMultiplierDict.Add("straymode.swordkilltf", 2f); } __instance.AddPoints((int)(150f * ((enemyType == "spider") ? 1f : 0.5f)), "straymode.swordkilltf", eid, sourceWeapon); __instance.gc.AddKill(); } else { if (!MonoSingleton.Instance.freshnessDecayMultiplierDict.ContainsKey("straymode.swordhit")) { MonoSingleton.Instance.freshnessDecayMultiplierDict.Add("straymode.swordhit", 1f); } __instance.AddPoints(40, "straymode.swordhit", eid, sourceWeapon); } break; case "straydrillpierce": __instance.enemiesShot = true; if (dead) { if (enemyType == "spider") { __instance.AddPoints(100, "ultrakill.bigkill", eid, sourceWeapon); } else { __instance.AddPoints(44, "ultrakill.kill", eid, sourceWeapon); MonoSingleton.Instance.AddPoints(1, "ultrakill.explosionhit", (GameObject)null, eid, -1, "PENETRATED", ""); } __instance.gc.AddKill(); } else { __instance.AddPoints(40, "straymode.swordhit", eid, sourceWeapon); } break; case "straydrillpull": __instance.enemiesShot = true; if (dead) { if (enemyType == "spider") { __instance.AddPoints(99, "ultrakill.bigkill", eid, sourceWeapon); } else { __instance.AddPoints(44, "ultrakill.kill", eid, sourceWeapon); } MonoSingleton.Instance.AddPoints(1, "ultrakill.explosionhit", (GameObject)null, eid, -1, "UNSTABBED", ""); __instance.gc.AddKill(); } else { if (!MonoSingleton.Instance.freshnessDecayMultiplierDict.ContainsKey("straymode.drillpull")) { MonoSingleton.Instance.freshnessDecayMultiplierDict.Add("straymode.drillpull", 1.2f); } __instance.AddPoints(100, "straymode.drillpull", eid, sourceWeapon); } break; case "straydrill": __instance.enemiesShot = true; if (dead) { if (enemyType == "spider") { __instance.AddPoints(100, "ultrakill.bigkill", eid, sourceWeapon); } else { __instance.AddPoints(45, "ultrakill.kill", eid, sourceWeapon); } __instance.gc.AddKill(); } else { __instance.AddPoints(4, "ultrakill.drillhit", eid, sourceWeapon); } break; } if (dead && !eid.puppet && hitter != "secret") { __instance.AddToMultiKill(sourceWeapon); } return false; } } [HarmonyPatch] public static class HookArmPatches { [HarmonyPrefix] [HarmonyPatch(typeof(HookArm), "Start")] public static void ReplaceHookArm(HookArm __instance) { //IL_003c: 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) if (tcenabled) { StraymodeWeaponID straymodeWeaponID = default(StraymodeWeaponID); if (!((Component)__instance).TryGetComponent(ref straymodeWeaponID)) { GameObject val = Object.Instantiate(((Component)MainCode.FetchFromBundle("Weapons/Hook Arm.prefab", autofill: true).transform.Find("HookArm")).gameObject, ((Component)__instance).transform.position, ((Component)__instance).transform.rotation, ((Component)__instance).transform); MainCode.FetchFromBundle("Weapons/Hook Arm.prefab", autofill: true).GetComponent(); Object.Destroy((Object)(object)__instance.model); __instance.model = val; __instance.hookModel = ((Component)val.transform.Find("Spear__1_")).gameObject; __instance.hand = val.transform.Find("Armature/Bone/Bone.001/Line Mid 2"); __instance.hook = val.transform.Find("Armature/Bone/Bone.001/Bone.002"); __instance.inspectLr = ((Component)val.transform.Find("Armature/Bone/Bone.001")).GetComponent(); __instance.throwSound = MainCode.FetchFromBundle("Sounds/HookArmThrow.prefab", autofill: true); __instance.hitSound = MainCode.FetchFromBundle("Sounds/HookArmHit.prefab", autofill: true); __instance.pullSound = MainCode.FetchFromBundle("Sounds/HookArmPull.prefab", autofill: true); __instance.pullDoneSound = MainCode.FetchFromBundle("Sounds/HookArmPullDone.prefab", autofill: true); __instance.catchSound = MainCode.FetchFromBundle("Sounds/HookArmCatch.prefab", autofill: true); __instance.errorSound = MainCode.FetchFromBundle("Sounds/HookArmError.prefab", autofill: true); __instance.wooshSound = MainCode.FetchFromBundle("Sounds/HookArmWoosh.prefab", autofill: true); __instance.throwLoop = MainCode.FetchFromBundle("Sounds/ChainLoop.ogg", autofill: true); __instance.pullLoop = MainCode.FetchFromBundle("Sounds/ChainLoop1.ogg", autofill: true); ((Renderer)((Component)__instance).GetComponent()).material = MainCode.FetchFromBundle("Weapons/Material/chain1big.mat", autofill: true); LineRenderer component = ((Component)__instance).GetComponent(); component.widthMultiplier *= 2f; ((Renderer)__instance.inspectLr).material = MainCode.FetchFromBundle("Weapons/Material/chain1big.mat", autofill: true); LineRenderer inspectLr = __instance.inspectLr; inspectLr.widthMultiplier *= 2f; } } } [HarmonyPrefix] [HarmonyPatch(typeof(HookArm), "Update")] public static bool HAKITAIFUCKINGHATEYOUCANYOUPLEASESTOPHARDCODINGRANDOMSHITTODORANDOMOTHERSHITIMTRYINGTOMODYOURFUCKINGGAMEYOUFUCK(HookArm __instance) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Invalid comparison between Unknown and I4 //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Invalid comparison between Unknown and I4 //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: 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_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0218: 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_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_058f: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Unknown result type (might be due to invalid IL or missing references) //IL_059f: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_0477: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_04f4: Unknown result type (might be due to invalid IL or missing references) //IL_04fe: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0297: 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_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled) { return true; } if ((Object)(object)__instance.anim != (Object)(object)__instance.model.GetComponent()) { Object.Destroy((Object)(object)((Component)__instance).GetComponent()); Object.Destroy((Object)(object)__instance.anim); __instance.anim = __instance.model.GetComponent(); } ((Component)__instance.hand).transform.localPosition = new Vector3(-0.00194f, 0.00484f, -0.00016f); __instance.aud.volume = 0.7f; if (!Object.op_Implicit((Object)(object)MonoSingleton.Instance) || MonoSingleton.Instance.paused) { return false; } if (!__instance.equipped || MonoSingleton.Instance.shopping || !MonoSingleton.Instance.activated) { if ((int)__instance.state != 0 || __instance.returning) { __instance.Cancel(); } __instance.model.SetActive(false); return false; } if (MonoSingleton.Instance.InputSource.Hook.WasPerformedThisFrame) { if ((int)__instance.state == 3) { __instance.StopThrow(0f, false); } else if (__instance.cooldown <= 0f) { __instance.ResetTraversals(); __instance.cooldown = 0.5f; __instance.model.SetActive(true); if (!__instance.forcingFistControl) { if (Object.op_Implicit((Object)(object)MonoSingleton.Instance.currentPunch)) { MonoSingleton.Instance.currentPunch.CancelAttack(); } FistControl instance = MonoSingleton.Instance; instance.forceNoHold++; __instance.forcingFistControl = true; ((Component)MonoSingleton.Instance).transform.localRotation = Quaternion.identity; if (MonoSingleton.Instance.fistCooldown > 0.1f) { MonoSingleton.Instance.fistCooldown = 0.1f; } } ((Renderer)__instance.lr).enabled = true; __instance.hookPoint = ((Component)__instance).transform.position; __instance.previousHookPoint = __instance.hookPoint; Vector3 val; if (Object.op_Implicit((Object)(object)__instance.targeter.CurrentTarget) && __instance.targeter.IsAutoAimed) { Bounds bounds = __instance.targeter.CurrentTarget.bounds; val = ((Bounds)(ref bounds)).center - ((Component)__instance).transform.position; __instance.throwDirection = ((Vector3)(ref val)).normalized; } else { __instance.throwDirection = ((Component)__instance).transform.forward; } __instance.returning = false; if (__instance.caughtObjects.Count > 0) { foreach (Rigidbody caughtObject in __instance.caughtObjects) { if (Object.op_Implicit((Object)(object)caughtObject)) { val = ((Component)MonoSingleton.Instance).transform.position - ((Component)caughtObject).transform.position; caughtObject.velocity = ((Vector3)(ref val)).normalized * (100f + __instance.returnDistance / 2f); } } __instance.caughtObjects.Clear(); } __instance.state = (HookState)1; __instance.lightTarget = false; __instance.throwWarp = 1f; __instance.anim.Play("Throw"); ((Renderer)__instance.inspectLr).enabled = false; __instance.caughtPoint = Vector3.zero; __instance.caughtTransform = null; __instance.caughtCollider = null; __instance.caughtEid = null; Object.Instantiate(__instance.throwSound); __instance.aud.clip = __instance.throwLoop; __instance.aud.panStereo = 0f; AudioSourceExtensions.Play(__instance.aud, true); AudioSourceExtensions.SetPitch(__instance.aud, Random.Range(0.9f, 1.1f)); __instance.semiBlocked = 0f; MonoSingleton.Instance.SetVibrationTracked(RumbleProperties.WhiplashThrow, __instance.model); } } if (__instance.cooldown != 0f) { __instance.cooldown = Mathf.MoveTowards(__instance.cooldown, 0f, Time.deltaTime); } if (((Renderer)__instance.lr).enabled || Object.op_Implicit((Object)(object)__instance.lineRendererPortalHelper)) { __instance.UpdateLineRendererPositions(); } if ((int)__instance.state == 3 && !__instance.lightTarget && MonoSingleton.Instance.InputSource.Jump.WasPerformedThisFrame) { if (MonoSingleton.Instance.rb.velocity.y < 1f) { MonoSingleton.Instance.rb.velocity = new Vector3(MonoSingleton.Instance.rb.velocity.x, 1f, MonoSingleton.Instance.rb.velocity.z); } MonoSingleton.Instance.rb.velocity = Vector3.ClampMagnitude(MonoSingleton.Instance.rb.velocity, 30f); if (!MonoSingleton.Instance.gc.touchingGround && !Physics.Raycast(((Component)MonoSingleton.Instance.gc).transform.position, Vector3.down, 1.5f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)2)))) { MonoSingleton.Instance.rb.AddForce(Vector3.up * 15f, (ForceMode)2); } else if (!MonoSingleton.Instance.jumping) { MonoSingleton.Instance.Jump(); } __instance.StopThrow(1f, false); } if (Object.op_Implicit((Object)(object)MonoSingleton.Instance.currentPunch) && MonoSingleton.Instance.currentPunch.holding && __instance.forcingFistControl) { ((Component)MonoSingleton.Instance.currentPunch.heldItem).transform.position = __instance.hook.position + __instance.hook.up * 0.2f; if ((int)__instance.state != 0 || __instance.returning) { MonoSingleton.Instance.heldObject.hooked = true; if (((Component)MonoSingleton.Instance.heldObject).gameObject.layer != 22) { Transform[] componentsInChildren = ((Component)MonoSingleton.Instance.heldObject).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { ((Component)componentsInChildren[i]).gameObject.layer = 22; } return false; } } else { MonoSingleton.Instance.heldObject.hooked = false; if (((Component)MonoSingleton.Instance.heldObject).gameObject.layer != 13) { Transform[] componentsInChildren2 = ((Component)MonoSingleton.Instance.heldObject).GetComponentsInChildren(); for (int j = 0; j < componentsInChildren2.Length; j++) { ((Component)componentsInChildren2[j]).gameObject.layer = 13; } } } } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(HookArm), "StopThrow")] public static bool FixingHakitaStupidHardcodedShitPart2(HookArm __instance, float animationTime = 0f, bool sparks = false) { //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled) { return true; } MonoSingleton.Instance.StopVibration(RumbleProperties.WhiplashThrow); MonoSingleton.Instance.StopVibration(RumbleProperties.WhiplashPull); if (animationTime == 0f) { Object.Instantiate(__instance.pullSound); __instance.aud.clip = __instance.pullLoop; AudioSourceExtensions.SetPitch(__instance.aud, Random.Range(0.9f, 1.1f)); __instance.aud.panStereo = -0.5f; AudioSourceExtensions.Play(__instance.aud, true); } else { Object.Instantiate(__instance.pullDoneSound); } if (__instance.forcingGroundCheck) { __instance.StopForceGroundCheck(); } if (__instance.lightTarget) { if (Object.op_Implicit((Object)(object)__instance.enemyGroundCheck)) { __instance.enemyGroundCheck.StopForceOff(); } __instance.lightTarget = false; __instance.enemyGroundCheck = null; __instance.enemyRigidbody = null; } if (Object.op_Implicit((Object)(object)__instance.caughtEid)) { __instance.caughtEid.hooked = false; __instance.caughtEid = null; } if (Object.op_Implicit((Object)(object)__instance.caughtHook)) { __instance.caughtHook.Unhooked(); __instance.caughtHook = null; } if (sparks) { Object.Instantiate(__instance.clinkSparks, __instance.hookPoint, Quaternion.LookRotation(((Component)__instance).transform.position - __instance.hookPoint)); } __instance.state = (HookState)0; __instance.anim.Play("Pull"); __instance.returnDistance = Mathf.Max(Vector3.Distance(((Component)__instance).transform.position, __instance.hookPoint), 25f); __instance.returning = true; __instance.throwWarp = 0f; if (Object.op_Implicit((Object)(object)__instance.currentWoosh)) { Object.Destroy((Object)(object)__instance.currentWoosh); } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(HookArm), "FixedUpdate")] public static bool FixFuckingStupidWhiplashShit3(HookArm __instance) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Invalid comparison between Unknown and I4 //IL_12e7: Unknown result type (might be due to invalid IL or missing references) //IL_12ed: Invalid comparison between Unknown and I4 //IL_008b: 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) //IL_1636: Unknown result type (might be due to invalid IL or missing references) //IL_163c: Invalid comparison between Unknown and I4 //IL_0441: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_1363: Unknown result type (might be due to invalid IL or missing references) //IL_1368: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_137c: Unknown result type (might be due to invalid IL or missing references) //IL_1381: Unknown result type (might be due to invalid IL or missing references) //IL_1388: Unknown result type (might be due to invalid IL or missing references) //IL_138d: Unknown result type (might be due to invalid IL or missing references) //IL_139a: Unknown result type (might be due to invalid IL or missing references) //IL_139f: Unknown result type (might be due to invalid IL or missing references) //IL_13a6: Unknown result type (might be due to invalid IL or missing references) //IL_049a: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_0492: 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_1670: Unknown result type (might be due to invalid IL or missing references) //IL_1675: Unknown result type (might be due to invalid IL or missing references) //IL_1676: Unknown result type (might be due to invalid IL or missing references) //IL_167d: Unknown result type (might be due to invalid IL or missing references) //IL_1682: Unknown result type (might be due to invalid IL or missing references) //IL_1687: Unknown result type (might be due to invalid IL or missing references) //IL_168e: Unknown result type (might be due to invalid IL or missing references) //IL_1695: Unknown result type (might be due to invalid IL or missing references) //IL_16a4: Unknown result type (might be due to invalid IL or missing references) //IL_13cd: Unknown result type (might be due to invalid IL or missing references) //IL_13d3: Unknown result type (might be due to invalid IL or missing references) //IL_13d8: Unknown result type (might be due to invalid IL or missing references) //IL_13dd: Unknown result type (might be due to invalid IL or missing references) //IL_1340: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //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_01b3: 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_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_1432: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_051a: Unknown result type (might be due to invalid IL or missing references) //IL_10bb: Unknown result type (might be due to invalid IL or missing references) //IL_10c0: 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) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0141: 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_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_1802: Unknown result type (might be due to invalid IL or missing references) //IL_1807: Unknown result type (might be due to invalid IL or missing references) //IL_180c: Unknown result type (might be due to invalid IL or missing references) //IL_181c: Unknown result type (might be due to invalid IL or missing references) //IL_1827: Unknown result type (might be due to invalid IL or missing references) //IL_182c: Unknown result type (might be due to invalid IL or missing references) //IL_1830: Unknown result type (might be due to invalid IL or missing references) //IL_183b: Unknown result type (might be due to invalid IL or missing references) //IL_1840: Unknown result type (might be due to invalid IL or missing references) //IL_184d: Unknown result type (might be due to invalid IL or missing references) //IL_1852: Unknown result type (might be due to invalid IL or missing references) //IL_1856: Unknown result type (might be due to invalid IL or missing references) //IL_1861: Unknown result type (might be due to invalid IL or missing references) //IL_186c: Unknown result type (might be due to invalid IL or missing references) //IL_14c4: Unknown result type (might be due to invalid IL or missing references) //IL_14ca: Invalid comparison between Unknown and I4 //IL_05c6: Unknown result type (might be due to invalid IL or missing references) //IL_05d2: Unknown result type (might be due to invalid IL or missing references) //IL_05d7: Unknown result type (might be due to invalid IL or missing references) //IL_05db: Unknown result type (might be due to invalid IL or missing references) //IL_05e1: Unknown result type (might be due to invalid IL or missing references) //IL_05e6: Unknown result type (might be due to invalid IL or missing references) //IL_05ec: Unknown result type (might be due to invalid IL or missing references) //IL_05f8: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_0601: Unknown result type (might be due to invalid IL or missing references) //IL_060c: Unknown result type (might be due to invalid IL or missing references) //IL_1886: Unknown result type (might be due to invalid IL or missing references) //IL_188a: Unknown result type (might be due to invalid IL or missing references) //IL_188c: Unknown result type (might be due to invalid IL or missing references) //IL_173c: Unknown result type (might be due to invalid IL or missing references) //IL_10d0: Unknown result type (might be due to invalid IL or missing references) //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Unknown result type (might be due to invalid IL or missing references) //IL_05aa: Unknown result type (might be due to invalid IL or missing references) //IL_05af: Unknown result type (might be due to invalid IL or missing references) //IL_0646: Unknown result type (might be due to invalid IL or missing references) //IL_064d: Invalid comparison between Unknown and I4 //IL_11a7: Unknown result type (might be due to invalid IL or missing references) //IL_11ad: Unknown result type (might be due to invalid IL or missing references) //IL_11b4: Unknown result type (might be due to invalid IL or missing references) //IL_11b9: Unknown result type (might be due to invalid IL or missing references) //IL_11be: Unknown result type (might be due to invalid IL or missing references) //IL_11c4: Unknown result type (might be due to invalid IL or missing references) //IL_11c9: Unknown result type (might be due to invalid IL or missing references) //IL_1102: Unknown result type (might be due to invalid IL or missing references) //IL_18e8: Unknown result type (might be due to invalid IL or missing references) //IL_18ec: Unknown result type (might be due to invalid IL or missing references) //IL_18ee: Unknown result type (might be due to invalid IL or missing references) //IL_18a8: Unknown result type (might be due to invalid IL or missing references) //IL_18b4: Unknown result type (might be due to invalid IL or missing references) //IL_18be: Unknown result type (might be due to invalid IL or missing references) //IL_18c3: Unknown result type (might be due to invalid IL or missing references) //IL_18ca: Unknown result type (might be due to invalid IL or missing references) //IL_18cc: Unknown result type (might be due to invalid IL or missing references) //IL_1514: Unknown result type (might be due to invalid IL or missing references) //IL_151a: Unknown result type (might be due to invalid IL or missing references) //IL_14fe: Unknown result type (might be due to invalid IL or missing references) //IL_06bd: Unknown result type (might be due to invalid IL or missing references) //IL_06c3: Invalid comparison between Unknown and I4 //IL_1151: Unknown result type (might be due to invalid IL or missing references) //IL_1153: Unknown result type (might be due to invalid IL or missing references) //IL_1158: Unknown result type (might be due to invalid IL or missing references) //IL_115a: Unknown result type (might be due to invalid IL or missing references) //IL_115f: Unknown result type (might be due to invalid IL or missing references) //IL_190b: Unknown result type (might be due to invalid IL or missing references) //IL_190d: Unknown result type (might be due to invalid IL or missing references) //IL_1912: Unknown result type (might be due to invalid IL or missing references) //IL_191e: Unknown result type (might be due to invalid IL or missing references) //IL_1923: Unknown result type (might be due to invalid IL or missing references) //IL_1925: Unknown result type (might be due to invalid IL or missing references) //IL_1929: Unknown result type (might be due to invalid IL or missing references) //IL_1933: Unknown result type (might be due to invalid IL or missing references) //IL_1938: Unknown result type (might be due to invalid IL or missing references) //IL_06cb: Unknown result type (might be due to invalid IL or missing references) //IL_06d2: Invalid comparison between Unknown and I4 //IL_0d60: Unknown result type (might be due to invalid IL or missing references) //IL_0d6c: Unknown result type (might be due to invalid IL or missing references) //IL_0d19: Unknown result type (might be due to invalid IL or missing references) //IL_0d20: Unknown result type (might be due to invalid IL or missing references) //IL_0d25: Unknown result type (might be due to invalid IL or missing references) //IL_116a: Unknown result type (might be due to invalid IL or missing references) //IL_116c: Unknown result type (might be due to invalid IL or missing references) //IL_1171: Unknown result type (might be due to invalid IL or missing references) //IL_112d: Unknown result type (might be due to invalid IL or missing references) //IL_1137: Unknown result type (might be due to invalid IL or missing references) //IL_113c: Unknown result type (might be due to invalid IL or missing references) //IL_113e: Unknown result type (might be due to invalid IL or missing references) //IL_1a5c: Unknown result type (might be due to invalid IL or missing references) //IL_1a67: Unknown result type (might be due to invalid IL or missing references) //IL_1a6c: Unknown result type (might be due to invalid IL or missing references) //IL_1a71: Unknown result type (might be due to invalid IL or missing references) //IL_19d4: Unknown result type (might be due to invalid IL or missing references) //IL_19da: Invalid comparison between Unknown and I4 //IL_1999: Unknown result type (might be due to invalid IL or missing references) //IL_1b28: Unknown result type (might be due to invalid IL or missing references) //IL_1b2e: Invalid comparison between Unknown and I4 //IL_0a41: Unknown result type (might be due to invalid IL or missing references) //IL_0a46: Unknown result type (might be due to invalid IL or missing references) //IL_0a4a: Unknown result type (might be due to invalid IL or missing references) //IL_0a4f: Unknown result type (might be due to invalid IL or missing references) //IL_0a56: Unknown result type (might be due to invalid IL or missing references) //IL_0a61: Unknown result type (might be due to invalid IL or missing references) //IL_0a66: Unknown result type (might be due to invalid IL or missing references) //IL_0a6b: Unknown result type (might be due to invalid IL or missing references) //IL_0a72: Unknown result type (might be due to invalid IL or missing references) //IL_0a97: Unknown result type (might be due to invalid IL or missing references) //IL_0a9c: Unknown result type (might be due to invalid IL or missing references) //IL_06f7: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_0702: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e0: Invalid comparison between Unknown and I4 //IL_1020: Unknown result type (might be due to invalid IL or missing references) //IL_102c: Unknown result type (might be due to invalid IL or missing references) //IL_1032: Unknown result type (might be due to invalid IL or missing references) //IL_1037: Unknown result type (might be due to invalid IL or missing references) //IL_103d: Unknown result type (might be due to invalid IL or missing references) //IL_1049: Unknown result type (might be due to invalid IL or missing references) //IL_1054: Unknown result type (might be due to invalid IL or missing references) //IL_0d9b: Unknown result type (might be due to invalid IL or missing references) //IL_0da0: Unknown result type (might be due to invalid IL or missing references) //IL_0da6: Unknown result type (might be due to invalid IL or missing references) //IL_0dab: Unknown result type (might be due to invalid IL or missing references) //IL_0db2: Unknown result type (might be due to invalid IL or missing references) //IL_1219: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_1a3c: Unknown result type (might be due to invalid IL or missing references) //IL_1a41: Unknown result type (might be due to invalid IL or missing references) //IL_1a45: Unknown result type (might be due to invalid IL or missing references) //IL_1b82: Unknown result type (might be due to invalid IL or missing references) //IL_1b88: Unknown result type (might be due to invalid IL or missing references) //IL_1b8d: Unknown result type (might be due to invalid IL or missing references) //IL_1b92: Unknown result type (might be due to invalid IL or missing references) //IL_0f22: Unknown result type (might be due to invalid IL or missing references) //IL_0f31: Unknown result type (might be due to invalid IL or missing references) //IL_0e1f: Unknown result type (might be due to invalid IL or missing references) //IL_0e2b: Unknown result type (might be due to invalid IL or missing references) //IL_0e31: Unknown result type (might be due to invalid IL or missing references) //IL_0e36: Unknown result type (might be due to invalid IL or missing references) //IL_0e3c: Unknown result type (might be due to invalid IL or missing references) //IL_0e48: Unknown result type (might be due to invalid IL or missing references) //IL_0e53: Unknown result type (might be due to invalid IL or missing references) //IL_1a12: Unknown result type (might be due to invalid IL or missing references) //IL_1a17: Unknown result type (might be due to invalid IL or missing references) //IL_1a1d: Unknown result type (might be due to invalid IL or missing references) //IL_1a22: Unknown result type (might be due to invalid IL or missing references) //IL_198a: Unknown result type (might be due to invalid IL or missing references) //IL_1991: Invalid comparison between Unknown and I4 //IL_1625: Unknown result type (might be due to invalid IL or missing references) //IL_162b: Unknown result type (might be due to invalid IL or missing references) //IL_1609: Unknown result type (might be due to invalid IL or missing references) //IL_160f: Unknown result type (might be due to invalid IL or missing references) //IL_0f41: Unknown result type (might be due to invalid IL or missing references) //IL_0f47: Unknown result type (might be due to invalid IL or missing references) //IL_0f8c: Unknown result type (might be due to invalid IL or missing references) //IL_0f98: Unknown result type (might be due to invalid IL or missing references) //IL_0f9e: Unknown result type (might be due to invalid IL or missing references) //IL_0fa3: Unknown result type (might be due to invalid IL or missing references) //IL_0fa9: Unknown result type (might be due to invalid IL or missing references) //IL_0fb5: Unknown result type (might be due to invalid IL or missing references) //IL_0fc0: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_1ab6: Unknown result type (might be due to invalid IL or missing references) //IL_1aa4: Unknown result type (might be due to invalid IL or missing references) //IL_19ab: Unknown result type (might be due to invalid IL or missing references) //IL_19b1: Unknown result type (might be due to invalid IL or missing references) //IL_1e10: Unknown result type (might be due to invalid IL or missing references) //IL_1e16: Unknown result type (might be due to invalid IL or missing references) //IL_1e1b: Unknown result type (might be due to invalid IL or missing references) //IL_1e20: Unknown result type (might be due to invalid IL or missing references) //IL_0802: Unknown result type (might be due to invalid IL or missing references) //IL_0809: Invalid comparison between Unknown and I4 //IL_07d1: Unknown result type (might be due to invalid IL or missing references) //IL_07d8: Unknown result type (might be due to invalid IL or missing references) //IL_0c7d: Unknown result type (might be due to invalid IL or missing references) //IL_0c84: Unknown result type (might be due to invalid IL or missing references) //IL_0c89: Unknown result type (might be due to invalid IL or missing references) //IL_0f5d: Unknown result type (might be due to invalid IL or missing references) //IL_0f68: Unknown result type (might be due to invalid IL or missing references) //IL_1af6: Unknown result type (might be due to invalid IL or missing references) //IL_1afc: Unknown result type (might be due to invalid IL or missing references) //IL_1ad7: Unknown result type (might be due to invalid IL or missing references) //IL_1ae0: Unknown result type (might be due to invalid IL or missing references) //IL_1e47: Unknown result type (might be due to invalid IL or missing references) //IL_1e4c: Unknown result type (might be due to invalid IL or missing references) //IL_1bec: Unknown result type (might be due to invalid IL or missing references) //IL_1bf1: Unknown result type (might be due to invalid IL or missing references) //IL_1c00: Unknown result type (might be due to invalid IL or missing references) //IL_1c05: Unknown result type (might be due to invalid IL or missing references) //IL_1c07: Unknown result type (might be due to invalid IL or missing references) //IL_1c0c: Unknown result type (might be due to invalid IL or missing references) //IL_083b: Unknown result type (might be due to invalid IL or missing references) //IL_0842: Unknown result type (might be due to invalid IL or missing references) //IL_0862: Unknown result type (might be due to invalid IL or missing references) //IL_0869: Unknown result type (might be due to invalid IL or missing references) //IL_086e: Unknown result type (might be due to invalid IL or missing references) //IL_0811: Unknown result type (might be due to invalid IL or missing references) //IL_0818: Invalid comparison between Unknown and I4 //IL_0ba5: Unknown result type (might be due to invalid IL or missing references) //IL_0bac: Unknown result type (might be due to invalid IL or missing references) //IL_0bb1: Unknown result type (might be due to invalid IL or missing references) //IL_0ff7: Unknown result type (might be due to invalid IL or missing references) //IL_0e9a: Unknown result type (might be due to invalid IL or missing references) //IL_0ea0: Unknown result type (might be due to invalid IL or missing references) //IL_1e9b: Unknown result type (might be due to invalid IL or missing references) //IL_1ea6: Unknown result type (might be due to invalid IL or missing references) //IL_1eab: Unknown result type (might be due to invalid IL or missing references) //IL_1eb0: Unknown result type (might be due to invalid IL or missing references) //IL_1eb4: Unknown result type (might be due to invalid IL or missing references) //IL_1ebe: Unknown result type (might be due to invalid IL or missing references) //IL_1d28: Unknown result type (might be due to invalid IL or missing references) //IL_1d2a: Unknown result type (might be due to invalid IL or missing references) //IL_1c30: Unknown result type (might be due to invalid IL or missing references) //IL_1c35: Unknown result type (might be due to invalid IL or missing references) //IL_1c37: Unknown result type (might be due to invalid IL or missing references) //IL_1c39: Unknown result type (might be due to invalid IL or missing references) //IL_1c3e: Unknown result type (might be due to invalid IL or missing references) //IL_1c46: Unknown result type (might be due to invalid IL or missing references) //IL_1c48: Unknown result type (might be due to invalid IL or missing references) //IL_1c4e: Unknown result type (might be due to invalid IL or missing references) //IL_1c53: Unknown result type (might be due to invalid IL or missing references) //IL_1c58: Unknown result type (might be due to invalid IL or missing references) //IL_1c5b: Unknown result type (might be due to invalid IL or missing references) //IL_1c60: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08a6: Invalid comparison between Unknown and I4 //IL_1000: Unknown result type (might be due to invalid IL or missing references) //IL_1005: Unknown result type (might be due to invalid IL or missing references) //IL_0ef0: Unknown result type (might be due to invalid IL or missing references) //IL_0ef5: Unknown result type (might be due to invalid IL or missing references) //IL_0ee7: Unknown result type (might be due to invalid IL or missing references) //IL_0ebb: Unknown result type (might be due to invalid IL or missing references) //IL_0ec6: Unknown result type (might be due to invalid IL or missing references) //IL_1e6a: Unknown result type (might be due to invalid IL or missing references) //IL_1e6f: Unknown result type (might be due to invalid IL or missing references) //IL_1e71: Unknown result type (might be due to invalid IL or missing references) //IL_1e73: Unknown result type (might be due to invalid IL or missing references) //IL_1e78: Unknown result type (might be due to invalid IL or missing references) //IL_1e79: Unknown result type (might be due to invalid IL or missing references) //IL_1e7a: Unknown result type (might be due to invalid IL or missing references) //IL_1e7c: Unknown result type (might be due to invalid IL or missing references) //IL_1e86: Unknown result type (might be due to invalid IL or missing references) //IL_1e8b: Unknown result type (might be due to invalid IL or missing references) //IL_1e90: Unknown result type (might be due to invalid IL or missing references) //IL_1d30: Unknown result type (might be due to invalid IL or missing references) //IL_1d32: Unknown result type (might be due to invalid IL or missing references) //IL_1d34: Unknown result type (might be due to invalid IL or missing references) //IL_1d39: Unknown result type (might be due to invalid IL or missing references) //IL_1c7a: Unknown result type (might be due to invalid IL or missing references) //IL_1c7c: Unknown result type (might be due to invalid IL or missing references) //IL_1c81: Unknown result type (might be due to invalid IL or missing references) //IL_1c87: Unknown result type (might be due to invalid IL or missing references) //IL_1c89: Unknown result type (might be due to invalid IL or missing references) //IL_1c8e: Unknown result type (might be due to invalid IL or missing references) //IL_08ae: Unknown result type (might be due to invalid IL or missing references) //IL_08b5: Invalid comparison between Unknown and I4 //IL_1db4: Unknown result type (might be due to invalid IL or missing references) //IL_1db7: Unknown result type (might be due to invalid IL or missing references) //IL_1dbc: Unknown result type (might be due to invalid IL or missing references) //IL_1dc1: Unknown result type (might be due to invalid IL or missing references) //IL_1dc5: Unknown result type (might be due to invalid IL or missing references) //IL_1dcf: Unknown result type (might be due to invalid IL or missing references) //IL_1d4f: Unknown result type (might be due to invalid IL or missing references) //IL_1d52: Unknown result type (might be due to invalid IL or missing references) //IL_1d57: Unknown result type (might be due to invalid IL or missing references) //IL_1d5c: Unknown result type (might be due to invalid IL or missing references) //IL_1d60: Unknown result type (might be due to invalid IL or missing references) //IL_1d6a: Unknown result type (might be due to invalid IL or missing references) //IL_1d7f: Unknown result type (might be due to invalid IL or missing references) //IL_1d91: Unknown result type (might be due to invalid IL or missing references) //IL_1d9b: Unknown result type (might be due to invalid IL or missing references) //IL_1da2: Unknown result type (might be due to invalid IL or missing references) //IL_08d9: Unknown result type (might be due to invalid IL or missing references) //IL_08e0: Invalid comparison between Unknown and I4 //IL_08bd: Unknown result type (might be due to invalid IL or missing references) //IL_08c4: Invalid comparison between Unknown and I4 //IL_1e00: Unknown result type (might be due to invalid IL or missing references) //IL_1df1: Unknown result type (might be due to invalid IL or missing references) //IL_1d02: Unknown result type (might be due to invalid IL or missing references) //IL_1d07: Unknown result type (might be due to invalid IL or missing references) //IL_1ce6: Unknown result type (might be due to invalid IL or missing references) //IL_1ceb: Unknown result type (might be due to invalid IL or missing references) //IL_1ced: Unknown result type (might be due to invalid IL or missing references) //IL_1cef: Unknown result type (might be due to invalid IL or missing references) //IL_1cf4: Unknown result type (might be due to invalid IL or missing references) //IL_08f3: Unknown result type (might be due to invalid IL or missing references) //IL_08fa: Unknown result type (might be due to invalid IL or missing references) //IL_1d13: Unknown result type (might be due to invalid IL or missing references) //IL_1d19: Unknown result type (might be due to invalid IL or missing references) //IL_1d1e: Unknown result type (might be due to invalid IL or missing references) //IL_0a13: Unknown result type (might be due to invalid IL or missing references) //IL_09c1: Unknown result type (might be due to invalid IL or missing references) //IL_09d6: Unknown result type (might be due to invalid IL or missing references) //IL_09dd: Invalid comparison between Unknown and I4 //IL_09eb: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled) { return true; } if (Object.op_Implicit((Object)(object)__instance.caughtGrenade) && __instance.caughtGrenade.playerRiding) { if (__instance.caughtObjects.Contains(__instance.caughtGrenade.rb)) { __instance.caughtGrenade.hooked = false; __instance.caughtObjects.Remove(__instance.caughtGrenade.rb); } else { __instance.caughtObjects.Clear(); } __instance.caughtGrenade = null; } if ((int)__instance.state == 0 && __instance.returning) { Vector3 hookPoint = __instance.hookPoint; if (__instance.portalTraversals.Count > 0) { __instance.RecalculateThrowingIntersections(true); } float num = Time.fixedDeltaTime * (100f + __instance.returnDistance / 2f); while (num > 0f) { Vector3 val = __instance.hand.position; if (__instance.portalTraversals.Count > 0) { List portalTraversals = __instance.portalTraversals; val = portalTraversals[portalTraversals.Count - 1].exitPoint; } float num2 = Vector3.Distance(__instance.hookPoint, val); if (num2 <= num && __instance.portalTraversals.Count > 0) { num -= num2; List portalTraversals2 = __instance.portalTraversals; PortalTraversalV2 val2 = portalTraversals2[portalTraversals2.Count - 1]; __instance.hookPoint = val2.entrancePoint; __instance.throwDirection = val2.entranceDirection; __instance.portalTraversals.RemoveAt(__instance.portalTraversals.Count - 1); if ((Object)(object)__instance.lineRendererPortalHelper != (Object)null) { __instance.lineRendererPortalHelper.UpdateTraversals((IList)__instance.portalTraversals); } if (__instance.portalTraversals.Count > 0) { __instance.RecalculateThrowingIntersections(true); } } else { __instance.hookPoint = Vector3.MoveTowards(__instance.hookPoint, val, num); num = 0f; } } for (int num3 = __instance.caughtObjects.Count - 1; num3 >= 0; num3--) { if ((Object)(object)__instance.caughtObjects[num3] != (Object)null) { __instance.caughtObjects[num3].position = __instance.hookPoint; } else { __instance.caughtObjects.RemoveAt(num3); } } if (__instance.hookPoint == __instance.hand.position && __instance.portalTraversals.Count == 0) { ((Renderer)__instance.lr).enabled = false; __instance.returning = false; __instance.anim.Play("Catch"); Object.Instantiate(__instance.catchSound); __instance.aud.Stop(); __instance.ResetTraversals(); if (__instance.caughtObjects.Count > 0) { Grenade val3 = default(Grenade); for (int num4 = __instance.caughtObjects.Count - 1; num4 >= 0; num4--) { if ((Object)(object)__instance.caughtObjects[num4] != (Object)null) { if (((Component)__instance.caughtObjects[num4]).TryGetComponent(ref val3)) { NewMovement instance = MonoSingleton.Instance; Vector3 position = ((Component)instance).transform.position; ((Component)val3).transform.position = position; val3.hooked = false; val3.ignoreEnemyType.Clear(); if (val3.rocket && !Object.op_Implicit((Object)(object)instance.ridingRocket) && Vector3.Angle(PhysicsExtensions.GetGravityDirection(instance.rb), hookPoint - position) < 45f) { val3.PlayerRideStart(); } else { val3.Explode(false, false, val3.rocket && !instance.gc.onGround, 1f, false, (GameObject)null, true); } } else { __instance.caughtObjects[num4].velocity = Vector3.zero; } } } __instance.caughtObjects.Clear(); } __instance.caughtGrenade = null; __instance.caughtCannonball = null; } } Vector3 val4 = -PhysicsExtensions.GetGravityDirection(MonoSingleton.Instance.rb); Bounds bounds; Vector3 nextCaughtPoint; if ((int)__instance.state == 1) { if (!MonoSingleton.Instance.InputSource.Hook.IsPressed && (__instance.cooldown <= 0.1f || __instance.caughtObjects.Count > 0)) { __instance.StopThrow(0f, false); } else { float num5 = 250f * Time.fixedDeltaTime; bool flag = false; PhysicsCastResult val5 = default(PhysicsCastResult); PortalTraversalV2[] array = default(PortalTraversalV2[]); Vector3 val6 = default(Vector3); if (PortalPhysicsV2.Raycast(__instance.hookPoint, __instance.throwDirection, num5, LayerMask.op_Implicit(__instance.enviroMask), ref val5, ref array, ref val6, (QueryTriggerInteraction)1)) { flag = true; num5 = val5.distance; } else if (array.Length != 0) { PortalTraversalV2 val7 = array[0]; __instance.portalTraversals.Add(val7); __instance.TraversePortal(val7); } RaycastHit[] array2 = Physics.SphereCastAll(__instance.hookPoint, Mathf.Min(Vector3.Distance(((Component)__instance).transform.position, __instance.hookPoint) / 15f, 5f), __instance.throwDirection, num5, LayerMask.op_Implicit(__instance.throwMask), (QueryTriggerInteraction)2); Array.Sort(array2, (RaycastHit x, RaycastHit y) => ((RaycastHit)(ref x)).distance.CompareTo(((RaycastHit)(ref y)).distance)); bool flag2 = false; Coin val12 = default(Coin); RaycastHit val16 = default(RaycastHit); EnemyIdentifierIdentifier val17 = default(EnemyIdentifierIdentifier); BulletCheck val13 = default(BulletCheck); HookPoint val9 = default(HookPoint); ItemIdentifier val10 = default(ItemIdentifier); for (int i = 0; i < array2.Length; i++) { RaycastHit val8 = array2[i]; bool flag3 = false; switch (((Component)((RaycastHit)(ref val8)).transform).gameObject.layer) { case 10: if (((Component)((RaycastHit)(ref val8)).transform).gameObject.CompareTag("Coin") && ((Component)((RaycastHit)(ref val8)).transform).TryGetComponent(ref val12)) { ((RaycastHit)(ref val8)).transform.position = __instance.hookPoint + ((Vector3)(ref __instance.throwDirection)).normalized * ((RaycastHit)(ref val8)).distance; val12.Bounce(); } goto default; case 11: case 12: { Vector3 hookPoint2 = __instance.hookPoint; bounds = ((RaycastHit)(ref val8)).collider.bounds; Vector3 val14 = ((Bounds)(ref bounds)).center - __instance.hookPoint; Vector3 hookPoint3 = __instance.hookPoint; bounds = ((RaycastHit)(ref val8)).collider.bounds; if (Physics.Raycast(hookPoint2, val14, Vector3.Distance(hookPoint3, ((Bounds)(ref bounds)).center), LayerMask.op_Implicit(__instance.enviroMask), (QueryTriggerInteraction)1)) { continue; } __instance.caughtEid = ((Component)((RaycastHit)(ref val8)).transform).GetComponentInParent(); if (Object.op_Implicit((Object)(object)__instance.caughtEid) && (int)__instance.caughtEid.enemyType == 38) { Drone val15 = (Object.op_Implicit((Object)(object)__instance.caughtEid.drone) ? __instance.caughtEid.drone : ((Component)__instance.caughtEid).GetComponent()); if (Object.op_Implicit((Object)(object)val15) && !val15.CanBeHooked()) { __instance.caughtEid.drone.RandomDodge(true); __instance.caughtEid = null; continue; } } if (!Object.op_Implicit((Object)(object)__instance.caughtEid) || ((int)__instance.caughtEid.enemyType != 4 && (int)__instance.caughtEid.enemyType != 33 && (int)__instance.caughtEid.enemyType != 2) || !__instance.caughtEid.dead || ((RaycastHit)(ref val8)).collider.Raycast(new Ray(__instance.hookPoint, __instance.throwDirection), ref val16, num5)) { if ((Object)(object)__instance.caughtEid == (Object)null && ((Component)((RaycastHit)(ref val8)).transform).TryGetComponent(ref val17)) { __instance.caughtEid = val17.eid; } if (Object.op_Implicit((Object)(object)__instance.caughtEid)) { if (__instance.caughtEid.hookIgnore) { __instance.caughtEid = null; goto default; } if (Object.op_Implicit((Object)(object)__instance.caughtCannonball) && __instance.caughtCannonball.hitEnemies.Contains(__instance.caughtEid)) { __instance.caughtEid = null; __instance.StopThrow(0f, false); return false; } if (__instance.caughtEid.blessed) { __instance.caughtEid.hitter = "hook"; __instance.caughtEid.DeliverDamage(((Component)__instance.caughtEid).gameObject, Vector3.zero, ((RaycastHit)(ref val8)).point, 1f, false, 0f, (GameObject)null, false, false); __instance.caughtEid = null; continue; } if ((int)__instance.caughtEid.enemyType == 21 || (int)__instance.caughtEid.enemyType == 39) { __instance.caughtEid.hitter = "hook"; __instance.caughtEid.DeliverDamage(((Component)__instance.caughtEid).gameObject, Vector3.zero, ((RaycastHit)(ref val8)).point, 1f, false, 0f, (GameObject)null, false, false); Object.Instantiate(__instance.clinkObjectSparks, ((RaycastHit)(ref val8)).point, Quaternion.LookRotation(((RaycastHit)(ref val8)).normal)); continue; } __instance.caughtEid.hitter = "hook"; __instance.caughtEid.hooked = true; if ((((int)__instance.caughtEid.enemyType != 1 && (int)__instance.caughtEid.enemyType != 9 && (int)__instance.caughtEid.enemyType != 38) || !__instance.caughtEid.dead) && (int)__instance.caughtEid.enemyType != 12) { __instance.caughtEid.DeliverDamage(((Component)__instance.caughtEid).gameObject, Vector3.zero, ((RaycastHit)(ref val8)).point, 0.2f, false, 0f, (GameObject)null, false, false); } if ((Object)(object)__instance.caughtEid == (Object)null) { return false; } if (Object.op_Implicit((Object)(object)MonoSingleton.Instance.heldObject)) { GameObject gameObject = ((Component)((RaycastHit)(ref val8)).transform).gameObject; if (((Component)((RaycastHit)(ref val8)).transform).gameObject.layer == 12) { EnemyIdentifierIdentifier componentInChildren = gameObject.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren)) { gameObject = ((Component)componentInChildren).gameObject; } } ((Component)MonoSingleton.Instance.heldObject).SendMessage("HitWith", (object)gameObject, (SendMessageOptions)1); if (MonoSingleton.Instance.heldObject.dropOnHit) { MonoSingleton.Instance.currentPunch.ForceDrop(); } } if (__instance.caughtEid.dead) { if (!__instance.deadIgnoreTypes.Contains(__instance.caughtEid.enemyType)) { goto default; } if ((int)__instance.caughtEid.enemyType == 9 || __instance.lightEnemies.Contains(__instance.caughtEid.enemyType)) { __instance.lightTarget = true; } __instance.caughtEid = null; } else if (__instance.lightEnemies.Contains(__instance.caughtEid.enemyType)) { __instance.lightTarget = true; } } flag2 = true; flag3 = true; __instance.caughtTransform = ((RaycastHit)(ref val8)).transform; bounds = ((RaycastHit)(ref val8)).collider.bounds; __instance.hookPoint = ((Bounds)(ref bounds)).center; __instance.caughtPoint = __instance.hookPoint - __instance.caughtTransform.position; __instance.state = (HookState)2; __instance.caughtCollider = ((RaycastHit)(ref val8)).collider; __instance.aud.Stop(); Object.Instantiate(__instance.hitSound, ((RaycastHit)(ref val8)).point, Quaternion.identity); goto default; } __instance.caughtEid = null; continue; } case 14: if (__instance.caughtObjects.Count < 5 && MonoSingleton.Instance.HasTransform(((RaycastHit)(ref val8)).transform) && (Object)(object)((RaycastHit)(ref val8)).collider.attachedRigidbody != (Object)null && !__instance.caughtObjects.Contains(((RaycastHit)(ref val8)).collider.attachedRigidbody)) { if ((Object)(object)__instance.caughtGrenade == (Object)null && MonoSingleton.Instance.grenadeList.Count > 0 && Object.op_Implicit((Object)(object)MonoSingleton.Instance.GetGrenade(((RaycastHit)(ref val8)).transform)) && MonoSingleton.Instance.GetGrenade(((RaycastHit)(ref val8)).transform).rocket && !MonoSingleton.Instance.GetGrenade(((RaycastHit)(ref val8)).transform).playerRiding) { __instance.caughtObjects.Add(((RaycastHit)(ref val8)).collider.attachedRigidbody); Object.Instantiate(__instance.clinkObjectSparks, ((RaycastHit)(ref val8)).point, Quaternion.LookRotation(((RaycastHit)(ref val8)).normal)); __instance.caughtGrenade = MonoSingleton.Instance.GetGrenade(((RaycastHit)(ref val8)).transform); __instance.caughtGrenade.rideable = true; __instance.caughtGrenade.hooked = true; __instance.caughtGrenade.ignoreEnemyType.Clear(); } else if (MonoSingleton.Instance.cannonballList.Count > 0 && Object.op_Implicit((Object)(object)MonoSingleton.Instance.GetCannonball(((RaycastHit)(ref val8)).transform)) && MonoSingleton.Instance.GetCannonball(((RaycastHit)(ref val8)).transform).physicsCannonball) { Cannonball cannonball = MonoSingleton.Instance.GetCannonball(((RaycastHit)(ref val8)).transform); __instance.caughtObjects.Add(((RaycastHit)(ref val8)).collider.attachedRigidbody); Object.Instantiate(__instance.clinkObjectSparks, ((RaycastHit)(ref val8)).point, Quaternion.LookRotation(((RaycastHit)(ref val8)).normal)); __instance.caughtCannonball = cannonball; cannonball.Unlaunch(true); cannonball.forceMaxSpeed = true; cannonball.InstaBreakDefenceCancel(); } } goto default; case 16: if (((RaycastHit)(ref val8)).collider.isTrigger && ((Component)((RaycastHit)(ref val8)).transform).TryGetComponent(ref val13)) { val13.ForceDodge(); } flag3 = true; goto default; case 26: if (!((RaycastHit)(ref val8)).collider.isTrigger) { __instance.StopThrow(0f, false); Object.Instantiate(__instance.clinkSparks, ((RaycastHit)(ref val8)).point, Quaternion.LookRotation(((RaycastHit)(ref val8)).normal)); flag2 = true; flag3 = true; } goto default; case 22: if (((Component)((RaycastHit)(ref val8)).transform).TryGetComponent(ref val9)) { if (val9.active && Vector3.Distance(((Component)__instance).transform.position, ((RaycastHit)(ref val8)).transform.position) > 5f) { flag2 = true; flag3 = true; __instance.caughtTransform = ((RaycastHit)(ref val8)).transform; __instance.hookPoint = ((RaycastHit)(ref val8)).transform.position; __instance.caughtPoint = Vector3.zero; __instance.state = (HookState)2; __instance.caughtCollider = ((RaycastHit)(ref val8)).collider; __instance.aud.Stop(); __instance.caughtHook = val9; val9.Hooked(); goto default; } } else if (Object.op_Implicit((Object)(object)MonoSingleton.Instance.currentPunch) && !MonoSingleton.Instance.currentPunch.holding) { if (((Component)((RaycastHit)(ref val8)).transform).TryGetComponent(ref val10)) { if (Physics.Raycast(__instance.hookPoint, ((RaycastHit)(ref val8)).transform.position - __instance.hookPoint, Vector3.Distance(__instance.hookPoint, ((RaycastHit)(ref val8)).transform.position), LayerMask.op_Implicit(__instance.enviroMask), (QueryTriggerInteraction)1)) { continue; } if (val10.infiniteSource) { val10 = val10.CreateCopy(); } flag2 = true; if ((Object)(object)val10.ipz == (Object)null || (val10.ipz.CheckDoorBounds(((Component)val10).transform.position, __instance.previousHookPoint, false) && val10.ipz.CheckDoorBounds(((Component)val10).transform.position, ((Component)__instance).transform.position, false))) { MonoSingleton.Instance.currentPunch.ForceHold(val10); } else { __instance.ItemGrabError(val8); } __instance.previousHookPoint = __instance.hookPoint; } } else { ItemPlaceZone[] components = ((Component)((RaycastHit)(ref val8)).transform).GetComponents(); bool flag4 = false; ItemPlaceZone[] array3 = components; foreach (ItemPlaceZone val11 in array3) { if (val11.acceptedItemType == MonoSingleton.Instance.heldObject.itemType && !val11.CheckDoorBounds(((Component)val11).transform.position, __instance.previousHookPoint, true) && !val11.CheckDoorBounds(((Component)val11).transform.position, ((Component)__instance).transform.position, true)) { flag4 = true; } } if (components.Length != 0) { if (Physics.Raycast(__instance.hookPoint, ((RaycastHit)(ref val8)).transform.position - __instance.hookPoint, Vector3.Distance(__instance.hookPoint, ((RaycastHit)(ref val8)).transform.position), LayerMask.op_Implicit(__instance.enviroMask), (QueryTriggerInteraction)1)) { continue; } flag2 = true; if (!flag4) { MonoSingleton.Instance.currentPunch.PlaceHeldObject(components, ((RaycastHit)(ref val8)).transform); } else { __instance.ItemGrabError(val8); } __instance.previousHookPoint = __instance.hookPoint; } } if (flag2) { flag3 = true; __instance.StopThrow(0f, false); } else if (!Physics.Raycast(__instance.hookPoint, ((RaycastHit)(ref val8)).transform.position - __instance.hookPoint, Vector3.Distance(__instance.hookPoint, ((RaycastHit)(ref val8)).transform.position), LayerMask.op_Implicit(__instance.enviroMask), (QueryTriggerInteraction)1)) { flag3 = true; } goto default; default: if (flag3 && Object.op_Implicit((Object)(object)MonoSingleton.Instance.heldObject)) { ((Component)MonoSingleton.Instance.heldObject).SendMessage("HitWith", (object)((Component)((RaycastHit)(ref val8)).transform).gameObject, (SendMessageOptions)1); } if (!flag2) { continue; } break; } break; } Vector3 position2 = __instance.hookPoint; if (flag && !flag2) { Breakable val18 = default(Breakable); if (((Component)val5.transform).TryGetComponent(ref val18) && val18.weak && !val18.precisionOnly && !val18.specialCaseOnly) { val18.Break(); } SandboxProp val19 = default(SandboxProp); if (((Component)val5.transform).gameObject.TryGetComponent(ref val19) && Object.op_Implicit((Object)(object)((SpawnableInstance)val19).rigidbody)) { ((SpawnableInstance)val19).rigidbody.AddForceAtPosition(__instance.currentForward * -100f, val5.point, (ForceMode)2); } else { Object.Instantiate(__instance.clinkSparks, val5.point, Quaternion.LookRotation(val5.normal)); } position2 = val5.point; __instance.StopThrow(0f, false); flag2 = true; } if (!flag2 && __instance.GetTotalLineDistance() > 300f) { __instance.StopThrow(0f, false); } else if (!flag2) { __instance.hookPoint += __instance.throwDirection * num5; position2 = __instance.hookPoint; if (__instance.portalTraversals.Count > 0) { __instance.RecalculateThrowingIntersections(true); } } Grenade val20 = default(Grenade); for (int num6 = __instance.caughtObjects.Count - 1; num6 >= 0; num6--) { if ((Object)(object)__instance.caughtObjects[num6] != (Object)null) { __instance.caughtObjects[num6].position = position2; if (flag2) { if (((Component)__instance.caughtObjects[num6]).TryGetComponent(ref val20)) { if (Object.op_Implicit((Object)(object)__instance.caughtEid) && Object.op_Implicit((Object)(object)val20.originEnemy) && (Object)(object)__instance.caughtEid == (Object)(object)val20.originEnemy) { MonoSingleton.Instance.AddPoints(100, "ultrakill.rocketreturn", (GameObject)null, __instance.caughtEid, -1, "", ""); } val20.hooked = false; val20.ignoreEnemyType.Clear(); val20.Explode(false, false, false, 1f, false, (GameObject)null, false); } else { __instance.caughtObjects.RemoveAt(num6); } } } else { __instance.caughtObjects.RemoveAt(num6); } } } } else if ((int)__instance.state == 2) { if ((Object)(object)__instance.caughtEid != (Object)null && (__instance.caughtEid.dead || __instance.caughtEid.hookIgnore || __instance.caughtEid.blessed)) { if (!__instance.caughtEid.dead || !__instance.deadIgnoreTypes.Contains(__instance.caughtEid.enemyType)) { __instance.StopThrow(0f, false); return false; } __instance.SolveDeadIgnore(); } else { nextCaughtPoint = __instance.GetNextCaughtPoint(); RaycastHit val21 = default(RaycastHit); if (!Object.op_Implicit((Object)(object)__instance.caughtTransform) || Physics.Raycast(__instance.hand.position, nextCaughtPoint - __instance.hand.position, ref val21, Vector3.Distance(__instance.hand.position, nextCaughtPoint), LayerMask.op_Implicit(__instance.enviroMask), (QueryTriggerInteraction)1)) { __instance.StopThrow(0f, false); return false; } } __instance.hookPoint = __instance.caughtTransform.position + __instance.caughtPoint; if (__instance.portalTraversals.Count > 0 && !__instance.RecalculatePortalIntersections(true)) { __instance.StopThrow(0f, false); return false; } if (!MonoSingleton.Instance.InputSource.Hook.IsPressed) { __instance.anim.Play("Pull"); __instance.state = (HookState)3; MonoSingleton.Instance.SetVibrationTracked(RumbleProperties.WhiplashPull, __instance.model); __instance.currentWoosh = Object.Instantiate(__instance.wooshSound); Object.Instantiate(__instance.pullSound); __instance.aud.clip = __instance.pullLoop; AudioSourceExtensions.SetPitch(__instance.aud, Random.Range(0.9f, 1.1f)); __instance.aud.panStereo = -0.5f; AudioSourceExtensions.Play(__instance.aud, true); if (Object.op_Implicit((Object)(object)__instance.caughtHook) && (int)__instance.caughtHook.type == 2) { __instance.caughtHook.SwitchPulled(); if (!MonoSingleton.Instance.gc.touchingGround) { if (MonoSingleton.Instance.inWater) { MonoSingleton.Instance.rb.velocity = Vector3.zero; } else { MonoSingleton.Instance.rb.velocity = val4 * 15f; } } __instance.StopThrow(0f, false); } else if (!__instance.forcingGroundCheck && !__instance.lightTarget) { __instance.ForceGroundCheck(); } else if (__instance.lightTarget) { Rigidbody enemyRigidbody = default(Rigidbody); if (Object.op_Implicit((Object)(object)__instance.caughtEid)) { if ((Object)(object)__instance.enemyGroundCheck != (Object)null) { __instance.enemyGroundCheck.StopForceOff(); } __instance.enemyGroundCheck = __instance.caughtEid.gce; if (Object.op_Implicit((Object)(object)__instance.enemyGroundCheck)) { __instance.enemyGroundCheck.ForceOff(); } __instance.enemyRigidbody = ((Component)__instance.caughtEid).GetComponent(); } else if (((Component)__instance.caughtTransform).TryGetComponent(ref enemyRigidbody)) { __instance.enemyRigidbody = enemyRigidbody; } else { __instance.StopThrow(0f, false); } if (!MonoSingleton.Instance.gc.touchingGround) { if (!MonoSingleton.Instance.inWater) { MonoSingleton.Instance.rb.velocity = val4 * 15f; } else { MonoSingleton.Instance.rb.velocity = val4 * 5f; } } } } } if ((int)__instance.state != 3) { __instance.beingPulled = false; return false; } if (!Object.op_Implicit((Object)(object)__instance.caughtTransform) || !Object.op_Implicit((Object)(object)__instance.caughtCollider)) { __instance.StopThrow(1f, false); return false; } nextCaughtPoint = __instance.GetNextCaughtPoint(); Vector3 val22 = nextCaughtPoint - ((Component)__instance).transform.position; RaycastHit val23 = default(RaycastHit); if (Physics.Raycast(((Component)__instance).transform.position, ((Vector3)(ref val22)).normalized, ref val23, ((Vector3)(ref val22)).magnitude, LayerMask.op_Implicit(__instance.enviroMask), (QueryTriggerInteraction)1)) { bool flag5 = true; EnemyIdentifier component = ((Component)((RaycastHit)(ref val23)).transform).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.blessed) { flag5 = false; } if (flag5) { __instance.StopThrow(1f, false); return false; } } if ((Object)(object)__instance.caughtEid != (Object)null && (__instance.caughtEid.dead || __instance.caughtEid.hookIgnore || __instance.caughtEid.blessed)) { if (!__instance.caughtEid.dead || !__instance.deadIgnoreTypes.Contains(__instance.caughtEid.enemyType)) { __instance.StopThrow(1f, false); return false; } __instance.SolveDeadIgnore(); } if (Object.op_Implicit((Object)(object)__instance.caughtEid) && !MonoSingleton.Instance.inWater && (!Object.op_Implicit((Object)(object)MonoSingleton.Instance) || !MonoSingleton.Instance.majorEnabled || !MonoSingleton.Instance.disableWhiplashHardDamage)) { if (MonoSingleton.Instance.antiHp + Time.fixedDeltaTime * 66f <= 50f) { MonoSingleton.Instance.ForceAddAntiHP(Time.fixedDeltaTime * 66f, true, true, true, false); } else if (MonoSingleton.Instance.antiHp <= 50f) { MonoSingleton.Instance.ForceAntiHP(50f, true, true, true, false); } } Vector3 val24 = ((Collider)__instance.playerCollider).ClosestPoint(__instance.hookPoint); Collider val25 = __instance.caughtCollider; Vector3 position3 = ((Component)__instance).transform.position; bounds = __instance.caughtCollider.bounds; Vector3 val26 = ((Bounds)(ref bounds)).center - ((Component)__instance).transform.position; bounds = __instance.caughtCollider.bounds; RaycastHit val27 = default(RaycastHit); if (Physics.Raycast(position3, val26, ref val27, Vector3.Distance(((Bounds)(ref bounds)).center, ((Component)__instance).transform.position), LayerMask.op_Implicit(__instance.enemyMask))) { val25 = ((RaycastHit)(ref val27)).collider; } if (Vector3.Distance(val24, val25.ClosestPoint(val24)) < 0.25f || (!__instance.lightTarget && Vector3.Distance(val24 + MonoSingleton.Instance.rb.velocity * Time.fixedDeltaTime, val25.ClosestPoint(val24)) < 0.25f)) { if (!__instance.lightTarget && Vector3.Distance(val24, val25.ClosestPoint(val24)) >= 0.25f) { Rigidbody rb = MonoSingleton.Instance.rb; Vector3 val28 = val25.ClosestPoint(val24); Vector3 velocity = MonoSingleton.Instance.rb.velocity; rb.MovePosition(val28 - ((Vector3)(ref velocity)).normalized * 0.25f); } if (Object.op_Implicit((Object)(object)__instance.enemyRigidbody)) { if ((Object)(object)__instance.enemyGroundCheck == (Object)null || __instance.enemyGroundCheck.touchingGround || (Object.op_Implicit((Object)(object)__instance.caughtEid) && __instance.caughtEid.underwater) || (int)__instance.caughtEid.enemyType == 31) { __instance.enemyRigidbody.velocity = Vector3.zero; } else { __instance.enemyRigidbody.velocity = val4 * 15f; } } bool flag6 = false; if (Object.op_Implicit((Object)(object)__instance.caughtHook)) { Vector3 velocity2; if ((int)__instance.caughtHook.type == 1) { flag6 = true; if (__instance.caughtHook.slingShotForce != 0f) { Rigidbody rb2 = MonoSingleton.Instance.rb; float slingShotForce = __instance.caughtHook.slingShotForce; velocity2 = MonoSingleton.Instance.rb.velocity; rb2.velocity = slingShotForce * ((Vector3)(ref velocity2)).normalized; } } HookPoint caughtHook = __instance.caughtHook; velocity2 = MonoSingleton.Instance.rb.velocity; caughtHook.Reached(((Vector3)(ref velocity2)).normalized); } __instance.StopThrow(1f, false); float num7 = Vector3.Dot(__instance.hookPoint - ((Component)__instance).transform.position, val4); if (!MonoSingleton.Instance.gc.touchingGround && !flag6) { if (MonoSingleton.Instance.inWater) { MonoSingleton.Instance.rb.velocity = Vector3.zero; return false; } if (((Component)__instance).transform.position.y < __instance.hookPoint.y) { MonoSingleton.Instance.rb.velocity = val4 * (15f + num7); return false; } MonoSingleton.Instance.rb.velocity = val4 * 15f; } return false; } if (Object.op_Implicit((Object)(object)__instance.caughtEid) && Object.op_Implicit((Object)(object)__instance.enemyRigidbody) && (int)__instance.caughtEid.enemyType == 1) { if (__instance.enemyRigidbody.isKinematic) { __instance.lightTarget = false; } else { __instance.lightTarget = true; } } if (__instance.lightTarget && __instance.forcingGroundCheck) { __instance.StopForceGroundCheck(); } else if (!__instance.lightTarget && !__instance.forcingGroundCheck) { __instance.ForceGroundCheck(); } __instance.hookPoint = __instance.caughtTransform.position + __instance.caughtPoint; if (__instance.portalTraversals.Count > 0 && !__instance.RecalculatePortalIntersections(true)) { __instance.StopThrow(1f, false); return false; } if (__instance.lightTarget) { if (!Object.op_Implicit((Object)(object)__instance.enemyRigidbody)) { __instance.StopThrow(1f, false); return false; } Vector3 val29 = ((Component)MonoSingleton.Instance).transform.position; bool flag7 = false; Vector3 val30 = ((Component)MonoSingleton.Instance).transform.position - val29; if (__instance.portalTraversals.Count > 0) { flag7 = true; List portalTraversals3 = __instance.portalTraversals; PortalTraversalV2 val31 = portalTraversals3[portalTraversals3.Count - 1]; val29 = val31.exitPoint; Vector3 val32 = __instance.caughtCollider.ClosestPoint(val29) - __instance.hookPoint; if (Vector3.Distance(__instance.hookPoint, val29) - ((Vector3)(ref val32)).magnitude <= 0.3f) { __instance.hookPoint = val31.entrancePoint; __instance.throwDirection = val31.entranceDirection; __instance.portalTraversals.RemoveAt(__instance.portalTraversals.Count - 1); if ((Object)(object)__instance.lineRendererPortalHelper != (Object)null) { __instance.lineRendererPortalHelper.UpdateTraversals((IList)__instance.portalTraversals); } if (__instance.portalTraversals.Count > 0) { List portalTraversals4 = __instance.portalTraversals; val31 = portalTraversals4[portalTraversals4.Count - 1]; val29 = val31.exitPoint; } else { val29 = ((Component)MonoSingleton.Instance).transform.position; flag7 = false; } __instance.caughtTransform.position = __instance.hookPoint - __instance.caughtPoint; } } Vector3 val33 = val29; if (!flag7) { val33 += val30; } Vector3 val34; if ((Object)(object)__instance.enemyGroundCheck != (Object)null) { Rigidbody enemyRigidbody2 = __instance.enemyRigidbody; val34 = val29 - __instance.hookPoint; enemyRigidbody2.velocity = ((Vector3)(ref val34)).normalized * 60f; ((Component)__instance.caughtEid).transform.LookAt(new Vector3(val33.x, ((Component)__instance.caughtEid).transform.position.y, val33.z)); return false; } Rigidbody enemyRigidbody3 = __instance.enemyRigidbody; val34 = val33 - __instance.hookPoint; enemyRigidbody3.velocity = ((Vector3)(ref val34)).normalized * 60f; if (Object.op_Implicit((Object)(object)__instance.caughtEid)) { ((Component)__instance.caughtEid).transform.LookAt(val33); return false; } __instance.caughtTransform.LookAt(val33); return false; } __instance.hookPoint = __instance.caughtTransform.position + __instance.caughtPoint; __instance.beingPulled = true; if (MonoSingleton.Instance.boost && !MonoSingleton.Instance.sliding) { return false; } nextCaughtPoint = __instance.hookPoint; List portalTraversals5 = __instance.portalTraversals; if (portalTraversals5 != null && portalTraversals5.Count > 0) { PortalTraversalV2 val35 = __instance.portalTraversals[0]; nextCaughtPoint = val35.entrancePoint; nextCaughtPoint += val35.entranceDirection * 1f; } Rigidbody rb3 = MonoSingleton.Instance.rb; Vector3 val36 = nextCaughtPoint - ((Component)MonoSingleton.Instance).transform.position; rb3.velocity = ((Vector3)(ref val36)).normalized * 60f; return false; } } [HarmonyPatch] public static class PlayerAnimPatches { [HarmonyPrefix] [HarmonyPatch(typeof(PlayerAnimations), "LateUpdate")] public static void FixRotationJank(PlayerAnimations __instance) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (!__instance.nm.boost && !__instance.nm.sliding) { ((Component)__instance).transform.localRotation = Quaternion.identity; } } [HarmonyPostfix] [HarmonyPatch(typeof(PlayerAnimations), "Start")] public static void ReplaceAnimator(PlayerAnimations __instance) { //IL_0054: 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) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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) if (tcenabled) { Object.Destroy((Object)(object)__instance.anim); ((Component)((Component)__instance).transform.GetChild(0)).gameObject.SetActive(false); ((Component)((Component)__instance).transform.GetChild(1)).gameObject.SetActive(false); GameObject val = Object.Instantiate(MainCode.FetchFromBundle("Player/Mirror/v1_combined.prefab", autofill: true), ((Component)__instance).transform.position, ((Component)__instance).transform.rotation, ((Component)__instance).transform); val.transform.localScale = Vector3.one * 0.87f; __instance.anim = val.GetComponent(); ((Component)__instance).transform.localRotation = Quaternion.identity; __instance.head = val.transform.Find("Stray/pelvis/Pelvis/spine_001/spine_002/spine_003/spine_004"); __instance.chest = val.transform.Find("Stray/pelvis/Pelvis/spine_001"); } } [HarmonyPrefix] [HarmonyPatch(typeof(PlayerAnimations), "UpdateWeapon")] [HarmonyPatch(new Type[] { })] public static bool UpdateWeaponFix(PlayerAnimations __instance) { if (!tcenabled) { return true; } if ((Object)(object)MonoSingleton.Instance == (Object)null || (Object)(object)MonoSingleton.Instance.currentWeapon == (Object)null) { return false; } int num = MonoSingleton.Instance.currentSlotIndex - 1; WeaponIdentifier val = default(WeaponIdentifier); bool flag = MonoSingleton.Instance.currentWeapon.TryGetComponent(ref val) && val.alternateVersion; for (int i = 0; i < __instance.weapons.Length; i++) { __instance.weapons[i].SetActive(i == num && !flag); if (i < __instance.altweapons.Length) { __instance.altweapons[i].SetActive(i == num && flag); } } __instance.bigWeapon = num >= 1; __instance.anim.SetBool("BigWeapon", __instance.bigWeapon); return false; } [HarmonyPrefix] [HarmonyPatch(typeof(PlayerAnimations), "Punch")] public static void PunchFistChange(PlayerAnimations __instance, float speed = 1f) { if (tcenabled) { bool flag = false; if (speed < 0.75f) { flag = true; } if (flag) { Transform transform = ((Component)__instance.anim).transform; ((Component)transform.Find("Stray/SadRobot")).gameObject.SetActive(true); ((Component)transform.Find("Stray/Swordsmachine")).gameObject.SetActive(false); } else { Transform transform2 = ((Component)__instance.anim).transform; ((Component)transform2.Find("Stray/SadRobot")).gameObject.SetActive(false); ((Component)transform2.Find("Stray/Swordsmachine")).gameObject.SetActive(true); } } } } [HarmonyPatch] public static class PlatformerPatches { public class StraySpinZone : MonoBehaviour { private List hitEnemies = new List(); public bool interactedWithItem; public GameObject spinSound; public void OnDisable() { interactedWithItem = false; hitEnemies.Clear(); } public void OnEnable() { if (Object.op_Implicit((Object)(object)MonoSingleton.Instance.heldObject)) { MonoSingleton.Instance.currentPunch.ForceThrow(); } } public void OnTriggerEnter(Collider other) { //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Invalid comparison between Unknown and I4 EnemyIdentifier val2 = default(EnemyIdentifier); Breakable val3 = default(Breakable); Glass val4 = default(Glass); if (((Component)other).gameObject.layer == 10 || ((Component)other).gameObject.layer == 11) { EnemyIdentifierIdentifier val = default(EnemyIdentifierIdentifier); if (((Component)other).TryGetComponent(ref val) && Object.op_Implicit((Object)(object)val.eid) && !val.eid.dead) { SpinEnemy(val.eid); } } else if ((((Component)other).gameObject.layer == 12 || ((Component)other).gameObject.CompareTag("Armor")) && ((Component)other).TryGetComponent(ref val2) && !val2.dead) { SpinEnemy(val2); } else if (((Component)other).TryGetComponent(ref val3) && !val3.precisionOnly && !val3.specialCaseOnly) { val3.Break(); } else if (((Component)other).TryGetComponent(ref val4)) { val4.Shatter(); } else { if (((Component)other).gameObject.layer != 22 || interactedWithItem) { return; } ItemIdentifier component = ((Component)other).GetComponent(); ItemPlaceZone[] components = ((Component)other).GetComponents(); if (Object.op_Implicit((Object)(object)MonoSingleton.Instance.heldObject) && components != null && components.Length != 0) { interactedWithItem = true; ((Component)MonoSingleton.Instance.heldObject).SendMessage("PutDown", (object)1); MonoSingleton.Instance.currentPunch.PlaceHeldObject(components, ((Component)other).transform); } else if (!Object.op_Implicit((Object)(object)MonoSingleton.Instance.heldObject) && (Object)(object)component != (Object)null) { interactedWithItem = true; ((Component)component).SendMessage("PickUp", (object)1); MonoSingleton.Instance.currentPunch.ForceHold(component); if ((int)MonoSingleton.Instance.playerType == 1) { MonoSingleton.Instance.CheckItem(); } } else if (Object.op_Implicit((Object)(object)MonoSingleton.Instance.heldObject)) { ((Component)MonoSingleton.Instance.heldObject).SendMessage("HitWith", (object)((Component)other).gameObject, (SendMessageOptions)1); } } } public void SpinEnemy(EnemyIdentifier eid) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0091: 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) //IL_00a1: 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_00b6: Unknown result type (might be due to invalid IL or missing references) if (!hitEnemies.Contains(eid)) { eid.hitter = "punch"; eid.DeliverDamage(((Component)eid).gameObject, Vector3.zero, eid.GetCenter().position, 0.1f, false, 0f, (GameObject)null, false, false); eid.hitter = "heavypunch"; eid.DeliverDamage(((Component)eid).gameObject, Vector3.zero, eid.GetCenter().position, 0.1f, false, 0f, (GameObject)null, false, false); eid.hitter = "clash"; eid.DeliverDamage(((Component)eid).gameObject, (eid.GetCenter().position - ((Component)this).transform.position) * 1000f, eid.GetCenter().position, 9.8f, false, 0f, (GameObject)null, false, false); Object.Instantiate(spinSound); hitEnemies.Add(eid); } } } [HarmonyPrefix] [HarmonyPatch(typeof(SpinZone), "OnEnable")] public static void SpinzoneRemove(SpinZone __instance) { if (tcenabled && !(SceneHelper.CurrentScene == "Level 4-S")) { ((Component)__instance).gameObject.AddComponent().spinSound = __instance.spinSound; Object.Destroy((Object)(object)__instance); } } [HarmonyPostfix] [HarmonyPatch(typeof(PlatformerMovement), "Respawn")] [HarmonyPatch(typeof(PlatformerMovement), "OnEnable")] public static void Add2Hits(PlatformerMovement __instance) { if (SceneHelper.CurrentScene != "Level 4-S" && tcenabled) { __instance.extraHits = 2; __instance.CheckProtector(); } } [HarmonyPrefix] [HarmonyPatch(typeof(PlatformerMovement), "Start")] public static bool ReplaceModel(PlatformerMovement __instance) { //IL_006d: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Expected O, but got Unknown //IL_0102: 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_012d: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled) { return true; } __instance.rb = ((Component)__instance).GetComponent(); __instance.aud = ((Component)__instance).GetComponent(); __instance.playerCollider = ((Component)__instance).GetComponent(); __instance.anim = ((Component)__instance).GetComponent(); Object.Destroy((Object)(object)__instance.anim); Object.Destroy((Object)(object)((Component)((Component)__instance).transform.GetChild(0)).gameObject); GameObject val = Object.Instantiate(MainCode.FetchFromBundle("Player/Clash/ClashStray.prefab", autofill: true), ((Component)__instance).transform.position, ((Component)__instance).transform.rotation, ((Component)__instance).transform); val.transform.localScale = new Vector3(3f, 3f, 3f); __instance.playerModel = val.transform; __instance.anim = val.GetComponent(); __instance.difficulty = MonoSingleton.Instance.GetInt("difficulty", 0); __instance.smr = ((Component)__instance).GetComponentInChildren(); __instance.block = new MaterialPropertyBlock(); ((Component)__instance).transform.position = ((Component)MonoSingleton.Instance.gc).transform.position; __instance.rb.velocity = MonoSingleton.Instance.rb.velocity; __instance.currentYPos = ((Component)__instance).transform.position.y; if ((Object)(object)MonoSingleton.Instance.pmov == (Object)null) { MonoSingleton.Instance.currentPlatformerPlayerPrefab = ((Component)((Component)__instance).transform.parent).gameObject; MonoSingleton.Instance.pmov = __instance; MonoSingleton.Instance.ChangeToPlatformer(); } __instance.spinZone.GetComponent().radius = 0.75f; __instance.spinZone.GetComponent().center = new Vector3(0f, 0.25f, 0f); return false; } [HarmonyPrefix] [HarmonyPatch(typeof(PlatformerMovement), "UpdateWings")] public static bool FuckYouAndYourStupidWings(PlatformerMovement __instance) { if (!tcenabled) { return true; } return false; } } public static MainCode Instance; public static bool tcenabled; public static string tcbundle; public static string tcscenes; public static GameObject bluearm; public static GameObject redarm; public static ManualLogSource Loge = new ManualLogSource("Straymode2"); public static Logger Loge2 = new Logger("Straymode2"); private static AudioMixerGroup mainMixer; private static AudioMixerGroup SMMixer; private static Shader MainShader; private static GameObject[] arm; private static GameObject[] shotgun; private static GameObject[] lasergun; private static GameObject[] rail; public static Dictionary Weapons = new Dictionary(0); private static bool GotWeapons; private static bool candoshit; public static bool overhealed; public static bool Debugging; public static GameObject beam; public static PlySCBeam bgbeam; public static List armguns = new List(); public static List laserguns = new List(); public static List swords = new List(); public static List anchors = new List(); public static Anchor_PhysicsSim curAnchProj; private static bool canTeleportPlayer; private static bool replaced = false; public static List allTargetables = new List(); public static bool DisplayMenuPopup = false; public static bool spawnedPopup = false; private static Sprite dwsprite; private static bool updatedMenu = false; public GameObject superDashHud; public static Dictionary charges = new Dictionary(0); public static List curHoles = new List(); public static SwordDrill curSword; public static bool telefragging = false; public static List boosters = new List(); private static float changeScaleCd = 0f; public static int rageCount; private static AudioSource enSnd; public static float tfTimer; public static bool freezeAnchors; public static GameObject clockNoise; public static List weaponNames = new List { "Revolver", "Shotgun", "Hammer", "Nailgun", "Railcannon", "Rocket Launcher" }; public static List weaponShortNames = new List { "rev", "sho", "arm", "nai", "rai", "rock" }; public static MeshRenderer[] museumRoomObjects = (MeshRenderer[])(object)new MeshRenderer[0]; public static void SendHudMessage(string msg, int delay = 0, bool silent = false) { MonoSingleton.Instance.SendHudMessage(msg, "", "", delay, silent, false, true); } public static IEnumerator ClearHudMessage(float time) { yield return (object)new WaitForSeconds(time); MonoSingleton.Instance.ClearMessage(); } public static Type Fetch(string name) { //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 Addressables.LoadAssetAsync((object)name).WaitForCompletion(); } public static Type FetchFromBundle(string name, bool autofill = false) where Type : Object { //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_0004: 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) if (!autofill) { return Addressables.LoadAssetAsync((object)name).WaitForCompletion(); } return Addressables.LoadAssetAsync((object)("Assets/formods/straymode/" + name)).WaitForCompletion(); } public static SceneInstance LoadFromBundle(string name, LoadSceneMode mode = 1, bool autofill = true) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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) return Addressables.LoadSceneAsync((object)(autofill ? ("Assets/formods/straymode/" + name) : name), mode, true, 100).WaitForCompletion(); } public static AsyncOperationHandle FetchFromBundleAsync(string name, bool autofill = false) where Type : Object { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) if (!autofill) { return Addressables.LoadAssetAsync((object)name); } return Addressables.LoadAssetAsync((object)("Assets/formods/straymode/" + name)); } public static void SetLayerRecursive(GameObject gobject, string layername) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown gobject.layer = LayerMask.NameToLayer(layername); foreach (Transform item in gobject.transform) { Transform val = item; ((Component)val).gameObject.layer = LayerMask.NameToLayer(layername); if ((Object)(object)((Component)val).GetComponentInChildren() != (Object)null) { SetLayerRecursive(((Component)val).gameObject, layername); } } } public static GameObject FindChild(Transform parent, string objPath) { return ((Component)parent.Find(objPath)).gameObject; } public Vector3 Shake(Vector3 originpos, Vector3 pos, float shakeamt) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: 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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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) Vector3 val = Vector3.zero; val = pos + new Vector3(Random.Range(0f - shakeamt, shakeamt), Random.Range(0f - shakeamt, shakeamt), Random.Range(0f - shakeamt, shakeamt)); ((Vector3)(ref val))..ctor(Mathf.Clamp(val.x, originpos.x - 0.01f, originpos.x + 0.01f), Mathf.Clamp(val.y, originpos.y - 0.01f, originpos.y + 0.01f), Mathf.Clamp(val.z, originpos.z - 0.01f, originpos.z + 0.01f)); return val; } public static void Log(string log, int type = 1, bool plog = false) { if (!log.ToLower().StartsWith("[straymode] ")) { log = "[Straymode] " + log; } switch (type) { case 1: if (plog) { Loge2.Info(log, (IEnumerable)null, (string)null, (object)null); } Loge.LogInfo((object)log); break; case 2: if (plog) { Loge2.Warning(log, (IEnumerable)null, (string)null, (object)null); } Loge.LogWarning((object)log); break; case 3: if (plog) { Loge2.Error(log, (IEnumerable)null, (string)null, (object)null); } Loge.LogError((object)log); break; } } public static bool CompareLayer(LayerMask mask, int layer) { //IL_0000: 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 LayerMask.op_Implicit(mask) == (LayerMask.op_Implicit(mask) | (1 << layer)); } public static SlotData GetSlot(int slot) { //IL_003c: 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_0049: Expected O, but got Unknown int currentSlot = GameProgressSaver.currentSlot; GameProgressSaver.currentSlot = slot; string savePath = GameProgressSaver.SavePath; SlotData val = null; val = ((!Directory.Exists(savePath)) ? null : ((GameProgressSaver.ReadFile(GameProgressSaver.generalProgressPath) is GameProgressMoneyAndGear) ? GameProgressSaver.GetDirectorySlotData(savePath) : null)); if (val == null) { val = new SlotData { exists = false }; } GameProgressSaver.currentSlot = currentSlot; return val; } public static bool IsEven(int value) { if ((float)value / 2f == (float)Mathf.RoundToInt((float)value / 2f) || value == 0) { return true; } return false; } public static bool IsPluginLoaded(string guid) { if (!Chainloader.PluginInfos.ContainsKey(guid)) { return false; } return (Object)(object)Chainloader.PluginInfos[guid].Instance != (Object)null; } public static void RefreshCatalogExperimental() { ((MonoBehaviour)Instance).StartCoroutine(RefreshCatalog()); } public static IEnumerator RefreshCatalog() { string path = (tcbundle = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); if (tcbundle != null) { Log("[Straymode] Got bundle " + ((tcbundle != null) ? tcbundle.ToString() : null), 1, plog: true); string text = Path.Combine(path, "catalog.json"); Path.Combine(path, "settings.json"); AsyncOperationHandle cat = Addressables.LoadContentCatalogAsync(text, true, (string)null); cat.Completed += delegate { foreach (string key in cat.Result.Keys) { if (key.StartsWith("Assets/formods/straymode/")) { Log(key); } } Log("Successfully Reloaded Content Catalog!", 2, plog: true); }; yield return cat; } else { Log("[Straymode] Failed to get bundles!", 3, plog: true); } yield return null; } public void Awake() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Invalid comparison between Unknown and I4 //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)this).gameObject != (Object)null && (int)((Object)((Component)this).gameObject).hideFlags != 61) { ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; } Loge = ((BaseUnityPlugin)this).Logger; Instance = this; MainShader = Fetch("Assets/Shaders/MasterShader/ULTRAKILL-Standard.shader"); if (tcbundle == null) { string path = (tcbundle = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); if (tcbundle != null) { Log("[Straymode] Got bundle " + ((tcbundle != null) ? tcbundle.ToString() : null)); string text = Path.Combine(path, "catalog.json"); Path.Combine(path, "settings.json"); AsyncOperationHandle cat = Addressables.LoadContentCatalogAsync(text, true, (string)null); cat.Completed += delegate { foreach (string key in cat.Result.Keys) { if (key.StartsWith("Assets/formods/straymode/")) { Log(key); } } Log("Got Content Catalog!"); }; } else { Log("[Straymode] Failed to get bundles!", 3); } } if (tcbundle != null) { Log("[Straymode] Got bundle"); } SceneManager.sceneLoaded += OnSceneChange; Log("[Straymode] Added onscenechange"); Log("Straymode loaded!"); } public static void GetWeapons() { GotWeapons = true; bluearm = MainCode.FetchFromBundle("Weapons/Stray arm blue.prefab", autofill: true); Log("[Straymode] Got Bluearm "); redarm = MainCode.FetchFromBundle("Weapons/Stray Arm Red.prefab", autofill: true); Log("[Straymode] Got Redarm "); GameObject[] array = (GameObject[])(object)new GameObject[2] { MainCode.FetchFromBundle("Weapons/Stray Pistol.prefab", autofill: true), default(GameObject) }; Log("[Straymode] Got ArmPierce " + ((object)array[0])?.ToString() + " : " + (object)array[1]); GameObject[] array2 = (GameObject[])(object)new GameObject[2] { MainCode.FetchFromBundle("Weapons/Stray Pistol Marksman.prefab", autofill: true), default(GameObject) }; Log("[Straymode] Got ArmMarks " + ((object)array2[0])?.ToString() + " : " + (object)array2[1]); GameObject[] array3 = (GameObject[])(object)new GameObject[2] { MainCode.FetchFromBundle("Weapons/Unknown.prefab", autofill: true), default(GameObject) }; Log("[Straymode] Got Arm3 " + ((object)array3[0])?.ToString() + " : " + (object)array3[1]); if (GetWeapon("ArmPierce", reTry: false) == null) { Weapons.Add("ArmPierce", array); } if (GetWeapon("ArmMarks", reTry: false) == null) { Weapons.Add("ArmMarks", array2); } if (GetWeapon("Arm3", reTry: false) == null) { Weapons.Add("Arm3", array3); } GameObject[] array4 = (GameObject[])(object)new GameObject[2] { MainCode.FetchFromBundle("Weapons/Stray Lasergun.prefab", autofill: true), default(GameObject) }; Log("[Straymode] Got LaserCore " + ((object)array4[0])?.ToString() + " : " + (object)array4[1]); GameObject[] array5 = (GameObject[])(object)new GameObject[2] { MainCode.FetchFromBundle("Weapons/Stray Lasergun Overcharge.prefab", autofill: true), default(GameObject) }; Log("[Straymode] Got LaserOC " + ((object)array5[0])?.ToString() + " : " + (object)array5[1]); GameObject[] array6 = (GameObject[])(object)new GameObject[2] { MainCode.FetchFromBundle("Weapons/Unknown.prefab", autofill: true), default(GameObject) }; Log("[Straymode] Got Laser3 " + ((object)array6[0])?.ToString() + " : " + (object)array6[1]); if (GetWeapon("LaserCore", reTry: false) == null) { Weapons.Add("LaserCore", array4); } if (GetWeapon("LaserOC", reTry: false) == null) { Weapons.Add("LaserOC", array5); } if (GetWeapon("Laser3", reTry: false) == null) { Weapons.Add("Laser3", array6); } GameObject[] array7 = (GameObject[])(object)new GameObject[2] { MainCode.FetchFromBundle("Weapons/Stray Sword.prefab", autofill: true), default(GameObject) }; Log("[Straymode] Got SwordC " + ((object)array7[0])?.ToString() + " : " + (object)array7[1]); GameObject[] array8 = (GameObject[])(object)new GameObject[2] { MainCode.FetchFromBundle("Weapons/Stray Sword Telefrag.prefab", autofill: true), default(GameObject) }; Log("[Straymode] Got SwordT " + ((object)array8[0])?.ToString() + " : " + (object)array8[1]); GameObject[] array9 = (GameObject[])(object)new GameObject[2] { MainCode.FetchFromBundle("Weapons/Unknown.prefab", autofill: true), default(GameObject) }; Log("[Straymode] Got Sword3 " + ((object)array9[0])?.ToString() + " : " + (object)array9[1]); if (GetWeapon("SwordC", reTry: false) == null) { Weapons.Add("SwordC", array7); } if (GetWeapon("SwordT", reTry: false) == null) { Weapons.Add("SwordT", array8); } if (GetWeapon("Sword3", reTry: false) == null) { Weapons.Add("Sword3", array9); } GameObject[] array10 = (GameObject[])(object)new GameObject[2] { MainCode.FetchFromBundle("Weapons/ShotgunWeapon.prefab", autofill: true), default(GameObject) }; Log("[Straymode] Got V.D.C. " + ((object)array10[0])?.ToString() + " : " + (object)array10[1]); GameObject[] array11 = (GameObject[])(object)new GameObject[2] { MainCode.FetchFromBundle("Weapons/ShotgunWeapon Green.prefab", autofill: true), default(GameObject) }; Log("[Straymode] Got M.D.C. " + ((object)array11[0])?.ToString() + " : " + (object)array11[1]); GameObject[] array12 = (GameObject[])(object)new GameObject[2] { MainCode.FetchFromBundle("Weapons/Unknown.prefab", autofill: true), default(GameObject) }; Log("[Straymode] Got DC3 " + ((object)array12[0])?.ToString() + " : " + (object)array12[1]); if (GetWeapon("VDC", reTry: false) == null) { Weapons.Add("VDC", array10); } if (GetWeapon("MDC", reTry: false) == null) { Weapons.Add("MDC", array11); } if (GetWeapon("DC3", reTry: false) == null) { Weapons.Add("DC3", array12); } GameObject[] array13 = (GameObject[])(object)new GameObject[2] { MainCode.FetchFromBundle("Weapons/Stray Anchor.prefab", autofill: true), default(GameObject) }; Log("[Straymode] Got Anch " + ((object)array13[0])?.ToString() + " : " + (object)array13[1]); GameObject[] array14 = (GameObject[])(object)new GameObject[2] { MainCode.FetchFromBundle("Weapons/Stray Anchor Green.prefab", autofill: true), default(GameObject) }; Log("[Straymode] Got Anch2 " + ((object)array14[0])?.ToString() + " : " + (object)array14[1]); GameObject[] array15 = (GameObject[])(object)new GameObject[2] { MainCode.FetchFromBundle("Weapons/Unknown.prefab", autofill: true), default(GameObject) }; Log("[Straymode] Got Anch3 " + ((object)array15[0])?.ToString() + " : " + (object)array15[1]); if (GetWeapon("Anch", reTry: false) == null) { Weapons.Add("Anch", array13); } if (GetWeapon("Anch2", reTry: false) == null) { Weapons.Add("Anch2", array14); } if (GetWeapon("Anch3", reTry: false) == null) { Weapons.Add("Anch3", array15); } Log("[Straymode] Got prefabs"); } public static GameObject[] GetWeapon(string key, bool reTry = true) { if (!Weapons.ContainsKey(key)) { Log("[Straymode] Failed to find weapon " + key, 2); if (reTry) { GetWeapons(); } } if (Weapons.TryGetValue(key, out var value)) { return value; } return null; } public static void GiveWeapon(string wep) { string text = ""; int index = 0; int num = 0; if (wep.EndsWith("_Alt")) { wep.Replace("_Alt", ""); num = 1; } if (!(wep == "ArmPierce")) { if (wep == "ArmMarks") { index = 0; text = "rev2"; } } else { index = 0; text = "rev0"; } bool flag = false; flag = GameProgressSaver.CheckGear(text) != 0 && MonoSingleton.Instance.GetInt("weapon." + text, 0) != 0; if (!flag) { MonoSingleton.Instance.SetInt("weapon." + text, 1); if (!SceneHelper.IsPlayingCustom) { GameProgressSaver.AddGear(text); } } MonoSingleton.Instance.noWeapons = false; if ((Object)(object)MonoSingleton.Instance != (Object)null) { ((Behaviour)MonoSingleton.Instance).enabled = true; MonoSingleton.Instance.ResetWeapons(false); } if (!flag) { for (int i = 0; i < MonoSingleton.Instance.slots[index].Count; i++) { if (((Object)MonoSingleton.Instance.slots[index][i]).name.Contains(((Object)GetWeapon(wep)[num]).name)) { flag = true; } } } if (!flag) { GameObject item = Object.Instantiate(GetWeapon(wep)[num], ((Component)MonoSingleton.Instance).transform); MonoSingleton.Instance.slots[index].Add(item); MonoSingleton.Instance.ForceWeapon(GetWeapon(wep)[num], true); MonoSingleton.Instance.noWeapons = false; MonoSingleton.Instance.UpdateWeaponList(false); } else { if (!SceneHelper.IsPlayingCustom) { return; } for (int j = 0; j < MonoSingleton.Instance.slots[index].Count; j++) { if (((Object)MonoSingleton.Instance.slots[index][j]).name == ((Object)GetWeapon(wep)[num]).name + "(Clone)") { MonoSingleton.Instance.ForceWeapon(GetWeapon(wep)[num], true); MonoSingleton.Instance.noWeapons = false; MonoSingleton.Instance.UpdateWeaponList(false); } } } } public void Start() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) new Harmony("plonk.straymode").PatchAll(); } public static void TheStupidFuckingFlashImageMethod() { ((Component)((Component)MonoSingleton.Instance).transform.Find("Canvas/HurtScreen/Panel")).GetComponent().Flash(1f); } public static void TurnOff24Wind() { GameObject mod = MapModificationsLoaderProxy.GetMod("2-4 Mods"); if (mod.GetComponentsInChildren() != null && mod.GetComponentsInChildren().Length != 0) { ParticleSystem[] componentsInChildren = mod.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].emissionRate = 0f; } } ((Component)mod.transform.Find("WeatherEffect")).gameObject.SetActive(false); ((Component)mod.transform.Find("WeatherEffect")).GetComponent().volume = 0f; ((Component)mod.transform.Find("StencilApplier")).GetComponent().masterShader = MainShader; ((Component)mod.transform.Find("StencilApplier")).GetComponent().LateStart(); ((Component)mod.transform.Find("StencilApplier")).GetComponent().EnableRain(false); } private void OnSceneChange(Scene scene, LoadSceneMode mode) { if (tcenabled) { museumRoomObjects = (MeshRenderer[])(object)new MeshRenderer[0]; overhealed = false; telefragging = false; boosters.Clear(); if (SceneHelper.CurrentScene != "Main Menu") { Patches.ResetAllAmmos(ResetWeaponsToo: true, resetShoCharge: true); } allTargetables.Clear(); _ = Debugging; } } public static void ReplaceLevels() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (!SceneHelper.IsPlayingCustom) { replaced = false; Debug.Log((object)"[Straymode] Scene Loaded"); LoadFromBundle("MapMods/Meshes_ActI-ActII.unity", (LoadSceneMode)1); } } public static void RunActualLevelReplacement() { //IL_0d89: Unknown result type (might be due to invalid IL or missing references) //IL_0d9d: Unknown result type (might be due to invalid IL or missing references) //IL_0df3: Unknown result type (might be due to invalid IL or missing references) //IL_09c0: Unknown result type (might be due to invalid IL or missing references) //IL_09ef: Unknown result type (might be due to invalid IL or missing references) //IL_0aca: Unknown result type (might be due to invalid IL or missing references) //IL_0ad4: Expected O, but got Unknown //IL_0ae2: Unknown result type (might be due to invalid IL or missing references) //IL_0aec: Expected O, but got Unknown //IL_1066: Unknown result type (might be due to invalid IL or missing references) //IL_106b: Unknown result type (might be due to invalid IL or missing references) //IL_1990: Unknown result type (might be due to invalid IL or missing references) //IL_1997: Unknown result type (might be due to invalid IL or missing references) //IL_21af: Unknown result type (might be due to invalid IL or missing references) //IL_21b4: Unknown result type (might be due to invalid IL or missing references) //IL_0e3a: Unknown result type (might be due to invalid IL or missing references) //IL_0c7b: Unknown result type (might be due to invalid IL or missing references) //IL_0c80: Unknown result type (might be due to invalid IL or missing references) //IL_0547: Unknown result type (might be due to invalid IL or missing references) //IL_0551: Expected O, but got Unknown //IL_079c: Unknown result type (might be due to invalid IL or missing references) //IL_07d0: Unknown result type (might be due to invalid IL or missing references) //IL_12a2: Unknown result type (might be due to invalid IL or missing references) //IL_12ac: Expected O, but got Unknown //IL_120c: Unknown result type (might be due to invalid IL or missing references) //IL_1211: Unknown result type (might be due to invalid IL or missing references) //IL_21cd: Unknown result type (might be due to invalid IL or missing references) //IL_21d4: Invalid comparison between Unknown and I4 //IL_2261: Unknown result type (might be due to invalid IL or missing references) //IL_2266: Unknown result type (might be due to invalid IL or missing references) //IL_0c99: Unknown result type (might be due to invalid IL or missing references) //IL_0ca0: Invalid comparison between Unknown and I4 //IL_227f: Unknown result type (might be due to invalid IL or missing references) //IL_2286: Invalid comparison between Unknown and I4 List list = new List { "CreditsMuseum2", "Level 6-2" }; List list2 = new List { "EventSystem", "StatsManager", "FirstRoom", "FirstRoom Prime", "FirstRoom Secret", "FirstRoom Encore", "FinalRoom", "Final Room", "FinalRoom SecretExit", "Level Info", "Door Trigger", "CausticVolumeManager", "0-S Mods", "Museum Mods", "1-1 Construction", "Player", "Platformer", "GameController", "DryZoneController", "OnLevelStart", "ScreenDistortionController", "Canvas", "SuperDash Hud", "'Loper" }; string currentScene = SceneHelper.CurrentScene; Scene activeScene; GameObject[] rootGameObjects; switch (currentScene) { case "Main Menu": { ((UnityEvent)FindObjectEvenIfDisabled("Canvas", "Main Menu (1)/LeftSide/Continue").GetComponent