Example #1
0
        // ステージ2撃墜処理(基地航空隊)
        private static void St2LandBaseBreak(LandBase landBase, Fleet enemy, LandBaseAirsList landBaseAirsList, int ti, CutInType cutInType)
        {
            // 迎撃艦を一覧を算出し、それぞれの撃墜量を出す
            var breakPer   = enemy.BreakPer;
            var breakFixed = enemy.BreakFixed(cutInType);

            // 撃墜処理
            for (int wi = 0; wi < landBase.Team[ti].Weapon.Count; ++wi)
            {
                if (!landBase.Team[ti].Weapon[wi].IsStage2X)
                {
                    continue;
                }
                // 迎撃艦を選択する
                int selectKammusuIndex = RandInt(0, breakPer.Count - 1);
                // 割合撃墜
                if (RandInt(0, 1) == 1)
                {
                    int breakCount = (int)(breakPer[selectKammusuIndex] * landBaseAirsList[ti][wi]);
                    landBaseAirsList[ti][wi] -= breakCount;
                }
                // 固定撃墜
                if (RandInt(0, 1) == 1)
                {
                    int breakCount = breakFixed[selectKammusuIndex];
                    breakCount += CutInAddBonus[(int)cutInType];
                    landBaseAirsList[ti][wi] = Math.Max(landBaseAirsList[ti][wi] - breakCount, 0);
                }
            }
        }
Example #2
0
        // ステージ2撃墜処理(敵軍)
        private static void St2EnemyBreak(Fleet enemy, Fleet friend, int unitCount, AirsList enemyAirsList, CutInType cutInType)
        {
            // 迎撃艦を一覧を算出し、それぞれの撃墜量を出す
            var breakPer   = friend.BreakPer;
            var breakFixed = friend.BreakFixed(cutInType);

            // 撃墜処理
            for (int i = 0; i < unitCount; ++i)
            {
                for (int j = 0; j < enemy.Unit[i].Kammusu.Count; ++j)
                {
                    for (int k = 0; k < enemy.Unit[i].Kammusu[j].Weapon.Count; ++k)
                    {
                        if (!enemy.Unit[i].Kammusu[j].Weapon[k].IsStage2)
                        {
                            continue;
                        }
                        // 迎撃艦を選択する
                        int selectKammusuIndex = RandInt(0, breakPer.Count - 1);
                        // 割合撃墜
                        if (RandInt(0, 1) == 1)
                        {
                            int breakCount = (int)(breakPer[selectKammusuIndex] * enemyAirsList[i][j][k]);
                            enemyAirsList[i][j][k] -= breakCount;
                        }
                        // 固定撃墜
                        if (RandInt(0, 1) == 1)
                        {
                            int breakCount = breakFixed[selectKammusuIndex] + 1;
                            breakCount            += CutInAddBonus[(int)cutInType];
                            enemyAirsList[i][j][k] = Math.Max(enemyAirsList[i][j][k] - breakCount, 0);
                        }
                    }
                }
            }
        }