Esempio n. 1
0
        public virtual void UpdateJudgeResult(int line, JudgeType result, bool flick, bool silent, bool countJudge = true)
        {
            if (countJudge)
            {
                if (!judgeResult.ContainsKey(result))
                {
                    judgeResult.Add(result, 1);
                }
                else
                {
                    judgeResult[result]++;
                }
            }

            if (!silent)
            {
                if (result.IsEither(JudgeType.Great, JudgeType.Perfect, JudgeType.Fantastic))
                {
                    comboCount++;
                    maxCombo = Mathf.Max(maxCombo, comboCount);
                    Game.PlayHitEffect(line);
                    if (TSystemConfig.Now.allowSoundEffect)
                    {
                        soundPlayer.PlayHitSound(true, flick);
                    }
                }
                else
                {
                    comboCount = 0;
                    if (result != JudgeType.Miss)
                    {
                        Game.PlayHitEffect(line);
                    }
                    if (TSystemConfig.Now.allowSoundEffect)
                    {
                        soundPlayer.PlayHitSound(false, flick);
                    }
                }
                judgeText.Show(result);
                comboText.Show(comboCount);
                customJudgeAction?.Invoke(result, flick);
            }
        }
Esempio n. 2
0
        protected virtual void Process()
        {
            switch (Type)
            {
            case NoteType.Damage:
                // If this note passed the judging line
                // (Executing this means that this note has not been hit),
                if (Progress >= 1)
                {
                    Judge();
                }
                break;

            case NoteType.SlideStart:
                // If next note of slide group is SlideEnd and it passed the judging line
                // while this note not being hit,
                if (!isHit && nextNote.Type == NoteType.SlideEnd && nextNote.Progress >= 1)
                {
                    Judge(JudgeType.Miss);      // This slide group is dead.
                }
                break;

            case NoteType.SlideMiddle:
                // When this note passed the judging line...
                if (Progress >= 1)
                {
                    if (Game.Mode.enableStrictSlideJudge && TimeDistance > Game.Mode.judgeHFSThreshold[1] &&
                        !latestSlideJudge.IsEither(JudgeType.Fantastic, JudgeType.Perfect))
                    {
                        Judge(JudgeType.Miss);
                    }

                    // Detach this note from slide group and
                    // connect previous note and next note for once.
                    if (!isHit && !slideTransfered)
                    {
                        TransferToBefore();
                    }

                    // Checks the latest slide judge every frame.
                    // If it has any judging result, judges it.
                    if (latestSlideJudge != JudgeType.NotJudged)
                    {
                        Judge(latestSlideJudge);
                    }
                }
                break;

            case NoteType.SlideEnd:
                // If the mode does not require release at this note and it passed the judging line...
                if (!Game.Mode.requireReleaseAtSlideEnd && !isHit && Progress >= 1)
                {
                    if (Game.Mode.enableStrictSlideJudge && TimeDistance > Game.Mode.judgeHFSThreshold[1] &&
                        !latestSlideJudge.IsEither(JudgeType.Fantastic, JudgeType.Perfect))
                    {
                        Judge(JudgeType.Miss);
                    }
                    else if (latestSlideJudge != JudgeType.NotJudged)
                    {
                        Judge(latestSlideJudge);
                    }
                }
                break;

            case NoteType.Hidden:
                if (TimeDistance >= Game.Mode.judgeThreshold[1])
                {
                    Game.noteInput.RemoveNote(EndLine, ID);
                    Delete();
                }
                break;

            case NoteType.Starter:
                if (Progress >= 1)
                {
                    Game.StartPlayMusic();
                    Delete();
                }
                break;

            case NoteType.Ender:
                if (Progress >= 1)
                {
                    Game.EndGame();
                    Delete();
                }
                break;

            case NoteType.Scroller:
                if (Progress >= 1)
                {
                    Game.TimeSpeed = Speed;
                    Delete();
                }
                break;

            case NoteType.SpecialEnterer:
                if (Progress > 1)
                {
                    Game.TriggerSpecialEnter();
                    Delete();
                }
                break;

            case NoteType.SpecialLeaver:
                if (Progress > 1)
                {
                    Game.TriggerSpecialLeave();
                    Delete();
                }
                break;

            case NoteType.LineChanger:
                if (Progress >= 1)
                {
                    Game.StartCoroutine(Game.ChangeLine(Size));
                    Delete();
                }
                break;

            case NoteType.SlideDummy:
                if (Game.notes[data.prevIds[0]].isHit || TimeDistance >= Game.Mode.judgeThreshold[5])
                {
                    Delete();
                }
                break;
            }

            if (!isHit && TimeDistance >= Game.Mode.judgeThreshold[5])   // So, when the note is not hit and reached the end...
            {
                Judge(JudgeType.Miss);
                //if (Type == NoteType.HoldEnd)
                //    foreach (var note in previousNotes)
                //        if (note.Type == NoteType.HoldStart)
                //            note.Delete();
                //if(Type == NoteType.SlideStart)
                //{
                //    Game.judge.noteQueue[EndLine].Remove(ID);
                //    Game.judge.UpdateJudgeResult(Mathf.RoundToInt(EndLine), JudgeType.Miss, false, false);
                //    Game.AddScore(data, JudgeType.Miss);
                //    isDead = true;
                //    Delete();
                //}
            }
        }