Пример #1
0
        // サイズ揃えは揃った分だけ効果アップ
        private void CalculateSizeSpecial(ScoreData score)
        {
            int straightNum = 0;

            for (int type = 0; type < _fishList.Length; type++)
            {
                bool isStraight = true;
                for (int size = 0; size < _fishList[0].Length; size++)
                {
                    if (_fishList[type][size] <= 0)
                    {
                        isStraight = false;
                        break;
                    }
                }
                if (isStraight)
                {
                    ++straightNum;
                }
            }
            Debug.Assert(0 <= straightNum && straightNum <= Enum.GetValues(typeof(FishType)).Length);
            if (0 < straightNum)
            {
                score._sizeSpecial = SpecialInfo.Straight(straightNum);
            }
        }
Пример #2
0
        private void CalculateToroSpecial(ScoreData score)
        {
            if (0 < _fishList[(int)FishType.maguro][(int)SizeType.Large] &&
                0 < _fishList[(int)FishType.sake][(int)SizeType.Large] &&
                0 < _fishList[(int)FishType.mekaziki][(int)SizeType.Large])
            {
                score._toroSpecial = SpecialInfo.BigToro3Kan();
                return;
            }

            if (0 < _fishList[(int)FishType.maguro][(int)SizeType.Medium] &&
                0 < _fishList[(int)FishType.sake][(int)SizeType.Medium] &&
                0 < _fishList[(int)FishType.mekaziki][(int)SizeType.Medium])
            {
                score._toroSpecial = SpecialInfo.MidiumToro3Kan();
                return;
            }

            if (0 < _fishList[(int)FishType.maguro][(int)SizeType.Small] &&
                0 < _fishList[(int)FishType.maguro][(int)SizeType.Small] &&
                0 < _fishList[(int)FishType.sake][(int)SizeType.Small])
            {
                score._toroSpecial = SpecialInfo.SmallToro3Kan();
                return;
            }
        }
Пример #3
0
 private void SetColorScore(ScoreData scoreData)
 {
     for (int i = 0; i < _colorPanel.Count; i++)
     {
         Debug.Assert(_colorPanel.Count == scoreData._colorGetList.Length);
         _colorPanel[i].SetActive(scoreData._colorGetList[i]);
     }
     _colorScore.SetText(scoreData._colorScore.ToString());
 }
Пример #4
0
 private void CalculateMunielSpecial(ScoreData score)
 {
     int[] sake     = _fishList[(int)FishType.sake];
     int[] mekaziki = _fishList[(int)FishType.mekaziki];
     if (3 <= sake[(int)SizeType.Large] + _fishList[(int)FishType.sake][(int)SizeType.Medium] + _fishList[(int)FishType.sake][(int)SizeType.Small] &&
         3 <= mekaziki[(int)SizeType.Large] + _fishList[(int)FishType.mekaziki][(int)SizeType.Medium] + _fishList[(int)FishType.mekaziki][(int)SizeType.Small])
     {
         score._toroSpecial = SpecialInfo.MunielRush();
         return;
     }
 }
Пример #5
0
 private void CalculateTunaSpecial(ScoreData score)
 {
     int[] maguro   = _fishList[(int)FishType.maguro];
     int[] mekaziki = _fishList[(int)FishType.mekaziki];
     if (3 <= maguro[(int)SizeType.Large] + _fishList[(int)FishType.maguro][(int)SizeType.Medium] + _fishList[(int)FishType.maguro][(int)SizeType.Small] &&
         3 <= mekaziki[(int)SizeType.Large] + _fishList[(int)FishType.mekaziki][(int)SizeType.Medium] + _fishList[(int)FishType.mekaziki][(int)SizeType.Small])
     {
         score._toroSpecial = SpecialInfo.TunaRush();
         return;
     }
 }
Пример #6
0
 private void CalculateTatakiSpecial(ScoreData score)
 {
     int[] katsuo = _fishList[(int)FishType.katsuo];
     int[] maguro = _fishList[(int)FishType.maguro];
     int[] sake   = _fishList[(int)FishType.sake];
     if ((0 < katsuo[(int)SizeType.Large] && 0 < maguro[(int)SizeType.Large] && 0 < sake[(int)SizeType.Large]) ||
         (0 < katsuo[(int)SizeType.Medium] && 0 < maguro[(int)SizeType.Medium] && 0 < sake[(int)SizeType.Medium]) ||
         (0 < katsuo[(int)SizeType.Small] && 0 < maguro[(int)SizeType.Small] && 0 < sake[(int)SizeType.Small]))
     {
         score._tatakiSpecial = SpecialInfo.Tataki3Kind();
     }
 }
Пример #7
0
 private void SetFishScores(ScoreData scoreData)
 {
     for (int i = 0; i < _fishScoreS.Count; i++)
     {
         Debug.Assert(_fishScoreS.Count == scoreData._fishSNumList.Length);
         _fishScoreS[i].SetText(scoreData._fishSNumList[i].ToString());
     }
     for (int i = 0; i < _fishScoreM.Count; i++)
     {
         Debug.Assert(_fishScoreM.Count == scoreData._fishMNumList.Length);
         _fishScoreM[i].SetText(scoreData._fishMNumList[i].ToString());
     }
     for (int i = 0; i < _fishScoreL.Count; i++)
     {
         Debug.Assert(_fishScoreL.Count == scoreData._fishLNumList.Length);
         _fishScoreL[i].SetText(scoreData._fishLNumList[i].ToString());
     }
     for (int i = 0; i < _fishScoreSum.Count; i++)
     {
         Debug.Assert(_fishScoreSum.Count == scoreData._fishScoreSumList.Length);
         _fishScoreSum[i].SetText(scoreData._fishScoreSumList[i].ToString());
     }
 }
Пример #8
0
        // 捕獲した魚情報からあれこれ計算してスコアを計算する処理
        public ScoreData CalculateScore()
        {
            var score = new ScoreData();

            // 魚の数を反映
            Debug.Assert(score._fishSNumList.Length == _fishList.Length, $"{score._fishSNumList.Length} == ${_fishList.Length}");
            for (int i = 0; i < score._fishSNumList.Length; i++)
            {
                score._fishSNumList[i] = _fishList[i][0];
            }
            Debug.Assert(score._fishMNumList.Length == _fishList.Length, $"{score._fishMNumList.Length} == ${_fishList.Length}");
            for (int i = 0; i < score._fishMNumList.Length; i++)
            {
                score._fishMNumList[i] = _fishList[i][1];
            }
            Debug.Assert(score._fishLNumList.Length == _fishList.Length, $"{score._fishLNumList.Length} == ${_fishList.Length}");
            for (int i = 0; i < score._fishLNumList.Length; i++)
            {
                score._fishLNumList[i] = _fishList[i][2];
            }

            // 魚種類ごとの合計スコアを計算して反映
            for (int fishType = 0; fishType < _fishList.Length; fishType++)
            {
                int scoreSum = 0;
                for (int sizeType = 0; sizeType < _fishList[0].Length; sizeType++)
                {
                    scoreSum += kBaseScore[fishType] * (sizeType + 1) * _fishList[fishType][sizeType];
                }
                score._fishScoreSumList[fishType] = scoreSum;
            }
            // 色の獲得状況を反映
            for (int i = 0; i < score._colorGetList.Length; i++)
            {
                score._colorGetList[i] = _colorList[i];
            }
            // 色の獲得状況に応じたスコアを計算して反映
            foreach (var isGet in score._colorGetList)
            {
                if (isGet)
                {
                    score._colorScore += kEachColorScore;
                }
            }

            //-----------
            // 役判定
            CalculateColorSpecial(score);
            CalculateSizeSpecial(score);
            CalculateToroSpecial(score);
            CalculateMunielSpecial(score);
            CalculateTatakiSpecial(score);
            CalculateTunaSpecial(score);
            //-----------

            // 基本スコアを合計
            foreach (var fishScore in score._fishScoreSumList)
            {
                score._total += fishScore;
            }
            score._total += score._colorScore;

            // 役によるボーナスを反映
            float scoreTotalFloat = score._total;

            scoreTotalFloat *= score._colorSpecial._bonusRate;
            scoreTotalFloat *= score._sizeSpecial._bonusRate;
            scoreTotalFloat *= score._toroSpecial._bonusRate;
            scoreTotalFloat *= score._munielSpecial._bonusRate;
            scoreTotalFloat *= score._tatakiSpecial._bonusRate;
            scoreTotalFloat *= score._specialSpecial._bonusRate;
            score._total     = Mathf.RoundToInt(scoreTotalFloat);

            return(score);
        }
Пример #9
0
        // 色に関する役は一番効果が高いやつひとつだけ採用
        private void CalculateColorSpecial(ScoreData score)
        {
            // レインボーALL判定
            if (_colorList[(int)ColorType.Blue] &&
                _colorList[(int)ColorType.Yellow] &&
                _colorList[(int)ColorType.Red] &&
                _colorList[(int)ColorType.Green] &&
                _colorList[(int)ColorType.Orange] &&
                _colorList[(int)ColorType.Indigo] &&
                _colorList[(int)ColorType.Violet] &&
                !_colorList[(int)ColorType.White] &&
                !_colorList[(int)ColorType.Gray] &&
                !_colorList[(int)ColorType.Black])
            {
                score._colorSpecial = SpecialInfo.RainbowAll();
                return;
            }

            // モノクロALL判定
            if (!_colorList[(int)ColorType.Blue] &&
                !_colorList[(int)ColorType.Yellow] &&
                !_colorList[(int)ColorType.Red] &&
                !_colorList[(int)ColorType.Green] &&
                !_colorList[(int)ColorType.Orange] &&
                !_colorList[(int)ColorType.Indigo] &&
                !_colorList[(int)ColorType.Violet] &&
                _colorList[(int)ColorType.White] &&
                _colorList[(int)ColorType.Gray] &&
                _colorList[(int)ColorType.Black])
            {
                score._colorSpecial = SpecialInfo.MonochromeAll();
                return;
            }

            // レインボー判定
            if (_colorList[(int)ColorType.Blue] &&
                _colorList[(int)ColorType.Yellow] &&
                _colorList[(int)ColorType.Red] &&
                _colorList[(int)ColorType.Green] &&
                _colorList[(int)ColorType.Orange] &&
                _colorList[(int)ColorType.Indigo] &&
                _colorList[(int)ColorType.Violet])
            {
                score._colorSpecial = SpecialInfo.Rainbow();
                return;
            }

            // モノクロ判定
            if (_colorList[(int)ColorType.White] &&
                _colorList[(int)ColorType.Gray] &&
                _colorList[(int)ColorType.Black])
            {
                score._colorSpecial = SpecialInfo.Monochrome();
                return;
            }

            // RGB判定
            if (_colorList[(int)ColorType.Blue] &&
                _colorList[(int)ColorType.Red] &&
                _colorList[(int)ColorType.Green])
            {
                score._colorSpecial = SpecialInfo.RGB();
                return;
            }

            // 信号機判定
            if ((_colorList[(int)ColorType.Blue] ||
                 _colorList[(int)ColorType.Green]) &&
                _colorList[(int)ColorType.Yellow] &&
                _colorList[(int)ColorType.Red])
            {
                score._colorSpecial = SpecialInfo.TrafficLight();
                return;
            }
        }
Пример #10
0
 private void SetColorSpecial(ScoreData scoreData)
 {
     _colorSpecial.SetText(scoreData._colorSpecial._text);
 }
Пример #11
0
 private void SetSpecialSpecial(ScoreData scoreData)
 {
     _specialSpecial.SetText(scoreData._specialSpecial._text);
 }
Пример #12
0
 private void SetTunaSpecial(ScoreData scoreData)
 {
     _tunaSpecial.SetText(scoreData._tunaSpecial._text);
 }
Пример #13
0
 private void SetTatakiSpecial(ScoreData scoreData)
 {
     _tatakiSpecial.SetText(scoreData._tatakiSpecial._text);
 }
Пример #14
0
 private void SetMunielSpecial(ScoreData scoreData)
 {
     _munielSpecial.SetText(scoreData._munielSpecial._text);
 }
Пример #15
0
 private void SetToroSpecial(ScoreData scoreData)
 {
     _toroSpecial.SetText(scoreData._toroSpecial._text);
 }