protected override int getHougHitProb(BattleAtackKinds_Day kind, Mem_ship atk_ship, List <Mst_slotitem> atk_slot, int tekkouKind) { int num = 0; using (var enumerator = Enumerable.Select(atk_slot, (Mst_slotitem obj, int idx) => new { obj, idx }).GetEnumerator()) { while (enumerator.MoveNext()) { var current = enumerator.get_Current(); num += current.obj.Houm; } } double num2 = this.valance2 + Math.Sqrt((double)atk_ship.GetBattleBaseParam().Luck * 1.5) + Math.Sqrt((double)atk_ship.Level) * 2.0 + (double)num; BattleFormationKinds1 formation; BattleFormationKinds1 formation2; if (!atk_ship.IsEnemy()) { formation = this.F_Data.Formation; formation2 = this.E_Data.Formation; } else { formation = this.E_Data.Formation; formation2 = this.F_Data.Formation; } double formationParamF = this.formationData.GetFormationParamF2(FormationDatas.GetFormationKinds.HOUGEKI, formation, formation2); num2 *= formationParamF; FatigueState fatigueState = atk_ship.Get_FatigueState(); double num3 = 1.0; if (fatigueState == FatigueState.Exaltation) { num3 = 1.2; } else if (fatigueState == FatigueState.Light) { num3 = 0.8; } else if (fatigueState == FatigueState.Distress) { num3 = 0.5; } num2 *= num3; return((int)num2); }
protected override int getHougHitProb(BattleAtackKinds_Day kind, Mem_ship atk_ship, List <Mst_slotitem> atk_slot, int tekkouKind) { int num = 0; foreach (var item in atk_slot.Select((Mst_slotitem obj, int idx) => new { obj, idx })) { num += item.obj.Houm; } double num2 = valance2 + Math.Sqrt((double)atk_ship.GetBattleBaseParam().Luck * 1.5) + Math.Sqrt(atk_ship.Level) * 2.0 + (double)num; BattleFormationKinds1 formation; BattleFormationKinds1 formation2; if (!atk_ship.IsEnemy()) { formation = F_Data.Formation; formation2 = E_Data.Formation; } else { formation = E_Data.Formation; formation2 = F_Data.Formation; } double formationParamF = formationData.GetFormationParamF2(FormationDatas.GetFormationKinds.HOUGEKI, formation, formation2); num2 *= formationParamF; FatigueState fatigueState = atk_ship.Get_FatigueState(); double num3 = 1.0; switch (fatigueState) { case FatigueState.Exaltation: num3 = 1.2; break; case FatigueState.Light: num3 = 0.8; break; case FatigueState.Distress: num3 = 0.5; break; } num2 *= num3; return((int)num2); }
private Support_HouRai getHougekiData() { BattleBaseData f_Data = this.F_Data; BattleBaseData e_Data = this.E_Data; List <Mem_ship> list = Enumerable.ToList <Mem_ship>(e_Data.ShipData); list.RemoveAll((Mem_ship x) => x.Nowhp <= 0 || Mst_DataManager.Instance.Mst_stype.get_Item(x.Stype).IsSubmarine()); if (Enumerable.Count <Mem_ship>(list) == 0) { return(null); } Support_HouRai support_HouRai = new Support_HouRai(); int i = 0; while (i < this.F_Data.ShipData.get_Count()) { Mem_ship mem_ship = f_Data.ShipData.get_Item(i); List <Mst_slotitem> list2 = f_Data.SlotData.get_Item(i); BattleAtackKinds_Day kind = BattleAtackKinds_Day.Normal; if (base.IsAirAttackGroup(mem_ship, list2, BattleCommand.None)) { if (base.CanAirAtack_DamageState(mem_ship)) { if (base.CanAirAttack(mem_ship, list2)) { kind = BattleAtackKinds_Day.AirAttack; goto IL_CA; } } } else if (base.isValidHougeki(mem_ship)) { goto IL_CA; } IL_1B3: i++; continue; IL_CA: BattleDamageKinds battleDamageKinds = BattleDamageKinds.Normal; Mem_ship atackTarget = base.getAtackTarget(mem_ship, list, true, false, true, ref battleDamageKinds); if (atackTarget == null) { goto IL_1B3; } int deckIdx = this.E_SubInfo.get_Item(atackTarget.Rid).DeckIdx; int hougAttackValue = this.getHougAttackValue(kind, mem_ship, list2, atackTarget, 0); int soukou = atackTarget.Soukou; int hougHitProb = this.getHougHitProb(kind, mem_ship, list2, 0); int battleAvo = base.getBattleAvo(FormationDatas.GetFormationKinds.HOUGEKI, atackTarget); BattleHitStatus hitStatus = this.getHitStatus(hougHitProb, battleAvo, mem_ship, atackTarget, this.valance3, false); int num = this.setDamageValue(hitStatus, hougAttackValue, soukou, mem_ship, atackTarget, e_Data.LostFlag); support_HouRai.Damage[deckIdx] += num; if (hitStatus != BattleHitStatus.Miss && support_HouRai.Clitical[deckIdx] != BattleHitStatus.Clitical) { support_HouRai.Clitical[deckIdx] = hitStatus; } if (support_HouRai.DamageType[deckIdx] != BattleDamageKinds.Rescue) { support_HouRai.DamageType[deckIdx] = battleDamageKinds; goto IL_1B3; } goto IL_1B3; } return(support_HouRai); }
protected override int getHougAttackValue(BattleAtackKinds_Day kind, Mem_ship atk_ship, List <Mst_slotitem> atk_slot, Mem_ship def_ship, int tekkouKind) { int num = 150; int num2 = 0; int num3 = 0; using (var enumerator = Enumerable.Select(atk_slot, (Mst_slotitem obj, int idx) => new { obj, idx }).GetEnumerator()) { while (enumerator.MoveNext()) { var current = enumerator.get_Current(); num2 += current.obj.Baku; num3 += current.obj.Raig; } } double num4 = this.valance1 + (double)atk_ship.Houg; bool flag = Mst_DataManager.Instance.Mst_stype.get_Item(def_ship.Stype).IsLandFacillity(Mst_DataManager.Instance.Mst_ship.get_Item(def_ship.Ship_id).Soku); if (flag) { num4 *= this.getLandFacciilityKeisu(atk_slot); num3 = 0; } if (kind == BattleAtackKinds_Day.AirAttack) { int airAtackPow = this.getAirAtackPow(num2, num3); num4 += (double)airAtackPow; num4 = 25.0 + (double)((int)(num4 * 1.5)); } BattleFormationKinds1 formation; BattleFormationKinds2 battleFormation; if (!atk_ship.IsEnemy()) { formation = this.F_Data.Formation; battleFormation = this.F_Data.BattleFormation; BattleFormationKinds1 formation2 = this.E_Data.Formation; } else { formation = this.E_Data.Formation; battleFormation = this.E_Data.BattleFormation; BattleFormationKinds1 formation2 = this.F_Data.Formation; } double formationParamBattle = this.formationData.GetFormationParamBattle(FormationDatas.GetFormationKinds.HOUGEKI, battleFormation); double formationParamF = this.formationData.GetFormationParamF1(FormationDatas.GetFormationKinds.HOUGEKI, formation); num4 = num4 * formationParamBattle * formationParamF; DamageState damageState = atk_ship.Get_DamageState(); double num5 = 1.0; if (damageState == DamageState.Tyuuha) { num5 = 0.7; } else if (damageState == DamageState.Taiha) { num5 = 0.4; } num4 *= num5; if (num4 > (double)num) { num4 = (double)num + Math.Sqrt(num4 - (double)num); } return((int)num4); }
private BattleAttackKind _convertAttackTypeEnum(BattleAtackKinds_Day kind) { return((BattleAttackKind)kind); }
protected KeyValuePair <BattleAtackKinds_Day, List <int> > getSpAttackKind(Mem_ship ship, List <Mst_slotitem> slotitems) { if (slotitems.Count == 0) { return(new KeyValuePair <BattleAtackKinds_Day, List <int> >(BattleAtackKinds_Day.Normal, new List <int> { 0 })); } BattleAtackKinds_Day battleAtackKinds_Day = BattleAtackKinds_Day.Normal; List <int> ret_slotitem = new List <int>(); Func <List <Mst_slotitem>, KeyValuePair <BattleAtackKinds_Day, List <int> > > func = delegate(List <Mst_slotitem> x) { int hougSlotData = getHougSlotData(x); ret_slotitem.Add(hougSlotData); return(new KeyValuePair <BattleAtackKinds_Day, List <int> >(BattleAtackKinds_Day.Normal, ret_slotitem)); }; int num; BattleBaseData battleBaseData; Dictionary <int, BattleShipSubInfo> dictionary; if (ship.IsEnemy()) { num = seikuValue[1]; battleBaseData = E_Data; dictionary = E_SubInfo; } else { num = seikuValue[0]; battleBaseData = F_Data; dictionary = F_SubInfo; } if (num <= 1) { return(func(slotitems)); } if (ship.Get_DamageState() >= DamageState.Taiha) { return(func(slotitems)); } Dictionary <int, List <Mst_slotitem> > dictionary2 = new Dictionary <int, List <Mst_slotitem> >(); dictionary2.Add(1, new List <Mst_slotitem>()); dictionary2.Add(12, new List <Mst_slotitem>()); dictionary2.Add(10, new List <Mst_slotitem>()); dictionary2.Add(19, new List <Mst_slotitem>()); dictionary2.Add(4, new List <Mst_slotitem>()); Dictionary <int, List <Mst_slotitem> > dictionary3 = dictionary2; double num2 = 0.0; foreach (var item in slotitems.Select((Mst_slotitem obj, int idx) => new { obj, idx })) { int api_mapbattle_type = item.obj.Api_mapbattle_type3; num2 += (double)item.obj.Saku; switch (api_mapbattle_type) { case 1: case 2: case 3: dictionary3[1].Add(item.obj); continue; case 12: case 13: dictionary3[12].Add(item.obj); continue; case 10: case 11: if (ship.Onslot[item.idx] > 0) { dictionary3[10].Add(item.obj); continue; } break; } if (api_mapbattle_type == 19 || api_mapbattle_type == 4) { dictionary3[api_mapbattle_type].Add(item.obj); } } if (dictionary3[10].Count == 0 || dictionary3[1].Count == 0) { return(func(slotitems)); } double num3 = 0.0; foreach (var item2 in battleBaseData.ShipData.Select((Mem_ship obj, int ship_idx) => new { obj, ship_idx })) { if (item2.obj.IsFight()) { num3 += (double)item2.obj.GetBattleBaseParam().Sakuteki; List <Mst_slotitem> list = battleBaseData.SlotData[item2.ship_idx]; if (list.Count != 0) { foreach (var item3 in list.Select((Mst_slotitem obj, int slot_idx) => new { obj, slot_idx })) { int num4 = item2.obj.Onslot[item3.slot_idx]; if ((item3.obj.Api_mapbattle_type3 == 10 || item3.obj.Api_mapbattle_type3 == 11) && num4 > 0) { int num5 = item3.obj.Saku * (int)Math.Sqrt(num4); num3 += (double)num5; } } } } } double num6 = (int)(Math.Sqrt(num3) + num3 * 0.1); int num7 = (int)(Math.Sqrt(ship.GetBattleBaseParam().Luck) + 10.0); switch (num) { case 3: num7 = (int)((double)num7 + 10.0 + (num6 + num2 * 1.6) * 0.7); break; case 2: num7 = (int)((double)num7 + (num6 + num2 * 1.2) * 0.6); break; } if (dictionary[ship.Rid].DeckIdx == 0) { num7 += 15; } Dictionary <BattleAtackKinds_Day, int> dictionary4 = new Dictionary <BattleAtackKinds_Day, int>(); dictionary4.Add(BattleAtackKinds_Day.Sp4, 150); dictionary4.Add(BattleAtackKinds_Day.Sp3, 140); dictionary4.Add(BattleAtackKinds_Day.Sp2, 130); dictionary4.Add(BattleAtackKinds_Day.Sp1, 120); dictionary4.Add(BattleAtackKinds_Day.Renzoku, 130); Dictionary <BattleAtackKinds_Day, int> dictionary5 = dictionary4; if (dictionary3[1].Count >= 2 && dictionary3[19].Count >= 1 && num7 > randInstance.Next(dictionary5[BattleAtackKinds_Day.Sp4])) { ret_slotitem.Add(dictionary3[10][0].Id); ret_slotitem.Add(dictionary3[1][0].Id); ret_slotitem.Add(dictionary3[1][1].Id); battleAtackKinds_Day = BattleAtackKinds_Day.Sp4; } else if (dictionary3[4].Count >= 1 && dictionary3[19].Count >= 1 && num7 > randInstance.Next(dictionary5[BattleAtackKinds_Day.Sp3])) { ret_slotitem.Add(dictionary3[10][0].Id); ret_slotitem.Add(dictionary3[1][0].Id); ret_slotitem.Add(dictionary3[19][0].Id); battleAtackKinds_Day = BattleAtackKinds_Day.Sp3; } else if (dictionary3[4].Count >= 1 && dictionary3[12].Count >= 1 && num7 > randInstance.Next(dictionary5[BattleAtackKinds_Day.Sp2])) { ret_slotitem.Add(dictionary3[10][0].Id); ret_slotitem.Add(dictionary3[12][0].Id); ret_slotitem.Add(dictionary3[1][0].Id); battleAtackKinds_Day = BattleAtackKinds_Day.Sp2; } else if (dictionary3[4].Count >= 1 && num7 > randInstance.Next(dictionary5[BattleAtackKinds_Day.Sp1])) { ret_slotitem.Add(dictionary3[10][0].Id); ret_slotitem.Add(dictionary3[1][0].Id); ret_slotitem.Add(dictionary3[4][0].Id); battleAtackKinds_Day = BattleAtackKinds_Day.Sp1; } else if (dictionary3[1].Count >= 2 && num7 > randInstance.Next(dictionary5[BattleAtackKinds_Day.Renzoku])) { ret_slotitem.Add(dictionary3[1][0].Id); ret_slotitem.Add(dictionary3[1][1].Id); battleAtackKinds_Day = BattleAtackKinds_Day.Renzoku; } if (battleAtackKinds_Day == BattleAtackKinds_Day.Normal) { return(func(slotitems)); } return(new KeyValuePair <BattleAtackKinds_Day, List <int> >(battleAtackKinds_Day, ret_slotitem)); }
protected virtual int getHougHitProb(BattleAtackKinds_Day kind, Mem_ship atk_ship, List <Mst_slotitem> atk_slot, int tekkouKind) { double num = 0.0; BattleFormationKinds1 formation; BattleFormationKinds1 formation2; List <int> list; if (!atk_ship.IsEnemy()) { formation = F_Data.Formation; formation2 = E_Data.Formation; int deckIdx = F_SubInfo[atk_ship.Rid].DeckIdx; list = F_Data.SlotLevel[deckIdx]; num = (double)commandParams.Fspp / 100.0; } else { formation = E_Data.Formation; formation2 = F_Data.Formation; int deckIdx2 = E_SubInfo[atk_ship.Rid].DeckIdx; list = E_Data.SlotLevel[deckIdx2]; } double num2 = 0.0; int num3 = 0; foreach (var item in atk_slot.Select((Mst_slotitem obj, int idx) => new { obj, idx })) { num3 += item.obj.Houm; num2 += getHougSlotPlus_Hit(item.obj, list[item.idx]); } double num4 = Math.Sqrt((double)atk_ship.GetBattleBaseParam().Luck * 1.5) + Math.Sqrt(atk_ship.Level) * 2.0 + (double)num3; double num5 = valance2 + num4 + num2; double formationParamF = formationData.GetFormationParamF2(FormationDatas.GetFormationKinds.HOUGEKI, formation, formation2); num5 *= formationParamF; FatigueState fatigueState = atk_ship.Get_FatigueState(); double num6 = 1.0; switch (fatigueState) { case FatigueState.Exaltation: num6 = 1.2; break; case FatigueState.Light: num6 = 0.8; break; case FatigueState.Distress: num6 = 0.5; break; } num5 *= num6; num5 = getHougHitProbUpValue(num5, atk_ship, atk_slot); Dictionary <BattleAtackKinds_Day, double> dictionary = new Dictionary <BattleAtackKinds_Day, double>(); dictionary.Add(BattleAtackKinds_Day.Renzoku, 1.1); dictionary.Add(BattleAtackKinds_Day.Sp1, 1.3); dictionary.Add(BattleAtackKinds_Day.Sp2, 1.5); dictionary.Add(BattleAtackKinds_Day.Sp3, 1.3); dictionary.Add(BattleAtackKinds_Day.Sp4, 1.2); Dictionary <BattleAtackKinds_Day, double> dictionary2 = dictionary; if (dictionary2.ContainsKey(kind)) { num5 *= dictionary2[kind]; } num5 *= getTekkouKeisu_Hit(tekkouKind); double num7 = num5 * num; num5 += num7; return((int)num5); }
protected virtual int getHougAttackValue(BattleAtackKinds_Day kind, Mem_ship atk_ship, List <Mst_slotitem> atk_slot, Mem_ship def_ship, int tekkouKind) { int num = 150; List <int> list; BattleFormationKinds1 formation; BattleFormationKinds2 battleFormation; if (atk_ship.IsEnemy()) { int deckIdx = E_SubInfo[atk_ship.Rid].DeckIdx; list = E_Data.SlotLevel[deckIdx]; formation = E_Data.Formation; battleFormation = E_Data.BattleFormation; BattleFormationKinds1 formation2 = F_Data.Formation; } else { int deckIdx2 = F_SubInfo[atk_ship.Rid].DeckIdx; list = F_Data.SlotLevel[deckIdx2]; formation = F_Data.Formation; battleFormation = F_Data.BattleFormation; BattleFormationKinds1 formation3 = E_Data.Formation; } double num2 = 0.0; int num3 = 0; int num4 = 0; int num5 = 0; foreach (var item in atk_slot.Select((Mst_slotitem obj, int idx) => new { obj, idx })) { Mst_slotitem obj2 = item.obj; if (IsAtapSlotItem(obj2.Api_mapbattle_type3)) { num5++; } num3 += obj2.Baku; num4 += obj2.Raig; num2 += getHougSlotPlus_Attack(obj2, list[item.idx]); } double num6 = valance1 + (double)atk_ship.Houg + num2; if (Mst_DataManager.Instance.Mst_stype[def_ship.Stype].IsLandFacillity(Mst_DataManager.Instance.Mst_ship[def_ship.Ship_id].Soku)) { num6 *= getLandFacciilityKeisu(atk_slot); num6 += (double)getAtapKeisu(num5); num4 = 0; } if (kind == BattleAtackKinds_Day.AirAttack) { int airAtackPow = getAirAtackPow(num3, num4); num6 += (double)airAtackPow; num6 = 25.0 + (double)(int)(num6 * 1.5); } double formationParamBattle = formationData.GetFormationParamBattle(FormationDatas.GetFormationKinds.HOUGEKI, battleFormation); double formationParamF = formationData.GetFormationParamF1(FormationDatas.GetFormationKinds.HOUGEKI, formation); num6 = num6 * formationParamBattle * formationParamF; DamageState damageState = atk_ship.Get_DamageState(); double num7 = 1.0; switch (damageState) { case DamageState.Tyuuha: num7 = 0.7; break; case DamageState.Taiha: num7 = 0.4; break; } num6 *= num7; num6 += getHougItemAtackHosei(atk_ship, atk_slot); if (num6 > (double)num) { num6 = (double)num + Math.Sqrt(num6 - (double)num); } Dictionary <BattleAtackKinds_Day, double> dictionary = new Dictionary <BattleAtackKinds_Day, double>(); dictionary.Add(BattleAtackKinds_Day.Renzoku, 1.2); dictionary.Add(BattleAtackKinds_Day.Sp1, 1.1); dictionary.Add(BattleAtackKinds_Day.Sp2, 1.2); dictionary.Add(BattleAtackKinds_Day.Sp3, 1.3); dictionary.Add(BattleAtackKinds_Day.Sp4, 1.5); Dictionary <BattleAtackKinds_Day, double> dictionary2 = dictionary; if (dictionary2.ContainsKey(kind)) { num6 *= dictionary2[kind]; } num6 *= getTekkouKeisu_Attack(tekkouKind); return((int)num6); }
private Hougeki <BattleAtackKinds_Day> getAttackData(Mem_ship attacker, List <Mst_slotitem> attackerSlot, List <int> attackerSlotLevel, BattleAtackKinds_Day attackType, bool submarine_flag, KeyValuePair <int, int> submarine_keisu, List <Mem_ship> targetShips, List <bool> targetLostFlags, Dictionary <int, BattleShipSubInfo> targetSubInfo, int powerDownType) { BattleDamageKinds dKind = BattleDamageKinds.Normal; Mem_ship atackTarget = getAtackTarget(attacker, targetShips, overKill: false, submarine_flag, rescueFlag: true, ref dKind); if (atackTarget == null) { return(null); } int deckIdx = targetSubInfo[atackTarget.Rid].DeckIdx; Hougeki <BattleAtackKinds_Day> hougeki = new Hougeki <BattleAtackKinds_Day>(); hougeki.Attacker = attacker.Rid; hougeki.SpType = attackType; int num = (attackType != BattleAtackKinds_Day.Renzoku) ? 1 : 2; for (int i = 0; i < num; i++) { int soukou = atackTarget.Soukou; hougeki.Target.Add(atackTarget.Rid); int num2; int num3; FormationDatas.GetFormationKinds battleState; if (submarine_flag) { num2 = getSubmarineAttackValue(submarine_keisu, attacker, attackerSlot, attackerSlotLevel); num3 = getSubmarineHitProb(attacker, attackerSlot, attackerSlotLevel); battleState = FormationDatas.GetFormationKinds.SUBMARINE; } else { int tekkouKind = getTekkouKind(atackTarget.Stype, attackerSlot); num2 = getHougAttackValue(attackType, attacker, attackerSlot, atackTarget, tekkouKind); num3 = getHougHitProb(attackType, attacker, attackerSlot, tekkouKind); battleState = FormationDatas.GetFormationKinds.HOUGEKI; } int battleAvo = getBattleAvo(battleState, atackTarget); switch (powerDownType) { case 1: num2 = (int)((double)num2 * 0.55); num3 = (int)((double)num3 * 0.55); break; case 2: num3 = (int)((double)num3 * 0.55); break; } bool airAttack = (attackType == BattleAtackKinds_Day.AirAttack) ? true : false; BattleHitStatus battleHitStatus = getHitStatus(num3, battleAvo, attacker, atackTarget, valance3, airAttack); if (battleHitStatus == BattleHitStatus.Miss && enableSpType.Contains(attackType)) { battleHitStatus = BattleHitStatus.Normal; } int item = setDamageValue(battleHitStatus, num2, soukou, attacker, atackTarget, targetLostFlags); hougeki.Damage.Add(item); hougeki.Clitical.Add(battleHitStatus); hougeki.DamageKind.Add(dKind); } if (attacker.IsEnemy()) { RecoveryShip(deckIdx); } return(hougeki); }
private Hougeki <BattleAtackKinds_Day> getHougekiData(int atk_idx, Mem_ship attacker) { if (!attacker.IsFight()) { return(null); } BattleBaseData e_Data = E_Data; Dictionary <int, BattleShipSubInfo> e_SubInfo = E_SubInfo; Dictionary <int, BattleShipSubInfo> f_SubInfo = F_SubInfo; BattleBaseData f_Data = F_Data; if (!isAttackerFromTargetKind(e_SubInfo[attacker.Rid])) { return(null); } BattleAtackKinds_Day battleAtackKinds_Day = BattleAtackKinds_Day.Normal; List <int> slot_List = null; List <Mem_ship> list = f_Data.ShipData; KeyValuePair <int, int> subMarineAtackKeisu = getSubMarineAtackKeisu(list, attacker, e_Data.SlotData[atk_idx], midnight: false); bool submarine_flag = false; bool flag = IsAirAttackGroup(attacker, e_Data.SlotData[atk_idx], BattleCommand.None); if (flag && !CanAirAtack_DamageState(attacker)) { return(null); } if (subMarineAtackKeisu.Key != 0) { battleAtackKinds_Day = ((subMarineAtackKeisu.Key == 1) ? BattleAtackKinds_Day.Bakurai : BattleAtackKinds_Day.AirAttack); List <int> list2 = new List <int>(); list2.Add(0); slot_List = list2; submarine_flag = true; } else { if (flag) { if (!CanAirAttack(attacker, e_Data.SlotData[atk_idx])) { return(null); } battleAtackKinds_Day = BattleAtackKinds_Day.AirAttack; List <int> list2 = new List <int>(); list2.Add(0); slot_List = list2; if (!isValidAirAtack_To_LandFaccillity(attacker, e_Data.SlotData[atk_idx])) { List <Mem_ship> list3 = (from shipobj in list let soku = Mst_DataManager.Instance.Mst_ship[shipobj.Ship_id].Soku let land_flag = Mst_DataManager.Instance.Mst_stype[shipobj.Stype].IsLandFacillity(soku) where !land_flag select shipobj).ToList(); list = list3; } } else if (!isValidHougeki(attacker)) { return(null); } KeyValuePair <BattleAtackKinds_Day, List <int> > spAttackKind = getSpAttackKind(attacker, e_Data.SlotData[atk_idx]); if (battleAtackKinds_Day != BattleAtackKinds_Day.AirAttack || spAttackKind.Key != 0) { battleAtackKinds_Day = spAttackKind.Key; slot_List = spAttackKind.Value; } } Hougeki <BattleAtackKinds_Day> attackData = getAttackData(attacker, e_Data.SlotData[atk_idx], e_Data.SlotLevel[atk_idx], battleAtackKinds_Day, submarine_flag, subMarineAtackKeisu, list, f_Data.LostFlag, f_SubInfo, 0); if (attackData != null) { attackData.Slot_List = slot_List; } return(attackData); }
private Hougeki <BattleAtackKinds_Day> getHougekiData(BattleCommand command, int atk_idx, Mem_ship attacker) { if (!attacker.IsFight()) { return(null); } BattleBaseData f_Data = F_Data; Dictionary <int, BattleShipSubInfo> f_SubInfo = F_SubInfo; BattleBaseData e_Data = E_Data; Dictionary <int, BattleShipSubInfo> e_SubInfo = E_SubInfo; if (!isAttackerFromTargetKind(f_SubInfo[attacker.Rid])) { return(null); } Dictionary <int, Mst_stype> mst_stypes = Mst_DataManager.Instance.Mst_stype; Dictionary <int, Mst_ship> mst_ships = Mst_DataManager.Instance.Mst_ship; List <Mem_ship> shipData = e_Data.ShipData; bool submarine_flag = false; BattleAtackKinds_Day battleAtackKinds_Day = BattleAtackKinds_Day.Normal; List <int> slot_List = null; KeyValuePair <int, int> submarine_keisu = new KeyValuePair <int, int>(0, 0); bool flag = IsAirAttackGroup(attacker, f_Data.SlotData[atk_idx], command); if (flag && !CanAirAtack_DamageState(attacker)) { return(null); } int num = 0; if (command != BattleCommand.Taisen) { shipData = (from x in shipData where !mst_stypes[x.Stype].IsSubmarine() select x).ToList(); if (flag) { if (command != BattleCommand.Kouku) { return(null); } if (!CanAirAttack(attacker, f_Data.SlotData[atk_idx])) { return(null); } battleAtackKinds_Day = BattleAtackKinds_Day.AirAttack; List <int> list = new List <int>(); list.Add(0); slot_List = list; if (!isValidAirAtack_To_LandFaccillity(attacker, f_Data.SlotData[atk_idx])) { shipData = (from x in shipData where (!mst_stypes[x.Stype].IsLandFacillity(mst_ships[x.Ship_id].Soku)) ? true : false select x).ToList(); } } else if (!isValidHougeki(attacker)) { return(null); } if (!flag && command == BattleCommand.Kouku) { if (airAttackEndRid.Contains(attacker.Rid)) { return(null); } airAttackEndRid.Add(attacker.Rid); num = 2; int hougSlotData = getHougSlotData(f_Data.SlotData[atk_idx]); List <int> list = new List <int>(); list.Add(hougSlotData); slot_List = list; } } else { shipData = (from x in shipData where mst_stypes[x.Stype].IsSubmarine() select x).ToList(); submarine_keisu = getSubMarineAtackKeisu(shipData, attacker, f_Data.SlotData[atk_idx], midnight: false); if (submarine_keisu.Key == 0) { shipData = (from x in e_Data.ShipData where !mst_stypes[x.Stype].IsSubmarine() select x).ToList(); submarine_flag = false; num = 1; if (flag) { if (!CanAirAttack(attacker, f_Data.SlotData[atk_idx])) { return(null); } battleAtackKinds_Day = BattleAtackKinds_Day.AirAttack; List <int> list = new List <int>(); list.Add(0); slot_List = list; if (!isValidAirAtack_To_LandFaccillity(attacker, f_Data.SlotData[atk_idx])) { shipData = (from x in shipData where (!mst_stypes[x.Stype].IsLandFacillity(mst_ships[x.Ship_id].Soku)) ? true : false select x).ToList(); } } else if (!isValidHougeki(attacker)) { return(null); } if (!flag) { int hougSlotData2 = getHougSlotData(f_Data.SlotData[atk_idx]); List <int> list = new List <int>(); list.Add(hougSlotData2); slot_List = list; } } else { battleAtackKinds_Day = ((submarine_keisu.Key == 1) ? BattleAtackKinds_Day.Bakurai : BattleAtackKinds_Day.AirAttack); List <int> list = new List <int>(); list.Add(0); slot_List = list; submarine_flag = true; } } if (shipData.Count == 0) { return(null); } if (command != BattleCommand.Taisen && num == 0) { KeyValuePair <BattleAtackKinds_Day, List <int> > spAttackKind = getSpAttackKind(attacker, f_Data.SlotData[atk_idx]); if (battleAtackKinds_Day != BattleAtackKinds_Day.AirAttack || spAttackKind.Key != 0) { battleAtackKinds_Day = spAttackKind.Key; slot_List = spAttackKind.Value; } } Hougeki <BattleAtackKinds_Day> attackData = getAttackData(attacker, f_Data.SlotData[atk_idx], f_Data.SlotLevel[atk_idx], battleAtackKinds_Day, submarine_flag, submarine_keisu, shipData, e_Data.LostFlag, e_SubInfo, num); if (attackData != null) { attackData.Slot_List = slot_List; } return(attackData); }
private Support_HouRai getHougekiData() { BattleBaseData f_Data = F_Data; BattleBaseData e_Data = E_Data; List <Mem_ship> list = e_Data.ShipData.ToList(); list.RemoveAll(delegate(Mem_ship x) { if (x.Nowhp <= 0) { return(true); } return(Mst_DataManager.Instance.Mst_stype[x.Stype].IsSubmarine() ? true : false); }); if (list.Count() == 0) { return(null); } Support_HouRai support_HouRai = new Support_HouRai(); for (int i = 0; i < F_Data.ShipData.Count; i++) { Mem_ship mem_ship = f_Data.ShipData[i]; List <Mst_slotitem> list2 = f_Data.SlotData[i]; BattleAtackKinds_Day kind = BattleAtackKinds_Day.Normal; if (IsAirAttackGroup(mem_ship, list2, BattleCommand.None)) { if (!CanAirAtack_DamageState(mem_ship) || !CanAirAttack(mem_ship, list2)) { continue; } kind = BattleAtackKinds_Day.AirAttack; } else if (!isValidHougeki(mem_ship)) { continue; } BattleDamageKinds dKind = BattleDamageKinds.Normal; Mem_ship atackTarget = getAtackTarget(mem_ship, list, overKill: true, subMarineFlag: false, rescueFlag: true, ref dKind); if (atackTarget != null) { int deckIdx = E_SubInfo[atackTarget.Rid].DeckIdx; int hougAttackValue = getHougAttackValue(kind, mem_ship, list2, atackTarget, 0); int soukou = atackTarget.Soukou; int hougHitProb = getHougHitProb(kind, mem_ship, list2, 0); int battleAvo = getBattleAvo(FormationDatas.GetFormationKinds.HOUGEKI, atackTarget); BattleHitStatus hitStatus = getHitStatus(hougHitProb, battleAvo, mem_ship, atackTarget, valance3, airAttack: false); int num = setDamageValue(hitStatus, hougAttackValue, soukou, mem_ship, atackTarget, e_Data.LostFlag); support_HouRai.Damage[deckIdx] += num; if (hitStatus != 0 && support_HouRai.Clitical[deckIdx] != BattleHitStatus.Clitical) { support_HouRai.Clitical[deckIdx] = hitStatus; } if (support_HouRai.DamageType[deckIdx] != BattleDamageKinds.Rescue) { support_HouRai.DamageType[deckIdx] = dKind; } } } return(support_HouRai); }
protected override int getHougAttackValue(BattleAtackKinds_Day kind, Mem_ship atk_ship, List <Mst_slotitem> atk_slot, Mem_ship def_ship, int tekkouKind) { int num = 150; int num2 = 0; int num3 = 0; foreach (var item in atk_slot.Select((Mst_slotitem obj, int idx) => new { obj, idx })) { num2 += item.obj.Baku; num3 += item.obj.Raig; } double num4 = valance1 + (double)atk_ship.Houg; if (Mst_DataManager.Instance.Mst_stype[def_ship.Stype].IsLandFacillity(Mst_DataManager.Instance.Mst_ship[def_ship.Ship_id].Soku)) { num4 *= getLandFacciilityKeisu(atk_slot); num3 = 0; } if (kind == BattleAtackKinds_Day.AirAttack) { int airAtackPow = getAirAtackPow(num2, num3); num4 += (double)airAtackPow; num4 = 25.0 + (double)(int)(num4 * 1.5); } BattleFormationKinds1 formation; BattleFormationKinds2 battleFormation; if (!atk_ship.IsEnemy()) { formation = F_Data.Formation; battleFormation = F_Data.BattleFormation; BattleFormationKinds1 formation2 = E_Data.Formation; } else { formation = E_Data.Formation; battleFormation = E_Data.BattleFormation; BattleFormationKinds1 formation3 = F_Data.Formation; } double formationParamBattle = formationData.GetFormationParamBattle(FormationDatas.GetFormationKinds.HOUGEKI, battleFormation); double formationParamF = formationData.GetFormationParamF1(FormationDatas.GetFormationKinds.HOUGEKI, formation); num4 = num4 * formationParamBattle * formationParamF; DamageState damageState = atk_ship.Get_DamageState(); double num5 = 1.0; switch (damageState) { case DamageState.Tyuuha: num5 = 0.7; break; case DamageState.Taiha: num5 = 0.4; break; } num4 *= num5; if (num4 > (double)num) { num4 = (double)num + Math.Sqrt(num4 - (double)num); } return((int)num4); }