コード例 #1
0
        public void ScoreDiffTextChanged(ScoreCal_Form1 mainForm, TJARead tjaRead, Calculate calculate)
        {
            int  i = 0;
            bool b = int.TryParse(mainForm.DIFFM.Text, out i);

            if (b)
            {
                calculate.ScoreDiff  = i;
                calculate.calNdk[0]  = tjaRead.ndk[0] * (calculate.ScoreInit - calculate.ScoreInit % 10);
                calculate.calNdk[1]  = tjaRead.ndk[1] * ((calculate.ScoreInit - calculate.ScoreInit % 10) + (calculate.ScoreDiff - calculate.ScoreDiff % 10));
                calculate.calNdk[2]  = tjaRead.ndk[2] * ((calculate.ScoreInit - calculate.ScoreInit % 10) + (calculate.ScoreDiff * 2 - calculate.ScoreDiff * 2 % 10));
                calculate.calNdk[3]  = tjaRead.ndk[3] * ((calculate.ScoreInit - calculate.ScoreInit % 10) + (calculate.ScoreDiff * 4 - calculate.ScoreDiff * 4 % 10));
                calculate.calNdk[4]  = tjaRead.ndk[4] * ((calculate.ScoreInit - calculate.ScoreInit % 10) + (calculate.ScoreDiff * 8 - calculate.ScoreDiff * 8 % 10));
                calculate.calNtdk[0] = tjaRead.ntdk[0] * 2 * (calculate.ScoreInit - calculate.ScoreInit % 10);
                calculate.calNtdk[1] = tjaRead.ntdk[1] * 2 * ((calculate.ScoreInit - calculate.ScoreInit % 10) + (calculate.ScoreDiff - calculate.ScoreDiff % 10));
                calculate.calNtdk[2] = tjaRead.ntdk[2] * 2 * ((calculate.ScoreInit - calculate.ScoreInit % 10) + (calculate.ScoreDiff * 2 - calculate.ScoreDiff * 2 % 10));
                calculate.calNtdk[3] = tjaRead.ntdk[3] * 2 * ((calculate.ScoreInit - calculate.ScoreInit % 10) + (calculate.ScoreDiff * 4 - calculate.ScoreDiff * 4 % 10));
                calculate.calNtdk[4] = tjaRead.ntdk[4] * 2 * ((calculate.ScoreInit - calculate.ScoreInit % 10) + (calculate.ScoreDiff * 8 - calculate.ScoreDiff * 8 % 10));

                calculate.calGdk[0]  = tjaRead.gdk[0] * (((calculate.ScoreInit - calculate.ScoreInit % 10) * 12 / 10) - (calculate.ScoreInit - (calculate.ScoreInit % 10) * 12 / 10) % 10);
                calculate.calGdk[1]  = tjaRead.gdk[1] * (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff - calculate.ScoreDiff % 10)) * 12 / 10) - ((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff - calculate.ScoreDiff % 10)) * 12 / 10) % 10);
                calculate.calGdk[2]  = tjaRead.gdk[2] * (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 2 - calculate.ScoreDiff * 2 % 10)) * 12 / 10) - ((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 2 - calculate.ScoreDiff * 2 % 10)) * 12 / 10) % 10);
                calculate.calGdk[3]  = tjaRead.gdk[3] * (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 4 - calculate.ScoreDiff * 4 % 10)) * 12 / 10) - ((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 4 - calculate.ScoreDiff * 4 % 10)) * 12 / 10) % 10);
                calculate.calGdk[4]  = tjaRead.gdk[4] * (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 8 - calculate.ScoreDiff * 8 % 10)) * 12 / 10) - ((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 8 - calculate.ScoreDiff * 8 % 10)) * 12 / 10) % 10);
                calculate.calGtdk[0] = tjaRead.gtdk[0] * 2 * (((calculate.ScoreInit - calculate.ScoreInit % 10) * 12 / 10) - ((calculate.ScoreInit - calculate.ScoreInit % 10) * 12 / 10 % 10));
                calculate.calGtdk[1] = tjaRead.gtdk[1] * 2 * (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff - calculate.ScoreDiff % 10)) * 12 / 10) - (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff - calculate.ScoreDiff % 10)) * 12 / 10) % 10));
                calculate.calGtdk[2] = tjaRead.gtdk[2] * 2 * (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 2 - calculate.ScoreDiff * 2 % 10)) * 12 / 10) - (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 2 - calculate.ScoreDiff * 2 % 10)) * 12 / 10) % 10));
                calculate.calGtdk[3] = tjaRead.gtdk[3] * 2 * (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 4 - calculate.ScoreDiff * 4 % 10)) * 12 / 10) - (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 4 - calculate.ScoreDiff * 4 % 10)) * 12 / 10) % 10));
                calculate.calGtdk[4] = tjaRead.gtdk[4] * 2 * (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 8 - calculate.ScoreDiff * 8 % 10)) * 12 / 10) - (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 8 - calculate.ScoreDiff * 8 % 10)) * 12 / 10) % 10));

                mainForm.INITM.Text = calculate.ScoreInit.ToString();
                mainForm.DIFFM.Text = calculate.ScoreDiff.ToString();
                mainForm.re.Text    = ((calculate.calNdk[0] + calculate.calNdk[1] + calculate.calNdk[2] + calculate.calNdk[3] + calculate.calNdk[4] + calculate.calNtdk[0] + calculate.calNtdk[1] + calculate.calNtdk[2] + calculate.calNtdk[3] + calculate.calNtdk[4] + calculate.calGdk[0] + calculate.calGdk[1] + calculate.calGdk[2] + calculate.calGdk[3] + calculate.calGdk[4] + calculate.calGtdk[0] + calculate.calGtdk[1] + calculate.calGtdk[2] + calculate.calGtdk[3] + calculate.calGtdk[4]) + (calculate.ComboBonus * 10000 + (tjaRead.baAmount[0] - tjaRead.baSum[0]) * 300 + (tjaRead.baAmount[1] - tjaRead.baSum[1]) * 360 + tjaRead.baSum[0] * 5000 + tjaRead.baSum[1] * 6000)).ToString();
            }
        }
コード例 #2
0
        public void Diff比率Changed(ScoreCal_Form1 mainForm, TJARead tjaRead, Calculate calculate)
        {
            double n = (double)mainForm.Diff比率.Value * 2, d = (double)mainForm.Diff比率.Value * 10;

            switch (n)
            {
            case 1:
                calculate.ScoreDiff = calculate.ScoreInit * 10 / 5;
                break;

            case 2:
                calculate.ScoreDiff = calculate.ScoreInit / 1;
                break;

            case 3:
                calculate.ScoreDiff = calculate.ScoreInit * 10 / 15;
                break;

            case 4:
                calculate.ScoreDiff = calculate.ScoreInit / 2;
                break;

            case 5:
                calculate.ScoreDiff = calculate.ScoreInit * 10 / 25;
                break;

            case 6:
                calculate.ScoreDiff = calculate.ScoreInit / 3;
                break;

            case 7:
                calculate.ScoreDiff = calculate.ScoreInit * 10 / 35;
                break;

            case 8:
                calculate.ScoreDiff = calculate.ScoreInit / 4;
                break;

            case 9:
                calculate.ScoreDiff = calculate.ScoreInit * 10 / 45;
                break;

            case 10:
                calculate.ScoreDiff = calculate.ScoreInit / 5;
                break;

            case 11:
                calculate.ScoreDiff = calculate.ScoreInit * 10 / 55;
                break;

            case 12:
                calculate.ScoreDiff = calculate.ScoreInit / 6;
                break;

            case 13:
                calculate.ScoreDiff = calculate.ScoreInit * 10 / 65;
                break;

            case 14:
                calculate.ScoreDiff = calculate.ScoreInit / 7;
                break;

            case 15:
                calculate.ScoreDiff = calculate.ScoreInit * 10 / 75;
                break;

            case 16:
                calculate.ScoreDiff = calculate.ScoreInit / 8;
                break;

            case 17:
                calculate.ScoreDiff = calculate.ScoreInit * 10 / 85;
                break;

            case 18:
                calculate.ScoreDiff = calculate.ScoreInit / 90;
                break;

            case 19:
                calculate.ScoreDiff = calculate.ScoreInit * 10 / 95;
                break;

            case 20:
                calculate.ScoreDiff = calculate.ScoreInit / 10;
                break;

            default:
                calculate.ScoreDiff = calculate.ScoreInit * 10 / (int)d;
                break;
            }
            calculate.calNdk[0]  = tjaRead.ndk[0] * (calculate.ScoreInit - calculate.ScoreInit % 10);
            calculate.calNdk[1]  = tjaRead.ndk[1] * ((calculate.ScoreInit - calculate.ScoreInit % 10) + (calculate.ScoreDiff - calculate.ScoreDiff % 10));
            calculate.calNdk[2]  = tjaRead.ndk[2] * ((calculate.ScoreInit - calculate.ScoreInit % 10) + (calculate.ScoreDiff * 2 - calculate.ScoreDiff * 2 % 10));
            calculate.calNdk[3]  = tjaRead.ndk[3] * ((calculate.ScoreInit - calculate.ScoreInit % 10) + (calculate.ScoreDiff * 4 - calculate.ScoreDiff * 4 % 10));
            calculate.calNdk[4]  = tjaRead.ndk[4] * ((calculate.ScoreInit - calculate.ScoreInit % 10) + (calculate.ScoreDiff * 8 - calculate.ScoreDiff * 8 % 10));
            calculate.calNtdk[0] = tjaRead.ntdk[0] * 2 * (calculate.ScoreInit - calculate.ScoreInit % 10);
            calculate.calNtdk[1] = tjaRead.ntdk[1] * 2 * ((calculate.ScoreInit - calculate.ScoreInit % 10) + (calculate.ScoreDiff - calculate.ScoreDiff % 10));
            calculate.calNtdk[2] = tjaRead.ntdk[2] * 2 * ((calculate.ScoreInit - calculate.ScoreInit % 10) + (calculate.ScoreDiff * 2 - calculate.ScoreDiff * 2 % 10));
            calculate.calNtdk[3] = tjaRead.ntdk[3] * 2 * ((calculate.ScoreInit - calculate.ScoreInit % 10) + (calculate.ScoreDiff * 4 - calculate.ScoreDiff * 4 % 10));
            calculate.calNtdk[4] = tjaRead.ntdk[4] * 2 * ((calculate.ScoreInit - calculate.ScoreInit % 10) + (calculate.ScoreDiff * 8 - calculate.ScoreDiff * 8 % 10));

            calculate.calGdk[0]  = tjaRead.gdk[0] * (((calculate.ScoreInit - calculate.ScoreInit % 10) * 12 / 10) - (calculate.ScoreInit - (calculate.ScoreInit % 10) * 12 / 10) % 10);
            calculate.calGdk[1]  = tjaRead.gdk[1] * (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff - calculate.ScoreDiff % 10)) * 12 / 10) - ((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff - calculate.ScoreDiff % 10)) * 12 / 10) % 10);
            calculate.calGdk[2]  = tjaRead.gdk[2] * (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 2 - calculate.ScoreDiff * 2 % 10)) * 12 / 10) - ((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 2 - calculate.ScoreDiff * 2 % 10)) * 12 / 10) % 10);
            calculate.calGdk[3]  = tjaRead.gdk[3] * (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 4 - calculate.ScoreDiff * 4 % 10)) * 12 / 10) - ((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 4 - calculate.ScoreDiff * 4 % 10)) * 12 / 10) % 10);
            calculate.calGdk[4]  = tjaRead.gdk[4] * (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 8 - calculate.ScoreDiff * 8 % 10)) * 12 / 10) - ((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 8 - calculate.ScoreDiff * 8 % 10)) * 12 / 10) % 10);
            calculate.calGtdk[0] = tjaRead.gtdk[0] * 2 * (((calculate.ScoreInit - calculate.ScoreInit % 10) * 12 / 10) - ((calculate.ScoreInit - calculate.ScoreInit % 10) * 12 / 10 % 10));
            calculate.calGtdk[1] = tjaRead.gtdk[1] * 2 * (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff - calculate.ScoreDiff % 10)) * 12 / 10) - (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff - calculate.ScoreDiff % 10)) * 12 / 10) % 10));
            calculate.calGtdk[2] = tjaRead.gtdk[2] * 2 * (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 2 - calculate.ScoreDiff * 2 % 10)) * 12 / 10) - (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 2 - calculate.ScoreDiff * 2 % 10)) * 12 / 10) % 10));
            calculate.calGtdk[3] = tjaRead.gtdk[3] * 2 * (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 4 - calculate.ScoreDiff * 4 % 10)) * 12 / 10) - (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 4 - calculate.ScoreDiff * 4 % 10)) * 12 / 10) % 10));
            calculate.calGtdk[4] = tjaRead.gtdk[4] * 2 * (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 8 - calculate.ScoreDiff * 8 % 10)) * 12 / 10) - (((calculate.ScoreInit - calculate.ScoreInit % 10 + (calculate.ScoreDiff * 8 - calculate.ScoreDiff * 8 % 10)) * 12 / 10) % 10));


            mainForm.INITM.Text = calculate.ScoreInit.ToString();
            mainForm.DIFFM.Text = calculate.ScoreDiff.ToString();
            mainForm.re.Text    = ((calculate.calNdk[0] + calculate.calNdk[1] + calculate.calNdk[2] + calculate.calNdk[3] + calculate.calNdk[4] + calculate.calNtdk[0] + calculate.calNtdk[1] + calculate.calNtdk[2] + calculate.calNtdk[3] + calculate.calNtdk[4] + calculate.calGdk[0] + calculate.calGdk[1] + calculate.calGdk[2] + calculate.calGdk[3] + calculate.calGdk[4] + calculate.calGtdk[0] + calculate.calGtdk[1] + calculate.calGtdk[2] + calculate.calGtdk[3] + calculate.calGtdk[4]) + (calculate.ComboBonus * 10000 + (tjaRead.baAmount[0] - tjaRead.baSum[0]) * 300 + (tjaRead.baAmount[1] - tjaRead.baSum[1]) * 360 + tjaRead.baSum[0] * 5000 + tjaRead.baSum[1] * 6000)).ToString();
        }
コード例 #3
0
        public void Calculated(ScoreCal_Form1 mainForm, TJARead tjaRead)
        {
            ResetValue();

            #region 3||4
            if (tjaRead.bCourseExist[3] || tjaRead.bCourseExist[4])
            {
                if (tjaRead.level <= 1)
                {
                    Score = 700000;
                }
                else if (tjaRead.level <= 2)
                {
                    Score = 750000;
                }
                else if (tjaRead.level <= 3)
                {
                    Score = 800000;
                }
                else if (tjaRead.level <= 4)
                {
                    Score = 850000;
                }
                else if (tjaRead.level <= 5)
                {
                    Score = 900000;
                }
                else if (tjaRead.level <= 6)
                {
                    Score = 950000;
                }
                else if (tjaRead.level <= 7)
                {
                    Score = 1000000;
                }
                else if (tjaRead.level <= 8)
                {
                    Score = 1050000;
                }
                else if (tjaRead.level <= 9)
                {
                    Score = 1100000;
                }
                else if (tjaRead.level <= 10)
                {
                    Score = 1200000;
                }
                else
                {
                    Score = 1000000;
                }
            }
            #endregion
            #region 2
            else if (tjaRead.bCourseExist[2])
            {
                if (tjaRead.level <= 1)
                {
                    Score = 550000;
                }
                else if (tjaRead.level <= 2)
                {
                    Score = 600000;
                }
                else if (tjaRead.level <= 3)
                {
                    Score = 650000;
                }
                else if (tjaRead.level <= 4)
                {
                    Score = 700000;
                }
                else if (tjaRead.level <= 5)
                {
                    Score = 750000;
                }
                else if (tjaRead.level <= 6)
                {
                    Score = 800000;
                }
                else if (tjaRead.level <= 7)
                {
                    Score = 850000;
                }
                else if (tjaRead.level <= 8)
                {
                    Score = 900000;
                }
                else
                {
                    Score = 750000;
                }
            }
            #endregion
            #region 1
            else if (tjaRead.bCourseExist[1])
            {
                if (tjaRead.level <= 1)
                {
                    Score = 400000;
                }
                else if (tjaRead.level <= 2)
                {
                    Score = 450000;
                }
                else if (tjaRead.level <= 3)
                {
                    Score = 500000;
                }
                else if (tjaRead.level <= 4)
                {
                    Score = 550000;
                }
                else if (tjaRead.level <= 5)
                {
                    Score = 600000;
                }
                else if (tjaRead.level <= 6)
                {
                    Score = 650000;
                }
                else if (tjaRead.level <= 7)
                {
                    Score = 700000;
                }
                else
                {
                    Score = 550000;
                }
            }
            #endregion
            #region 0
            else if (tjaRead.bCourseExist[0])
            {
                if (tjaRead.level <= 1)
                {
                    Score = 300000;
                }
                else if (tjaRead.level <= 2)
                {
                    Score = 320000;
                }
                else if (tjaRead.level <= 3)
                {
                    Score = 340000;
                }
                else if (tjaRead.level <= 4)
                {
                    Score = 360000;
                }
                else if (tjaRead.level <= 5)
                {
                    Score = 380000;
                }
                else
                {
                    Score = 340000;
                }
            }
            #endregion


            ComboBonus             = tjaRead.nComboBonus / 100;
            mainForm.ScoreUD.Value = Score;



            //通常スコア
            while (((calNdk[0] + calNdk[1] + calNdk[2] + calNdk[3] + calNdk[4] + calNtdk[0] + calNtdk[1] + calNtdk[2] + calNtdk[3] + calNtdk[4] + calGdk[0] + calGdk[1] + calGdk[2] + calGdk[3] + calGdk[4] + calGtdk[0] + calGtdk[1] + calGtdk[2] + calGtdk[3] + calGtdk[4]) + (ComboBonus * 10000 + (tjaRead.baAmount[0] - tjaRead.baSum[0]) * 300 + (tjaRead.baAmount[1] - tjaRead.baSum[1]) * 360 + tjaRead.baSum[0] * 5000 + tjaRead.baSum[1] * 6000)) < Score)
            {
                int n;
                diff用    += 1;
                ScoreDiff = diff用 / 4;
                if (diff用 % 10 == 0)
                {
                    ScoreInit += 10;
                }

                calNdk[0]  = tjaRead.ndk[0] * (ScoreInit - ScoreInit % 10);
                calNdk[1]  = tjaRead.ndk[1] * ((ScoreInit - ScoreInit % 10) + (ScoreDiff - ScoreDiff % 10));
                calNdk[2]  = tjaRead.ndk[2] * ((ScoreInit - ScoreInit % 10) + (ScoreDiff * 2 - ScoreDiff * 2 % 10));
                calNdk[3]  = tjaRead.ndk[3] * ((ScoreInit - ScoreInit % 10) + (ScoreDiff * 4 - ScoreDiff * 4 % 10));
                calNdk[4]  = tjaRead.ndk[4] * ((ScoreInit - ScoreInit % 10) + (ScoreDiff * 8 - ScoreDiff * 8 % 10));
                calNtdk[0] = tjaRead.ntdk[0] * 2 * (ScoreInit - ScoreInit % 10);
                calNtdk[1] = tjaRead.ntdk[1] * 2 * ((ScoreInit - ScoreInit % 10) + (ScoreDiff - ScoreDiff % 10));
                calNtdk[2] = tjaRead.ntdk[2] * 2 * ((ScoreInit - ScoreInit % 10) + (ScoreDiff * 2 - ScoreDiff * 2 % 10));
                calNtdk[3] = tjaRead.ntdk[3] * 2 * ((ScoreInit - ScoreInit % 10) + (ScoreDiff * 4 - ScoreDiff * 4 % 10));
                calNtdk[4] = tjaRead.ntdk[4] * 2 * ((ScoreInit - ScoreInit % 10) + (ScoreDiff * 8 - ScoreDiff * 8 % 10));

                calGdk[0]  = tjaRead.gdk[0] * (((ScoreInit - ScoreInit % 10) * 12 / 10) - ((ScoreInit - ScoreInit % 10) * 12 / 10 % 10));
                calGdk[1]  = tjaRead.gdk[1] * (((ScoreInit - ScoreInit % 10 + (ScoreDiff - ScoreDiff % 10)) * 12 / 10) - ((ScoreInit - ScoreInit % 10 + (ScoreDiff - ScoreDiff % 10)) * 12 / 10) % 10);
                calGdk[2]  = tjaRead.gdk[2] * (((ScoreInit - ScoreInit % 10 + (ScoreDiff * 2 - ScoreDiff * 2 % 10)) * 12 / 10) - ((ScoreInit - ScoreInit % 10 + (ScoreDiff * 2 - ScoreDiff * 2 % 10)) * 12 / 10) % 10);
                calGdk[3]  = tjaRead.gdk[3] * (((ScoreInit - ScoreInit % 10 + (ScoreDiff * 4 - ScoreDiff * 4 % 10)) * 12 / 10) - ((ScoreInit - ScoreInit % 10 + (ScoreDiff * 4 - ScoreDiff * 4 % 10)) * 12 / 10) % 10);
                calGdk[4]  = tjaRead.gdk[4] * (((ScoreInit - ScoreInit % 10 + (ScoreDiff * 8 - ScoreDiff * 8 % 10)) * 12 / 10) - ((ScoreInit - ScoreInit % 10 + (ScoreDiff * 8 - ScoreDiff * 8 % 10)) * 12 / 10) % 10);
                calGtdk[0] = tjaRead.gtdk[0] * 2 * (((ScoreInit - ScoreInit % 10) * 12 / 10) - ((ScoreInit - ScoreInit % 10) * 12 / 10 % 10));
                calGtdk[1] = tjaRead.gtdk[1] * 2 * (((ScoreInit - ScoreInit % 10 + (ScoreDiff - ScoreDiff % 10)) * 12 / 10) - (((ScoreInit - ScoreInit % 10 + (ScoreDiff - ScoreDiff % 10)) * 12 / 10) % 10));
                calGtdk[2] = tjaRead.gtdk[2] * 2 * (((ScoreInit - ScoreInit % 10 + (ScoreDiff * 2 - ScoreDiff * 2 % 10)) * 12 / 10) - (((ScoreInit - ScoreInit % 10 + (ScoreDiff * 2 - ScoreDiff * 2 % 10)) * 12 / 10) % 10));
                calGtdk[3] = tjaRead.gtdk[3] * 2 * (((ScoreInit - ScoreInit % 10 + (ScoreDiff * 4 - ScoreDiff * 4 % 10)) * 12 / 10) - (((ScoreInit - ScoreInit % 10 + (ScoreDiff * 4 - ScoreDiff * 4 % 10)) * 12 / 10) % 10));
                calGtdk[4] = tjaRead.gtdk[4] * 2 * (((ScoreInit - ScoreInit % 10 + (ScoreDiff * 8 - ScoreDiff * 8 % 10)) * 12 / 10) - (((ScoreInit - ScoreInit % 10 + (ScoreDiff * 8 - ScoreDiff * 8 % 10)) * 12 / 10) % 10));

                n = ((calNdk[0] + calNdk[1] + calNdk[2] + calNdk[3] + calNdk[4] + calNtdk[0] + calNtdk[1] + calNtdk[2] + calNtdk[3] + calNtdk[4] + calGdk[0] + calGdk[1] + calGdk[2] + calGdk[3] + calGdk[4] + calGtdk[0] + calGtdk[1] + calGtdk[2] + calGtdk[3] + calGtdk[4]) + (ComboBonus * 10000 + (tjaRead.baAmount[0] - tjaRead.baSum[0]) * 300 + (tjaRead.baAmount[1] - tjaRead.baSum[1]) * 360 + tjaRead.baSum[0] * 5000 + tjaRead.baSum[1] * 6000));
                if (n > Score)
                {
                    break;
                }
            }

            //真打スコア
            for (int i = 0; i < 5; i++)
            {
                shinuchiNotes += tjaRead.ndk[i] + tjaRead.ntdk[i] * 2 + tjaRead.gdk[i] + tjaRead.gtdk[i] * 2;
            }
            while (shinuchiNotes * shinuchiInit + (tjaRead.baAmount[0] - tjaRead.baSum[0]) * 300 + (tjaRead.baAmount[1] - tjaRead.baSum[1]) * 300 + (tjaRead.baSum[0] * 5000 + tjaRead.baSum[1] * 5000) < 1000000)
            {
                shinuchiInit += 10;
            }

            #region 読み込み後テキスト
            mainForm.Total.Text         = tjaRead.nComboBonus.ToString();
            mainForm.Difficulty.Text    = tjaRead.level.ToString();
            mainForm.ndk0.Text          = tjaRead.ndk[0].ToString();
            mainForm.ndk1.Text          = tjaRead.ndk[1].ToString();
            mainForm.ndk2.Text          = tjaRead.ndk[2].ToString();
            mainForm.ndk3.Text          = tjaRead.ndk[3].ToString();
            mainForm.ndk4.Text          = tjaRead.ndk[4].ToString();
            mainForm.ntdk0.Text         = tjaRead.ntdk[0].ToString();
            mainForm.ntdk1.Text         = tjaRead.ntdk[1].ToString();
            mainForm.ntdk2.Text         = tjaRead.ntdk[2].ToString();
            mainForm.ntdk3.Text         = tjaRead.ntdk[3].ToString();
            mainForm.ntdk4.Text         = tjaRead.ntdk[4].ToString();
            mainForm.gdk0.Text          = tjaRead.gdk[0].ToString();
            mainForm.gdk1.Text          = tjaRead.gdk[1].ToString();
            mainForm.gdk2.Text          = tjaRead.gdk[2].ToString();
            mainForm.gdk3.Text          = tjaRead.gdk[3].ToString();
            mainForm.gdk4.Text          = tjaRead.gdk[4].ToString();
            mainForm.gtdk0.Text         = tjaRead.gtdk[0].ToString();
            mainForm.gtdk1.Text         = tjaRead.gtdk[1].ToString();
            mainForm.gtdk2.Text         = tjaRead.gtdk[2].ToString();
            mainForm.gtdk3.Text         = tjaRead.gtdk[3].ToString();
            mainForm.gtdk4.Text         = tjaRead.gtdk[4].ToString();
            mainForm.textBox1.Text      = tjaRead.str[2];
            mainForm.TJAName.Text       = tjaRead.ofd.SafeFileName;
            mainForm.INITM.Text         = ScoreInit.ToString();
            mainForm.DIFFM.Text         = ScoreDiff.ToString();
            mainForm.ShinuchiUD.Text    = shinuchiInit.ToString();
            mainForm.re.Text            = ((calNdk[0] + calNdk[1] + calNdk[2] + calNdk[3] + calNdk[4] + calNtdk[0] + calNtdk[1] + calNtdk[2] + calNtdk[3] + calNtdk[4] + calGdk[0] + calGdk[1] + calGdk[2] + calGdk[3] + calGdk[4] + calGtdk[0] + calGtdk[1] + calGtdk[2] + calGtdk[3] + calGtdk[4]) + (ComboBonus * 10000 + (tjaRead.baAmount[0] - tjaRead.baSum[0]) * 300 + (tjaRead.baAmount[1] - tjaRead.baSum[1]) * 360 + tjaRead.baSum[0] * 5000 + tjaRead.baSum[1] * 6000)).ToString();
            mainForm.ShinuchiValue.Text = (shinuchiNotes * shinuchiInit + (tjaRead.baAmount[0] - tjaRead.baSum[0]) * 300 + (tjaRead.baAmount[1] - tjaRead.baSum[1]) * 300 + (tjaRead.baSum[0] * 5000 + tjaRead.baSum[1] * 5000)).ToString();
            mainForm.basum0.Text        = tjaRead.baSum[0].ToString();
            mainForm.basum1.Text        = tjaRead.baSum[1].ToString();
            mainForm.baamount0.Text     = tjaRead.baAmount[0].ToString();
            mainForm.baamount1.Text     = tjaRead.baAmount[1].ToString();

            if (tjaRead.bKusudamaExist)
            {
                mainForm.Kusudama.Visible = true;
            }
            else
            {
                mainForm.Kusudama.Visible = false;
            }

            //初期化

            bool bChecked = false;
            mainForm.easy.Enabled   = false;
            mainForm.normal.Enabled = false;
            mainForm.hard.Enabled   = false;
            mainForm.oni.Enabled    = false;
            mainForm.edit.Enabled   = false;

            mainForm.easy.Checked   = false;
            mainForm.normal.Checked = false;
            mainForm.hard.Checked   = false;
            mainForm.oni.Checked    = false;
            mainForm.edit.Checked   = false;


            if (tjaRead.bCourseExist[4])
            {
                mainForm.edit.Enabled = true;
                mainForm.edit.Checked = true;
                bChecked = true;
            }
            if (tjaRead.bCourseExist[3])
            {
                mainForm.oni.Enabled = true;
                if (!bChecked)
                {
                    mainForm.oni.Checked = true;
                    bChecked             = true;
                }
            }
            if (tjaRead.bCourseExist[2])
            {
                mainForm.hard.Enabled = true;
                if (!bChecked)
                {
                    mainForm.hard.Checked = true;
                    bChecked = true;
                }
            }
            if (tjaRead.bCourseExist[1])
            {
                mainForm.normal.Enabled = true;
                if (!bChecked)
                {
                    mainForm.normal.Checked = true;
                    bChecked = true;
                }
            }
            if (tjaRead.bCourseExist[0])
            {
                mainForm.easy.Enabled = true;
                if (!bChecked)
                {
                    mainForm.easy.Checked = true;
                    bChecked = true;
                }
            }

            #endregion
            bRead = true;

            if (bRead)
            {
                mainForm.TJAReader.Text = "別のTJAファイルを読み込む";
                mainForm.Text           = "TJAScoreCalculator..." + tjaRead.ofd.SafeFileName;
            }
        }
コード例 #4
0
 public Calculate(ScoreCal_Form1 mainForm, TJARead tjaRead)
 {
     ResetValue();
 }
コード例 #5
0
 public void ShinuchiUDValueChanged(ScoreCal_Form1 mainForm, TJARead tjaRead, Calculate calculate)
 {
     calculate.shinuchiInit      = (int)mainForm.ShinuchiUD.Value;
     mainForm.ShinuchiValue.Text = (calculate.shinuchiNotes * calculate.shinuchiInit + (tjaRead.baAmount[0] - tjaRead.baSum[0]) * 300 + (tjaRead.baAmount[1] - tjaRead.baSum[1]) * 300 + (tjaRead.baSum[0] * 5000 + tjaRead.baSum[1] * 5000)).ToString();
 }
コード例 #6
0
        public void Calculated(ScoreCal_Form1 mainForm, TJARead tjaRead)
        {
            if (bRead)
            {
                ResetValue();
                bRead = false;
            }

            if (!bRead)
            {
                if (tjaRead.level <= 1)
                {
                    Score = 700000;
                }
                else if (tjaRead.level <= 2)
                {
                    Score = 750000;
                }
                else if (tjaRead.level <= 3)
                {
                    Score = 800000;
                }
                else if (tjaRead.level <= 4)
                {
                    Score = 850000;
                }
                else if (tjaRead.level <= 5)
                {
                    Score = 900000;
                }
                else if (tjaRead.level <= 6)
                {
                    Score = 950000;
                }
                else if (tjaRead.level <= 7)
                {
                    Score = 1000000;
                }
                else if (tjaRead.level <= 8)
                {
                    Score = 1050000;
                }
                else if (tjaRead.level <= 9)
                {
                    Score = 1100000;
                }
                else if (tjaRead.level <= 10)
                {
                    Score = 1200000;
                }
                else
                {
                    Score = 1000000;
                }

                ComboBonus             = tjaRead.tja0[1].Length / 100;
                mainForm.ScoreUD.Value = Score;



                while (((calNdk[0] + calNdk[1] + calNdk[2] + calNdk[3] + calNdk[4] + calNtdk[0] + calNtdk[1] + calNtdk[2] + calNtdk[3] + calNtdk[4] + calGdk[0] + calGdk[1] + calGdk[2] + calGdk[3] + calGdk[4] + calGtdk[0] + calGtdk[1] + calGtdk[2] + calGtdk[3] + calGtdk[4]) + (ComboBonus * 10000 + (tjaRead.baAmount[0] - tjaRead.baSum[0]) * 300 + (tjaRead.baAmount[1] - tjaRead.baSum[1]) * 360 + tjaRead.baSum[0] * 5000 + tjaRead.baSum[1] * 6000)) < Score)
                {
                    int n;
                    diff用    += 1;
                    ScoreDiff = diff用 / 4;
                    if (diff用 % 10 == 0)
                    {
                        ScoreInit += 10;
                    }

                    calNdk[0]  = tjaRead.ndk[0] * (ScoreInit - ScoreInit % 10);
                    calNdk[1]  = tjaRead.ndk[1] * ((ScoreInit - ScoreInit % 10) + (ScoreDiff - ScoreDiff % 10));
                    calNdk[2]  = tjaRead.ndk[2] * ((ScoreInit - ScoreInit % 10) + (ScoreDiff * 2 - ScoreDiff * 2 % 10));
                    calNdk[3]  = tjaRead.ndk[3] * ((ScoreInit - ScoreInit % 10) + (ScoreDiff * 4 - ScoreDiff * 4 % 10));
                    calNdk[4]  = tjaRead.ndk[4] * ((ScoreInit - ScoreInit % 10) + (ScoreDiff * 8 - ScoreDiff * 8 % 10));
                    calNtdk[0] = tjaRead.ntdk[0] * 2 * (ScoreInit - ScoreInit % 10);
                    calNtdk[1] = tjaRead.ntdk[1] * 2 * ((ScoreInit - ScoreInit % 10) + (ScoreDiff - ScoreDiff % 10));
                    calNtdk[2] = tjaRead.ntdk[2] * 2 * ((ScoreInit - ScoreInit % 10) + (ScoreDiff * 2 - ScoreDiff * 2 % 10));
                    calNtdk[3] = tjaRead.ntdk[3] * 2 * ((ScoreInit - ScoreInit % 10) + (ScoreDiff * 4 - ScoreDiff * 4 % 10));
                    calNtdk[4] = tjaRead.ntdk[4] * 2 * ((ScoreInit - ScoreInit % 10) + (ScoreDiff * 8 - ScoreDiff * 8 % 10));

                    calGdk[0]  = tjaRead.gdk[0] * (((ScoreInit - ScoreInit % 10) * 12 / 10) - (ScoreInit - (ScoreInit % 10) * 12 / 10) % 10);
                    calGdk[1]  = tjaRead.gdk[1] * (((ScoreInit - ScoreInit % 10 + (ScoreDiff - ScoreDiff % 10)) * 12 / 10) - ((ScoreInit - ScoreInit % 10 + (ScoreDiff - ScoreDiff % 10)) * 12 / 10) % 10);
                    calGdk[2]  = tjaRead.gdk[2] * (((ScoreInit - ScoreInit % 10 + (ScoreDiff * 2 - ScoreDiff * 2 % 10)) * 12 / 10) - ((ScoreInit - ScoreInit % 10 + (ScoreDiff * 2 - ScoreDiff * 2 % 10)) * 12 / 10) % 10);
                    calGdk[3]  = tjaRead.gdk[3] * (((ScoreInit - ScoreInit % 10 + (ScoreDiff * 4 - ScoreDiff * 4 % 10)) * 12 / 10) - ((ScoreInit - ScoreInit % 10 + (ScoreDiff * 4 - ScoreDiff * 4 % 10)) * 12 / 10) % 10);
                    calGdk[4]  = tjaRead.gdk[4] * (((ScoreInit - ScoreInit % 10 + (ScoreDiff * 8 - ScoreDiff * 8 % 10)) * 12 / 10) - ((ScoreInit - ScoreInit % 10 + (ScoreDiff * 8 - ScoreDiff * 8 % 10)) * 12 / 10) % 10);
                    calGtdk[0] = tjaRead.gtdk[0] * 2 * (((ScoreInit - ScoreInit % 10) * 12 / 10) - ((ScoreInit - ScoreInit % 10) * 12 / 10 % 10));
                    calGtdk[1] = tjaRead.gtdk[1] * 2 * (((ScoreInit - ScoreInit % 10 + (ScoreDiff - ScoreDiff % 10)) * 12 / 10) - (((ScoreInit - ScoreInit % 10 + (ScoreDiff - ScoreDiff % 10)) * 12 / 10) % 10));
                    calGtdk[2] = tjaRead.gtdk[2] * 2 * (((ScoreInit - ScoreInit % 10 + (ScoreDiff * 2 - ScoreDiff * 2 % 10)) * 12 / 10) - (((ScoreInit - ScoreInit % 10 + (ScoreDiff * 2 - ScoreDiff * 2 % 10)) * 12 / 10) % 10));
                    calGtdk[3] = tjaRead.gtdk[3] * 2 * (((ScoreInit - ScoreInit % 10 + (ScoreDiff * 4 - ScoreDiff * 4 % 10)) * 12 / 10) - (((ScoreInit - ScoreInit % 10 + (ScoreDiff * 4 - ScoreDiff * 4 % 10)) * 12 / 10) % 10));
                    calGtdk[4] = tjaRead.gtdk[4] * 2 * (((ScoreInit - ScoreInit % 10 + (ScoreDiff * 8 - ScoreDiff * 8 % 10)) * 12 / 10) - (((ScoreInit - ScoreInit % 10 + (ScoreDiff * 8 - ScoreDiff * 8 % 10)) * 12 / 10) % 10));

                    n = ((calNdk[0] + calNdk[1] + calNdk[2] + calNdk[3] + calNdk[4] + calNtdk[0] + calNtdk[1] + calNtdk[2] + calNtdk[3] + calNtdk[4] + calGdk[0] + calGdk[1] + calGdk[2] + calGdk[3] + calGdk[4] + calGtdk[0] + calGtdk[1] + calGtdk[2] + calGtdk[3] + calGtdk[4]) + (ComboBonus * 10000 + (tjaRead.baAmount[0] - tjaRead.baSum[0]) * 300 + (tjaRead.baAmount[1] - tjaRead.baSum[1]) * 360 + tjaRead.baSum[0] * 5000 + tjaRead.baSum[1] * 6000));
                    if (n > Score)
                    {
                        break;
                    }
                }

                #region 読み込み後テキスト
                mainForm.Total.Text      = tjaRead.tja0[1].Length.ToString();
                mainForm.Difficulty.Text = tjaRead.level.ToString();
                mainForm.ndk0.Text       = tjaRead.ndk[0].ToString();
                mainForm.ndk1.Text       = tjaRead.ndk[1].ToString();
                mainForm.ndk2.Text       = tjaRead.ndk[2].ToString();
                mainForm.ndk3.Text       = tjaRead.ndk[3].ToString();
                mainForm.ndk4.Text       = tjaRead.ndk[4].ToString();
                mainForm.ntdk0.Text      = tjaRead.ntdk[0].ToString();
                mainForm.ntdk1.Text      = tjaRead.ntdk[1].ToString();
                mainForm.ntdk2.Text      = tjaRead.ntdk[2].ToString();
                mainForm.ntdk3.Text      = tjaRead.ntdk[3].ToString();
                mainForm.ntdk4.Text      = tjaRead.ntdk[4].ToString();
                mainForm.gdk0.Text       = tjaRead.gdk[0].ToString();
                mainForm.gdk1.Text       = tjaRead.gdk[1].ToString();
                mainForm.gdk2.Text       = tjaRead.gdk[2].ToString();
                mainForm.gdk3.Text       = tjaRead.gdk[3].ToString();
                mainForm.gdk4.Text       = tjaRead.gdk[4].ToString();
                mainForm.gtdk0.Text      = tjaRead.gtdk[0].ToString();
                mainForm.gtdk1.Text      = tjaRead.gtdk[1].ToString();
                mainForm.gtdk2.Text      = tjaRead.gtdk[2].ToString();
                mainForm.gtdk3.Text      = tjaRead.gtdk[3].ToString();
                mainForm.gtdk4.Text      = tjaRead.gtdk[4].ToString();
                mainForm.textBox1.Text   = tjaRead.str[2];
                mainForm.TJAName.Text    = tjaRead.ofd.SafeFileName;
                mainForm.INITM.Text      = ScoreInit.ToString();
                mainForm.DIFFM.Text      = ScoreDiff.ToString();
                mainForm.re.Text         = ((calNdk[0] + calNdk[1] + calNdk[2] + calNdk[3] + calNdk[4] + calNtdk[0] + calNtdk[1] + calNtdk[2] + calNtdk[3] + calNtdk[4] + calGdk[0] + calGdk[1] + calGdk[2] + calGdk[3] + calGdk[4] + calGtdk[0] + calGtdk[1] + calGtdk[2] + calGtdk[3] + calGtdk[4]) + (ComboBonus * 10000 + (tjaRead.baAmount[0] - tjaRead.baSum[0]) * 300 + (tjaRead.baAmount[1] - tjaRead.baSum[1]) * 360 + tjaRead.baSum[0] * 5000 + tjaRead.baSum[1] * 6000)).ToString();
                mainForm.basum0.Text     = tjaRead.baSum[0].ToString();
                mainForm.basum1.Text     = tjaRead.baSum[1].ToString();
                mainForm.baamount0.Text  = tjaRead.baAmount[0].ToString();
                mainForm.baamount1.Text  = tjaRead.baAmount[1].ToString();
                #endregion

                bRead = true;
            }

            if (bRead)
            {
                mainForm.TJAReader.Text = "別のTJAファイルを読み込む";
            }
        }