예제 #1
0
        // メソッド

        public void tStorePerfResults(out CScoreIni.CPerformanceEntry Drums, out CScoreIni.CPerformanceEntry Guitar, out CScoreIni.CPerformanceEntry Bass, out bool bIsTrainingMode)
        {
            Drums = new CScoreIni.CPerformanceEntry();

            base.tStorePerfResults_Guitar(out Guitar);
            base.tStorePerfResultsBass(out Bass);

            bIsTrainingMode = base.bIsTrainingMode;

            //			if ( CDTXMania.ConfigIni.bIsSwappedGuitarBass )		// #24063 2011.1.24 yyagi Gt/Bsを入れ替えていたなら、演奏結果も入れ替える
            //			{
            //				CScoreIni.CPerformanceEntry t;
            //				t = Guitar;
            //				Guitar = Bass;
            //				Bass = t;
            //
            //				CDTXMania.DTX.SwapGuitarBassInfos();			// 譜面情報も元に戻す
            //			}
        }
예제 #2
0
        // CStage 実装

        public override void OnActivate()
        {
            Trace.TraceInformation("結果ステージを活性化します。");
            Trace.Indent();
            try
            {
                #region [ Initialize ]
                //---------------------
                this.eReturnValueWhenFadeOutCompleted = EReturnValue.Continue;
                this.bAnimationComplete = false;
                this.bIsCheckedWhetherResultScreenShouldSaveOrNot = false;                                              // #24609 2011.3.14 yyagi
                this.n最後に再生したHHのWAV番号   = -1;
                this.n最後に再生したHHのチャンネル番号 = 0;
                for (int i = 0; i < 3; i++)
                {
                    this.bNewRecordSkill[i] = false;
                    this.bNewRecordScore[i] = false;
                    this.bNewRecordRank[i]  = false;
                }
                //---------------------
                #endregion

                if (CDTXMania.ConfigIni.bScoreIniを出力する && !bIsTrainingMode && (CDTXMania.ConfigIni.bSaveScoreIfModifiedPlaySpeed || CDTXMania.ConfigIni.nPlaySpeed == 20))
                {
                    #region [ Calculate results ]
                    //---------------------
                    for (int i = 0; i < 3; i++)
                    {
                        this.nRankValue[i] = -1;
                        this.fPerfect率[i]  = this.fGreat率[i] = this.fGood率[i] = this.fPoor率[i] = this.fMiss率[i] = 0.0f;                         // #28500 2011.5.24 yyagi
                        if ((((i != 0) || (CDTXMania.DTX.bチップがある.Drums && !CDTXMania.ConfigIni.bGuitarRevolutionMode)) &&
                             ((i != 1) || (CDTXMania.DTX.bチップがある.Guitar && CDTXMania.ConfigIni.bGuitarRevolutionMode))) &&
                            ((i != 2) || (CDTXMania.DTX.bチップがある.Bass && CDTXMania.ConfigIni.bGuitarRevolutionMode)))
                        {
                            CScoreIni.CPerformanceEntry part = this.stPerformanceEntry[i];
                            bool bIsAutoPlay = true;
                            switch (i)
                            {
                            case 0:
                                bIsAutoPlay = CDTXMania.ConfigIni.bAllDrumsAreAutoPlay;
                                break;

                            case 1:
                                bIsAutoPlay = CDTXMania.ConfigIni.bAllGuitarsAreAutoPlay;
                                break;

                            case 2:
                                bIsAutoPlay = CDTXMania.ConfigIni.bAllBassAreAutoPlay;
                                break;
                            }

                            this.fPerfect率[i] = bIsAutoPlay ? 0f : ((100f * part.nPerfectCount) / ((float)part.nTotalChipsCount));
                            this.fGreat率[i]   = bIsAutoPlay ? 0f : ((100f * part.nGreatCount) / ((float)part.nTotalChipsCount));
                            this.fGood率[i]    = bIsAutoPlay ? 0f : ((100f * part.nGoodCount) / ((float)part.nTotalChipsCount));
                            this.fPoor率[i]    = bIsAutoPlay ? 0f : ((100f * part.nPoorCount) / ((float)part.nTotalChipsCount));
                            this.fMiss率[i]    = bIsAutoPlay ? 0f : ((100f * part.nMissCount) / ((float)part.nTotalChipsCount));
                            this.bAuto[i]     = bIsAutoPlay;                         // #23596 10.11.16 add ikanick そのパートがオートなら1
                            //        10.11.17 change (int to bool) ikanick
                            //18072020: Change first condition check to 1, XG mode is 1, not 0. Fisyher
                            if (CDTXMania.ConfigIni.nSkillMode == 1)
                            {
                                this.nRankValue[i] = CScoreIni.tCalculateRank(part);
                            }
                            else if (CDTXMania.ConfigIni.nSkillMode == 0)
                            {
                                this.nRankValue[i] = CScoreIni.tCalculateRankOld(part);
                            }

                            //Save progress bar records
                            CScore cScore = CDTXMania.stageSongSelection.rChosenScore;
                            this.strBestProgressBarRecord[i] = cScore.SongInformation.progress[i];
                            //May not need to save this...
                            this.strCurrProgressBarRecord[i] = this.stPerformanceEntry[i].strProgress;
                        }
                    }
                    this.n総合ランク値 = CScoreIni.tCalculateOverallRankValue(this.stPerformanceEntry.Drums, this.stPerformanceEntry.Guitar, this.stPerformanceEntry.Bass);
                    //---------------------
                    #endregion

                    #region [ Write .score.ini ]
                    //---------------------
                    string    str = CDTXMania.DTX.strファイル名の絶対パス + ".score.ini";
                    CScoreIni ini = new CScoreIni(str);

                    bool[] b今までにフルコンボしたことがある = new bool[] { false, false, false };
                    if (!CDTXMania.ConfigIni.bAllDrumsAreAutoPlay || !CDTXMania.ConfigIni.bAllGuitarsAreAutoPlay || !CDTXMania.ConfigIni.bAllBassAreAutoPlay)
                    {
                        for (int i = 0; i < 3; i++)
                        {
                            // フルコンボチェックならびに新記録ランクチェックは、ini.Record[] が、スコアチェックや演奏型スキルチェックの IF 内で書き直されてしまうよりも前に行う。(2010.9.10)

                            b今までにフルコンボしたことがある[i] = ini.stSection[i * 2].bIsFullCombo | ini.stSection[i * 2 + 1].bIsFullCombo;

                            #region [deleted by #24459]
                            //		if( this.nRankValue[ i ] <= CScoreIni.tCalculateRank( ini.stSection[ ( i * 2 ) + 1 ] ) )
                            //		{
                            //			this.bNewRecordRank[ i ] = true;
                            //		}
                            #endregion
                            // #24459 上記の条件だと[HiSkill.***]でのランクしかチェックしていないので、BestRankと比較するよう変更。
                            if (this.nRankValue[i] >= 0 && ini.stFile.BestRank[i] > this.nRankValue[i])                                 // #24459 2011.3.1 yyagi update BestRank
                            {
                                this.bNewRecordRank[i] = true;
                                ini.stFile.BestRank[i] = this.nRankValue[i];
                            }

                            // 新記録スコアチェック
                            if (this.stPerformanceEntry[i].nスコア > ini.stSection[i * 2].nスコア)
                            {
                                this.bNewRecordScore[i] = true;
                                ini.stSection[i * 2]    = this.stPerformanceEntry[i];
                                this.SaveGhost(i * 2);                                 // #35411 chnmr0 add
                            }

                            // 新記録スキルチェック
                            if ((this.stPerformanceEntry[i].dbPerformanceSkill > ini.stSection[(i * 2) + 1].dbPerformanceSkill) && !this.bAuto[i])
                            {
                                this.bNewRecordSkill[i]    = true;
                                ini.stSection[(i * 2) + 1] = this.stPerformanceEntry[i];
                                this.SaveGhost((i * 2) + 1);                                 // #35411 chnmr0 add
                            }

                            // ラストプレイ #23595 2011.1.9 ikanick
                            // オートじゃなければプレイ結果を書き込む
                            if (this.bAuto[i] == false)
                            {
                                ini.stSection[i + 6] = this.stPerformanceEntry[i];
                                this.SaveGhost(i + 6);                                 // #35411 chnmr0 add
                            }

                            // #23596 10.11.16 add ikanick オートじゃないならクリア回数を1増やす
                            //        11.02.05 bAuto to tGetIsUpdateNeeded use      ikanick
                            bool[] b更新が必要か否か = new bool[3];
                            CScoreIni.tGetIsUpdateNeeded(out b更新が必要か否か[0], out b更新が必要か否か[1], out b更新が必要か否か[2]);

                            if (b更新が必要か否か[i])
                            {
                                switch (i)
                                {
                                case 0:
                                    ini.stFile.ClearCountDrums++;
                                    break;

                                case 1:
                                    ini.stFile.ClearCountGuitar++;
                                    break;

                                case 2:
                                    ini.stFile.ClearCountBass++;
                                    break;

                                default:
                                    throw new Exception("クリア回数増加のk(0-2)が範囲外です。");
                                }
                            }

                            //---------------------------------------------------------------------/
                        }
                        // Already checked
                        //if (CDTXMania.ConfigIni.bScoreIniを出力する)
                        {
                            ini.tExport(str);
                        }
                    }
                    //---------------------
                    #endregion

                    #region [ Update nb of performance #24281 2011.1.30 yyagi]
                    this.nNbPerformances.Drums  = ini.stFile.PlayCountDrums;
                    this.nNbPerformances.Guitar = ini.stFile.PlayCountGuitar;
                    this.nNbPerformances.Bass   = ini.stFile.PlayCountBass;
                    #endregion
                    #region [ Update score information on Song Selection screen ]
                    //---------------------
                    if (!CDTXMania.bCompactMode)
                    {
                        CScore cScore    = CDTXMania.stageSongSelection.rChosenScore;
                        bool[] b更新が必要か否か = new bool[3];
                        CScoreIni.tGetIsUpdateNeeded(out b更新が必要か否か[0], out b更新が必要か否か[1], out b更新が必要か否か[2]);
                        for (int m = 0; m < 3; m++)
                        {
                            if (b更新が必要か否か[m])
                            {
                                // FullCombo した記録を FullCombo なしで超えた場合、FullCombo マークが消えてしまう。
                                // → FullCombo は、最新記録と関係なく、一度達成したらずっとつくようにする。(2010.9.11)
                                cScore.SongInformation.FullCombo[m] = this.stPerformanceEntry[m].bIsFullCombo | b今までにフルコンボしたことがある[m];

                                if (this.bNewRecordSkill[m])
                                {
                                    cScore.SongInformation.HighSkill[m] = this.stPerformanceEntry[m].dbPerformanceSkill;
                                    // New Song Progress for new skill record
                                    cScore.SongInformation.progress[m] = this.stPerformanceEntry[m].strProgress;
                                }

                                if (this.bNewRecordRank[m])
                                {
                                    cScore.SongInformation.BestRank[m] = this.nRankValue[m];
                                }

                                //Check if Progress record existed or not; if not, update anyway
                                if (CScoreIni.tProgressBarLength(cScore.SongInformation.progress[m]) == 0)
                                {
                                    cScore.SongInformation.progress[m] = this.stPerformanceEntry[m].strProgress;
                                }
                            }
                        }
                    }
                    //---------------------
                    #endregion
                }

                base.OnActivate();
                //this.actProgressBar.t表示レイアウトを設定する(180, 540, 20, 460);
                //this.actProgressBar.t演奏記録から区間情報を設定する(st演奏記録);
            }
            finally
            {
                Trace.TraceInformation("結果ステージの活性化を完了しました。");
                Trace.Unindent();
            }
        }