コード例 #1
0
 public virtual void Deactivate()
 {
     if (!defaultParams.active)
     {
         MelonLogger.Msg(type.ToString() + " cancelled");
         return;
     }
     MelonLogger.Msg(type.ToString() + " deactivated");
     defaultParams.active = false;
     ModStatusHandler.RemoveStatusDisplays(type, ModStatusHandler.UpdateType.Ingame);
     ModStatusHandler.UpdateStatusDisplays(type, defaultParams.name, defaultParams.cooldown.ToString(), defaultParams.user, defaultParams.color, ModStatusHandler.UpdateType.ScoreOverlay);
     ModifierManager.ProcessQueue();
     MelonCoroutines.Start(CooldownTimer(defaultParams.cooldown));
     if (ModifierManager.nukeActive)
     {
         foreach (Modifier mod in ModifierManager.activeModifiers)
         {
             if (mod.defaultParams.active)
             {
                 return;
             }
         }
         ModifierManager.nukeActive = false;
     }
 }
コード例 #2
0
 private static void Postfix(MenuState __instance, ref MenuState.State state)
 {
     if (state == MenuState.State.Launched || state == MenuState.State.SongPage)
     {
         MelonCoroutines.Start(ModifierManager.Reset());
     }
 }
コード例 #3
0
ファイル: Nuke.cs プロジェクト: Contiinuum/TwitchModifiers
 public override void Activate()
 {
     MelonCoroutines.Start(ModifierManager.NukeReset(true));
     base.Activate();
     ModifierManager.nukeActive = true;
     MelonCoroutines.Start(Dropnuke());
 }
コード例 #4
0
 private static void Postfix(EnvironmentLoader __instance)
 {
     if (!Config.generalParams.enableTwitchModifiers)
     {
         return;
     }
     if (MenuState.sState == MenuState.State.SettingsPage)
     {
         MelonCoroutines.Start(ModifierManager.ISetDefaultArenaValues());
     }
 }
コード例 #5
0
 private static void Postfix(SongCues __instance)
 {
     if (KataConfig.I.practiceMode)
     {
         return;
     }
     if (!Config.generalParams.enableTwitchModifiers)
     {
         return;
     }
     MelonCoroutines.Start(ModifierManager.ISetUserArenaValues());
     ModifierManager.SetOriginalOffset(__instance.mCues.cues);
     //AuthorableModifiers.LoadModifierCues();
 }
コード例 #6
0
 protected IEnumerator CooldownTimer(float cooldownTimer)
 {
     while (cooldownTimer > 0)
     {
         ModStatusHandler.UpdateStatusDisplays(type, defaultParams.name, cooldownTimer.ToString(), defaultParams.user, defaultParams.color, ModStatusHandler.UpdateType.ScoreOverlay);
         if (ModifierManager.stopAllModifiers)
         {
             yield break;
         }
         if (!InGameUI.I.pauseScreen.IsPaused())
         {
             cooldownTimer--;
         }
         yield return(new WaitForSecondsRealtime(1f));
     }
     ModStatusHandler.RemoveStatusDisplays(type, ModStatusHandler.UpdateType.ScoreOverlay);
     ModifierManager.RemoveActiveModifier(this);
 }
コード例 #7
0
        public static void CreateModifier(ModifierType type, float amount, string user, string color, bool fromNuke = true)
        {
            Modifier mod = null;

            switch (type)
            {
            case ModifierType.Speed:
                if (Config.speedParams.enabled)
                {
                    if (!Config.generalParams.allowScoreDisablingMods && amount < 1f)
                    {
                        return;
                    }
                    mod = new SpeedChange(type, new ModifierParams.Default("Speed", user, color), Config.speedParams, amount);
                }
                break;

            case ModifierType.AA:
                if (Config.aimParams.enabled)
                {
                    mod = new AimAssistChange(type, new ModifierParams.Default("AA", user, color), Config.aimParams, amount);
                }
                break;

            case ModifierType.Psychedelia:
                if (Config.psychadeliaParams.enabled)
                {
                    mod = new Psychadelia(type, new ModifierParams.Default("Psychedelia", user, color), Config.psychadeliaParams, amount);
                }
                break;

            case ModifierType.Mines:
                if (Config.mineParams.enabled)
                {
                    mod = new Mines(type, new ModifierParams.Default("Mines", user, color), Config.mineParams);
                }
                break;

            case ModifierType.Wobble:
                if (Config.wobbleParams.enabled)
                {
                    mod = new Wobble(type, new ModifierParams.Default("Wobble", user, color), Config.wobbleParams, amount);
                }
                break;

            case ModifierType.InvisGuns:
                if (Config.invisGunsParams.enabled)
                {
                    mod = new InvisibleGuns(type, new ModifierParams.Default("Invis Guns", user, color), Config.invisGunsParams);
                }
                break;

            case ModifierType.Particles:
                if (Config.particlesParams.enabled)
                {
                    mod = new Particles(type, new ModifierParams.Default("Particles", user, color), Config.particlesParams, amount);
                }
                break;

            case ModifierType.ZOffset:
                if (Config.zOffsetParams.enabled)
                {
                    mod = new ZOffset(type, new ModifierParams.Default("zOffset", user, color), Config.zOffsetParams, amount);
                }
                break;

            case ModifierType.BetterMelees:
                if (Config.betterMeleesParams.enabled)
                {
                    mod = new BetterMelees(type, new ModifierParams.Default("Better Melees", user, color), Config.betterMeleesParams);
                }
                break;

            case ModifierType.RandomOffset:
                if (Config.randomOffsetParams.enabled)
                {
                    mod = new RandomOffset(type, new ModifierParams.Default("Random Offset", user, color), Config.randomOffsetParams);
                }
                break;

            case ModifierType.Scale:
                if (Config.scaleParams.enabled)
                {
                    mod = new Scale(type, new ModifierParams.Default("Scale", user, color), Config.scaleParams, amount);
                }
                break;

            case ModifierType.RandomColors:
                if (Config.randomColorParams.enabled)
                {
                    mod = new RandomColors(type, new ModifierParams.Default("Random Colors", user, color), Config.randomColorParams);
                }
                break;

            case ModifierType.ColorSwap:
                if (Config.colorSwapParams.enabled)
                {
                    mod = new ColorSwap(type, new ModifierParams.Default("Color Swap", user, color), Config.colorSwapParams);
                }
                break;

            case ModifierType.StreamMode:
                if (Config.streamModeParams.enabled)
                {
                    if (!Config.generalParams.allowScoreDisablingMods)
                    {
                        return;
                    }
                    mod = new StreamMode(type, new ModifierParams.Default("Stream Mode", user, color), Config.streamModeParams);
                }
                break;

            case ModifierType.HiddenTelegraphs:
                if (Config.hiddenTelegraphsParams.enabled)
                {
                    mod = new HiddenTelegraphs(type, new ModifierParams.Default("Hidden Teles", user, color), Config.hiddenTelegraphsParams);
                }
                break;

            case ModifierType.UnifyColors:
                if (Config.unifyColorsParams.enabled)
                {
                    mod = new UnifyColors(type, new ModifierParams.Default("Unify Colors", user, color), Config.unifyColorsParams);
                }
                break;

            /*case ModifierType.TimingAttack:
             *  if (Config.timingAttackParams.enabled) mod = new TimingAttack(type, new ModifierParams.Default("Timing Attack", user, color), Config.timingAttackParams);
             *  break;
             * case ModifierType.Nuke:
             *  if (Config.nukeParams.enabled) mod = new Nuke(type, new ModifierParams.Default("Nuke", user, color), Config.nukeParams);
             *  break;*/
            case ModifierType.StutterChains:
                if (Config.stutterChainParams.enabled)
                {
                    mod = new StutterChains(type, new ModifierParams.Default("Stutter Chains", user, color), Config.stutterChainParams, amount);
                }
                break;
                //case ModifierType.BopMode:
                //if(Config.bopModeParams.enabled) mod = new BopMode(type, new ModifierParams.Default("Lightshow", user, color), Config.bopModeParams);
                break;

            default:
                return;
            }
            if (mod is null)
            {
                return;
            }
            ModifierManager.AddModifierToQueue(mod, fromNuke);
        }
コード例 #8
0
 private static void Prefix(InGameUI __instance)
 {
     MelonCoroutines.Start(ModifierManager.Reset());
 }
コード例 #9
0
 private static void Postfix(AudioDriver __instance)
 {
     ModStatusHandler.ShowEnabledString();
     MelonCoroutines.Start(ModifierManager.ProcessQueueDelayed());
 }