private static void ConditionedSpawnFlyingSprite(FlyingSpriteSpawner flyingSpriteSpawner, Vector3 pos, Quaternion rotation, Quaternion inverseRotation, INoteController noteController)
 {
     if (FakeNoteHelper.GetFakeNote(noteController))
     {
         flyingSpriteSpawner.SpawnFlyingSprite(pos, rotation, inverseRotation);
     }
 }
        public static bool Prefix(FlyingSpriteSpawner __instance, Vector3 pos, ref FlyingSpriteEffect.Pool ____flyingSpriteEffectPool, ref float ____xSpread, ref float ____targetYPos, ref float ____targetZPos, ref float ____duration, ref Sprite ____sprite, ref Material ____material, ref Color ____color, ref bool ____shake)
        {
            if (!Plugin.active)
            {
                return(true);
            }

            FlyingSpriteEffect flyingSpriteEffect = ____flyingSpriteEffectPool.Spawn();

            flyingSpriteEffect.didFinishEvent += __instance.HandleFlyingSpriteEffectDidFinish;
            Vector3 targetPos = Vector3.zero;

            if (lastNoteRotationSet)
            {
                Quaternion quaternion = lastNoteRotation;
                lastNoteRotationSet = false;
                Vector3 vector = quaternion * pos;
                flyingSpriteEffect.transform.SetPositionAndRotation(vector, quaternion);
                targetPos = quaternion * new Vector3(pos.x, ____targetYPos, ____targetZPos);
            }
            else
            {
                flyingSpriteEffect.transform.SetPositionAndRotation(pos, Quaternion.identity);
                targetPos = new Vector3(pos.x, ____targetYPos, ____targetZPos);
            }

            flyingSpriteEffect.InitAndPresent(____duration, targetPos, ____sprite, ____material, ____color, ____shake);

            return(false);
        }
        public static bool Prefix(Vector3 pos, NoteController noteController, NoteCutInfo noteCutInfo, ref ColorManager ____colorManager, ref NoteCutParticlesEffect ____noteCutParticlesEffect, ref bool ____spawnScores, ref ScoreController ____scoreController, ref FlyingScoreSpawner ____flyingScoreSpawner, ref ShockwaveEffect ____shockwaveEffect, ref FlyingSpriteSpawner ____failFlyingSpriteSpawner, ref NoteDebrisSpawner ____noteDebrisSpawner)
        {
            if (!Plugin.active)
            {
                return(true);
            }

            if (noteCutInfo.allIsOK)
            {
                NoteData noteData = noteController.noteData;
                Color    color    = ____colorManager.ColorForNoteType(noteData.noteType).ColorWithAlpha(0.5f);
                ____noteCutParticlesEffect.SpawnParticles(pos, noteCutInfo.cutNormal, noteCutInfo.saberDir, color, 150, 50, Mathf.Clamp(noteData.timeToNextBasicNote, 0.4f, 1f), noteCutInfo.saberType);

                if (____spawnScores)
                {
                    int multiplierWithFever = ____scoreController.multiplierWithFever;
                    FlyingScoreSpawnerPatch.lastNoteRotation    = noteController.transform.rotation;
                    FlyingScoreSpawnerPatch.lastNoteRotationSet = true;
                    Vector3 pos2 = Quaternion.Inverse(FlyingSpriteSpawnerPatch.lastNoteRotation) * pos;
                    ____flyingScoreSpawner.SpawnFlyingScore(noteCutInfo, noteData.lineIndex, multiplierWithFever, pos2, new Color(0.8f, 0.8f, 0.8f));
                }
                Vector3 pos3 = pos;
                pos3.y = 0.01f;
                ____shockwaveEffect.SpawnShockwave(pos3);
            }
            else
            {
                FlyingSpriteSpawnerPatch.lastNoteRotation    = noteController.transform.rotation;
                FlyingSpriteSpawnerPatch.lastNoteRotationSet = true;
                Vector3 pos4 = Quaternion.Inverse(FlyingSpriteSpawnerPatch.lastNoteRotation) * pos;
                ____failFlyingSpriteSpawner.SpawnFlyingSprite(pos4);
            }
            ____noteDebrisSpawner.SpawnDebris(noteCutInfo, noteController);

            return(false);
        }
        public static bool Prefix(MissedNoteEffectSpawner __instance, BeatmapObjectSpawnController noteSpawnController, NoteController noteController, ref FlyingSpriteSpawner ____missedNoteFlyingSpriteSpawner, ref float ____spawnPosZ)
        {
            if (!Plugin.active)
            {
                return(true);
            }

            NoteData noteData = noteController.noteData;

            if (noteData.noteType == NoteType.NoteA || noteData.noteType == NoteType.NoteB)
            {
                FlyingSpriteSpawnerPatch.lastNoteRotation    = noteController.transform.rotation;
                FlyingSpriteSpawnerPatch.lastNoteRotationSet = true;
                Vector3 pos = Quaternion.Inverse(FlyingSpriteSpawnerPatch.lastNoteRotation) * noteController.noteTransform.position;
                pos.z = ____spawnPosZ;
                ____missedNoteFlyingSpriteSpawner.SpawnFlyingSprite(pos);
            }
            return(false);
        }
        public static bool Prefix(MissedNoteEffectSpawner __instance, Vector3 pos, NoteController noteController, NoteCutInfo noteCutInfo, ref BombExplosionEffect ____bombExplosionEffect, ref FlyingSpriteSpawner ____failFlyingSpriteSpawner, ref ShockwaveEffect ____shockwaveEffect)
        {
            if (!Plugin.active)
            {
                return(true);
            }

            FlyingSpriteSpawnerPatch.lastNoteRotation    = noteController.transform.rotation;
            FlyingSpriteSpawnerPatch.lastNoteRotationSet = true;
            Vector3 pos2 = Quaternion.Inverse(FlyingSpriteSpawnerPatch.lastNoteRotation) * pos;

            ____failFlyingSpriteSpawner.SpawnFlyingSprite(pos2);
            ____bombExplosionEffect.SpawnExplosion(pos);
            Vector3 pos3 = pos;

            pos3.y = 0.01f;
            ____shockwaveEffect.SpawnShockwave(pos3);

            return(false);
        }