private static bool Prefix(ParticleSystemEventEffect __instance, BeatmapEventData beatmapEventData, BeatmapEventType ____colorEvent)
        {
            if (TechnicolorConfig.Instance.TechnicolorEnabled && beatmapEventData.type == ____colorEvent &&
                beatmapEventData.value > 0 && beatmapEventData.value <= 7)
            {
                if (TechnicolorConfig.Instance.TechnicolorLightsGrouping == TechnicolorLightsGrouping.ISOLATED &&
                    TechnicolorController.TechniLightRandom.NextDouble() < TechnicolorConfig.Instance !.TechnicolorLightsFrequency)
                {
                    ParticleSystem.MainModule mainmodule     = _mainModuleAccessor(ref __instance);
                    ParticleSystem.Particle[] particles      = _particlesAccessor(ref __instance);
                    ParticleSystem            particleSystem = _particleSystemAccessor(ref __instance);
                    mainmodule.startColor = TechnicolorController.GetTechnicolor(beatmapEventData.value > 3, beatmapEventData.time, TechnicolorConfig.Instance.TechnicolorLightsStyle);
                    particleSystem.GetParticles(particles, particles.Length);
                    for (int i = 0; i < particleSystem.particleCount; i++)
                    {
                        particles[i].startColor = TechnicolorController.GetTechnicolor(beatmapEventData.value > 3, beatmapEventData.time + particles[i].randomSeed, TechnicolorConfig.Instance.TechnicolorLightsStyle);
                    }

                    particleSystem.SetParticles(particles, particleSystem.particleCount);

                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 2
0
 private void Colorize(BombNoteController __instance, NoteData noteData)
 {
     _manager.GlobalColorize(TechnicolorController.GetTechnicolor(
                                 true,
                                 noteData.time + __instance.GetInstanceID(),
                                 TechnicolorConfig.Instance.TechnicolorBombsStyle));
 }
Exemplo n.º 3
0
        private static void Postfix(NoteController noteController)
        {
            NoteData noteData = noteController.noteData;
            Color    color    = TechnicolorController.GetTechnicolor(noteData.colorType == ColorType.ColorA, noteData.time + noteController.GetInstanceID(), TechnicolorConfig.Instance.TechnicolorBlocksStyle);

            noteController.ColorizeNote(color);
        }
Exemplo n.º 4
0
 private void Colorize(ObstacleController __instance, ObstacleData obstacleData)
 {
     _manager.Colorize(__instance, TechnicolorController.GetTechnicolor(
                           true,
                           obstacleData.time + __instance.GetInstanceID(),
                           TechnicolorConfig.Instance.TechnicolorWallsStyle));
 }
Exemplo n.º 5
0
        private bool Colorize(ParticleSystemEventEffect __instance, BasicBeatmapEventData basicBeatmapEventData)
        {
            if (!TechnicolorConfig.Instance.TechnicolorEnabled)
            {
                return(true);
            }

            if (TechnicolorConfig.Instance.TechnicolorLightsGrouping != TechnicolorLightsGrouping.ISOLATED ||
                !(TechnicolorController.TechniLightRandom.NextDouble() <
                  TechnicolorConfig.Instance.TechnicolorLightsFrequency))
            {
                return(true);
            }

            ParticleSystem.MainModule mainmodule     = _mainModuleAccessor(ref __instance);
            ParticleSystem.Particle[] particles      = _particlesAccessor(ref __instance);
            ParticleSystem            particleSystem = _particleSystemAccessor(ref __instance);

            mainmodule.startColor = TechnicolorController.GetTechnicolor(
                basicBeatmapEventData.value > 3,
                basicBeatmapEventData.time,
                TechnicolorConfig.Instance.TechnicolorLightsStyle);
            particleSystem.GetParticles(particles, particles.Length);
            for (int i = 0; i < particleSystem.particleCount; i++)
            {
                particles[i].startColor = TechnicolorController.GetTechnicolor(
                    basicBeatmapEventData.value > 3,
                    basicBeatmapEventData.time + particles[i].randomSeed,
                    TechnicolorConfig.Instance.TechnicolorLightsStyle);
            }

            particleSystem.SetParticles(particles, particleSystem.particleCount);

            return(false);
        }
Exemplo n.º 6
0
#pragma warning disable SA1313 // Parameter names should begin with lower-case letter
        private static void Prefix(NoteController noteController)
#pragma warning restore SA1313 // Parameter names should begin with lower-case letter
        {
            NoteData noteData = noteController.noteData;
            Color    color    = TechnicolorController.GetTechnicolor(noteData.colorType == ColorType.ColorA, noteData.time + noteController.GetInstanceID(), TechnicolorConfig.Instance.TechnicolorBlocksStyle);

            noteController.SetNoteColors(color, color);
        }
Exemplo n.º 7
0
        private void Colorize(NoteController noteController)
        {
            NoteData noteData = noteController.noteData;
            Color    color    = TechnicolorController.GetTechnicolor(
                noteData.colorType == ColorType.ColorA,
                noteData.time + noteController.GetInstanceID(),
                TechnicolorConfig.Instance.TechnicolorBlocksStyle);

            _manager.Colorize(noteController, color);
        }
Exemplo n.º 8
0
        private bool Colorize(ChromaLightSwitchEventEffect __instance, BasicBeatmapEventData beatmapEventData)
        {
            if (!TechnicolorConfig.Instance.TechnicolorEnabled)
            {
                return(true);
            }

            LightColorizer lightColorizer = __instance.Colorizer;
            bool           warm           = !ChromaLightSwitchEventEffect.IsColor0(beatmapEventData.value);

            if (TechnicolorConfig.Instance.TechnicolorLightsGrouping == TechnicolorLightsGrouping.ISOLATED)
            {
                foreach (ILightWithId light in lightColorizer.Lights)
                {
                    Color color = TechnicolorController.GetTechnicolor(warm, beatmapEventData.time + light.GetHashCode(), TechnicolorConfig.Instance.TechnicolorLightsStyle);
                    lightColorizer.Colorize(false, color, color, color, color);
                    __instance.Refresh(true, new[] { light }, beatmapEventData);
                }

                return(false);
            }

            if (!(TechnicolorController.TechniLightRandom.NextDouble() <
                  TechnicolorConfig.Instance.TechnicolorLightsFrequency))
            {
                return(true);
            }

            {
                Color color = TechnicolorController.GetTechnicolor(warm, beatmapEventData.time, TechnicolorConfig.Instance.TechnicolorLightsStyle);
                switch (TechnicolorConfig.Instance.TechnicolorLightsGrouping)
                {
                case TechnicolorLightsGrouping.ISOLATED_GROUP:
                    lightColorizer.Colorize(false, color, color, color, color);
                    break;

                default:
                    _manager.GlobalColorize(false, color, color, color, color);
                    break;
                }
            }

            return(true);
        }
#pragma warning disable SA1313 // Parameter names should begin with lower-case letter
        private static bool Prefix(LightSwitchEventEffect __instance, BeatmapEventData beatmapEventData, BeatmapEventType ____event, LightWithIdManager ____lightManager)
#pragma warning restore SA1313 // Parameter names should begin with lower-case letter
        {
            if (TechnicolorConfig.Instance.TechnicolorEnabled && beatmapEventData.type == ____event &&
                beatmapEventData.value > 0 && beatmapEventData.value <= 7)
            {
                if (TechnicolorConfig.Instance.TechnicolorLightsGrouping == TechnicolorLightsGrouping.ISOLATED)
                {
                    ____lightManager.SetColorForId(__instance.lightsId, TechnicolorController.GetTechnicolor(beatmapEventData.value > 3, beatmapEventData.time, TechnicolorConfig.Instance.TechnicolorLightsStyle));

                    List <LightWithId>[] lightManagerLights = _lightsWithIdAccessor(ref ____lightManager);
                    List <LightWithId>   lights             = lightManagerLights[__instance.lightsId];
                    for (int i = 0; i < lights.Count; i++)
                    {
                        lights[i].ColorWasSet(TechnicolorController.GetTechnicolor(beatmapEventData.value > 3, beatmapEventData.time + lights[i].GetInstanceID(), TechnicolorConfig.Instance.TechnicolorLightsStyle));
                    }

                    return(false);
                }
                else if (TechnicolorController.TechniLightRandom.NextDouble() < TechnicolorConfig.Instance.TechnicolorLightsFrequency)
                {
                    bool blue = beatmapEventData.value <= 3;
                    switch (TechnicolorConfig.Instance.TechnicolorLightsGrouping)
                    {
                    case TechnicolorLightsGrouping.ISOLATED_GROUP:
                        // ternary operator gore
                        ____event.SetLightingColors(
                            blue ? (Color?)TechnicolorController.GetTechnicolor(false, beatmapEventData.time, TechnicolorConfig.Instance.TechnicolorLightsStyle) : null,
                            blue ? null : (Color?)TechnicolorController.GetTechnicolor(true, beatmapEventData.time, TechnicolorConfig.Instance.TechnicolorLightsStyle));
                        break;

                    case TechnicolorLightsGrouping.STANDARD:
                    default:
                        Color?t = TechnicolorController.GetTechnicolor(!blue, beatmapEventData.time, TechnicolorConfig.Instance.TechnicolorLightsStyle);
                        LightColorizer.SetAllLightingColors(blue ? null : t, blue ? t : null);
                        break;
                    }
                }
            }

            return(true);
        }
Exemplo n.º 10
0
        private static bool Prefix(ChromaLightSwitchEventEffect __instance, BeatmapEventData beatmapEventData, BeatmapEventType ____event)
        {
            if (TechnicolorConfig.Instance.TechnicolorEnabled && beatmapEventData.type == ____event &&
                beatmapEventData.value > 0 && beatmapEventData.value <= 7)
            {
                bool warm = !__instance.IsColor0(beatmapEventData.value);
                if (TechnicolorConfig.Instance.TechnicolorLightsGrouping == TechnicolorLightsGrouping.ISOLATED)
                {
                    LightColorizer lightColorizer = __instance.LightColorizer;
                    foreach (ILightWithId light in lightColorizer.Lights)
                    {
                        Color color = TechnicolorController.GetTechnicolor(warm, beatmapEventData.time + light.GetHashCode(), TechnicolorConfig.Instance.TechnicolorLightsStyle);
                        lightColorizer.Colorize(false, color, color, color, color);
                        __instance.Refresh(true, new ILightWithId[] { light }, beatmapEventData);
                    }

                    return(false);
                }
                else if (TechnicolorController.TechniLightRandom.NextDouble() < TechnicolorConfig.Instance.TechnicolorLightsFrequency)
                {
                    Color color = TechnicolorController.GetTechnicolor(warm, beatmapEventData.time, TechnicolorConfig.Instance.TechnicolorLightsStyle);
                    switch (TechnicolorConfig.Instance.TechnicolorLightsGrouping)
                    {
                    case TechnicolorLightsGrouping.ISOLATED_GROUP:
                        ____event.ColorizeLight(false, color, color, color, color);
                        break;

                    case TechnicolorLightsGrouping.STANDARD:
                    default:
                        LightColorizer.GlobalColorize(false, color, color, color, color);
                        break;
                    }
                }
            }

            return(true);
        }
Exemplo n.º 11
0
 private static void Postfix(BombNoteController __instance, NoteData noteData)
 {
     __instance.ColorizeBomb(TechnicolorController.GetTechnicolor(true, noteData.time + __instance.GetInstanceID(), TechnicolorConfig.Instance.TechnicolorBombsStyle));
 }
Exemplo n.º 12
0
#pragma warning disable SA1313 // Parameter names should begin with lower-case letter
        private static void Prefix(BombNoteController __instance, NoteData noteData)
#pragma warning restore SA1313 // Parameter names should begin with lower-case letter
        {
            __instance.SetBombColor(TechnicolorController.GetTechnicolor(true, noteData.time + __instance.GetInstanceID(), TechnicolorConfig.Instance.TechnicolorBombsStyle));
        }
Exemplo n.º 13
0
#pragma warning disable SA1313 // Parameter names should begin with lower-case letter
        private static void Prefix(ObstacleController __instance, ObstacleData obstacleData)
#pragma warning restore SA1313 // Parameter names should begin with lower-case letter
        {
            __instance.SetObstacleColor(TechnicolorController.GetTechnicolor(true, obstacleData.time + __instance.GetInstanceID(), TechnicolorConfig.Instance.TechnicolorWallsStyle));
        }
Exemplo n.º 14
0
 private static void Postfix(ObstacleController __instance, ObstacleData obstacleData)
 {
     __instance.ColorizeObstacle(TechnicolorController.GetTechnicolor(true, obstacleData.time + __instance.GetInstanceID(), TechnicolorConfig.Instance.TechnicolorWallsStyle));
 }