// ステージ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); } } }
// LandBaseAirsList private static void CopyAirsList(LandBaseAirsList src, LandBaseAirsList dst) { for (int i = 0; i < src.Count; ++i) { for (int j = 0; j < src[i].Count; ++j) { dst[i][j] = src[i][j]; } } }
private static int NowAirValueX(LandBase landBase, LandBaseAirsList landBaseAirsList, int ti) { int airValue = 0; var weaponList = landBase.Team[ti].Weapon; for (int wi = 0; wi < landBase.Team[ti].Airs.Count; ++wi) { airValue += weaponList[wi].AirValueX(landBaseAirsList[ti][wi]); } return(airValue); }
// ステージ1撃墜処理(基地航空隊) private static void St1LandBaseBreak(LandBase landBase, LandBaseAirsList landBaseAirsList, int ti, AirWarStatus airWarStatus) { for (int wi = 0; wi < landBase.Team[ti].Weapon.Count; ++wi) { if (!landBase.Team[ti].Weapon[wi].IsStage1X) { continue; } int breakCount = landBaseAirsList[ti][wi] * RandInt(St1FriendBreakMin[(int)airWarStatus], St1FriendBreakMax[(int)airWarStatus]) / 256; landBaseAirsList[ti][wi] -= breakCount; } }
// LandBaseListとLeaveLandBaseAirsListをLandBaseAirsListから作成する private static void MakeLists(LandBaseAirsList airsList, out LandBaseList landBaseList, out LeaveLandBaseAirsList landBaseLeaveAirsList) { landBaseList = new LandBaseList(); landBaseLeaveAirsList = new LeaveLandBaseAirsList(); for (int i = 0; i < airsList.Count; ++i) { var tempList = new List <List <int> >(); landBaseList.Add(0); for (int j = 0; j < airsList[i].Count; ++j) { var tempList2 = Enumerable.Repeat(0, airsList[i][j] + 1).ToList(); tempList.Add(tempList2); } landBaseLeaveAirsList.Add(tempList); } }
// 記録する private static void MemoLeaveList(LandBase landBase, LandBaseAirsList landBaseAirsList, LandBaseList landBaseList, LeaveLandBaseAirsList landBaseLeaveAirsList) { for (int ti = 0; ti < landBaseAirsList.Count; ++ti) { bool allBrokenFlg = true; bool hasPAPBWB = false; for (int wi = 0; wi < landBase.Team[ti].Weapon.Count; ++wi) { if (landBase.Team[ti].Weapon[wi].IsStage2X) { hasPAPBWB = true; if (landBaseAirsList[ti][wi] != 0) { allBrokenFlg = false; } } ++landBaseLeaveAirsList[ti][wi][landBaseAirsList[ti][wi]]; } if (allBrokenFlg && hasPAPBWB) { ++landBaseList[ti]; } } }