void CalcCorePlayData()
    {
        CorePlayData.BMPDelta = CorePlayData.CurrentSong.BPM / 60f / 2f;
        m_CurrentTB           = 60f / CorePlayData.CurrentSong.BPM;
        while (m_CurrentTB < 0.5f || m_CurrentTB > 1)
        {
            if (m_CurrentTB < 0.5f)
            {
                m_CurrentTB *= 2f;
            }
            else if (m_CurrentTB > 1)
            {
                m_CurrentTB /= 2f;
            }
        }
        CorePlayData.TB = m_CurrentTB;

        m_RhythmBeatInterval = 60000f / CorePlayData.CurrentSong.BPM;
        Debug.LogWarning("m_RhythmBeatInterval coreplay: " + m_RhythmBeatInterval);

        //计算分数
        int levelNum = StaticData.LevelID - RuntimeConst.LevelBase;

        m_SongMaxScoreInfo = BeatmapParse.GetSongObjectMaxScore(CorePlayData.CurrentSong);
        int currentMaxScore = m_SongMaxScoreInfo.MaxScore;

        m_AllWordNum = m_SongMaxScoreInfo.MaxCombo;
        float destScore = (Mathf.Log10(levelNum) + RuntimeConst.ScoreAddOnParam) * CorePlayData.FirstLevelMaxScore;

        m_ScoreParam = destScore / currentMaxScore;
        PageManager.Instance.CurrentPage.GetNode <CalculateNode>().levelMaxScore = currentMaxScore;
        PageManager.Instance.CurrentPage.GetNode <CalculateNode>().scoreParam    = m_ScoreParam;
        PageManager.Instance.CurrentPage.GetNode <BossWarNode>().scoreParam      = m_ScoreParam;
        //Debug.Log(m_ScoreParam);
    }
示例#2
0
    public static void CalcAllTxtScore()
    {
#if UNITY_EDITOR
        List <string> options = null;

        options = EditorModeFileMisc.GetFileName("*.txt", "Assets/Resources/Songs");

        for (int i = 0; i < options.Count; i++)
        {
            SongObject       so   = Parse(options[i]);
            SongMaxScoreInfo info = GetSongObjectMaxScore(so);
            //LogManager.Log("关卡 :" , options[i] , "的最高得分:" , info.MaxScore ,
            //          ". 其中点击次数:" , info.ClickFrequency , ", 语音语句数量:" , (info.MaxCombo - info.ClickFrequency));
            LogManager.Log("关卡 :", options[i], "的最高得分:", info.MaxScore,
                           ". 其中点击分数占比:", info.ClickScorePercent, ", 语音分数占比:", info.VoiceScorePercent,
                           ".点击时间占比:", info.ClickTimePercent, ", 语音时间占比:", info.VoiceTimePercent);
        }
#endif
    }
示例#3
0
    public static SongMaxScoreInfo GetSongObjectMaxScore(SongObject so)
    {
        SongMaxScoreInfo info = new SongMaxScoreInfo();

        info.MaxScore = 0;
        info.MaxCombo = 0;
        int voiceSorce = 0;
        int clickTime  = 0;
        int voiceTime  = 0;

        info.ClickFrequency = 0;
        //点击和语音
        for (int i = 0; i < so.SentenceObjs.Count; i++)
        {
            if (so.SentenceObjs[i].Type == SentenceType.Common)
            {
                for (int j = 0; j < so.SentenceObjs[i].ClickAndHOList.HitObjects.Count; j++)
                {
                    clickTime     += so.SentenceObjs[i].m_InOutTime.EndTime - so.SentenceObjs[i].m_InOutTime.StartTime;
                    info.MaxScore += (int)(CorePlaySettings.Instance.m_ComboPoint + info.MaxCombo * RuntimeConst.ScoreParam);
                    info.MaxCombo++;
                    info.ClickFrequency++;
                }
            }
            else if (so.SentenceObjs[i].Type == SentenceType.Voice)
            {
                voiceTime     += so.SentenceObjs[i].m_InOutTime.EndTime - so.SentenceObjs[i].m_InOutTime.StartTime;
                voiceSorce    += CorePlaySettings.Instance.m_VoiceRightPoint;
                info.MaxScore += CorePlaySettings.Instance.m_VoiceRightPoint;
                info.MaxCombo++;
            }
        }

        //boss战
        for (int i = 0; i < so.StreamSentences.Count; i++)
        {
            if (so.StreamSentences[i].Type == SentenceType.Common)
            {
                for (int j = 0; j < so.StreamSentences[i].Group[0].Sentence.Count; j++)
                {
                    clickTime     += so.StreamSentences[i].TimeLength;
                    info.MaxScore += (int)(CorePlaySettings.Instance.m_ComboPoint + info.MaxCombo * RuntimeConst.ScoreParam);
                    info.MaxCombo++;
                    info.ClickFrequency++;
                }
            }
            else if (so.StreamSentences[i].Type == SentenceType.Voice)
            {
                voiceTime     += so.StreamSentences[i].TimeLength;
                voiceSorce    += CorePlaySettings.Instance.m_VoiceRightPoint;
                info.MaxScore += CorePlaySettings.Instance.m_VoiceRightPoint;
                info.MaxCombo++;
            }
        }

        //普通关语音回放部分
        for (int i = 0; i < so.NonRhythmSenteces.Count; i++)
        {
            if (so.NonRhythmSenteces[i].Type == SentenceType.NonRhythmCommon)
            {
                for (int j = 0; j < so.NonRhythmSenteces[i].Sentence.Count; j++)
                {
                    clickTime     += (int)(so.NonRhythmSenteces[i].Duration * 1000);
                    info.MaxScore += (int)(CorePlaySettings.Instance.m_ComboPoint + info.MaxCombo * RuntimeConst.ScoreParam);
                    info.MaxCombo++;
                    info.ClickFrequency++;
                }
            }
            else if (so.NonRhythmSenteces[i].Type == SentenceType.NonRhythmVoice)
            {
                voiceTime     += (int)(so.NonRhythmSenteces[i].Duration * 1000);
                voiceSorce    += CorePlaySettings.Instance.m_VoiceRightPoint;
                info.MaxScore += CorePlaySettings.Instance.m_VoiceRightPoint;
                info.MaxCombo++;
            }
        }

        info.VoiceScorePercent = (float)voiceSorce / info.MaxScore;
        info.ClickScorePercent = 1 - info.VoiceScorePercent;

        info.ClickTimePercent = (float)(clickTime) / (clickTime + voiceTime);
        info.VoiceTimePercent = 1 - info.ClickTimePercent;
        return(info);
    }