Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of QoL v4.2.1
QoL.dll
Decompiled 5 days agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GlobalEnums; using HarmonyLib; using HutongGames.PlayMaker; using HutongGames.PlayMaker.Actions; using InControl; using Microsoft.CodeAnalysis; using QoL.FSMEdits; using Silksong.FsmUtil; using Silksong.ModMenu.Elements; using Silksong.ModMenu.Plugin; using Silksong.ModMenu.Screens; using TMProOld; using UnityEngine; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("QoL")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("4.2.1.0")] [assembly: AssemblyInformationalVersion("4.2.1+c962d210fbc6d528e48bf0d19b1f79f013af5f7c")] [assembly: AssemblyProduct("QoL")] [assembly: AssemblyTitle("QoL")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/Vitaxses/Silksong.QoL")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("4.2.1.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace BepInEx { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] [Embedded] internal sealed class BepInAutoPluginAttribute : Attribute { public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace BepInEx.Preloader.Core.Patching { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] [Embedded] internal sealed class PatcherAutoPluginAttribute : Attribute { public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace Microsoft.CodeAnalysis { [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace QoL { public static class Configs { public enum FastCogworkStatues { None, LiftUnlocked, QuestUnlocked, Both } public enum LiftSpeed { Vanilla, SlightlyFaster, Fast, VeryFast } public const string TrackerSection = "Tracker Modules"; public const string BellwaySection = "Bellway Modules"; public const string VentricaSection = "Ventrica Modules"; public const string NPCSection = "NPC Modules"; public const string NPCIntroSection = "Intro Modules"; public const string OldPatchSection = "Old Patch Modules"; public const string ToolPogoSection = "Pogo Modules"; public const string CutsceneSection = "Cutscene Modules"; public const string FastSection = "Fast Modules"; public static ConfigEntry<bool> FleaTracked { get; private set; } public static ConfigEntry<bool> FasterBellwayTravel { get; private set; } public static ConfigEntry<bool> FasterBellwayBuy { get; private set; } public static ConfigEntry<bool> NoBellBeastSleep { get; private set; } public static ConfigEntry<bool> BellBeastFreeWill { get; private set; } public static ConfigEntry<bool> FasterBeastlingCall { get; private set; } public static ConfigEntry<bool> SkipBeastlingCallPerformance { get; private set; } public static ConfigEntry<bool> FasterVentricaTravel { get; private set; } public static ConfigEntry<bool> FasterVentricaBuy { get; private set; } public static ConfigEntry<bool> FasterCaretaker { get; private set; } public static ConfigEntry<bool> FasterSeamstress { get; private set; } public static ConfigEntry<bool> FasterShakra { get; private set; } public static ConfigEntry<bool> FasterLaceAct2 { get; private set; } public static ConfigEntry<FastCogworkStatues> FasterCogworkStatues { get; private set; } public static ConfigEntry<bool> FasterVaultkeeper { get; private set; } public static ConfigEntry<bool> FasterMelodyObtain { get; private set; } public static ConfigEntry<bool> FasterBossLoad { get; private set; } public static ConfigEntry<bool> PinPogo { get; private set; } public static ConfigEntry<bool> OldDelversDrillSnareSetter { get; private set; } public static ConfigEntry<bool> OldFloat { get; private set; } public static ConfigEntry<bool> CloaklessClawline { get; private set; } public static ConfigEntry<bool> OldVoltVessels { get; private set; } public static ConfigEntry<bool> BeastBoosts { get; private set; } public static ConfigEntry<bool> OldScuttlebrace { get; private set; } public static ConfigEntry<bool> OldMist { get; private set; } public static ConfigEntry<bool> TrobbioSkip { get; private set; } public static ConfigEntry<bool> LeverSkips { get; private set; } public static ConfigEntry<bool> RemoveFaydownNeedolinCheck { get; private set; } public static ConfigEntry<bool> OldPutrifiedPlanks { get; private set; } public static ConfigEntry<bool> SkipCutscene { get; private set; } public static ConfigEntry<bool> SkipDreamCutscene { get; private set; } public static ConfigEntry<bool> SkipDreamCutsceneFully { get; private set; } public static ConfigEntry<bool> SkipTutorialToolMsg { get; private set; } public static ConfigEntry<bool> SkipWeakness { get; private set; } public static ConfigEntry<bool> InstantLevers { get; private set; } public static ConfigEntry<LiftSpeed> FasterLifts { get; private set; } public static ConfigEntry<bool> InstantText { get; private set; } public static ConfigEntry<bool> FastUI { get; private set; } internal static void Bind(ConfigFile config) { FleaTracked = config.Bind<bool>("Tracker Modules", "Count Fleas", false, "Counts saved fleas"); FasterBellwayTravel = config.Bind<bool>("Bellway Modules", "Faster Bellway Travel Animation", true, "Speeds up arrival and departure animations for Bellway travel"); FasterBellwayBuy = config.Bind<bool>("Bellway Modules", "Faster Bellway Purchase", true, "Speeds up the animation when buying Bellway stations and calls the Bell Beast afterwards"); NoBellBeastSleep = config.Bind<bool>("Bellway Modules", "BellBeast Always Awake", true, "Keeps the Bell Beast always awake"); BellBeastFreeWill = config.Bind<bool>("Bellway Modules", "BellBeast Always Ready", false, "Makes the Bell Beast always ready at your location"); FasterBeastlingCall = config.Bind<bool>("Bellway Modules", "Faster Beastling Call", true, "Speeds up Beastling call performance and travel"); SkipBeastlingCallPerformance = config.Bind<bool>("Bellway Modules", "Skip Beastling Call Performance", false, "Skips the Beastling call performance entirely"); FasterVentricaTravel = config.Bind<bool>("Ventrica Modules", "Faster Ventrica Travel Animation", true, "Speeds up arrival and departure animations for Ventrica travel"); FasterVentricaBuy = config.Bind<bool>("Ventrica Modules", "Faster Ventrica Purchase", true, "Speeds up the animation when buying Ventrica stations"); FasterCaretaker = config.Bind<bool>("Intro Modules", "Caretaker", true, ""); FasterSeamstress = config.Bind<bool>("Intro Modules", "Seamstress", true, ""); FasterShakra = config.Bind<bool>("Intro Modules", "Shakra", true, ""); FasterLaceAct2 = config.Bind<bool>("Intro Modules", "Lace Act 2 Entrance", true, ""); FasterCogworkStatues = config.Bind<FastCogworkStatues>("Intro Modules", "Cogwork Statues Mode", FastCogworkStatues.None, ""); FasterVaultkeeper = config.Bind<bool>("Intro Modules", "Vaultkeeper Cardinius", true, ""); FasterMelodyObtain = config.Bind<bool>("Intro Modules", "Melody Obtain", false, ""); FasterBossLoad = config.Bind<bool>("NPC Modules", "Faster Boss Start", false, "Removes first-time events for bosses"); PinPogo = config.Bind<bool>("Pogo Modules", "Pimpillo Pogo", false, ""); OldDelversDrillSnareSetter = config.Bind<bool>("Pogo Modules", "Old Delvers Drill & Snare Setter", false, ""); OldFloat = config.Bind<bool>("Old Patch Modules", "Drifters Cloak Override", false, "Re-adds float override input (Down + Jump)"); CloaklessClawline = config.Bind<bool>("Old Patch Modules", "Cloakless Clawline", false, "Wall requiring the Drifter's Cloak in Underworks is now clingable"); BeastBoosts = config.Bind<bool>("Old Patch Modules", "Beast Boosts", false, "The Beast's Crest Needle Art occasionally grants extra height"); OldScuttlebrace = config.Bind<bool>("Old Patch Modules", "Old Scuttlebrace", false, "Scuttlebrace Allows wall-jumping off unclingable walls"); OldMist = config.Bind<bool>("Old Patch Modules", "Old Mist", false, "Enables room juggling in the Mist"); TrobbioSkip = config.Bind<bool>("Old Patch Modules", "Trobbio Skip", false, "Allows tools to hit the slide platforms in Whispering Vaults"); LeverSkips = config.Bind<bool>("Old Patch Modules", "Lever Skips", false, "Allows certain levers to be hit through walls"); RemoveFaydownNeedolinCheck = config.Bind<bool>("Old Patch Modules", "Faydown Cloak Without Needolin", false, "Allows getting the Faydown Cloak without the Needolin"); OldPutrifiedPlanks = config.Bind<bool>("Old Patch Modules", "Old Putrified Ducts Planks", false, "Allows certain tools to break the planks between Bilewater and Putrified Ducts"); SkipCutscene = config.Bind<bool>("Cutscene Modules", "Skip Cutscenes", true, "Skips cutscenes"); SkipDreamCutscene = config.Bind<bool>("Cutscene Modules", "Skip Dream Cutscenes", true, "Skips dream cutscenes (Needolin & First Sinner)"); SkipDreamCutsceneFully = config.Bind<bool>("Cutscene Modules", "Fully Skip Dream Scenes", false, "Skips dream scenes entirely"); SkipTutorialToolMsg = config.Bind<bool>("Cutscene Modules", "Skip Tool Pickup Tutorial", true, "Skips the first tool pickup tutorial"); SkipWeakness = config.Bind<bool>("Cutscene Modules", "Skip Weakness", true, "Removes weakness scenes"); InstantLevers = config.Bind<bool>("Fast Modules", "Instant Levers", true, "Removes the delay when hitting a lever"); InstantText = config.Bind<bool>("Fast Modules", "Instant Text", true, "Makes text reveal speed instant"); FasterLifts = config.Bind<LiftSpeed>("Fast Modules", "Lift Speed", LiftSpeed.Fast, "Adjusts lift speed"); FastUI = config.Bind<bool>("Fast Modules", "Fast Menu", true, "Removes the menu fade delay"); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("io.github.vitaxses.qol", "QoL", "4.2.1")] public sealed class QoLPlugin : BaseUnityPlugin, IModMenuCustomMenu, IModMenuInterface { private readonly Harmony harmony = new Harmony("io.github.vitaxses.qol"); public const string Id = "io.github.vitaxses.qol"; internal static ManualLogSource Logger { get; private set; } public static string Name => "QoL"; public static string Version => "4.2.1"; private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; Configs.Bind(((BaseUnityPlugin)this).Config); harmony.PatchAll(); Logger.LogInfo((object)("Plugin " + Name + " (io.github.vitaxses.qol) v" + Version + " has loaded!")); } public LocalizedText ModMenuName() { return LocalizedText.op_Implicit(Name); } public AbstractMenuScreen BuildCustomMenu() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Expected O, but got Unknown //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Expected O, but got Unknown //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Expected O, but got Unknown //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Expected O, but got Unknown //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Expected O, but got Unknown PaginatedMenuScreenBuilder val = new PaginatedMenuScreenBuilder(LocalizedText.op_Implicit(Name), 8); ConfigEntryFactory val2 = new ConfigEntryFactory(); List<IGrouping<string, KeyValuePair<ConfigDefinition, ConfigEntryBase>>> list = (from entry in (IEnumerable<KeyValuePair<ConfigDefinition, ConfigEntryBase>>)((BaseUnityPlugin)this).Config group entry by entry.Value.Definition.Section into g where g.Any() select g).ToList(); MenuElement val4 = default(MenuElement); MenuElement val5 = default(MenuElement); MenuElement val7 = default(MenuElement); foreach (IGrouping<string, KeyValuePair<ConfigDefinition, ConfigEntryBase>> item in list) { if (item.Key == "Intro Modules" || item.Key == "Pogo Modules") { continue; } PaginatedMenuScreenBuilder val3 = new PaginatedMenuScreenBuilder(LocalizedText.op_Implicit(item.Key), 8); foreach (KeyValuePair<ConfigDefinition, ConfigEntryBase> item2 in item) { if (val2.GenerateMenuElement(item2.Value, ref val4)) { val3.Add(val4); } } if (item.Key == "NPC Modules") { PaginatedMenuScreenBuilder npcIntroSectionBuilder = new PaginatedMenuScreenBuilder(LocalizedText.Raw("NPC Intro Modules"), 8); foreach (KeyValuePair<ConfigDefinition, ConfigEntryBase> item3 in list.First((IGrouping<string, KeyValuePair<ConfigDefinition, ConfigEntryBase>> c) => c.Key == "Intro Modules")) { if (val2.GenerateMenuElement(item3.Value, ref val5)) { npcIntroSectionBuilder.Add(val5); } } TextButton val6 = new TextButton(LocalizedText.Raw("Intro Modules")) { OnSubmit = delegate { MenuScreenNavigation.Show((AbstractMenuScreen)(object)npcIntroSectionBuilder.Build(), (HistoryMode)0); } }; val3.Add((MenuElement)(object)val6); } if (item.Key == "Old Patch Modules") { PaginatedMenuScreenBuilder toolPogoBuilder = new PaginatedMenuScreenBuilder(LocalizedText.Raw("Old Patch Pogo Modules"), 8); foreach (KeyValuePair<ConfigDefinition, ConfigEntryBase> item4 in list.First((IGrouping<string, KeyValuePair<ConfigDefinition, ConfigEntryBase>> c) => c.Key == "Pogo Modules")) { if (val2.GenerateMenuElement(item4.Value, ref val7)) { toolPogoBuilder.Add(val7); } } TextButton val8 = new TextButton(LocalizedText.Raw("Pogo Modules")) { OnSubmit = delegate { MenuScreenNavigation.Show((AbstractMenuScreen)(object)toolPogoBuilder.Build(), (HistoryMode)0); } }; val3.Add((MenuElement)(object)val8); } PaginatedMenuScreen sectionMenu = val3.Build(); TextButton val9 = new TextButton(LocalizedText.Raw(item.Key)) { OnSubmit = delegate { MenuScreenNavigation.Show((AbstractMenuScreen)(object)sectionMenu, (HistoryMode)0); } }; val.Add((MenuElement)(object)val9); } return (AbstractMenuScreen)(object)val.Build(); } } } namespace QoL.Patches { [HarmonyPatch(typeof(Lever), "Start")] internal static class LeverPatch { [HarmonyWrapSafe] [HarmonyPostfix] private static void Postfix_Start(Lever __instance) { if (Configs.InstantLevers.Value) { __instance.openGateDelay = 0f; } if (Configs.LeverSkips.Value && ((Object)((Component)__instance).gameObject).name.StartsWith("Understore Lever") && GameManager.instance.sceneName == "Ward_01") { __instance.canHitTrigger = null; } } } [HarmonyPatch(typeof(Trapdoor), "Awake")] internal static class TrapdoorPatch { [HarmonyWrapSafe] [HarmonyPostfix] private static void Postfix_Awake(Trapdoor __instance) { if (Configs.InstantLevers.Value) { __instance.retractStartDelay = (__instance.retractEndDelay = (__instance.openWaitTime = 0f)); } } } [HarmonyPatch(typeof(TrapBridgeExtend), "Awake")] internal static class TrapBridgeExtendPatch { [HarmonyWrapSafe] [HarmonyPostfix] private static void Postfix_Awake(TrapBridgeExtend __instance) { if (Configs.InstantLevers.Value) { __instance.animator.speed = 8f; ((TrapBridge)__instance).openDelay = (((TrapBridge)__instance).anticDelay = 0f); } } } [HarmonyPatch(typeof(Lever_tk2d), "Start")] internal static class Lever_tk2dPatch { [HarmonyWrapSafe] [HarmonyPostfix] private static void Postfix_Start(Lever_tk2d __instance) { //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_0079: Unknown result type (might be due to invalid IL or missing references) if (Configs.InstantLevers.Value) { __instance.openGateDelay = 0f; } if (!Configs.LeverSkips.Value) { return; } GameObject gameObject = ((Component)__instance).gameObject; if (gameObject != null && ((Object)gameObject).name == "Song_lever_side") { Scene scene = gameObject.scene; if (((Scene)(ref scene)).name == "Bone_10") { ((Component)((Component)__instance).transform.GetChild(2)).transform.position = new Vector3(96.4f, 30.11f, 0.005f); } } } } [HarmonyPatch(typeof(Gate), "Start")] internal static class GatePatch { [HarmonyWrapSafe] [HarmonyPostfix] private static void Postfix_Start(Gate __instance) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) if (!Configs.OldPutrifiedPlanks.Value) { return; } GameObject gameObject = ((Component)__instance).gameObject; if (gameObject != null && ((Object)gameObject).name == "drop_planks") { Scene scene = gameObject.scene; if (((Scene)(ref scene)).name == "Aqueduct_04") { BoxCollider2D component = ((Component)((Component)__instance).transform.GetChild(3)).GetComponent<BoxCollider2D>(); component.size = new Vector2(component.size.x * 2f, 50f); } } } } [HarmonyPatch(typeof(PressurePlateBase), "Awake")] internal static class PressurePlateBasePatch { [HarmonyWrapSafe] [HarmonyPostfix] private static void Postfix_Start(PressurePlateBase __instance) { if (Configs.InstantLevers.Value) { __instance.gateOpenDelay = 0f; __instance.dropTime = (__instance.waitTime = 0.05f); } } } [HarmonyPatch(typeof(DialDoorBridge), "Start")] internal static class DialDoorBridgePatch { [HarmonyWrapSafe] [HarmonyPostfix] private static void Postfix_Start(DialDoorBridge __instance) { if (Configs.InstantLevers.Value) { __instance.doorOpenDelay = (__instance.moveDelay = (__instance.moveDuration = 0f)); } } } [HarmonyPatch(typeof(PlayMakerFSM), "Start")] internal static class PlayMakerFSMPatch { private static readonly Action<PlayMakerFSM>[] edits = new Action<PlayMakerFSM>[27] { FsmFasterBoss.FasterBoss, FasterNpc.FasterNPC, Bellway.BellBeast, Bellway.Toll, Ventrica.Tube, Ventrica.Toll, FsmLiftControl.Lift, BeastlingCall.SilkSpecials, BeastlingCall.Beastlings, BeastlingCall.Needolin, FsmCutscene.LastDive, FsmCutscene.Lace2, FsmCutscene.FleaTravel, FsmCutscene.ShermaAct3Intro, FsmCutscene.DivingBell, FsmCutscene.CitadelEntrance, FsmCutscene.SmallCutscenes, DreamCutscene.Widow, DreamCutscene.FirstSinner, DreamCutscene.MemoryThread, DreamCutscene.SilkHeart, ToolPatch.Scuttlebrace, Abilities.NeedleStrike, Abilities.FaydownNeedolinCheck, SkipWeakness.SkipWeaknessPatch, FastMenu.ShopUI, FastMenu.QuestUIPrompt }; [HarmonyPostfix] private static void Postfix_Start(PlayMakerFSM __instance) { Action<PlayMakerFSM>[] array = edits; foreach (Action<PlayMakerFSM> action in array) { try { action(__instance); } catch (Exception ex) { QoLPlugin.Logger.LogError((object)("Exception thrown when editing FSM " + __instance.FsmName + " on " + ((Object)__instance).name)); QoLPlugin.Logger.LogError((object)ex); } } } } } namespace QoL.Patches.Tracker { [HarmonyPatch(typeof(InventoryPaneInput), "OnEnable")] internal static class InventoryPaneInputPatch { private static GameObject FleaCounter; private static TMP_Text Counter; [HarmonyWrapSafe] [HarmonyPostfix] private static void Postfix_OnEnable() { //IL_008a: Unknown result type (might be due to invalid IL or missing references) if (!Configs.FleaTracked.Value) { if ((Object)(object)FleaCounter != (Object)null && FleaCounter.activeSelf) { FleaCounter.SetActive(false); } return; } if ((Object)(object)FleaCounter == (Object)null) { GameObject gameObject = ((Component)GameObject.Find("_GameCameras/HudCamera/In-game/Inventory/Inv").transform.GetChild(6)).gameObject; FleaCounter = Object.Instantiate<GameObject>(gameObject, gameObject.transform.GetParent(), false); FleaCounter.transform.localPosition = new Vector3(-8f, -15.25f, -3.3f); Object.DestroyImmediate((Object)(object)FleaCounter.GetComponent<SetTextMeshProGameText>()); FleaCounter.GetComponent<TMP_Text>().text = "Fleas Saved: "; GameObject gameObject2 = ((Component)FleaCounter.transform.GetChild(0)).gameObject; ((Object)gameObject2).name = "Counter"; Counter = gameObject2.GetComponent<TMP_Text>(); ((Object)FleaCounter).name = "FleaCounter"; FleaCounter.SetActive(true); } if (!FleaCounter.activeSelf) { FleaCounter.SetActive(true); } int num = PlayerData.instance.SavedFleasCount; if (PlayerData.instance.CaravanLechSaved) { num++; } if (PlayerData.instance.MetTroupeHunterWild) { num++; } if (PlayerData.instance.tamedGiantFlea) { num++; } string text = num.ToString(); if (num >= 30) { text += " (Max)"; } Counter.text = text; } } } namespace QoL.Patches.OldPatch { [HarmonyPatch(typeof(NonSlider), "Awake")] internal static class CloaklessClawline { [HarmonyWrapSafe] [HarmonyPostfix] private static void Postfix_Awake(NonSlider __instance) { //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_0067: Unknown result type (might be due to invalid IL or missing references) GameObject gameObject = ((Component)__instance).gameObject; if (gameObject != null && ((Object)gameObject).name == "terrain collider (15)") { Scene scene = gameObject.scene; if (((Scene)(ref scene)).name == "Under_17" && Configs.CloaklessClawline.Value) { QoLPlugin.Logger.LogDebug((object)"Modifying Cloakless Clawline Wall Grab"); ((Component)__instance).transform.position = new Vector3(12.3f, 7.64f, 0f); Object.Destroy((Object)(object)__instance); } } } } [HarmonyPatch(typeof(HeroController), "CanDoubleJump")] internal static class OldFloat { [HarmonyWrapSafe] [HarmonyPostfix] private static void Postfix_CanDoubleJump(HeroController __instance, ref bool __result) { if (Configs.OldFloat.Value && __result) { __result = !((OneAxisInputControl)__instance.inputHandler.inputActions.Down).IsPressed; } } } [HarmonyPatch(typeof(MazeController), "SubscribeDoorEntered")] internal static class OldMist { [HarmonyWrapSafe] [HarmonyPrefix] private static bool Prefix_SubscribeDoorEntered(MazeController __instance, TransitionPoint door) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown if (!Configs.OldMist.Value) { return true; } door.OnBeforeTransition += (BeforeTransitionEvent)delegate { OnBeforeTransition(__instance, door); }; return false; } internal static void OnBeforeTransition(MazeController controller, TransitionPoint door) { //IL_0028: 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_010d: 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) string name = ((Object)door).name; PlayerData instance = PlayerData.instance; Scene scene; if (controller.isCapScene) { instance.PreviousMazeTargetDoor = door.entryPoint; scene = ((Component)door).gameObject.scene; instance.PreviousMazeScene = ((Scene)(ref scene)).name; instance.PreviousMazeDoor = name; return; } bool num = door.targetScene == controller.restSceneName; bool flag = instance.PreviousMazeTargetDoor != name; if (num) { instance.EnteredMazeRestScene = true; instance.CorrectMazeDoorsEntered = controller.neededCorrectDoors - controller.restScenePoint; instance.IncorrectMazeDoorsEntered = 0; } else if (flag) { if (controller.correctDoors.Contains(door)) { instance.CorrectMazeDoorsEntered++; instance.IncorrectMazeDoorsEntered = 0; } else { instance.CorrectMazeDoorsEntered = 0; instance.IncorrectMazeDoorsEntered++; instance.EnteredMazeRestScene = false; if (instance.IncorrectMazeDoorsEntered >= controller.allowedIncorrectDoors && name.StartsWith("right")) { door.SetTargetScene("Dust_Maze_09_entrance"); door.entryPoint = "left1"; } } } instance.PreviousMazeTargetDoor = door.entryPoint; scene = ((Component)door).gameObject.scene; instance.PreviousMazeScene = ((Scene)(ref scene)).name; instance.PreviousMazeDoor = name; } } [HarmonyPatch(typeof(ToolPin), "OnEnable")] internal static class ToolPinPatch { [HarmonyWrapSafe] [HarmonyPostfix] public static void Postfix_OnEnable(ToolPin __instance) { NonBouncer val = default(NonBouncer); if (Configs.PinPogo.Value && ((Component)__instance).TryGetComponent<NonBouncer>(ref val)) { Object.Destroy((Object)(object)val); } } } [HarmonyPatch(typeof(TinkEffect), "TryDoTinkReactionNoDamager")] internal static class TinkEffectPatch { [HarmonyWrapSafe] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { foreach (CodeInstruction code in instructions) { yield return code; if (code.opcode == OpCodes.Stloc_S && ((LocalBuilder)code.operand).LocalIndex == 11) { yield return new CodeInstruction(OpCodes.Ldloc_S, (object)(byte)11); yield return new CodeInstruction(OpCodes.Ldarg_0, (object)null); yield return new CodeInstruction(OpCodes.Ldarg_1, (object)null); yield return new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(TinkEffectPatch), "OverrideFlag6", (Type[])null, (Type[])null)); yield return new CodeInstruction(OpCodes.Stloc_S, (object)(byte)11); } } } private static bool OverrideFlag6(bool orig, TinkEffect tink, GameObject obj) { if (Configs.OldDelversDrillSnareSetter.Value && (((Object)obj).name == "Screw Attack Damager" || ((Object)obj).name == "Snare Loop Damager")) { if (((Object)tink).name.StartsWith("Lightning Bola Ball")) { return false; } if (((Object)tink).name == "Pollen Shot(Clone)") { return false; } if (((Object)tink).name == "Sprite" && (Object)(object)((Component)tink).transform.parent != (Object)null && ((Object)((Component)tink).transform.parent).name == "Hero Conch Projectile(Clone)") { return false; } if (((Object)tink).name == "Throwing Bell(Clone)") { return false; } } return orig; } } [HarmonyPatch(typeof(HitSlidePlatform), "Awake")] internal static class TrobbioSkip { [HarmonyWrapSafe] [HarmonyPostfix] private static void Postfix_Awake(HitSlidePlatform __instance) { if (Configs.TrobbioSkip.Value) { TinkEffect[] tinkers = __instance.tinkers; for (int i = 0; i < tinkers.Length; i++) { tinkers[i].onlyReactToNail = false; } } } } } namespace QoL.Patches.Fast { [HarmonyPatch(typeof(LiftControl), "Start")] internal static class LiftControlPatch { [HarmonyWrapSafe] [HarmonyPostfix] private static void Postfix_Start(LiftControl __instance) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) Scene scene = ((Component)__instance).gameObject.scene; string name = ((Scene)(ref scene)).name; Configs.LiftSpeed value = Configs.FasterLifts.Value; if (value == Configs.LiftSpeed.Vanilla || name == "Ward_01") { return; } __instance.moveSpeed = 28f; if (name != "Library_11") { float moveSpeed = 0f; switch (value) { case Configs.LiftSpeed.SlightlyFaster: moveSpeed = 35f; break; case Configs.LiftSpeed.Fast: moveSpeed = 75f; break; case Configs.LiftSpeed.VeryFast: moveSpeed = 90f; break; } __instance.moveSpeed = moveSpeed; } __instance.moveDelay = 0f; __instance.endDelay = 0f; } } [HarmonyPatch(typeof(ManualLift), "Start")] internal static class ManualLiftPatch { [HarmonyWrapSafe] [HarmonyPostfix] private static void Postfix_Start(ManualLift __instance) { Configs.LiftSpeed value = Configs.FasterLifts.Value; if (value != Configs.LiftSpeed.Vanilla) { float num = __instance.moveSpeed; switch (value) { case Configs.LiftSpeed.SlightlyFaster: num *= 2f; break; case Configs.LiftSpeed.Fast: num = 55f; break; case Configs.LiftSpeed.VeryFast: num = 75f; break; } __instance.moveSpeed = num; __instance.acceleration = 12f; __instance.moveDelay = 0f; } } } [HarmonyPatch(typeof(UIManager), "Start")] internal static class UIManagerPatch { [HarmonyWrapSafe] [HarmonyPostfix] private static void Postfix_Start() { Configs.FastUI.SettingChanged += delegate { Adjust(); }; Adjust(); } internal static void Adjust() { if (Configs.FastUI.Value) { UIManager.instance.MENU_FADE_SPEED = 13f; } else { UIManager.instance.MENU_FADE_SPEED = 3.2f; } } } [HarmonyPatch(typeof(DialogueBox), "Start")] internal static class DialogueBoxPatch { [HarmonyWrapSafe] [HarmonyPostfix] private static void Postfix_Start(DialogueBox __instance) { if (Configs.InstantText.Value) { __instance.currentRevealSpeed = (__instance.regularRevealSpeed = (__instance.fastRevealSpeed *= 150f)); __instance.animator.speed = 3f; } } } [HarmonyPatch(typeof(DialogueYesNoBox), "Awake")] internal static class DialogueYesNoBoxPatch { [HarmonyWrapSafe] [HarmonyPostfix] private static void Postfix_Awake(DialogueYesNoBox __instance) { if (Configs.InstantText.Value) { __instance.textRevealSpeed = 250f; __instance.textRevealWait = 0f; __instance.animator.speed = 2f; } } } } namespace QoL.Patches.Cutscene { [HarmonyPatch(typeof(CreditsHelper), "Start")] internal static class CreditsHelperPatch { [HarmonyWrapSafe] [HarmonyPrefix] private static void Prefix_Start(CreditsHelper __instance) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) if (Configs.SkipCutscene.Value) { CutsceneHelper cutSceneHelper = __instance.cutSceneHelper; cutSceneHelper.startSkipLocked = false; __instance.startPause = (cutSceneHelper.waitBeforeFadeIn = 0f); cutSceneHelper.skipMode = (SkipPromptMode)1; cutSceneHelper.UnlockSkip(); } } } [HarmonyPatch(typeof(CutsceneHelper), "Start")] internal static class CutsceneHelperPatch { [HarmonyWrapSafe] [HarmonyPrefix] private static void Prefix_Start(CutsceneHelper __instance) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) if (Configs.SkipCutscene.Value && !(GameManager.instance.sceneName != "End_Credits_Scroll")) { __instance.startSkipLocked = false; __instance.waitBeforeFadeIn = 0f; __instance.skipMode = (SkipPromptMode)1; __instance.UnlockSkip(); } } } [HarmonyPatch(typeof(InputHandler), "SetSkipMode")] internal static class InputHandlerPatch { private static readonly string[] UnskipScene = new string[14] { "Bone_East_Umbrella", "Belltown", "Room_Pinstress", "Belltown_Room_pinsmith", "Belltown_Room_doctor", "End_Credits_Scroll", "End_Credits", "Menu_Credits", "End_Game_Completion", "PermaDeath", "Bellway_City", "City_Lace_cutscene", "Opening_Sequence_Act3", "Belltown_Room_Spare" }; [HarmonyWrapSafe] [HarmonyPrefix] private static bool Prefix_SetSkipMode(InputHandler __instance, ref SkipPromptMode newMode) { if (Configs.SkipCutscene.Value && !UnskipScene.Contains(GameManager.instance.sceneName)) { newMode = (SkipPromptMode)1; } return true; } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] internal static class SkippableSequencePatch { [HarmonyWrapSafe] [HarmonyPrefix] private static bool Prefix_CanSkip(SkippableSequence __instance) { if (Configs.SkipCutscene.Value) { __instance.AllowSkip(); } return true; } } [HarmonyPatch(typeof(StartManager), "Start")] internal static class StartManagerPatch { [HarmonyWrapSafe] [HarmonyPrefix] private static void Prefix_Start(StartManager __instance) { if (Configs.SkipCutscene.Value) { Animator startManagerAnimator = __instance.startManagerAnimator; if (startManagerAnimator != null) { startManagerAnimator.speed = 1000f; } } } } [HarmonyPatch(typeof(PlayerData), "SetupNewPlayerData")] internal static class SkipTutorialTool { [HarmonyWrapSafe] [HarmonyPostfix] private static void Postfix_SetupNewPlayerData(PlayerData __instance) { if (Configs.SkipTutorialToolMsg.Value) { __instance.SeenToolGetPrompt = (__instance.SeenToolWeaponGetPrompt = true); } } } } namespace QoL.FSMEdits { internal static class Abilities { internal static void NeedleStrike(PlayMakerFSM fsm) { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown if (Configs.BeastBoosts.Value && fsm != null && fsm.FsmName == "Nail Arts") { QoLPlugin.Logger.LogDebug((object)"Modifying Needle Strike FSM"); FsmState state = FsmUtil.GetState(fsm, "Warrior2 Leap"); FsmFloat val = FsmUtil.FindFloatVariable(fsm, "Velocity Y"); FsmBool wasGroundedBool = FsmUtil.GetBoolVariable(fsm, "QoL Beast Was Grounded"); FsmUtil.InsertAction(state, (FsmStateAction)new ConvertBoolToFloat { boolVariable = wasGroundedBool, floatVariable = val, falseValue = val, trueValue = FsmUtil.GetFirstActionOfType<ConvertBoolToFloat>(state).trueValue }, 4); FsmUtil.AddMethod(state, (Action<FsmStateAction>)delegate { ((NamedVariable)wasGroundedBool).RawValue = (Configs.BeastBoosts.Value ? ((NamedVariable)FsmUtil.FindBoolVariable(fsm, "Is Grounded")).RawValue : ((object)false)); }); } } internal static void FaydownNeedolinCheck(PlayMakerFSM fsm) { if (Configs.RemoveFaydownNeedolinCheck.Value && fsm != null && fsm.FsmName == "DJ Get Sequence") { QoLPlugin.Logger.LogDebug((object)"Modifying Faydown Get Sequence FSM"); FsmUtil.ChangeTransition(fsm, "Has Needolin?", "FALSE", "Dlg End"); } } } internal static class BeastlingCall { internal static void SilkSpecials(PlayMakerFSM fsm) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (!Configs.FasterBeastlingCall.Value || fsm == null || !(fsm.FsmName == "Silk Specials")) { return; } GameObject gameObject = ((Component)fsm).gameObject; if (gameObject != null && ((Object)gameObject).name == "Hero_Hornet(Clone)") { Scene scene = gameObject.scene; if (((Scene)(ref scene)).name == "DontDestroyOnLoad") { FsmUtil.DisableActions(fsm, "Hornet Jump Antic", new int[3] { 1, 4, 5 }); FsmUtil.DisableActions(fsm, "Hornet Jump", new int[8] { 1, 2, 3, 4, 5, 6, 7, 8 }); FsmUtil.AddTransition(fsm, "Hornet Jump", FsmEvent.Finished.Name, "Hornet Fall"); FsmUtil.DisableActions(fsm, "Hornet Fall", new int[5] { 0, 3, 5, 6, 7 }); FsmUtil.AddTransition(fsm, "Hornet Fall", FsmEvent.Finished.Name, "Children Leave Fade"); FsmUtil.GetAction<ScreenFader>(fsm, "Children Leave Fade", 6).duration = FsmFloat.op_Implicit(0.25f); FsmUtil.GetAction<Wait>(fsm, "Children Leave Fade", 7).time = FsmFloat.op_Implicit(0.25f); } } } internal static void Beastlings(PlayMakerFSM fsm) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) if (!Configs.FasterBeastlingCall.Value || fsm == null || !(fsm.FsmName == "bellbeast_child_teleport_arrive")) { return; } GameObject gameObject = ((Component)fsm).gameObject; if (gameObject == null || !(((Object)gameObject).name == "Bone Beast Children Teleport(Clone)")) { return; } Scene scene = gameObject.scene; if (((Scene)(ref scene)).name == "DontDestroyOnLoad") { FsmUtil.AddMethod(fsm, "Init", (Action<FsmStateAction>)delegate { MirrorTk2dAnimDelayed component = ((Component)fsm).GetComponent<MirrorTk2dAnimDelayed>(); component.mirrorAnimator.PlayFromFrame(0); component.animator.PlayFromFrame(0); component.animator.Stop(); }); } } internal static void Needolin(PlayMakerFSM fsmSilkSpecials) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) if ((!Configs.FasterBeastlingCall.Value && !Configs.SkipBeastlingCallPerformance.Value) || fsmSilkSpecials == null || !(fsmSilkSpecials.FsmName == "Silk Specials")) { return; } GameObject gameObject = ((Component)fsmSilkSpecials).gameObject; if (gameObject != null && ((Object)gameObject).name == "Hero_Hornet(Clone)") { Scene scene = gameObject.scene; if (((Scene)(ref scene)).name == "DontDestroyOnLoad") { Fsm runFsm = ((RunFSMAction)FsmUtil.GetAction<RunFSM>(fsmSilkSpecials, "Needolin Sub", 2)).runFsm; FsmUtil.GetAction<BoolTestDelay>(runFsm, "Needolin FT Wait", 4).delay = FsmFloat.op_Implicit(0f); FsmUtil.GetAction<Wait>(runFsm, "Can Fast Travel?", 1).time = FsmFloat.op_Implicit(0f); FsmUtil.GetAction<Wait>(runFsm, "Needolin FT Antic", 5).time = FsmFloat.op_Implicit(Configs.SkipBeastlingCallPerformance.Value ? 0f : 1.5f); } } } } internal static class Bellway { private static bool IsInBellwayScene(Component component) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) Dictionary<FastTravelLocations, string> scenes = FastTravelScenes._scenes; Scene scene = component.gameObject.scene; return scenes.ContainsValue(GameManager.InternalBaseSceneName(((Scene)(ref scene)).name)); } internal static void BellBeast(PlayMakerFSM fsm) { //IL_0182: 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_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: 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_01da: Expected O, but got Unknown if (fsm == null || !(fsm.FsmName == "Interaction") || !(((Object)fsm).name == "Bone Beast NPC") || !IsInBellwayScene((Component)(object)fsm)) { return; } QoLPlugin.Logger.LogDebug((object)"Modifying Bell Beast FSM"); if (Configs.FasterBellwayTravel.Value) { FsmUtil.GetAction<Wait>(fsm, "Travel Arrive Start", 7).time = FsmFloat.op_Implicit(0f); FsmUtil.GetAction<ScreenFader>(fsm, "Hero Jump", 0).duration = FsmFloat.op_Implicit(0.25f); FsmUtil.DisableAction(fsm, "Hero Jump", 5); FsmUtil.ChangeTransition(fsm, "Hero Jump", FsmEvent.Finished.Name, "Time Passes"); FsmUtil.ChangeTransition(fsm, "First Enter?", FsmEvent.Finished.Name, "Idle"); } FsmUtil.AddMethod(fsm, "Wait Finished Entering", (Action<FsmStateAction>)delegate { if (!HudCanvas.IsVisible) { HudCanvas instance = HudCanvas.instance; instance.targetFsm.SendEvent("IN"); FSMUtility.SendEventToGameObject(((Component)instance).gameObject, "INVENTORY OPEN COMPLETE", true); } }); if (Configs.BellBeastFreeWill.Value) { EnumCompare actionCompareLocation = FsmUtil.GetAction<EnumCompare>(fsm, "Is Already Present?", 1); actionCompareLocation.notEqualEvent = actionCompareLocation.equalEvent; FsmUtil.InsertMethod(fsm, "First Enter?", 0, (Action<FsmStateAction>)delegate { //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) PlayerData.instance.FastTravelNPCLocation = (FastTravelLocations)(object)actionCompareLocation.compareTo.Value; }); } if (Configs.NoBellBeastSleep.Value) { FsmUtil.ChangeTransition(fsm, "Start State", "SLEEP", "Wake Up"); } if (Configs.SkipCutscene.Value) { FsmUtil.DisableAction(fsm, "Choose Scene", 3); FsmUtil.ReplaceAction(fsm, "Go To Stag Cutscene", 7, (FsmStateAction)new BeginSceneTransition { sceneName = fsm.FsmVariables.GetFsmString("To Scene"), entryGateName = FsmString.op_Implicit("door_fastTravelExit"), entryDelay = FsmFloat.op_Implicit(0f), visualization = FsmEnum.op_Implicit((Enum)(object)(SceneLoadVisualizations)0), preventCameraFadeOut = true }); } if (Configs.FasterBellwayBuy.Value) { FsmUtil.ChangeTransition(fsm, "Can Appear 2", "TRUE", "Appear Delay"); FsmUtil.DisableAction(fsm, "Appear Delay", 5); FsmUtil.DisableAction(fsm, "Start Shake", 8); } } internal static void Toll(PlayMakerFSM fsm) { //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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown if (Configs.FasterBellwayBuy.Value && fsm != null && fsm.FsmName == "Unlock Behaviour" && ((Object)fsm).name == "Bellway Toll Machine" && IsInBellwayScene((Component)(object)fsm)) { QoLPlugin.Logger.LogDebug((object)"Modifying Bellway Toll FSM"); FsmUtil.DisableAction(fsm, "Return Control", 5); FsmUtil.AddAction(fsm, "Return Control", (FsmStateAction)new SetAnimator { target = new FsmOwnerDefault(), active = FsmBool.op_Implicit(true) }); FsmUtil.AddMethod(fsm, "Return Control", (Action<FsmStateAction>)delegate { ((Component)fsm).GetComponent<Animator>().speed = 20f; }); FsmUtil.DisableAction(fsm, "Sequence Strum", 0); FsmUtil.DisableAction(fsm, "Stop", 1); FsmUtil.DisableActions(fsm, "Open Floor", new int[2] { 3, 5 }); FsmUtil.GetAction<CallMethodProper>(fsm, "Open Floor", 0).gameObject.GameObject.Value.GetComponent<Animator>().speed = 10f; } } } internal static class FsmCutscene { internal static void LastDive(PlayMakerFSM fsm) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (!Configs.SkipCutscene.Value || fsm == null || !(fsm.FsmName == "Dive Cutscene")) { return; } GameObject gameObject = ((Component)fsm).gameObject; if (gameObject != null && ((Object)gameObject).name == "Abyss Dive Cutscene") { Scene scene = gameObject.scene; if (((Scene)(ref scene)).name == "Abyss_05") { FsmUtil.DisableAction(fsm, "Preload Scene", 3); BeginSceneTransition action = FsmUtil.GetAction<BeginSceneTransition>(fsm, "Dive End", 9); action.sceneName = FsmString.op_Implicit("Abyss_Cocoon"); action.entryGateName = FsmString.op_Implicit("door_entry"); } } } internal static void Lace2(PlayMakerFSM fsm) { //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) if (!Configs.SkipCutscene.Value) { return; } if (fsm != null && ((Object)fsm).name == "door_cutsceneEndLaceTower" && fsm.FsmName == "Travel Control") { FsmUtil.ChangeTransition(fsm, "Lift Arrive?", "FALSE", "Lift Already Here"); ((Component)((Component)fsm).transform.GetChild(2)).GetComponent<Animator>().speed = 5f; FsmUtil.GetFirstActionOfType<iTweenMoveTo>(FsmUtil.GetState(fsm, "Enter")).speed = FsmFloat.op_Implicit(25f); FsmState state = FsmUtil.GetState(fsm, "In Lift"); ((FsmStateAction)FsmUtil.GetAction<Wait>(state, 8)).enabled = false; FsmUtil.GetAction<Wait>(state, 10).time = (FsmUtil.GetAction<ScreenFader>(state, 11).duration = (FsmUtil.GetAction<Wait>(state, 12).time = FsmFloat.op_Implicit(0.5f))); if (PlayerData.instance.encounteredLaceTower) { FsmUtil.GetFirstActionOfType<SendEventToRegister>(fsm, "Lift Already Here").eventName = FsmString.op_Implicit("BATTLE START REFIGHT"); } FsmUtil.InsertMethod(fsm, "Lift Already Here", 0, (Action<FsmStateAction>)delegate { AudioMixerExtensions.TransitionToSafe(GameManager.instance.actorSnapshotUnpaused, 0f); GameManager.instance.ui.AudioGoToGameplay(0.2f); }); ((FsmStateAction)FsmUtil.GetFirstActionOfType<PlayerDataVariableTest>(FsmUtil.GetState(fsm, "Hero Control"))).Enabled = PlayerData.instance.laceTowerDoorOpened; } else { if (fsm == null || !(fsm.FsmName == "Sequence") || !(((Object)fsm).name == "Boss Scene")) { return; } GameObject gameObject = ((Component)fsm).gameObject; if (gameObject == null) { return; } Scene scene = gameObject.scene; if (((Scene)(ref scene)).name == "Cog_Dancers") { Transform child = ((Component)fsm).transform.GetChild(12); ((Component)child).GetComponent<Animator>().speed = 4f; FsmUtil.DisableActionsOfType<Wait>(fsm, "Lift Inspect Wait"); ((Component)child.GetChild(1).GetChild(2).GetChild(9)).GetComponent<Animator>().speed = 5f; FsmUtil.InsertMethod(FsmUtil.GetState(fsm, "Get In Lift Start"), (Action<FsmStateAction>)delegate { GameObject gameObject2 = ((Component)((Component)fsm).transform.GetChild(5)).gameObject; ((InteractableBase)gameObject2.GetComponent<PlayMakerNPC>()).Deactivate(false); gameObject2.SetActive(false); }, 8); FsmUtil.GetLastActionOfType<Wait>(FsmUtil.GetState(fsm, "In Lift")).time = FsmFloat.op_Implicit(0.5f); FsmUtil.GetFirstActionOfType<iTweenMoveTo>(FsmUtil.GetState(fsm, "Get In Lift Move")).speed = (FsmUtil.GetFirstActionOfType<iTweenMoveTo>(FsmUtil.GetState(fsm, "Hero Exit")).speed = FsmFloat.op_Implicit(15f)); FsmUtil.GetFirstActionOfType<Wait>(FsmUtil.GetState(fsm, "Fade Down")).time = FsmFloat.op_Implicit(0.7f); ((FsmStateAction)FsmUtil.GetFirstActionOfType<Tk2dPlayAnimationWait>(FsmUtil.GetState(fsm, "Hero Exited"))).Enabled = false; } } } internal static void FleaTravel(PlayMakerFSM fsm) { if (Configs.SkipCutscene.Value) { if (fsm != null && fsm.FsmName == "Quest End Sequence" && ((Object)fsm).name == "Caravan") { FsmUtil.GetFirstActionOfType<Wait>(FsmUtil.GetState(fsm, "Fade Down")).time = FsmFloat.op_Implicit(1.5f); FsmState state = FsmUtil.GetState(fsm, "Sound With"); ((FsmStateAction)FsmUtil.GetFirstActionOfType<StartPreloadingScene>(state)).Enabled = false; ((FsmStateAction)FsmUtil.GetFirstActionOfType<PlayAudioEvent>(state)).Enabled = false; FsmUtil.GetFirstActionOfType<Wait>(state).time = FsmFloat.op_Implicit(1.5f); FsmState state2 = FsmUtil.GetState(fsm, "Sound Without"); ((FsmStateAction)FsmUtil.GetFirstActionOfType<PlayAudioEvent>(state2)).Enabled = false; FsmUtil.GetFirstActionOfType<Wait>(state2).time = FsmFloat.op_Implicit(1.5f); } else if (fsm != null && fsm.FsmName == "Cutscene Control" && ((Object)fsm).name == "_SceneManager") { FsmState state3 = FsmUtil.GetState(fsm, "Wait"); FsmUtil.GetLastActionOfType<Wait>(state3).time = FsmFloat.op_Implicit(3f); FsmUtil.GetFirstActionOfType<Wait>(state3).time = FsmFloat.op_Implicit(0.5f); FsmUtil.GetFirstActionOfType<ScreenFader>(state3).duration = FsmFloat.op_Implicit(0.5f); FsmState state4 = FsmUtil.GetState(fsm, "Fade Out"); FsmUtil.GetFirstActionOfType<Wait>(state4).time = FsmFloat.op_Implicit(0.3f); FsmUtil.GetFirstActionOfType<ScreenFader>(state4).duration = FsmFloat.op_Implicit(0.3f); ((FsmStateAction)FsmUtil.GetFirstActionOfType<PlayAudioEvent>(state4)).Enabled = false; ((FsmStateAction)FsmUtil.GetLastActionOfType<Wait>(state4)).Enabled = false; } } } internal static void ShermaAct3Intro(PlayMakerFSM fsm) { if (Configs.SkipCutscene.Value && fsm != null && fsm.FsmName == "Cutscene Control" && ((Object)fsm).name == "door_act3_wakeUp") { FsmUtil.DisableActionsOfType<Wait>(FsmUtil.GetState(fsm, "Fade Pause")); FsmUtil.GetFirstActionOfType<Wait>(FsmUtil.GetState(fsm, "Sherma Start")).time = FsmFloat.op_Implicit(1.5f); FsmState state = FsmUtil.GetState(fsm, "Fade In"); FsmUtil.GetFirstActionOfType<ScreenFader>(state).duration = FsmFloat.op_Implicit(2.5f); FsmUtil.GetFirstActionOfType<CameraBlurPlaneFade>(state).Duration = FsmFloat.op_Implicit(2f); FsmUtil.GetFirstActionOfType<Wait>(state).time = FsmFloat.op_Implicit(4f); FsmUtil.GetFirstActionOfType<Wait>(FsmUtil.GetState(fsm, "Get Up")).time = FsmFloat.op_Implicit(0.5f); } } internal static void DivingBell(PlayMakerFSM fsm) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) if (!Configs.SkipCutscene.Value) { return; } if (fsm != null && fsm.FsmName == "Dialogue" && ((Object)fsm).name == "Wake Up Scene") { GameObject gameObject = ((Component)fsm).gameObject; if (gameObject != null) { Scene scene = gameObject.scene; if (((Scene)(ref scene)).name == "Room_Diving_Bell_Abyss") { FsmUtil.ChangeTransition(fsm, "Wait", FsmEvent.Finished.Name, "Fade Up"); FsmUtil.GetFirstActionOfType<Wait>(FsmUtil.GetState(fsm, "Wait")).time = FsmFloat.op_Implicit(1f); FsmState state = FsmUtil.GetState(fsm, "Fade Up"); FsmUtil.GetFirstActionOfType<ScreenFaderAlpha>(state).Duration = FsmFloat.op_Implicit(1f); FsmUtil.GetFirstActionOfType<Wait>(state).time = FsmFloat.op_Implicit(1.5f); FsmUtil.ChangeTransition(fsm, "Fade Up", FsmEvent.Finished.Name, "Get Up"); FsmUtil.AddMethod(FsmUtil.GetState(fsm, "Get Up"), (Action<FsmStateAction>)delegate { HeroController.instance.RegainControl(); if (!HudCanvas.IsVisible) { HudCanvas instance = HudCanvas.instance; instance.targetFsm.SendEvent("IN"); FSMUtility.SendEventToGameObject(((Component)instance).gameObject, "INVENTORY OPEN COMPLETE", true); } }); } } } if (fsm != null && fsm.FsmName == "Sequence" && ((Object)fsm).name == "Travel Sequence Control") { FsmUtil.GetFirstActionOfType<Wait>(FsmUtil.GetState(fsm, "Depressed")).time = FsmFloat.op_Implicit(0.5f); FsmUtil.DisableActionsOfType<Wait>(FsmUtil.GetState(fsm, "Hornet Grab")); FsmUtil.DisableActionsOfType<Wait>(FsmUtil.GetState(fsm, "Descend Sequence Fixed")); FsmState state2 = FsmUtil.GetState(fsm, "Fade To Black"); FsmUtil.DisableActionsOfType<Wait>(state2); Wait lastActionOfType = FsmUtil.GetLastActionOfType<Wait>(state2); lastActionOfType.time = FsmFloat.op_Implicit(1.5f); ((FsmStateAction)lastActionOfType).Enabled = true; FsmState state3 = FsmUtil.GetState(fsm, "Cut To Cinematic"); FsmUtil.GetFirstActionOfType<ScreenFader>(state3).duration = (FsmUtil.GetFirstActionOfType<Wait>(state3).time = FsmFloat.op_Implicit(1f)); FsmUtil.GetLastActionOfType<Wait>(state3).time = FsmFloat.op_Implicit(1.5f); FsmUtil.GetFirstActionOfType<Wait>(FsmUtil.GetState(fsm, "Fade To End")).time = FsmFloat.op_Implicit(1.5f); FsmState state4 = FsmUtil.GetState(fsm, "Fade Up"); FsmUtil.DisableActionsOfType<Wait>(state4); Wait lastActionOfType2 = FsmUtil.GetLastActionOfType<Wait>(state4); lastActionOfType2.time = FsmFloat.op_Implicit(0.5f); ((FsmStateAction)lastActionOfType2).Enabled = true; } } internal static void CitadelEntrance(PlayMakerFSM fsm) { if (Configs.SkipCutscene.Value && fsm != null && fsm.FsmName == "Cutscene Control" && ((Object)fsm).name == "right_cutsceneEntry") { FsmUtil.ChangeTransition(fsm, "State 1", "FINISH ENTRY", "Fade In"); FsmUtil.GetFirstActionOfType<ScreenFader>(fsm, "Fade In").duration = FsmFloat.op_Implicit(0.5f); FsmUtil.GetFirstActionOfType<Wait>(fsm, "Fade In").time = FsmFloat.op_Implicit(0.5f); FsmUtil.ChangeTransition(fsm, "Fade In", FsmEvent.Finished.Name, "Give Control"); FsmUtil.DisableActions(fsm, "State 1", new int[3] { 2, 3, 4 }); } } internal static void SmallCutscenes(PlayMakerFSM fsm) { } } internal static class DreamCutscene { internal static void Widow(PlayMakerFSM fsm) { //IL_00e9: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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) if (!Configs.SkipDreamCutscene.Value) { return; } Scene scene; if (fsm != null && fsm.FsmName == "Control" && ((Object)fsm).name == "Spinner Boss") { if (!Configs.SkipDreamCutsceneFully.Value) { return; } BeginSceneTransition firstActionOfType = FsmUtil.GetFirstActionOfType<BeginSceneTransition>(FsmUtil.GetState(fsm, "To Memory Scene")); scene = ((Component)fsm).gameObject.scene; firstActionOfType.sceneName = FsmString.op_Implicit(((Scene)(ref scene)).name); } if (fsm != null && fsm.FsmName == "Wake Up" && ((Object)fsm).name == "door_wakeOnGround") { GameObject gameObject = ((Component)fsm).gameObject; if (gameObject != null) { scene = gameObject.scene; if (((Scene)(ref scene)).name == "Belltown_Shrine") { FsmUtil.AddMethod(fsm, "Regain Control", (Action<FsmStateAction>)delegate { PlayerData.instance.disableInventory = false; }); } } } scene = ((Component)fsm).gameObject.scene; if (!(((Scene)(ref scene)).name != "Memory_Needolin")) { if (fsm != null && fsm.FsmName == "Memory Control") { FsmUtil.ChangeTransition(fsm, "End Pause", FsmEvent.Finished.Name, "Wait"); } MemorySkipCutscene(fsm); } } internal static void FirstSinner(PlayMakerFSM fsm) { //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown if (!Configs.SkipDreamCutscene.Value) { return; } Scene scene; if (fsm != null && fsm.FsmName == "Inspection" && ((Object)fsm).name == "Shrine First Weaver NPC") { if (!Configs.SkipDreamCutsceneFully.Value) { return; } FsmState state = FsmUtil.GetState(fsm, "To First Sinner Memory"); BeginSceneTransition firstActionOfType = FsmUtil.GetFirstActionOfType<BeginSceneTransition>(state); scene = ((Component)fsm).gameObject.scene; firstActionOfType.sceneName = FsmString.op_Implicit(((Scene)(ref scene)).name); FsmUtil.GetFirstActionOfType<Wait>(state).time = FsmFloat.op_Implicit(1.5f); FsmUtil.InsertMethod(state, (Action<FsmStateAction>)delegate { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown PlayerData.instance.hasSilkBomb = (PlayerData.instance.defeatedFirstWeaver = true); ToolItemManager.AutoEquip((ToolItem)fsm.Fsm.Variables.FindFsmObject("Equip Tool").Value); }, 1); SpawnSkillGetMsg firstActionOfType2 = FsmUtil.GetFirstActionOfType<SpawnSkillGetMsg>(FsmUtil.GetState(fsm, "Skill Msg")); FsmUtil.InsertAction(state, (FsmStateAction)new SpawnSkillGetMsg { MsgPrefab = firstActionOfType2.MsgPrefab, Skill = firstActionOfType2.Skill }, 2); } scene = ((Component)fsm).gameObject.scene; if (!(((Scene)(ref scene)).name != "Memory_First_Sinner")) { if (fsm != null && fsm.FsmName == "Memory Control") { FsmUtil.ChangeTransition(fsm, "End Pause", FsmEvent.Finished.Name, "Get Rune Bomb"); } MemorySkipCutscene(fsm); } } internal static void MemorySkipCutscene(PlayMakerFSM fsm) { if (fsm != null && fsm.FsmName == "Control" && ((Object)fsm).name == "memory_orb_inspect") { FsmUtil.ChangeTransition(fsm, "Fade To Black", FsmEvent.Finished.Name, "End Memory"); } } internal static void MemoryThread(PlayMakerFSM fsm) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown if (Configs.SkipDreamCutscene.Value) { if (fsm != null && fsm.FsmName == "FSM" && ((Object)fsm).name == "thread_memory") { FsmUtil.ChangeTransition(fsm, "Burst? Hold.", "TRUE", "Deep Memory Enter Fall"); FsmState state = FsmUtil.GetState(fsm, "Collapse"); FsmUtil.AddAction(state, (FsmStateAction)new Wait { time = FsmFloat.op_Implicit(0.7f) }); FsmUtil.DisableActionsOfType<ListenForAnimationEvent>(state); } else if (fsm != null && fsm.FsmName == "To Memory" && ((Object)fsm).name == "Memory Group") { FsmUtil.GetFirstActionOfType<ScreenFader>(FsmUtil.GetState(fsm, "Transition Scene")).duration = FsmFloat.op_Implicit(0.3f); } } } internal static void SilkHeart(PlayMakerFSM fsm) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) if (!Configs.SkipDreamCutscene.Value) { return; } Scene scene; if (fsm.FsmName == "Memory Control") { scene = ((Component)fsm).gameObject.scene; if (((Scene)(ref scene)).name.StartsWith("Memory_Silk_Heart")) { FsmUtil.GetFirstActionOfType<Wait>(FsmUtil.GetState(fsm, "To White")).time = FsmFloat.op_Implicit(1f); FsmUtil.ChangeTransition(fsm, "To White", FsmEvent.Finished.Name, "To Black"); } } if (!Configs.SkipDreamCutsceneFully.Value || fsm == null || !(fsm.FsmName == "Control") || !(((Object)fsm).name == "Silk Heart")) { return; } scene = ((Component)fsm).gameObject.scene; string scene2 = ((Scene)(ref scene)).name.Replace("_boss", ""); if (scene2 != "Bone_05" && scene2 != "Ward_02" && scene2 != "Song_Tower_01") { return; } FsmUtil.AddMethod(FsmUtil.GetState(fsm, "Set Data"), (Action<FsmStateAction>)delegate { switch (scene2) { case "Bone_05": PlayerData.instance.defeatedBellBeast = (PlayerData.instance.bonebottomQuestBoardFixed = true); break; case "Ward_02": PlayerData.instance.wardBossDefeated = true; break; case "Song_Tower_01": PlayerData.instance.defeatedLaceTower = true; break; } }); FsmUtil.FindStringVariable(fsm, "Memory Scene").Value = scene2; FsmUtil.DisableActionsOfType<StringCompare>(FsmUtil.GetState(fsm, "Memory?")); FsmState state = FsmUtil.GetState(fsm, "Memory Scene"); FsmUtil.ChangeTransition(fsm, "Drop To Place", FsmEvent.Finished.Name, state.Name); FsmUtil.DisableAction(state, 0); FsmUtil.GetFirstActionOfType<BeginSceneTransition>(state).entryGateName = FsmString.op_Implicit("door_cinematicEnd"); } } public static class FsmFasterBoss { internal static void FasterBoss(PlayMakerFSM fsm) { if (Configs.FasterBossLoad.Value) { FasterLace(fsm); FasterGMS(fsm); FasterTrobbio(fsm); FasterWidow(fsm); FasterLastJudge(fsm); FasterUnravelled(fsm); FasterCraggler(fsm); } } private static void FasterCraggler(PlayMakerFSM fsm) { if (fsm != null && fsm.FsmName == "Control" && ((Object)fsm).name == "Roof Crab") { FsmUtil.ChangeTransition(fsm, "Meet?", "ROAR", "Attack Antic"); } } private static void FasterUnravelled(PlayMakerFSM fsm) { //IL_0053: 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) if (fsm == null || !(fsm.FsmName == "Control") || !(((Object)fsm).name == "Boss Scene")) { return; } GameObject gameObject = ((Component)fsm).gameObject; if (gameObject == null) { return; } Scene scene = gameObject.scene; if (((Scene)(ref scene)).name == "Ward_02_boss") { QoLPlugin.Logger.LogDebug((object)"Modifying TheUnravelled Boss FSM"); FsmState state = FsmUtil.GetState(fsm, "Arena Start"); FsmUtil.DisableAction(state, 2); FsmUtil.InsertMethod(state, 2, (Action<FsmStateAction>)delegate { ((NamedVariable)FsmUtil.FindBoolVariable(fsm, "Boss Encountered")).RawValue = true; }); FsmUtil.GetFirstActionOfType<WaitBool>(state).time = FsmFloat.op_Implicit(1f); FsmUtil.GetFirstActionOfType<Wait>(FsmUtil.GetState(fsm, "Encountered Start")).time = FsmFloat.op_Implicit(0.5f); FsmUtil.GetFirstActionOfType<WaitBool>(FsmUtil.GetState(fsm, "P2 Pause")).time = FsmFloat.op_Implicit(0.5f); FsmUtil.GetFirstActionOfType<WaitBool>(FsmUtil.GetState(fsm, "P2 Setup")).time = FsmFloat.op_Implicit(1f); FsmUtil.DisableAction(FsmUtil.GetState(fsm, "P3 Pause"), 0); } } internal static void FasterLastJudge(PlayMakerFSM fsm) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (fsm.FsmName != "Control") { return; } Scene scene = ((Component)fsm).gameObject.scene; if (((Scene)(ref scene)).name != "Coral_Judge_Arena") { return; } if (((Object)fsm).name == "Boss Scene" && PlayerData.instance.bellShrineBellhart && PlayerData.instance.bellShrineBoneForest && PlayerData.instance.bellShrineGreymoor && PlayerData.instance.bellShrineShellwood && PlayerData.instance.bellShrineWilds) { FsmUtil.ChangeTransition(fsm, "Init", "UNENCOUNTERED", "Encountered"); QoLPlugin.Logger.LogDebug((object)"Modifying LastJudge Boss Door FSM"); } else if (((Object)fsm).name == "Last Judge") { QoLPlugin.Logger.LogDebug((object)"Modifying LastJudge Boss FSM"); FsmUtil.AddMethod(FsmUtil.GetState(fsm, "Intro Roar"), (Action<FsmStateAction>)delegate { PlayerData.instance.encounteredLastJudge = true; }); } } internal static void FasterLace(PlayMakerFSM fsm) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) if (fsm.FsmName != "Control") { return; } GameObject gameObject = ((Component)fsm).gameObject; Scene scene; if (gameObject != null && ((Object)gameObject).name == "Lace Boss1") { scene = gameObject.scene; if (((Scene)(ref scene)).name == "Bone_East_12") { QoLPlugin.Logger.LogDebug((object)"Modifying Lace1 Boss FSM"); FsmUtil.ChangeTransition(fsm, "Encountered?", "MEET", "Refight"); return; } } gameObject = ((Component)fsm).gameObject; if (gameObject != null && ((Object)gameObject).name == "Intro Control") { scene = gameObject.scene; if (((Scene)(ref scene)).name == "Abyss_Cocoon") { QoLPlugin.Logger.LogDebug((object)"Modifying LostLace Boss FSM"); FsmUtil.ChangeTransition(fsm, "Check Encountered", FsmEvent.Finished.Name, "Encountered"); return; } } if (fsm == null || !(((Object)fsm).name == "door_entry") || !(fsm.FsmName == "Control")) { return; } gameObject = ((Component)fsm).gameObject; if (gameObject != null) { scene = gameObject.scene; if (((Scene)(ref scene)).name == "Abyss_Cocoon") { PlayerDataBoolTest firstActionOfType = FsmUtil.GetFirstActionOfType<PlayerDataBoolTest>(FsmUtil.GetState(fsm, "Silk Darkness?")); firstActionOfType.isFalse = firstActionOfType.isTrue; PlayerDataBoolTest firstActionOfType2 = FsmUtil.GetFirstActionOfType<PlayerDataBoolTest>(FsmUtil.GetState(fsm, "Return Control")); firstActionOfType2.isFalse = firstActionOfType2.isTrue; } } } internal static void FasterGMS(PlayMakerFSM fsm) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if (fsm == null || !(fsm.FsmName == "First Challenge") || !(((Object)fsm).name == "Intro Sequence")) { return; } GameObject gameObject = ((Component)fsm).gameObject; if (gameObject != null) { Scene scene = gameObject.scene; if (((Scene)(ref scene)).name == "Cradle_03") { QoLPlugin.Logger.LogDebug((object)"Modifying GMS Boss FSM"); FsmUtil.GetFirstActionOfType<Wait>(fsm, "Wait For Beat End").time = FsmFloat.op_Implicit(0.5f); FsmUtil.GetFirstActionOfType<AnimatorPlay>(fsm, "Burst Anim").normalizedTime = FsmFloat.op_Implicit(5f); FsmUtil.DisableActionsOfType<ListenForAnimationEvent>(fsm, "Burst Anim"); FsmUtil.GetFirstActionOfType<Wait>(fsm, "Ready Wait").time = FsmFloat.op_Implicit(0.2f); FsmUtil.GetFirstActionOfType<Wait>(fsm, "Intro Shake").time = FsmFloat.op_Implicit(1f); } } } internal static void FasterTrobbio(PlayMakerFSM fsm) { if (fsm != null && fsm.FsmName == "Control" && ((Object)fsm).name == "Trobbio") { QoLPlugin.Logger.LogDebug((object)"Modifying Trobbio Boss FSM"); FsmUtil.ChangeTransition(fsm, "Init", FsmEvent.Finished.Name, "Wait Refight"); FsmUtil.DisableAction(FsmUtil.GetState(fsm, "Start Pause"), 0); FsmUtil.ChangeTransition(fsm, "Start Pause", FsmEvent.Finished.Name, "Quick Entrance 1"); } else if (fsm != null && fsm.FsmName == "Control" && ((Object)fsm).name == "Tormented Trobbio") { QoLPlugin.Logger.LogDebug((object)"Modifying TormentedTrobbio Boss FSM"); FsmUtil.ChangeTransition(fsm, "State", "MEET", "Start Pause"); FsmUtil.DisableAction(FsmUtil.GetState(fsm, "State"), 1); FsmUtil.AddMethod(FsmUtil.GetState(fsm, "Wait"), (Action<FsmStateAction>)delegate { FsmUtil.FindBoolVariable(fsm, "Encountered").Value = true; }); FsmUtil.GetFirstActionOfType<ConvertBoolToFloat>(FsmUtil.GetState(fsm, "Trobbio Rise")).trueValue = FsmFloat.op_Implicit(0.2f); FsmUtil.GetFirstActionOfType<ConvertBoolToFloat>(FsmUtil.GetState(fsm, "Rise End")).trueValue = FsmFloat.op_Implicit(0f); } } internal static void FasterWidow(PlayMakerFSM fsm) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if (fsm == null || !(fsm.FsmName == "Control") || !(((Object)fsm).name == "Boss Scene")) { return; } GameObject gameObject = ((Component)fsm).gameObject; if (gameObject != null) { Scene scene = gameObject.scene; if (((Scene)(ref scene)).name == "Belltown_Shrine") { QoLPlugin.Logger.LogDebug((object)"Modifying Widow Boss FSM"); FsmUtil.ChangeTransition(fsm, "Check State", "UNENCOUNTERED", "State 1"); FsmUtil.DisableAction(FsmUtil.GetState(fsm, "Spinner Look"), 2); } } } } internal static class FasterNpc { internal static void FasterNPC(PlayMakerFSM fsm) { //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) Configs.FastCogworkStatues value = Configs.FasterCogworkStatues.Value; Scene scene; if (value != Configs.FastCogworkStatues.None && fsm != null && fsm.FsmName == "Sequence" && ((Object)fsm).name == "Boss Scene") { GameObject gameObject = ((Component)fsm).gameObject; if (gameObject != null) { scene = gameObject.scene; if (((Scene)(ref scene)).name == "Cog_Dancers") { if (!PlayerData.instance.defeatedCogworkDancers && value != Configs.FastCogworkStatues.LiftUnlocked) { FsmUtil.ChangeTransition(fsm, "Repeat?", "CANCEL", "All Talk Choose Dlg"); } if (value != Configs.FastCogworkStatues.QuestUnlocked) { FsmUtil.ChangeTransition(fsm, "Statues End Singing", FsmEvent.Finished.Name, "Return Control"); } goto IL_0343; } } } if (Configs.FasterLaceAct2.Value && fsm != null && fsm.FsmName == "Control" && ((Object)fsm).name == "Lace NPC Citadel Meet") { scene = ((Component)fsm).gameObject.scene; bool MistEntrance = ((Scene)(ref scene)).name == "Song_20"; FsmUtil.DisableActionsOfType<SetMeshRenderer>(fsm, "Init"); FsmUtil.AddMethod(fsm, "Init", (Action<FsmStateAction>)delegate { //IL_0011: 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_002d: 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_0071: 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_0085: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)fsm).transform; transform.position += (MistEntrance ? new Vector3(5.86f, 0f, 0f) : new Vector3(-6f, 0f, 0f)); if (MistEntrance) { Transform child = ((Component)fsm).transform.GetChild(0); child.localPosition += new Vector3(-2f, 0f); } }); FsmUtil.DisableActionsOfType<HeroPlayLookUpAnim>(fsm, "Look Up"); FsmUtil.DisableActionsOfType<Wait>(fsm, "Look Up"); FsmUtil.ChangeTransition(fsm, "Look Up", FsmEvent.Finished.Name, "Wait"); FsmUtil.DisableActionsOfType<Wait>(fsm, "Wait"); FsmUtil.ChangeTransition(fsm, "Wait", FsmEvent.Finished.Name, "Jump Antic"); FsmUtil.AddAction(fsm, "Jump Antic", (FsmStateAction)new Wait { time = FsmFloat.op_Implicit(0.1f), finishEvent = FsmEvent.Finished }); FsmUtil.DisableActionsOfType<Wait>(fsm, "Wait"); FsmUtil.DisableActionsOfType<Wait>(fsm, "Quest Update"); FsmUtil.GetFirstActionOfType<Wait>(fsm, "Wake Rumble").time = FsmFloat.op_Implicit(0.5f); } else if (Configs.FasterMelodyObtain.Value && fsm != null && fsm.FsmName == "Cyllinder States" && ((Object)fsm).name == "puzzle cyllinders") { FsmUtil.DisableActionsOfType<Wait>(fsm, "Singing 2"); ((FsmStateAction)FsmUtil.GetFirstActionOfType<Wait>(fsm, "BG Choir On")).enabled = false; FsmUtil.GetLastActionOfType<Wait>(fsm, "BG Choir On").time = FsmFloat.op_Implicit(2f); } goto IL_0343; IL_0343: if (fsm.FsmName != "Dialogue") { return; } if (Configs.FasterSeamstress.Value) { GameObject gameObject = ((Component)fsm).gameObject; if (gameObject != null && ((Object)gameObject).name == "Seamstress") { scene = gameObject.scene; if (((Scene)(ref scene)).name == "Bone_East_Umbrella") { QoLPlugin.Logger.LogDebug((object)"Modifying Seamstress Dialogue"); FsmUtil.DisableAction(FsmUtil.GetState(fsm, "DLG After Dress"), 0); ((Component)fsm).gameObject.transform.Find("Exit Lore Wall").localPosition = new Vector3(-30f, 1.91f, 0f); return; } } } if (Configs.FasterCaretaker.Value) { GameObject gameObject = ((Component)fsm).gameObject; if (gameObject != null && ((Object)gameObject).name == "Enclave Caretaker FirstMeet") { scene = gameObject.scene; if (((Scene)(ref scene)).name == "Song_Enclave") { QoLPlugin.Logger.LogDebug((object)"Modifying Caretaker Dialogue"); if (PlayerData.instance.bellShrineEnclave) { PlayerData.instance.metCaretaker = true; } return; } } } if (Configs.FasterShakra.Value && ((Object)((Component)fsm).gameObject).name == "Mapper NPC") { QoLPlugin.Logger.LogDebug((object)"Modifying Shakra Dialogue"); PlayerData.instance.metMapper = true; } else if (((Object)((Component)fsm).gameObject).name == "Librarian") { if (FsmUtil.GetState(fsm, "Needolin Pre Wait") != null) { RelicBoardOwner component = ((Component)fsm).GetComponent<RelicBoardOwner>(); if (Configs.FasterVaultkeeper.Value && (component.IsAnyRelicsToDeposit() || ((IEnumerable<CollectableItemRelicType>)component.list).SelectMany((CollectableItemRelicType type) => type.Relics).Any((CollectableRelic relic) => relic.SavedData.IsDeposited))) { FsmUtil.ChangeTransition(fsm, "Init", FsmEvent.Finished.Name, "Roar End Small"); FsmUtil.DisableActionsOfType<CheckTrackTriggerCount>(fsm, "Idle"); } if (Configs.FasterMelodyObtain.Value) { FsmUtil.DisableActionsOfType<Wait>(fsm, "Needolin Pre Wait"); FsmUtil.ChangeTransition(fsm, "Needolin Pre Wait", FsmEvent.Finished.Name, "Needolin"); } } } else { if (!Configs.FasterMelodyObtain.Value || !(((Object)((Component)fsm).gameObject).name == "Last Conductor NPC")) { return; } FsmUtil.GetLastActionOfType<Wait>(fsm, "Run Melody Play Prompted").time = FsmFloat.op_Implicit(4f); FsmUtil.ChangeTransition(fsm, "Run Melody Play Prompted", FsmEvent.Finished.Name, "Set Learned Melody 2"); FsmUtil.InsertMethod(fsm, "Playing Wait", 1, (Action<FsmStateAction>)delegate { EventRegister.SendEvent("NEEDOLIN LOCK", (GameObject)null); fsm.SendEvent("MELODY"); }); FsmUtil.AddTransition(fsm, "Playing Wait", "MELODY", "Run Melody Play Prompted"); FsmUtil.InsertMethod(fsm, "End Dialogue", 1, (Action<FsmStateAction>)delegate { EventRegister.SendEvent("FSM CANCEL", (GameObject)null); HeroController.instance.RegainControl(); if (!HudCanvas.IsVisible) { HudCanvas instance = HudCanvas.instance; instance.targetFsm.SendEvent("IN"); FSMUtility.SendEventToGameObject(((Component)instance).gameObject, "INVENTORY OPEN COMPLETE", true); } }); } } } public static class FastMenu { internal static void ShopUI(PlayMakerFSM fsm) { if (Configs.FastUI.Value) { FsmFloat obj = FsmUtil.FindFloatVariable(fsm, "Fade Time"); if (obj != null) { ((NamedVariable)obj).RawValue = 0.1f; } if (fsm.FsmName == "ui_list_item" && (((Object)fsm).name == "No" || ((Object)fsm).name == "Yes")) { FsmUtil.GetLastActionOfType<Wait>(FsmUtil.GetState(fsm, "Chosen")).time = FsmFloat.op_Implicit(0f); } else if (fsm.FsmName == "Confirm Control" && ((Object)fsm).name == "UI List") { FsmUtil.GetFirstActionOfType<Wait>(FsmUtil.GetState(fsm, "Particles")).time = FsmFloat.op_Implicit(0.1f); } } } internal static void QuestUIPrompt(PlayMakerFSM fsm) { if (Configs.FastUI.Value && !(fsm.FsmName != "Control") && (!(((Object)fsm).name != "Wish Granted Prompt New(Clone)") || !(((Object)fsm).name != "Wish Promised Prompt(Clone)"))) { ((Component)((Component)fsm).gameObject.transform.GetChild(1)).GetComponent<Animator>().speed = 2f; FsmUtil.GetFirstActionOfType<Wait>(FsmUtil.GetState(fsm, "Idle")).time = FsmFloat.op_Implicit(1f); FsmUtil.DisableActionsOfType<Wait>(FsmUtil.GetState(fsm, "Fade Down")); FsmUtil.DisableActionsOfType<Wait>(FsmUtil.GetState(fsm, "Explainer Up")); if (((Object)fsm).name == "Wish Granted Prompt New(Clone)") { ((FsmStateAction)FsmUtil.GetFirstActionOfType<ActivateGameObject>(FsmUtil.GetState(fsm, "Press"))).Enabled = false; } } } } internal static class FsmLiftControl { private static bool IsInLiftScene(Component component) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) Scene scene = component.gameObject.scene; string text = GameManager.InternalBaseSceneName(((Scene)(ref scene)).name); switch (text) { default: return text == "Dock_01"; case "Bonetown": case "Belltown_06": case "Room_Forge": return true; } } internal static void Lift(PlayMakerFSM fsm) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) Configs.LiftSpeed value = Configs.FasterLifts.Value; if (value != Configs.LiftSpeed.Vanilla && IsInLiftScene((Component)(object)fsm) && fsm != null && fsm.FsmName == "Lift Control") { QoLPlugin.Logger.LogDebug((object)"Modifying Lift FSM"); float value2 = 0f; float num = 0f; switch (value) { case Configs.LiftSpeed.SlightlyFaster: value2 = 16f; num = 16f; break; case Configs.LiftSpeed.Fast: value2 = 19f; num = 31.4f; break; case Configs.LiftSpeed.VeryFast: { Scene scene = ((Component)fsm).gameObject.scene; value2 = ((((Scene)(ref scene)).name == "Bonetown") ? 28 : 21); num = 31.4f; break; } } FsmUtil.FindFloatVariable(fsm, "Speed").Value = value2; FsmUtil.GetFirstActionOfType<SetFloatValue>(fsm, "Init").floatValue = FsmFloat.op_Implicit(num); } } } internal static class SkipWeakness { internal static void SkipWeaknessPatch(PlayMakerFSM fsm) { //IL_0211: 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_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Expected O, but got Unknown //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Expected O, but got Unknown //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) if (!Configs.SkipWeakness.Value) { return; } if (!PlayerData.instance.churchKeeperIntro && fsm != null && ((Object)fsm).name == "Churchkeeper Intro Scene" && fsm.FsmName == "Control") { QoLPlugin.Logger.LogDebug((object)"Modifying Churchkeeper Dialogue"); PlayerData.instance.churchKeeperIntro = true; FsmUtil.ChangeTransition(fsm, "Pause", FsmEvent.Finished.Name, "Set End"); FsmUtil.AddMethod(FsmUtil.GetState(fsm, "Set End"), (Action<FsmStateAction>)delegate { fsm.SendEvent("GET ITEM MSG END"); }); } else if (fsm != null && ((Object)fsm).name == "Weakness Scene" && fsm.FsmName == "Control") { QoLPlugin.Logger.LogDebug((object)"Modifying Weakness Scene"); FsmUtil.ChangeTransition(fsm, "Check PD Bool", FsmEvent.Finished.Name, "Activated"); } else if (fsm != null && ((Object)fsm).name == "Weakness Cog Drop Scene" && fsm.FsmName == "Control") { QoLPlugin.Logger.LogDebug((object)"Modifying Weakness Scene"); FsmUtil.ChangeTransition(fsm, "Init", FsmEvent.Finished.Name, "Activated"); } else if (fsm != null && ((Object)fsm).name == "Weakness Scene Act3 Final" && fsm.FsmName == "Control") { QoLPlugin.Logger.LogDebug((object)"Modifying Weakness Scene"); Trigger2dEvent firstActionOfType = FsmUtil.GetFirstActionOfType<Trigger2dEvent>(FsmUtil.GetState(fsm, "Dormant")); Trigger2dEvent lastActionOfType = FsmUtil.GetLastActionOfType<Trigger2dEvent>(FsmUtil.GetState(fsm, "Walk R")); firstActionOfType.gameObject = lastActionOfType.gameObject; firstActionOfType.trigger = (Trigger2DType)1; firstActionOfType.sendEvent = lastActionOfType.sendEvent; firstActionOfType.storeCollider = lastActionOfType.storeCollider; FsmUtil.InsertAction(FsmUtil.GetState(fsm, "Weak Fall"), (FsmStateAction)new AddHeroInputBlocker { Blocker = FsmUtil.GetFirstActionOfType<AddHeroInputBlocker>(FsmUtil.GetState(fsm, "First Land")).Blocker }, 0); FsmUtil.GetFirstActionOfType<Wait>(FsmUtil.GetState(fsm, "Weak Fall Land")).time = FsmFloat.op_Implicit(0.5f); FsmState state = FsmUtil.GetState(fsm, "Fade Out"); FsmUtil.GetFirstActionOfType<ScreenFader>(state).duration = FsmFloat.op_Implicit(0.6f); FsmUtil.GetFirstActionOfType<Wait>(state).time = FsmFloat.op_Implicit(0.6f); FsmUtil.ChangeTransition(fsm, "Get Up To Kneel", FsmEvent.Finished.Name, "Fade Out"); FsmUtil.InsertAction(FsmUtil.GetState(fsm, "To Enclave Scene"), (FsmStateAction)new RemoveHeroInputBlocker { Blocker = FsmUtil.GetFirstActionOfType<RemoveHeroInputBlocker>(FsmUtil.GetState(fsm, "Release Lock")).Blocker }, 4); } else { if (fsm == null || !(fsm.FsmName == "Control") || !(((Object)fsm).name == "Hatch")) { return; } GameObject gameObject = ((Component)fsm).gameObject; if (gameObject != null) { Scene scene = gameObject.scene; if (((Scene)(ref scene)).name == "Song_25") { FsmUtil.GetFirstActionOfType<SetFloatValue>(FsmUtil.GetState(fsm, "Wait for Call")).floatValue = FsmFloat.op_Implicit(0.1f); } } } } } public static class ToolPatch { internal static void Scuttlebrace(PlayMakerFSM fsm) { if (Configs.OldScuttlebrace.Value && !(fsm.FsmName != "Tool Attacks")) { QoLPlugin.Logger.LogDebug((object)"Modifying Scuttlebrace Tool"); FsmUtil.GetFirstActionOfType<ListenForJump>(FsmUtil.GetState(fsm, "Scuttle End")).activeBool = FsmBool.op_Implicit(true); } } } internal static class Ventrica { private static bool IsInVentricaScene(Component component) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) Dictionary<TubeTravelLocations, string> tubeScenes = FastTravelScenes._tubeScenes; Scene scene = component.gameObject.scene; return tubeScenes.ContainsValue(GameManager.InternalBaseSceneName(((Scene)(ref scene)).name)); } internal static void Tube(PlayMakerFSM fsm) { if (fsm != null && fsm.FsmName == "Tube Travel" && ((Object)fsm).name == "City Travel Tube" && IsInVentricaScene((Component)(object)fsm)) { QoLPlugin.Logger.LogDebug((object)"Modifying Ventrica FSM"); if (Configs.FasterVentricaTravel.Value) { FsmUtil.DisableAction(fsm, "Tube Start Away", 3); FsmUtil.GetAction<SendEventByName>(fsm, "Tube Start Away", 4).sendEvent = FsmString.op_Implicit("START OPEN"); FsmUtil.ChangeTransition(fsm, "Start In Tube", FsmEvent.Finished.Name, "Break Items"); FsmUtil.AddTransition(fsm, "Break Items", FsmEvent.Finished.Name, "Open"); FsmUtil.DisableAction(fsm, "Open", 3); FsmUtil.AddTransition(fsm, "Open", FsmEvent.Finished.Name, "Hop Out Antic"); FsmUtil.ChangeTransition(fsm, "Preload Scene", FsmEvent.Finished.Name, "Close"); FsmUtil.AddTransition(fsm, "Close", FsmEvent.Finished.Name, "Save State"); FsmUtil.GetAction<ScreenFader>(fsm, "Fade Out", 2).duration = FsmFloat.op_Implicit(0.25f); FsmUtil.GetAction<Wait>(fsm, "Fade Out", 3).time = FsmFloat.op_Implicit(0.25f); } if (Configs.FasterVentricaBuy.Value) { FsmUtil.GetAction<SendEventByName>(fsm, "Unlock Open", 1).sendEvent = FsmString.op_Implicit("START OPEN"); FsmUtil.AddTransition(fsm, "Unlock Open", FsmEvent.Finished.Name, "Unlock"); } } } internal static void Toll(PlayMakerFSM fsm) { if (Configs.FasterVentricaBuy.Value && fsm != null && fsm.FsmName == "Unlock Behaviour" && ((Object)fsm).name == "tube_toll_machine" && IsInVentricaScene((Component)(object)fsm)) { QoLPlugin.Logger.LogDebug((object)"Modifying Ventrica Toll FSM"); FsmUtil.DisableAction(fsm, "Retract Animation", 0); FsmUtil.AddLambdaMethod(fsm, "Retract Animation", (Action<Action>)delegate(Action finish) { ((Component)fsm).GetComponent<Animator>().speed = 100f; finish(); }); FsmUtil.DisableAction(fsm, "After Retract Pause", 1); } } } }