Пример #1
0
 public CChip()
 {
     this.nDistanceFromBar = new STDGBVALUE <int>()
     {
         Drums  = 0,
         Guitar = 0,
         Bass   = 0,
     };
     chipロングノート終端 = null;
 }
Пример #2
0
        public void ComputeDistanceFromBar(long nCurrentTime, STDGBVALUE <double> dbPerformanceScrollSpeed)
        {
            const double speed = 286;               // BPM150の時の1小節の長さ[dot]
            //XGのHS4.5が1289。思えばBPMじゃなくて拍の長さが関係あるよね。
            double ScrollSpeedDrums  = (dbPerformanceScrollSpeed.Drums + 1.0) * 0.5 * 37.5 * speed / 60000.0;
            double ScrollSpeedGuitar = (dbPerformanceScrollSpeed.Guitar + 1.0) * 0.5 * 0.5 * 37.5 * speed / 60000.0;
            double ScrollSpeedBass   = (dbPerformanceScrollSpeed.Bass + 1.0) * 0.5 * 0.5 * 37.5 * speed / 60000.0;

            this.nDistanceFromBar.Drums  = (int)((this.nPlaybackTimeMs - nCurrentTime) * ScrollSpeedDrums);
            this.nDistanceFromBar.Guitar = (int)((this.nPlaybackTimeMs - nCurrentTime) * ScrollSpeedGuitar);
            this.nDistanceFromBar.Bass   = (int)((this.nPlaybackTimeMs - nCurrentTime) * ScrollSpeedBass);

            //New: Compute Distance for End of Long Note chip
            if (this.bロングノートである)
            {
                this.chipロングノート終端.ComputeDistanceFromBar(nCurrentTime, dbPerformanceScrollSpeed);
            }
        }
Пример #3
0
 public void t演奏記録から区間情報を設定する(STDGBVALUE <CScoreIni.CPerformanceEntry> stPerformanceEntry, EInstrumentPart eInstrumentPart)
 {
     for (EInstrumentPart ePart = EInstrumentPart.DRUMS; ePart <= EInstrumentPart.BASS; ePart++)
     {
         for (int i = 0; i < nSectionIntervalCount; i++)
         {
             CProgressSection c区間 = listProgressSection[(int)ePart][i];
             c区間.nChipCount             = 0;
             c区間.nHitCount              = 0;
             c区間.rectDrawingFrame.Width = 0;
         }
     }
     epartプレイ楽器 = eInstrumentPart;            //CDTXMania.stageSongSelection.tオートを参考にこれからプレイするであろうパートを推測する();
     if (epartプレイ楽器 >= EInstrumentPart.DRUMS && epartプレイ楽器 <= EInstrumentPart.BASS && stPerformanceEntry[(int)epartプレイ楽器] != null)
     {
         char[] arrプログレス = stPerformanceEntry[(int)epartプレイ楽器].strProgress.ToCharArray();
         tプログレス配列から区間情報を設定する(arrプログレス);
     }
 }
Пример #4
0
        /// <summary>
        /// コンストラクタ(座標値の初期化)
        /// </summary>
        public C演奏判定ライン座標共通()
        {
            n判定ラインY座標元データ = new STDGBVALUE <int> [2, 2, 2];
            #region [ 判定ライン座標の初期化]
            // Normal, Drums画面, 判定ライン
            n判定ラインY座標元データ[0, 0, 0].Drums  = 0;                          //未使用
            n判定ラインY座標元データ[0, 0, 0].Guitar = 95;
            n判定ラインY座標元データ[0, 0, 0].Bass   = 95;
            // Reverse, Drums画面, 判定ライン
            n判定ラインY座標元データ[1, 0, 0].Drums  = 0;                          //未使用
            n判定ラインY座標元データ[1, 0, 0].Guitar = 374;
            n判定ラインY座標元データ[1, 0, 0].Bass   = 374;
            // Normal, Drums画面, Wailing枠
            n判定ラインY座標元データ[0, 0, 1].Drums  = 0;                          //未使用
            n判定ラインY座標元データ[0, 0, 1].Guitar = 69;
            n判定ラインY座標元データ[0, 0, 1].Bass   = 69;
            // Reverse, Drums画面, Wailing枠
            n判定ラインY座標元データ[1, 0, 1].Drums  = 0;                          //未使用
            n判定ラインY座標元データ[1, 0, 1].Guitar = 350;
            n判定ラインY座標元データ[1, 0, 1].Bass   = 350;

            // Normal, GR画面, 判定ライン
            n判定ラインY座標元データ[0, 1, 0].Drums  = 0;                          //未使用
            n判定ラインY座標元データ[0, 1, 0].Guitar = 40;
            n判定ラインY座標元データ[0, 1, 0].Bass   = 40;
            // Reverse, GR画面, 判定ライン
            n判定ラインY座標元データ[1, 1, 0].Drums  = 0;                          //未使用
            n判定ラインY座標元データ[1, 1, 0].Guitar = 369;
            n判定ラインY座標元データ[1, 1, 0].Bass   = 369;
            // Normal, GR画面, Wailing枠
            n判定ラインY座標元データ[0, 1, 1].Drums  = 0;                          //未使用
            n判定ラインY座標元データ[0, 1, 1].Guitar = 11;
            n判定ラインY座標元データ[0, 1, 1].Bass   = 11;
            // Reverse, GR画面, Wailing枠
            n判定ラインY座標元データ[1, 1, 1].Drums  = 0;                          //未使用
            n判定ラインY座標元データ[1, 1, 1].Guitar = 340;
            n判定ラインY座標元データ[1, 1, 1].Bass   = 340;
            #endregion

            n演奏RGBボタンY座標元データ = new STDGBVALUE <int> [2, 2, 2];
            #region [ RGBボタン座標の初期化]
            // Normal, Drums画面, RGBボタン
            n演奏RGBボタンY座標元データ[0, 0, 0].Drums  = 0;                       // 未使用
            n演奏RGBボタンY座標元データ[0, 0, 0].Guitar = 57;
            n演奏RGBボタンY座標元データ[0, 0, 0].Bass   = 57;
            // Reverse, Drums画面, RGBボタン
            n演奏RGBボタンY座標元データ[1, 0, 0].Drums  = 0;                       // 未使用
            n演奏RGBボタンY座標元データ[1, 0, 0].Guitar = 57;
            n演奏RGBボタンY座標元データ[1, 0, 0].Bass   = 57;
            // Normal, Drums画面, RGBボタン(Vシリーズ)
            n演奏RGBボタンY座標元データ[0, 0, 1].Drums  = 0;                       // 未使用
            n演奏RGBボタンY座標元データ[0, 0, 1].Guitar = 107;
            n演奏RGBボタンY座標元データ[0, 0, 1].Bass   = 107;
            // Reverse, Drums画面, RGBボタン(Vシリーズ)
            n演奏RGBボタンY座標元データ[1, 0, 1].Drums  = 0;                       // 未使用
            n演奏RGBボタンY座標元データ[1, 0, 1].Guitar = 107;
            n演奏RGBボタンY座標元データ[1, 0, 1].Bass   = 107;

            // Normal, GR画面, RGBボタン
            n演奏RGBボタンY座標元データ[0, 1, 0].Drums  = 0;                       // 未使用
            n演奏RGBボタンY座標元データ[0, 1, 0].Guitar = 3;
            n演奏RGBボタンY座標元データ[0, 1, 0].Bass   = 3;
            // Reverse, GR画面, RGBボタン
            n演奏RGBボタンY座標元データ[1, 1, 0].Drums  = 0;                       // 未使用
            n演奏RGBボタンY座標元データ[1, 1, 0].Guitar = 3;
            n演奏RGBボタンY座標元データ[1, 1, 0].Bass   = 3;
            // Normal, GR画面, RGBボタン(Vシリーズ)
            n演奏RGBボタンY座標元データ[0, 1, 1].Drums  = 0;                       // 未使用
            n演奏RGBボタンY座標元データ[0, 1, 1].Guitar = 44;
            n演奏RGBボタンY座標元データ[0, 1, 1].Bass   = 44;
            // Reverse, GR画面, RGBボタン(Vシリーズ)
            n演奏RGBボタンY座標元データ[1, 1, 1].Drums  = 0;                       // 未使用
            n演奏RGBボタンY座標元データ[1, 1, 1].Guitar = 44;
            n演奏RGBボタンY座標元データ[1, 1, 1].Bass   = 44;
            #endregion

            n判定位置        = new STDGBVALUE <E判定位置>();
            n判定位置.Drums  = E判定位置.標準;
            n判定位置.Guitar = E判定位置.標準;
            n判定位置.Bass   = E判定位置.標準;

            // 補正値は、Normal/Reverse, Drums/GR画面共通
            nJudgeLinePosY_delta.Drums  = 0;
            nJudgeLinePosY_delta.Guitar = 0;
            nJudgeLinePosY_delta.Bass   = 0;
        }
Пример #5
0
        //fork
        // #35411 chnmr0 add
        private void SaveGhost(int sectionIndex)
        {
            //return; //2015.12.31 kairera0467 以下封印

            STDGBVALUE <bool> saveCond = new STDGBVALUE <bool>();

            saveCond.Drums  = true;
            saveCond.Guitar = true;
            saveCond.Bass   = true;

            foreach (CChip chip in CDTXMania.DTX.listChip)
            {
                if (chip.bIsAutoPlayed)
                {
                    if (chip.nChannelNumber != EChannel.Guitar_Wailing && chip.nChannelNumber != EChannel.Bass_Wailing)                     // Guitar/Bass Wailing は OK
                    {
                        saveCond[(int)(chip.eInstrumentPart)] = false;
                    }
                }
            }
            for (int instIndex = 0; instIndex < 3; ++instIndex)
            {
                saveCond[instIndex] &= CDTXMania.listAutoGhostLag.Drums == null;
            }

            string          directory = CDTXMania.DTX.strFolderName;
            string          filename  = CDTXMania.DTX.strファイル名 + ".";
            EInstrumentPart inst      = EInstrumentPart.UNKNOWN;

            if (sectionIndex == 0)
            {
                filename += "hiscore.dr.ghost";
                inst      = EInstrumentPart.DRUMS;
            }
            else if (sectionIndex == 1)
            {
                filename += "hiskill.dr.ghost";
                inst      = EInstrumentPart.DRUMS;
            }
            if (sectionIndex == 2)
            {
                filename += "hiscore.gt.ghost";
                inst      = EInstrumentPart.GUITAR;
            }
            else if (sectionIndex == 3)
            {
                filename += "hiskill.gt.ghost";
                inst      = EInstrumentPart.GUITAR;
            }
            if (sectionIndex == 4)
            {
                filename += "hiscore.bs.ghost";
                inst      = EInstrumentPart.BASS;
            }
            else if (sectionIndex == 5)
            {
                filename += "hiskill.bs.ghost";
                inst      = EInstrumentPart.BASS;
            }
            else if (sectionIndex == 6)
            {
                filename += "lastplay.dr.ghost";
                inst      = EInstrumentPart.DRUMS;
            }
            else if (sectionIndex == 7)
            {
                filename += "lastplay.gt.ghost";
                inst      = EInstrumentPart.GUITAR;
            }
            else if (sectionIndex == 8)
            {
                filename += "lastplay.bs.ghost";
                inst      = EInstrumentPart.BASS;
            }

            if (inst == EInstrumentPart.UNKNOWN)
            {
                return;
            }

            int cnt = 0;

            foreach (DTXMania.CChip chip in CDTXMania.DTX.listChip)
            {
                if (chip.eInstrumentPart == inst)
                {
                    ++cnt;
                }
            }

            if (saveCond[(int)inst])
            //if(false)
            {
                using (FileStream fs = new FileStream(directory + "\\" + filename, FileMode.Create, FileAccess.Write))
                {
                    using (BinaryWriter bw = new BinaryWriter(fs))
                    {
                        bw.Write((Int32)cnt);
                        foreach (DTXMania.CChip chip in CDTXMania.DTX.listChip)
                        {
                            if (chip.eInstrumentPart == inst)
                            {
                                // -128 ms から 127 ms までのラグしか保存しない
                                // その範囲を超えているラグはクランプ
                                // ラグデータの 上位8ビットでそのチップの前でギター空打ちBADがあったことを示す
                                int lag = chip.nLag;
                                if (lag < -128)
                                {
                                    lag = -128;
                                }
                                if (lag > 127)
                                {
                                    lag = 127;
                                }
                                byte lower = (byte)(lag + 128);
                                int  upper = chip.nCurrentComboForGhost == 0 ? 1 : 0;
                                bw.Write((short)((upper << 8) | lower));
                            }
                        }
                    }
                }

                //Ver.K追加 演奏結果の記録
                //CScoreIni.CPerformanceEntry cScoreData;
                //cScoreData = this.stPerformanceEntry[ (int)inst ];
                //using (FileStream fs = new FileStream(directory + "\\" + filename + ".score", FileMode.Create, FileAccess.Write))
                //{
                //    using (StreamWriter sw = new StreamWriter(fs))
                //    {
                //        sw.WriteLine( "Score=" + cScoreData.nスコア );
                //        sw.WriteLine( "PlaySkill=" + cScoreData.dbPerformanceSkill );
                //        sw.WriteLine( "Skill=" + cScoreData.dbGameSkill );
                //        sw.WriteLine( "Perfect=" + cScoreData.nPerfectCount_ExclAuto );
                //        sw.WriteLine( "Great=" + cScoreData.nGreatCount_ExclAuto );
                //        sw.WriteLine( "Good=" + cScoreData.nGoodCount_ExclAuto );
                //        sw.WriteLine( "Poor=" + cScoreData.nPoorCount_ExclAuto );
                //        sw.WriteLine( "Miss=" + cScoreData.nMissCount_ExclAuto );
                //        sw.WriteLine( "MaxCombo=" + cScoreData.nMaxCombo );
                //    }
                //}
            }
        }