public JudgeType NormalNoteJudge(int differenceFrame, int judgeLane, JudgeData judgeData)
    {
        JudgeType judgeResult = JudgeType.None;

        JudgeStruct[] judges = judgeData.judges;
        bool          isPush = false;

        // フレームの差が一番長い判定よりも大きくなったらミスにする
        if (differenceFrame < -judges[judges.Length - 1].flameRange)
        {
            particleController.ShowJudgeText(judgeLineTrans[judgeLane], judgeData.judges[(int)JudgeType.Miss].sprite);
            SetNextNote(judgeLane);
            judgeResult = JudgeType.Miss;
        }

        if (StaticValue.isAuto)
        {
            isPush = differenceFrame <= 0 ? true : false;
        }
        else
        {
            isPush = ButtonDownInput(judgeLane);
        }

        if (isPush)
        {
            for (int i = (int)JudgeType.Just; i < judges.Length; i++)
            {
                if (Mathf.Abs(differenceFrame) <= judges[i].flameRange)
                {
                    //輝くノーツの場合は必ず最高判定にする
                    if (nextNotes[judgeLane].IsShiny)
                    {
                        i = (int)JudgeType.Just;
                        particleController.PlayParticle(judgeLineTrans[judgeLane], 4);
                    }

                    particleController.ShowJudgeText(judgeLineTrans[judgeLane], judges[i].sprite);
                    particleController.PlayParticle(judgeLineTrans[judgeLane], i);
                    SetLaneBeamColor(judgeLane, beamColor.beamColors[i]);
                    nextNotes[judgeLane].JudgeHide();

                    PlayTapSE(NotesType.Normal, judgeLane, nextNotes[judgeLane].IsShiny);

                    MightPlayFastLateAnim(differenceFrame, i);

                    SetNextNote(judgeLane);

                    return((JudgeType)Enum.ToObject(typeof(JudgeType), i));
                }
            }

            SetLaneBeamColor(judgeLane, beamColor.noneColor);
        }

        return(judgeResult);
    }
Пример #2
0
    public void ChangeDetail()
    {
        JudgeData judgeData = judgeDatas[(int)judge];

        float justMSec = (judgeData.judges[(int)JudgeType.Just].flameRange + 1) * 8.3f;
        float goodMSec = (judgeData.judges[(int)JudgeType.Good].flameRange + 1) * 8.3f;

        justMSecText.SetText("±{0:1} ms", justMSec);
        goodMSecText.SetText("±{0:1} ms", goodMSec);

        valueNameText.SetText(Enum.GetName(typeof(JudgeStyle), judge));
    }
Пример #3
0
 private static void HandleSetJudgeInfo(PacketHeader header, Connection connection, JudgeData judgeData)
 {
     Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, new ThreadStart(delegate
     {
         ClientWindow.JudgeName     = judgeData.JudgeName;
         ClientWindow.JudgeCategory = judgeData.Category;
     }));
 }
    public void UpdateManage(ref UIDataStruct uiData, RuleStruct gaugeRule, GameObject[] laneObjs, JudgeData timingRange, bool isStarted)
    {
        int currentFlame = timeCountroller.PlayFlame;
        int deltaFlame   = timeCountroller.DeltaFlame;

        for (int i = 0; i < laneObjs.Length; i++)
        {
            NotesType type        = NotesType.Normal;
            JudgeType judgeResult = JudgeType.None;

            if (isStarted)
            {
                type        = NotesType.Normal;
                judgeResult = Judge(
                    type: ref type,
                    currentFlame: currentFlame,
                    judgeLane: i,
                    deltaFlame: deltaFlame,
                    judgeData: timingRange
                    );

                uiData.barrageCount = targetBarrageCount;
            }

            LaneBeamManage(i);

            if (judgeResult == JudgeType.None)
            {
                continue;
            }

            uiData.judgeCount[(int)judgeResult]++;
            uiData.scoreCount += timingRange.judges[(int)judgeResult].scoreCount;

            float typeRate = 1.0f;
            if (type == NotesType.Hold)
            {
                typeRate = gaugeRule.holdParRate;
            }

            if (judgeResult == JudgeType.Miss)
            {
                float missPenalty = gaugeRule.missPenalty;

                if (gaugeRule.dyingRate >= uiData.gaugePer)
                {
                    missPenalty /= 2;
                }

                uiData.conboCount = 0;
                uiData.gaugePer   = Mathf.Clamp01(uiData.gaugePer - missPenalty * typeRate / 100);
            }
            else
            {
                float addPer = gaugeRule.gaugeCount[(int)judgeResult] / (float)uiData.totalGaugeCount * gaugeRule.parRate * typeRate;
                uiData.gaugePer = Mathf.Clamp01(uiData.gaugePer + addPer);

                uiData.conboCount++;
                judgeLineAnim.SetTrigger("Shiny");

                if (uiData.maxConbo < uiData.conboCount)
                {
                    uiData.maxConbo = uiData.conboCount;
                }
            }
        }

        judgeLineMaterial.SetFloat("_Shiny", judgeLineShiny);
    }
    public JudgeType BarrageNoteJudge(int differenceFrame, int endDifferenceFlame, int judgeLane, JudgeData judgeData)
    {
        BarrageNotes judgeNotes   = (BarrageNotes)nextNotes[judgeLane];
        JudgeType    judgeResult  = JudgeType.None;
        int          currentCount = judgeNotes.CurrentCount;

        if (differenceFrame <= 0)
        {
            bool isPush = false;
            if (targetBarrageCount <= 0)
            {
                targetBarrageCount = currentCount;
                judgeNotes.SetLineMaterial(lineMaterials[(int)LineMaterialType.Shiny]);
            }
            if (StaticValue.isAuto)
            {
                if (autoBarrageTime <= 0)
                {
                    isPush           = true;
                    autoBarrageTime += autoBarrageInterval;
                }
                else
                {
                    autoBarrageTime -= Time.deltaTime;
                }
            }
            else
            {
                isPush = ButtonDownInput(judgeLane);
            }
            if (isPush)
            {
                currentCount--;
                judgeNotes.CurrentCount = currentCount;
                particleController.PlayParticle(judgeLineTrans[judgeLane], 0);
                targetBarrageCount = currentCount;

                PlayTapSE(NotesType.Barrage, 0);
            }
        }

        if (currentCount <= 0)
        {
            judgeResult = JudgeType.Just;
            judgeNotes.SetLineMaterial(lineMaterials[(int)LineMaterialType.Dark]);
            SetNextNote(judgeLane);
            particleController.ShowJudgeText(judgeLineTrans[judgeLane], judgeData.judges[(int)JudgeType.Just].sprite);
            particleController.PlayParticle(judgeLineTrans[judgeLane], (int)judgeResult);

            cookpitCameraAnim.SetTrigger("MashShake");
            PlayTapSE(NotesType.Barrage, -1);

            return(judgeResult);
        }
        if (endDifferenceFlame <= 0)
        {
            SetNextNote(judgeLane);
            judgeResult = JudgeType.Miss;
            particleController.ShowJudgeText(judgeLineTrans[judgeLane], judgeData.judges[(int)JudgeType.Miss].sprite);
            targetBarrageCount = -1;

            return(judgeResult);
        }

        return(judgeResult);
    }
    public JudgeType HoldNoteJudge(int differenceFrame, int endDifferenceFlame, int judgeLane, int deltaFlame, JudgeData judgeData)
    {
        HoldNotes judgeNotes  = (HoldNotes)nextNotes[judgeLane];
        JudgeType judgeResult = JudgeType.None;

        JudgeStruct[] judges    = judgeData.judges;
        JudgeStruct   lastJudge = judges[judgeData.judges.Length - 1];
        bool          isPush    = false;

        // 終点が判定ラインを超えたか
        if (endDifferenceFlame <= 0)
        {
            // 始点が押されず、始点の判定がされる前に終点が来た場合はミスにする
            if (!judgeNotes.IsPushedJudge)
            {
                particleController.ShowJudgeText(judgeLineTrans[judgeLane], judgeData.judges[(int)JudgeType.Miss].sprite);
                judgeResult = JudgeType.Miss;
                judgeNotes.IsPushedJudge = true;
            }
            else
            {
                bool isButtonPushed = false;
                if (StaticValue.isAuto)
                {
                    isButtonPushed = endDifferenceFlame >= 0 ? true : false;
                }
                else
                {
                    isButtonPushed = ButtonInput(judgeLane);
                }
                judgeResult = judgeNotes.HoldManage(deltaFlame, isButtonPushed, judgeData.judges);

                if (judgeResult != JudgeType.None)
                {
                    particleController.ShowJudgeText(judgeLineTrans[judgeLane], judgeData.judges[(int)judgeResult].sprite);
                    SetLaneBeamColor(judgeLane, beamColor.beamColors[(int)judgeResult]);

                    if (judgeResult != JudgeType.Miss)
                    {
                        particleController.PlayParticle(judgeLineTrans[judgeLane], (int)judgeResult);
                    }
                }
            }

            SetNextNote(judgeLane);
            return(judgeResult);
        }

        if (differenceFrame <= 0)
        {
            if (1 < (differenceFrame + deltaFlame))
            {
                deltaFlame = Mathf.Abs(differenceFrame);
            }

            bool isButtonPushed = false;
            if (StaticValue.isAuto)
            {
                isButtonPushed = endDifferenceFlame >= 0 ? true : false;
            }
            else
            {
                isButtonPushed = ButtonInput(judgeLane);
            }

            if (isButtonPushed && judgeNotes.IsPushed)
            {
                judgeNotes.SetLineMaterial(lineMaterials[(int)LineMaterialType.Shiny]);
            }
            else if (differenceFrame < -lastJudge.flameRange)
            {
                judgeNotes.SetLineMaterial(lineMaterials[(int)LineMaterialType.Dark]);
            }

            judgeResult = judgeNotes.HoldManage(deltaFlame, isButtonPushed, judgeData.judges);

            if (judgeResult != JudgeType.None)
            {
                particleController.ShowJudgeText(judgeLineTrans[judgeLane], judgeData.judges[(int)judgeResult].sprite);
                SetLaneBeamColor(judgeLane, beamColor.beamColors[(int)judgeResult]);

                if (judgeResult != JudgeType.Miss)
                {
                    particleController.PlayParticle(judgeLineTrans[judgeLane], (int)judgeResult);
                }
            }
        }

        if (StaticValue.isAuto)
        {
            isPush = differenceFrame <= 0 ? true : false;
        }
        else
        {
            isPush = ButtonDownInput(judgeLane);
        }

        // 始点の判定の最大範囲が過ぎた場合は始点の判定をミスにする
        if (!judgeNotes.IsPushedJudge && differenceFrame < -lastJudge.flameRange)
        {
            particleController.ShowJudgeText(judgeLineTrans[judgeLane], judgeData.judges[(int)JudgeType.Miss].sprite);
            judgeResult = JudgeType.Miss;
            judgeNotes.IsPushedJudge = true;
        }

        // ボタンを離してから押さないと反応しないように
        if (isPush && !judgeNotes.IsPushed)
        {
            if (differenceFrame < lastJudge.flameRange)
            {
                judgeNotes.IsPushed = true;
                // 始点の判定をする
                if (!judgeNotes.IsPushedJudge)
                {
                    for (int i = (int)JudgeType.Just; i < judges.Length; i++)
                    {
                        if (Mathf.Abs(differenceFrame) <= judges[i].flameRange)
                        {
                            //輝くノーツの場合は必ず最高判定にする
                            if (judgeNotes.IsShiny)
                            {
                                i = (int)JudgeType.Just;
                                particleController.PlayParticle(judgeLineTrans[judgeLane], 4);
                            }

                            particleController.ShowJudgeText(judgeLineTrans[judgeLane], judges[i].sprite);
                            particleController.PlayParticle(judgeLineTrans[judgeLane], i);

                            SetLaneBeamColor(judgeLane, beamColor.beamColors[i]);

                            MightPlayFastLateAnim(differenceFrame, i);

                            judgeNotes.IsPushedJudge = true;
                            PlayTapSE(NotesType.Hold, judgeLane, judgeNotes.IsShiny);

                            judgeResult = (JudgeType)Enum.ToObject(typeof(JudgeType), i);

                            break;
                        }
                    }
                }
            }
            else
            {
                SetLaneBeamColor(judgeLane, beamColor.noneColor);
            }
        }

        return(judgeResult);
    }
    /// <summary>
    /// ノーツの判定処理
    /// </summary>
    /// <param name="currentFlame"></param>
    /// <param name="judgeLane"></param>
    /// <param name="judgeData"></param>
    public JudgeType Judge(ref NotesType type, int currentFlame, int judgeLane, int deltaFlame, JudgeData judgeData)
    {
        JudgeType judgeResult = JudgeType.None;

        if (nextNotes[judgeLane] == null)
        {
            if (ButtonDownInput(judgeLane))
            {
                SetLaneBeamColor(judgeLane, beamColor.noneColor);
            }
            return(judgeResult);
        }

        int differenceFlame    = nextNotes[judgeLane].TimingFlame - currentFlame;
        int endDifferenceFlame = 0;

        type = nextNotes[judgeLane].Type;

        switch (type)
        {
        case NotesType.Normal:

            judgeResult = NormalNoteJudge(differenceFlame, judgeLane, judgeData);
            break;

        case NotesType.Hold:

            HoldNotes holdNotes = (HoldNotes)nextNotes[judgeLane];
            endDifferenceFlame = holdNotes.EndTimingFlame - currentFlame;
            judgeResult        = HoldNoteJudge(differenceFlame, endDifferenceFlame, judgeLane, deltaFlame, judgeData);
            break;

        case NotesType.Barrage:

            BarrageNotes barrageNotes = (BarrageNotes)nextNotes[judgeLane];
            endDifferenceFlame = barrageNotes.EndTimingFlame - currentFlame;
            judgeResult        = BarrageNoteJudge(differenceFlame, endDifferenceFlame, judgeLane, judgeData);
            break;
        }

        return(judgeResult);
    }