Example #1
0
        private void HeroControllerOnLookForInput(On.HeroController.orig_LookForInput orig, HeroController self)
        {
            if (Reflection.GetAttr <HeroController, InputHandler>(HeroController.instance, "inputHandler")
                .inputActions.dash.WasPressed &&
                voidCount > 4)
            {
                isBerserk = true;
                StartCoroutine(BerserkMode());
            }

            orig(self);
        }
 private static bool CanQuickMap(On.HeroController.orig_CanQuickMap orig, HeroController self)
 {
     return(Storage
         ? !GameManager.instance.isPaused &&
            !self.cState.onConveyor &&
            !self.cState.dashing &&
            !self.cState.backDashing &&
            (!self.cState.attacking || ReflectionHelper.GetAttr <HeroController, float>(self, "attack_time") >= self.ATTACK_RECOVERY_TIME) &&
            !self.cState.recoiling &&
            !self.cState.hazardDeath &&
            !self.cState.hazardRespawning
         : orig(self));
 }
        private static void EnableSuperslides(On.InputHandler.orig_Update orig, InputHandler self)
        {
            if (Superslides && GameManager.instance.TimeSlowed)
            {
                // Ensure the slide has the correct speed
                ReflectionHelper.SetAttr(HeroController.instance, "recoilSteps", 0);

                // Kill the thing that kills superslides
                int timeSlowedCount = ReflectionHelper.GetAttr <GameManager, int>(GameManager.instance, "timeSlowedCount");
                ReflectionHelper.SetAttr(GameManager.instance, "timeSlowedCount", 0);

                orig(self);

                // Restore to old value
                ReflectionHelper.SetAttr(GameManager.instance, "timeSlowedCount", timeSlowedCount);
            }
            else
            {
                orig(self);
            }
        }
Example #4
0
 private static string GetSavePath(int saveSlot, string ending)
 {
     return(Path.Combine(ReflectionHelper.GetAttr <DesktopPlatform, string>(Platform.Current as DesktopPlatform, "saveDirPath"), $"user{saveSlot}.{ending}"));
 }