Decompiled source of StrayMode v2.1.4
Straymode2.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
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 Straymode.IdentifierCode; using Straymode.InGameCode; using Straymode.InGameCode.CustomProjectiles; using Straymode.WeaponCode; using TMPro; using ULTRAKILL.Cheats; using Unity.AI.Navigation; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Audio; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.SceneManagement; using UnityEngine.UI; [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("2.0.9.0")] [assembly: NeutralResourcesLanguage("en-FI")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.0.9.0")] [module: UnverifiableCode] 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")); } } 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (((Component)other).gameObject.CompareTag("Player")) { NewMovement instance = MonoSingleton<NewMovement>.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.rotation = endpoint.rotation; } Portal portal = default(Portal); if (((Component)other).gameObject.TryGetComponent<Portal>(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 = "2.1.4"; } [BepInPlugin("plonk.straymode", "Straymode2", "2.1.4")] public class MainCode : BaseUnityPlugin { [Serializable] public class Charge { public float amt; public float target; public float speed; public bool autoRegen; public bool resetToZero; public Charge(float amt, float target, float speed, bool autoRegen, bool resetToZero = false) { this.amt = amt; this.target = target; this.speed = speed; this.autoRegen = autoRegen; this.resetToZero = resetToZero; } public void SetTo(float percentage) { amt = Mathf.Lerp(0f, target, percentage / 100f); } public void SetToValue(float val) { amt = val; } public void Run() { if (autoRegen) { amt = Mathf.MoveTowards(amt, target, Time.deltaTime * speed); } } public float GetPercentage() { return Mathf.Abs(amt / target) * 100f; } public void Reset() { if (resetToZero) { SetTo(0f); } else { SetTo(100f); } } } [HarmonyPatch] public class Patches { [HarmonyPrefix] [HarmonyPatch(typeof(OptionsMenuToManager), "Start")] public static void OPMStartPatch() { } [HarmonyPrefix] [HarmonyPatch(typeof(EnemyIdentifier), "Start")] public static void SCDontAttackPatch(EnemyIdentifier __instance) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Invalid comparison between Unknown and I4 //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Invalid comparison between Unknown and I4 bool flag = false; if (((int)__instance.enemyType == 13) | ((int)__instance.enemyType == 15)) { flag = true; } if (flag & tcenabled) { __instance.prioritizeEnemiesUnlessAttacked = true; __instance.attackEnemies = 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Expected O, but got Unknown //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Expected O, but got Unknown //IL_0112: 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<SlotRowPanel>(__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<SlotRowPanel> list = new List<SlotRowPanel>(); list.AddRange(__instance.slots); list.Add(newRow); __instance.slots = list.ToArray(); } } [HarmonyPostfix] [HarmonyPatch(typeof(NewMovement), "Start")] private static void MovementSoundPatch(NewMovement __instance) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) if (MonoSingleton<PrefsManager>.Instance.GetInt("selectedSaveSlot", 0) == 1015064006) { Transform transform = ((Component)__instance).transform; transform.localScale *= 1.3f; GameProgressMoneyAndGear generalProgress = GameProgressSaver.GetGeneralProgress(); generalProgress.revalt = 0; generalProgress.sho2 = 0; generalProgress.rev1 = 0; generalProgress.nai2 = 0; generalProgress.nai3 = 0; generalProgress.naialt = 0; generalProgress.beam0 = 0; generalProgress.beam1 = 0; generalProgress.beam2 = 0; generalProgress.beam3 = 0; generalProgress.rai1 = 0; generalProgress.rai3 = 0; generalProgress.rock0 = 0; generalProgress.rock1 = 0; generalProgress.rock2 = 0; generalProgress.rock3 = 0; generalProgress.arm2 = 0; generalProgress.arm3 = 0; GameProgressSaver.WriteFile(GameProgressSaver.generalProgressPath, (object)generalProgress); switch (SceneHelper.CurrentScene) { case "Level 0-4": __instance.cc.cam.useOcclusionCulling = false; break; case "Level 0-5": __instance.cc.cam.useOcclusionCulling = false; break; case "Level 0-S": __instance.cc.cam.useOcclusionCulling = false; break; case "Level 1-4": __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<Slider>().maxValue = 80f; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (2)/Filler/AntiHealth Slider")).GetComponent<Slider>().minValue = 19f; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (2)/Filler/Supercharge Slider")).GetComponent<Slider>().minValue = 80f; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (2)/Filler/Supercharge Slider")).GetComponent<Slider>().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<Image>().sprite = ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 3/Fill Area/Fill")).GetComponent<Image>().sprite; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 2/Fill Area/Fill/ReadyFlash")).GetComponent<Image>().sprite = ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 3/Fill Area/Fill")).GetComponent<Image>().sprite; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 2/Background")).GetComponent<Image>().sprite = ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 3/Fill Area/Fill")).GetComponent<Image>().sprite; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/Filler/Panel (3)/Stamina Slider 2/Fill Area/Fill")).GetComponent<Image>().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<Image>().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<Image>().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<Image>()).enabled = false; ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/RailcannonChargePanel/Panel")).GetComponent<Image>().sprite = MainCode.FetchFromBundle<Sprite>("Textures/UI/lightningboltbigvector.png", autofill: true); ((Component)((Component)__instance).transform.Find("Main Camera/HUD Camera/HUD/GunCanvas/StatsPanel/RailcannonChargePanel/Panel (2)")).GetComponent<Image>().sprite = MainCode.FetchFromBundle<Sprite>("Textures/UI/lightningboltbigvector.png", autofill: true); } } [HarmonyPrefix] [HarmonyPatch(typeof(CameraFrustumTargeter), "Update")] public static bool CFTUpdate(CameraFrustumTargeter __instance) { //IL_00b0: 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_00cc: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025c: 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_026a: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: 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; } RaycastHit val = default(RaycastHit); if (__instance.RaycastFromViewportCenter(ref val) && !Physics.Raycast(__instance.camera.ViewportPointToRay(Vector2.op_Implicit(new Vector2(0.5f, 0.5f))), ((RaycastHit)(ref val)).distance, LayerMask.op_Implicit(__instance.occlusionMask))) { Collider collider = ((RaycastHit)(ref val)).collider; if (!collider.isTrigger || ((Component)collider).gameObject.layer == 22) { __instance.CurrentTarget = collider; __instance.IsAutoAimed = false; return false; } } __instance.CalculateFrustumInformation(); int num = Physics.OverlapBoxNonAlloc(((Bounds)(ref __instance.bounds)).center, ((Bounds)(ref __instance.bounds)).extents, __instance.targets, ((Component)__instance).transform.rotation, ((LayerMask)(ref __instance.mask)).value); float num2 = float.PositiveInfinity; Collider currentTarget = null; HookPoint val3 = default(HookPoint); BlackHole blackHole = default(BlackHole); Grenade val4 = default(Grenade); for (int i = 0; i < num; i++) { Vector3 position = ((Component)__instance).transform.position; Bounds bounds = __instance.targets[i].bounds; Vector3 val2 = ((Bounds)(ref bounds)).center - position; if ((((Component)__instance.targets[i]).gameObject.layer != 22 && __instance.targets[i].isTrigger) || (((Component)__instance.targets[i]).gameObject.layer == 22 && (!((Component)__instance.targets[i]).TryGetComponent<HookPoint>(ref val3) || !val3.active)) || (((Component)__instance.targets[i]).gameObject.layer == 10 && !((Component)__instance.targets[i]).TryGetComponent<BlackHole>(ref blackHole)) || (((Component)__instance.targets[i]).gameObject.layer == 14 && !((Component)__instance.targets[i]).TryGetComponent<Grenade>(ref val4))) { continue; } int num3 = Physics.RaycastNonAlloc(position, val2, __instance.occluders, ((Vector3)(ref val2)).magnitude, ((LayerMask)(ref __instance.occlusionMask)).value, (QueryTriggerInteraction)1); for (int j = 0; j < num3; j++) { if (!((Object)(object)((RaycastHit)(ref __instance.occluders[j])).collider == (Object)null)) { __instance.CurrentTarget = currentTarget; __instance.IsAutoAimed = true; return false; } } Camera camera = __instance.camera; bounds = __instance.targets[i].bounds; Vector3 val5 = camera.WorldToViewportPoint(((Bounds)(ref bounds)).center); float num4 = Vector3.Distance(val5, Vector2.op_Implicit(new Vector2(0.5f, 0.5f))); if (val5.x <= 0.5f + __instance.maxHorAim / 2f && val5.x >= 0.5f - __instance.maxHorAim / 2f && val5.y <= 0.5f + __instance.maxHorAim / 2f && val5.y >= 0.5f - __instance.maxHorAim / 2f && val5.z >= 0f && num4 < num2) { num2 = num4; currentTarget = __instance.targets[i]; } } __instance.CurrentTarget = currentTarget; __instance.IsAutoAimed = true; return false; } [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<CustomParryProjectile>(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")) { array = GetWeapon("LaserCore"); } else if (name.Contains("Nail")) { array = GetWeapon("SwordC"); } else if (name.Contains("ShotgunWeapon")) { array = GetWeapon("VDC"); } } } 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Invalid comparison between Unknown and I4 //IL_00ef: Unknown result type (might be due to invalid IL or missing references) if (tcenabled) { if (((Component)other).gameObject.CompareTag("Player") && !__instance.activated) { if (!__instance.ghost) { __instance.activated = true; MonoSingleton<TimeController>.Instance.ParryFlash(); StyleHUD instance = MonoSingleton<StyleHUD>.Instance; StatsManager instance2 = MonoSingleton<StatsManager>.Instance; Object.Instantiate<GameObject>(__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<TimeController>.Instance.ParryFlash(); } Object.Instantiate<GameObject>(__instance.breakEffect, ((Component)__instance).transform.position, Quaternion.identity); Object.Destroy((Object)(object)((Component)__instance).gameObject); } if (__instance.superCharge) { if ((int)MonoSingleton<PlayerTracker>.Instance.playerType == 0) { overhealed = true; MonoSingleton<NewMovement>.Instance.hp = 160; } else { MonoSingleton<PlatformerMovement>.Instance.AddExtraHit(2); } if (!MonoSingleton<PrefsManager>.Instance.GetBool("hideSuperChargePopup", false)) { MonoSingleton<PrefsManager>.Instance.SetBool("hideSuperChargePopup", true); MonoSingleton<HudMessageReceiver>.Instance.SendHudMessage("<color=red>RED SOUL ORBS</color> give <color=green>200 HEALTH</color>. \nOverheal cannot be regained with blood.", "", "", 1, false, false, true); } } else if ((int)MonoSingleton<PlayerTracker>.Instance.playerType == 1) { MonoSingleton<PlatformerMovement>.Instance.AddExtraHit(1); } } return false; } return true; } [HarmonyPrefix] [HarmonyPatch(typeof(IntroTextController), "Awake")] public static void replaceTutorialText(IntroTextController __instance) { if (SceneHelper.CurrentScene == "Tutorial" && tcenabled) { ((TMP_Text)__instance.page1Screen.GetComponent<TextMeshProUGUI>()).text = ((TMP_Text)MainCode.FetchFromBundle<GameObject>("page 1 first.prefab", autofill: true).GetComponent<TextMeshProUGUI>()).text; ((TMP_Text)__instance.page1SecondTimeScreen.GetComponent<TextMeshProUGUI>()).text = ((TMP_Text)MainCode.FetchFromBundle<GameObject>("page 1 second.prefab", autofill: true).GetComponent<TextMeshProUGUI>()).text; ((TMP_Text)__instance.page2Screen.GetComponent<TextMeshProUGUI>()).text = ((TMP_Text)MainCode.FetchFromBundle<GameObject>("page 2 alternate.prefab", autofill: true).GetComponent<TextMeshProUGUI>()).text; ((TMP_Text)__instance.page2NoFade.GetComponent<TextMeshProUGUI>()).text = ((TMP_Text)MainCode.FetchFromBundle<GameObject>("page 2 nofade alternate.prefab", autofill: true).GetComponent<TextMeshProUGUI>()).text; } } [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) { if ((Object)(object)__instance.gunc == (Object)null) { __instance.gunc = ((Component)__instance).GetComponent<GunControl>(); } int num = 5; for (int i = 0; i < Mathf.Min(__instance.gunc.slots.Count, num); i++) { List<GameObject> list = __instance.gunc.slots[i]; foreach (GameObject item in list) { Object.Destroy((Object)(object)item); } list.Clear(); } List<int> 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, AddressablesExtensions.ToAssets(__instance.rocketBlue)); break; case 1: __instance.CheckWeapon("rock1", __instance.gunc.slot5, AddressablesExtensions.ToAssets(__instance.rocketGreen)); 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<FistControl>.Instance.shopping) { __instance.gunc.ForceWeapon(((Component)((Component)__instance.gunc).transform.GetChild(0)).gameObject, true); __instance.gunc.UpdateWeaponIcon(false); } return false; } return true; } [HarmonyPrefix] [HarmonyPatch(typeof(StyleHUD), "Update")] public static void NullFreshnessFix(StyleHUD __instance) { if (!tcenabled) { return; } Dictionary<GameObject, float> dictionary = new Dictionary<GameObject, float>(); foreach (KeyValuePair<GameObject, float> item in __instance.weaponFreshness) { if ((Object)(object)item.Key == (Object)null) { dictionary.Add(item.Key, item.Value); } } foreach (KeyValuePair<GameObject, float> 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<GunControl>(); } int num = 0; if (MonoSingleton<PrefsManager>.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(AddressablesExtensions.ToAsset(__instance.nailMagnet[num]), true); break; case "nai1": __instance.gunc.ForceWeapon(AddressablesExtensions.ToAsset(__instance.nailOverheat[num]), true); break; case "nai2": __instance.gunc.ForceWeapon(AddressablesExtensions.ToAsset(__instance.nailRed[num]), true); break; case "rai0": __instance.gunc.ForceWeapon(AddressablesExtensions.ToAsset(__instance.railCannon[num]), true); break; case "rai1": __instance.gunc.ForceWeapon(AddressablesExtensions.ToAsset(__instance.railHarpoon[num]), true); break; case "rai2": __instance.gunc.ForceWeapon(AddressablesExtensions.ToAsset(__instance.railMalicious[num]), true); break; case "rock0": __instance.gunc.ForceWeapon(AddressablesExtensions.ToAsset(__instance.rocketBlue[num]), true); break; case "rock1": __instance.gunc.ForceWeapon(AddressablesExtensions.ToAsset(__instance.rocketGreen[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) { MonoSingleton<GunSetter>.Instance.ResetWeapons(false); } } [HarmonyPrefix] [HarmonyPatch(typeof(FistControl), "ResetFists")] public static bool resetFistsPatch(FistControl __instance) { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Invalid comparison between Unknown and I4 //IL_0086: Unknown result type (might be due to invalid IL or missing references) if (tcenabled) { 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(); } MonoSingleton<HookArm>.Instance.equipped = false; if ((MonoSingleton<PrefsManager>.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<GameObject>(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<PrefsManager>.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; } return true; } [HarmonyPrefix] [HarmonyPatch(typeof(FistControl), "CheckFist")] public static bool checkFistsPatch(FistControl __instance, string name) { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Invalid comparison between Unknown and I4 //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Invalid comparison between Unknown and I4 //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Invalid comparison between Unknown and I4 //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Invalid comparison between Unknown and I4 if (tcenabled) { if (__instance.forcedLoadout != null) { if (!(name == "arm1")) { if (name == "arm2") { if ((int)__instance.forcedLoadout.arm.greenVariant == 1) { MonoSingleton<HookArm>.Instance.equipped = true; return false; } if ((int)__instance.forcedLoadout.arm.greenVariant == 2) { return false; } } } else { if ((int)__instance.forcedLoadout.arm.redVariant == 1) { __instance.spawnedArmNums.Add(1); GameObject val = Object.Instantiate<GameObject>(redarm, ((Component)__instance).transform); val.AddComponent<StraymodeWeaponID>(); __instance.spawnedArms.Add(val); return false; } if ((int)__instance.forcedLoadout.arm.redVariant == 2) { return false; } } } if (MonoSingleton<PrefsManager>.Instance.GetInt("weapon." + name, 1) == 1 && GameProgressSaver.CheckGear(name) == 1) { GameObject val2 = null; switch (name) { case "arm3": val2 = Object.Instantiate<GameObject>(AddressablesExtensions.ToAsset(__instance.goldArm), ((Component)__instance).transform); __instance.spawnedArmNums.Add(3); break; case "arm2": MonoSingleton<HookArm>.Instance.equipped = true; break; case "arm1": val2 = Object.Instantiate<GameObject>(redarm, ((Component)__instance).transform); val2.AddComponent<StraymodeWeaponID>(); __instance.spawnedArmNums.Add(1); break; } if ((Object)(object)val2 != (Object)null) { __instance.spawnedArms.Add(val2); } } return false; } return true; } [HarmonyPrefix] [HarmonyPatch(typeof(MenuActSelect), "OnEnable")] public static void RemoveAct2And3(MenuActSelect __instance) { if (tcenabled && ((((Object)((Component)__instance).transform).name == "Act II") | (((Object)((Component)__instance).transform).name == "Act III"))) { __instance.forceOff = true; } } [HarmonyPrefix] [HarmonyPatch(typeof(LeaderboardController), "SubmitLevelScore")] [HarmonyPatch(typeof(LeaderboardController), "SubmitCyberGrindScore")] private static bool DisableLeaderboardSubmissions() { return false; } [HarmonyPostfix] [HarmonyPatch(typeof(NewMovement), "Respawn")] public static void ResetWeaponsStuff() { ResetAllAmmos(ResetWeaponsToo: true, resetShoCharge: true); } [HarmonyPostfix] [HarmonyPatch(typeof(WeaponCharges), "MaxCharges")] public static void ResetWeaponsStuff2() { ResetAllAmmos(ResetWeaponsToo: false); } public static void ResetAllAmmos(bool ResetWeaponsToo = true, bool resetShoCharge = false) { foreach (KeyValuePair<string, Charge> charge in charges) { charge.Value.Reset(); } if (!ResetWeaponsToo) { return; } foreach (StrayGun armgun in armguns) { armgun.Reset(); } foreach (StrayLaserGun lasergun in laserguns) { lasergun.Reset(); } } [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<SpawnableObject>("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<SpawnableObject>("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++) { if (objects.enemies[k].identifier == "ultrakill.v2") { objects.enemies[k] = MainCode.FetchFromBundle<SpawnableObject>("Enemies/Swordscleaner/V2Straymode.asset", autofill: true); } } } [HarmonyPrefix] [HarmonyPatch(typeof(PlayerActivator), "OnTriggerEnter")] public static void Skip01Thing(PlayerActivator __instance, Collider other) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) if (((Component)other).gameObject.CompareTag("Player") && tcenabled && SceneHelper.CurrentScene == "Level 0-1" && !__instance.activated && canTeleportPlayer) { ((Component)MonoSingleton<NewMovement>.instance).transform.position = new Vector3(40f, 0f, 380f); canTeleportPlayer = false; } } [HarmonyPrefix] [HarmonyPatch(typeof(RevolverAnimationReceiver), "Click")] public static bool ClickFix(RevolverAnimationReceiver __instance) { StraymodeWeaponID straymodeWeaponID = default(StraymodeWeaponID); if (tcenabled & ((Component)__instance).TryGetComponent<StraymodeWeaponID>(ref straymodeWeaponID)) { if (Object.op_Implicit((Object)(object)__instance.click)) { AudioSource component = Object.Instantiate<GameObject>(__instance.click).GetComponent<AudioSource>(); 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<GameObject>(); foreach (List<GameObject> 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<ItemIdentifier>(ref val)) { __instance.events.Invoke(""); ((Component)other).gameObject.SetActive(false); ((Component)__instance).GetComponent<Collider>().enabled = false; } } } [HarmonyPatch] public class TerminalPatches { public static void ReplaceWeaponIconAndDesc(Transform t, string name, string desc, WeaponDescriptor icon, int var) { ((Component)t.GetChild(2)).GetComponent<TextMeshProUGUI>(); Transform child = t.GetChild(1); Transform parent = t.parent.parent.parent; ((Component)child).GetComponent<Image>().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<TextMeshProUGUI>()).text = name; ((TMP_Text)((Component)val.Find("Name")).GetComponent<TextMeshProUGUI>()).text = name; ((TMP_Text)((Component)val.Find("Description")).GetComponent<TextMeshProUGUI>()).text = desc; ((Component)val.Find("Icon Inset/Icon")).GetComponent<Image>().sprite = ((Component)child).GetComponent<Image>().sprite; } [HarmonyPostfix] [HarmonyPatch(typeof(VariationInfo), "Start")] public static void ChangeWeaponDescriptions(VariationInfo __instance) { if (!tcenabled) { return; } ReplaceWeaponName(((Component)((Component)__instance).transform.GetChild(2)).GetComponent<TextMeshProUGUI>()); ReplaceWeaponName(((Component)((Component)__instance).transform.parent.parent.Find("Title")).GetComponent<TextMeshProUGUI>()); if (__instance.weaponName.Contains("rev")) { string weaponName = __instance.weaponName; if (weaponName != null) { if (weaponName.Contains("0")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "PIERCING", "<color=orange>Primary fire</color>: Hold to fire. \r\n<color=orange>Alt fire</color>: Fire a bouncy, penetrating beam.", MainCode.FetchFromBundle<WeaponDescriptor>("Weapons/Descriptors/StrayPistol.asset", autofill: true), 0); } else if (weaponName.Contains("2")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "REFLECTOR", "<color=orange>Alt fire</color> to charge the last fired orb to make it reflect and boost projectiles shot into it. Charged orbs becomes <color=red>supercharged</color> for a short time, allowing for more combo potential.", MainCode.FetchFromBundle<WeaponDescriptor>("Weapons/Descriptors/StrayPistol Electric.asset", autofill: true), 1); } else if (weaponName.Contains("1")) { if (GameProgressSaver.CheckGear(__instance.weaponName) > 0) { __instance.ChangeEquipment(0); MonoSingleton<GunControl>.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", "<color=orange>PRIMARY FIRE</color>: Fire shotgun pellets in a triangular pattern.\r\n<color=orange>ALTERNATE FIRE</color>: Launch a volley of three grenades using 75 ammo.", MainCode.FetchFromBundle<WeaponDescriptor>("Weapons/Descriptors/StrayLaserGun Alt.asset", autofill: true), 0); } else if (weaponName2.Contains("1")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "OVERCHARGE", "Shoot to slowly charge <color=orange>Alt fire</color>.\n<color=orange>Alt fire</color> fires a powerful, penetrating electricity beam.", MainCode.FetchFromBundle<WeaponDescriptor>("Weapons/Descriptors/StrayLaserGun Green Alt.asset", autofill: true), 1); } else if (weaponName2.Contains("2")) { if (GameProgressSaver.CheckGear(__instance.weaponName) > 0) { __instance.ChangeEquipment(0); MonoSingleton<GunControl>.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", "<color=orange>Primary fire</color>: Slash enemies.\n<color=orange>Secondary fire</color>: Throw the sword. Thrown swords get stuck in <color=orange>Heavy enemies</color>.", MainCode.FetchFromBundle<WeaponDescriptor>("Weapons/Descriptors/StraySword.asset", autofill: true), 0); } else if (weaponName3.Contains("1")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "TELEFRAG", "<color=orange>Alt Fire (While looking at an enemy)</color>: Teleport into the enemy and slash them, dealing damage and additionally applying a shock effect if a <color=#00ffff>Thrown sword</color> is embedded in the enemy.", MainCode.FetchFromBundle<WeaponDescriptor>("Weapons/Descriptors/StraySword Tele.asset", autofill: true), 1); } else if (weaponName3.Contains("2")) { if (GameProgressSaver.CheckGear(__instance.weaponName) > 0) { __instance.ChangeEquipment(0); MonoSingleton<GunControl>.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", "<color=orange>Primary fire</color>: Fire a powerful ball of energy. Projectile explodes on contact with terrain. Recharges even when not equipped.", MainCode.FetchFromBundle<WeaponDescriptor>("Weapons/Descriptors/StrayCannon.asset", autofill: true), 0); } else if (weaponName4.Contains("2")) { ReplaceWeaponIconAndDesc(((Component)__instance).transform, "M.D.C. CONFIG", "<color=orange>Primary fire</color>: Fire a powerful, explosive ball of energy. Projectile explodes on contact with objects. Recharges even when not equipped.", MainCode.FetchFromBundle<WeaponDescriptor>("Weapons/Descriptors/StrayCannon Green.asset", autofill: true), 2); } else if (weaponName4.Contains("1")) { if (GameProgressSaver.CheckGear(__instance.weaponName) > 0) { __instance.ChangeEquipment(0); MonoSingleton<GunControl>.Instance.UpdateWeaponList(false); } ((Component)__instance).gameObject.SetActive(false); } } Log("Replaced Rail Image!"); } if (__instance.weaponName.Contains("arm")) { string weaponName5 = __instance.weaponName; if (weaponName5 != null && !weaponName5.Contains("0")) { if (weaponName5.Contains("1")) { ((TMP_Text)((Component)((Component)__instance).transform.parent.parent.parent.Find("Arm Info (Red)").Find("Panel/Description")).GetComponent<TextMeshProUGUI>()).text = "Slow punch with high damage and knockback.\r\n\r\n<color=orange>Hold Punch</color> to launch the hammer forward, causing a <color=orange>shockwave</color> that knocks surrounding enemies away."; ((TMP_Text)((Component)((Component)__instance).transform.parent.parent.parent.Find("Arm Info (Red)").Find("Panel/Name")).GetComponent<TextMeshProUGUI>()).text = "PILEDRIVER"; ((TMP_Text)((Component)((Component)__instance).transform.parent.parent.parent.Find("Arm Info (Red)").Find("Title")).GetComponent<TextMeshProUGUI>()).text = "PILEDRIVER"; ((TMP_Text)((Component)((Component)__instance).transform.Find("Variation Name")).GetComponent<TextMeshProUGUI>()).text = "PILEDRIVER"; } else { weaponName5.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("2")) { flag = true; } if (flag && !Debugging) { if (GameProgressSaver.CheckGear(__instance.weaponName) > 0) { __instance.ChangeEquipment(0); MonoSingleton<GunControl>.Instance.UpdateWeaponList(false); } ((Component)__instance).gameObject.SetActive(false); } if (!__instance.weaponName.Contains("arm")) { ((Component)((Component)__instance).transform.parent.Find("Info and Color Panel")).gameObject.SetActive(false); } } 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 = "INDEV"; } 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 = "INDEV"; } 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<TextMeshProUGUI>()).text = "STRAY ARM"; } else if (__instance.weaponName.Contains("sho")) { ((TMP_Text)((Component)__instance).GetComponentInChildren<TextMeshProUGUI>()).text = "MACHINE SHOTGUN"; } else if (__instance.weaponName.Contains("nai")) { ((TMP_Text)((Component)__instance).GetComponentInChildren<TextMeshProUGUI>()).text = "SWORD"; } else if (__instance.weaponName.Contains("rai")) { ((TMP_Text)((Component)__instance).GetComponentInChildren<TextMeshProUGUI>()).text = "DISPLACEMENT CANNON"; } } } [HarmonyPatch] public class TipsOfTheDay { public static List<string> newTexts = new List<string> { "The <color=#40E7FF>Piercing</color> arm deals <color=orange>locational damage</color>.\r\n\r\nA <color=orange>headshot</color> deals <color=orange>2x</color> damage.\r\n", "<color=orange>Machine Shotgun mobility</color>:\nThe Machine Shotguns knock you back when firing.\nUse it to your advantage.", "Shooting <color=#40E7FF>SHOTGUN CORES</color> at <color=red>SUPERCHARGED</color> <color=green>REFLECTOR PROJECTILES</color> them explode.", "<color=#40E7FF>THROWN SWORDS</color> can get <color=orange>STUCK</color> in <color=orange>Heavy Enemies</color>." }; [HarmonyPostfix] [HarmonyPatch(typeof(ShopZone), "Start")] public static void TipsFix(ShopZone __instance) { if ((Object)(object)((Component)__instance).transform.Find("Canvas/Background/Main Panel/Tip of the Day/Panel/Text Inset/TipText") != (Object)null && tcenabled) { TextMeshProUGUI component = ((Component)((Component)__instance).transform.Find("Canvas/Background/Main Panel/Tip of the Day/Panel/Text Inset/TipText")).GetComponent<TextMeshProUGUI>(); switch (SceneHelper.CurrentScene) { case "Level 0-2": ((TMP_Text)component).text = newTexts[0]; break; case "Level 0-4": ((TMP_Text)component).text = newTexts[1]; break; case "Level 1-2": ((TMP_Text)component).text = newTexts[2]; break; case "Level 1-4": ((TMP_Text)component).text = newTexts[3]; break; } } } } [HarmonyPatch] public class EnemyPatches { [HarmonyPrefix] [HarmonyPatch(typeof(V2), "LateUpdate")] private static bool LateUpdateFix(V2 __instance) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0134: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: 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_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0278: 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_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0202: 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_0212: Unknown result type (might be due to invalid IL or missing references) //IL_021f: 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_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled) { 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; 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 + Vector3.up * 1.5f + val.velocity * (Vector3.Distance(position, __instance.aimAtTarget[0].position) * (__instance.predictAmount / 10f))); } else { __instance.aimAtTarget[0].LookAt(position + Vector3.up * 1.5f + 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 + Vector3.up * 1.5f + 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(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; return false; } return true; } [HarmonyPostfix] [HarmonyPatch(typeof(MinosBoss), "Update")] private static void UpdatePatchForMinos(MinosBoss __instance) { if (tcenabled && !(SceneHelper.CurrentScene != "Level 2-4")) { 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); } } } [HarmonyPrefix] [HarmonyPatch(typeof(MinosPrime), "Update")] public static bool MinosUpdateThing(MinosPrime __instance) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0203: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: 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_01ce: 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) if (!tcenabled || __instance.eid.overrideFullName != "Greater Angel Tyros") { return true; } if (__instance.target == null) { return false; } if (__instance.activated) { if (((Component)__instance).transform.position.y < -200f && SceneHelper.CurrentScene == "Level 3-2") { __instance.rb.MovePosition(new Vector3(0f, 10f, 120f)); } __instance.playerPos = new Vector3(__instance.target.position.x, ((Component)__instance).transform.position.y, __instance.target.position.z); if (!__instance.inAction) { __instance.cooldown = Mathf.MoveTowards(__instance.cooldown, 0f, Time.deltaTime * __instance.eid.totalSpeedModifier); } if (!__instance.enraged && __instance.mach.health < __instance.originalHp / 2f) { __instance.enraged = true; __instance.aud.clip = __instance.phaseChangeVoice; __instance.aud.pitch = 2f; __instance.aud.Play(); __instance.currentPassiveEffect = Object.Instantiate<GameObject>(__instance.passiveEffect, ((Component)__instance).transform.position + Vector3.up * 3.5f, Quaternion.identity); __instance.currentPassiveEffect.transform.SetParent(((Component)__instance).transform); EnemyIdentifierIdentifier[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<EnemyIdentifierIdentifier>(); foreach (EnemyIdentifierIdentifier val in componentsInChildren) { Object.Instantiate<GameObject>(__instance.flameEffect, ((Component)val).transform); } Object.Instantiate<GameObject>(__instance.phaseChangeEffect, __instance.mach.chest.transform.position, Quaternion.identity); return false; } } else { if (__instance.ascending) { __instance.rb.velocity = Vector3.MoveTowards(__instance.rb.velocity, Vector3.up * 3f, Time.deltaTime); MonoSingleton<CameraController>.Instance.CameraShake(0.1f); return false; } if (__instance.vibrating) { ((Component)__instance).transform.position = new Vector3(__instance.origPos.x + Random.Range(-0.1f, 0.1f), __instance.origPos.y + Random.Range(-0.1f, 0.1f), __instance.origPos.z + Random.Range(-0.1f, 0.1f)); } } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(MinosPrime), "Dropkick")] public static bool MinosDropKick(MinosPrime __instance) { if (!tcenabled || __instance.eid.overrideFullName != "Greater Angel Tyros") { return true; } __instance.inAction = true; if (Object.op_Implicit((Object)(object)__instance.nma) && __instance.nma.isOnNavMesh) { __instance.nma.isStopped = true; } __instance.anim.Play("Dropkick", 0, 0f); __instance.tracking = true; __instance.fullTracking = false; __instance.sc.knockBackForce = 100f; __instance.aiming = false; __instance.attackAmount += 2; if (!__instance.enraged) { __instance.cooldown += 1.25f; } else { __instance.cooldown += 0.25f; } return false; } [HarmonyPrefix] [HarmonyPatch(typeof(MinosPrime), "Combo")] public static bool MinosCombo(MinosPrime __instance) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Invalid comparison between Unknown and I4 //IL_0035: 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) if (!tcenabled || __instance.eid.overrideFullName != "Greater Angel Tyros") { return true; } if ((int)__instance.previousCombo == 1) { __instance.Boxing(); return false; } __instance.previousCombo = (MPAttack)1; __instance.inAction = true; ((Component)__instance).transform.LookAt(__instance.playerPos); __instance.tracking = true; __instance.fullTracking = false; __instance.gravityInAction = false; __instance.anim.Play("Combo", 0, 0f); __instance.sc.knockBackForce = 50f; __instance.aiming = false; __instance.attackAmount += 3; return false; } [HarmonyPrefix] [HarmonyPatch(typeof(MinosPrime), "RiderKick")] public static bool MinosRiderKick(MinosPrime __instance) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled || __instance.eid.overrideFullName != "Greater Angel Tyros") { return true; } if (__instance.target == null) { return false; } __instance.downSwingAmount = 0; __instance.previouslyRiderKicked = true; __instance.inAction = true; ((Component)__instance).transform.LookAt(__instance.target.position); __instance.tracking = true; __instance.fullTracking = true; __instance.gravityInAction = false; __instance.anim.SetTrigger("RiderKick"); if (__instance.difficulty >= 2) { ((MonoBehaviour)__instance).Invoke("StopTracking", 0.5f / __instance.anim.speed); } else { ((MonoBehaviour)__instance).Invoke("StopTracking", 0.25f / __instance.anim.speed); } ((MonoBehaviour)__instance).Invoke("RiderKickActivate", 0.75f / __instance.anim.speed); Transform transform = Object.Instantiate<GameObject>(__instance.warningFlash, __instance.head.position, Quaternion.LookRotation(((Component)MonoSingleton<CameraController>.Instance).transform.position - __instance.head.position)).transform; transform.localScale *= 5f; __instance.sc.knockBackForce = 50f; __instance.aiming = false; __instance.attackAmount++; return false; } [HarmonyPrefix] [HarmonyPatch(typeof(MinosPrime), "Boxing")] public static bool MinosBoxing(MinosPrime __instance) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled || __instance.eid.overrideFullName != "Greater Angel Tyros") { return true; } if ((int)__instance.previousCombo == 0) { __instance.Combo(); return false; } __instance.previousCombo = (MPAttack)0; __instance.inAction = true; ((Component)__instance).transform.LookAt(__instance.playerPos); __instance.tracking = true; __instance.fullTracking = false; __instance.gravityInAction = false; __instance.anim.Play("Boxing", 0, 0f); __instance.sc.knockBackForce = 30f; __instance.aiming = false; __instance.attackAmount += 2; return false; } [HarmonyPrefix] [HarmonyPatch(typeof(MinosPrime), "DropAttack")] public static bool MinosDropAttack(MinosPrime __instance) { //IL_004b: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) if (!tcenabled || __instance.eid.overrideFullName != "Greater Angel Tyros") { return true; } __instance.downSwingAmount = 0; __instance.tracking = true; __instance.fullTracking = false; __instance.ResetRotation(); __instance.inAction = true; ((Component)__instance).transform.LookAt(__instance.playerPos); __instance.gravityInAction = false; __instance.anim.SetTrigger("DropAttack"); ((MonoBehaviour)__instance).Invoke("DropAttackActivate", 0.75f / __instance.anim.speed); Transform transform = Object.Instantiate<GameObject>(__instance.warningFlash, __instance.head.position, Quaternion.LookRotation(((Component)MonoSingleton<CameraController>.Instance).transform.position - __instance.head.position)).transform; transform.localScale *= 5f; __instance.sc.knockBackForce = 50f; __instance.aiming = false; __instance.attackAmount++; return false; } [HarmonyPrefix] [HarmonyPatch(typeof(MinosPrime), "PlayVoice")] public static bool PlayVoice(MinosPrime __instance, AudioClip[] voice) { if (!tcenabled || __instance.eid.overrideFullName != "Greater Angel Tyros") { return true; } if (voice.Length == 0 || ((Object)(object)__instance.aud.clip == (Object)(object)__instance.phaseChangeVoice && __instance.aud.isPlaying)) { return false; } __instance.aud.clip = voice[Random.Range(0, voice.Length)]; if (voice != __instance.hurtVoice) { __instance.aud.pitch = Random.Range(0.95f, 1f); } else { __instance.aud.pitch = 3f; } __instance.aud.Play(); return false; } [HarmonyPostfix] [HarmonyPatch(typeof(MinosPrime), "Death")] public static void StopTimerAfterDeath(MinosPrime __instance) { if (tcenabled && !(__instance.eid.overrideFullName != "Greater Angel Tyros") && !(SceneHelper.CurrentScene != "Level 3-2")) { MonoSingleton<StatsManager>.Instance.StopTimer(); } } } [HarmonyPatch] public 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; } switch (hitter) { default: if (hitter == null) { break; } if (!hitter.Contains("punch")) { switch (hitter) { case "strayTele": __instance.enemiesShot = true; if (dead) { if (enemyType == "spider") { __instance.AddPoints(100, "ultrakill.bigkill", eid, sourceWeapon); } else { __instance.AddPoints(45, "ultrakill.kill", eid, sourceWeapon); } MonoSingleton<StyleHUD>.Instance.AddPoints((int)(150f * __instance.airTime), "ultrakill.explosionhit", sourceWeapon, eid, 1, "<color=yellow>TELEFRAGGED</color>", ""); __instance.gc.AddKill(); } else { __instance.AddPoints(150, "ultrakill.explosionhit", eid, sourceWeapon); } break; 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; } 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<StyleHUD>.Instance.freshnessDecayMultiplierDict.ContainsKey("straymode.revhit")) { MonoSingleton<StyleHUD>.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<StyleHUD>.Instance.freshnessDecayMultiplierDict.ContainsKey("straymode.swordhit")) { MonoSingleton<StyleHUD>.Instance.freshnessDecayMultiplierDict.Add("straymode.swordhit", 2f); } __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<StyleHUD>.Instance.AddPoints(1, "ultrakill.explosionhit", (GameObject)null, eid, -1, "<color=#00ffff>PENETRATED</color>", ""); } __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<StyleHUD>.Instance.AddPoints(1, "ultrakill.explosionhit", (GameObject)null, eid, -1, "<color=#00ffff>UNSTABBED</color>", ""); __instance.gc.AddKill(); } else { if (!MonoSingleton<StyleHUD>.Instance.freshnessDecayMultiplierDict.ContainsKey("straymode.drillpull")) { MonoSingleton<StyleHUD>.Instance.freshnessDecayMultiplierDict.Add("straymode.drillpull", 1.5f); } __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; } } public static bool tcenabled; public static AssetBundle tcbundle; public static GameObject bluearm; public static GameObject redarm; public static ManualLogSource Loge = new ManualLogSource("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<string, GameObject[]> Weapons = new Dictionary<string, GameObject[]>(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<StrayGun> armguns = new List<StrayGun>(); public static List<StrayLaserGun> laserguns = new List<StrayLaserGun>(); public static List<StraySword> swords = new List<StraySword>(); private static bool canTeleportPlayer; private static bool replaced = false; public static bool DisplayMenuPopup = false; public static bool spawnedPopup = false; private static bool updatedMenu = false; public static Dictionary<string, Charge> charges = new Dictionary<string, Charge>(0); public static List<BlackHole> curHoles = new List<BlackHole>(); public static SwordDrill curSword; public static bool telefragging = false; public static List<int> boosters = new List<int>(); public static List<string> weaponNames = new List<string> { "Revolver", "Shotgun", "Hammer", "Nailgun", "Railcannon" }; public static List<string> weaponShortNames = new List<string> { "rev", "sho", "arm", "nai", "rai" }; public static void SendHudMessage(string msg, int delay = 0, bool silent = false) { MonoSingleton<HudMessageReceiver>.Instance.SendHudMessage(msg, "", "", delay, silent, false, true); } public static Type Fetch<Type>(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<Type>((object)name).WaitForCompletion(); } public static Type FetchFromBundle<Type>(string name, bool autofill = false) where Type : Object { if ((Object)(object)tcbundle == (Object)null) { Log("Straymode bundle is null!", 3); return default(Type); } if (!autofill) { return tcbundle.LoadAsset<Type>(name); } return tcbundle.LoadAsset<Type>("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<Transform>() != (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) { switch (type) { case 1: Loge.LogInfo((object)log); break; case 2: Loge.LogWarning((object)log); break; case 3: 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 void Awake() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Invalid comparison between Unknown and I4 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; MainShader = Fetch<Shader>("Assets/Shaders/MasterShader/ULTRAKILL-Standard.shader"); if ((Object)(object)tcbundle == (Object)null) { using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Straymode.Bundle.straymode"); if (stream == null) { Log("[Straymode] Failed to load asset bundle stream: Resource not found", 3); return; } AssetBundle val = AssetBundle.LoadFromStream(stream); if ((Object)(object)val == (Object)null) { Log("[Straymode] Failed to load asset bundle from stream", 3); return; } tcbundle = val; string[] allAssetNames = tcbundle.GetAllAssetNames(); for (int i = 0; i < allAssetNames.Length; i++) { Log(allAssetNames[i]); } } if ((Object)(object)tcbundle != (Object)null) { Log("[Straymode] Got bundle"); } SceneManager.sceneLoaded += OnSceneChange; Log("[Straymode] Added onscenechange"); GetWeapons(); Log("[Straymode] Got weapons"); Log("Straymode loaded!"); } public static void GetWeapons() { GotWeapons = true; bluearm = MainCode.FetchFromBundle<GameObject>("Weapons/Stray arm Blue.prefab", autofill: true); Log("[Straymode] Got Bluearm "); redarm = MainCode.FetchFromBundle<GameObject>("Weapons/Stray arm Red.prefab", autofill: true); Log("[Straymode] Got Redarm "); GameObject[] array = (GameObject[])(object)new GameObject[2] { MainCode.FetchFromBundle<GameObject>("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<GameObject>("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<GameObject>("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<GameObject>("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<GameObject>("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<GameObject>("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<GameObject>("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<GameObject>("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<GameObject>("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<GameObject>("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<GameObject>("Weapons/ShotgunWeapon Green.prefab", autofill: true), default(GameObject) }; Log("[Straymode] Got M.D.C. " + ((object)array11[0])?.ToString() + " : " + (object)