protected bool CanAirAttack(Mem_ship ship, List <Mst_slotitem> slotData) { if (!ship.IsFight()) { return(false); } HashSet <int> hashSet = new HashSet <int>(); hashSet.Add(7); hashSet.Add(8); HashSet <int> hashSet2 = hashSet; int num = 0; int num2 = 0; int num3 = 0; for (int i = 0; i < slotData.Count(); i++) { Mst_slotitem mst_slotitem = slotData[i]; if (mst_slotitem != null && hashSet2.Contains(mst_slotitem.Api_mapbattle_type3)) { num += ship.Onslot[i]; num2 += mst_slotitem.Baku; num3 += mst_slotitem.Raig; } } if (num <= 0) { return(false); } if (getAirAtackPow(num2, num3) <= 0) { return(false); } return(true); }
protected virtual double getHougSlotPlus_Attack(Mst_slotitem mstItem, int slotLevel) { double result = 0.0; if (slotLevel <= 0) { return(result); } if (mstItem.Api_mapbattle_type3 == 5 || mstItem.Api_mapbattle_type3 == 22) { return(result); } double num = 2.0; if (mstItem.Houg > 12) { num = 3.0; } if (mstItem.Api_mapbattle_type3 == 12 || mstItem.Api_mapbattle_type3 == 13 || mstItem.Api_mapbattle_type3 == 16 || mstItem.Api_mapbattle_type3 == 17 || mstItem.Api_mapbattle_type3 == 27 || mstItem.Api_mapbattle_type3 == 28) { num = 0.0; } else if (mstItem.Api_mapbattle_type3 == 14 || mstItem.Api_mapbattle_type3 == 15 || mstItem.Api_mapbattle_type3 == 40) { num = 1.5; } return(num * Math.Sqrt(slotLevel) * 0.5); }
private int getSyokusetuPlane(Dictionary <Mst_slotitem, HashSet <Mem_ship> > touchItems) { IOrderedEnumerable <Mst_slotitem> orderedEnumerable = Enumerable.OrderByDescending <Mst_slotitem, int>(touchItems.get_Keys(), (Mst_slotitem x) => x.Houm); using (IEnumerator <Mst_slotitem> enumerator = orderedEnumerable.GetEnumerator()) { while (enumerator.MoveNext()) { Mst_slotitem current = enumerator.get_Current(); Mst_slotitem mst_slotitem = current; using (HashSet <Mem_ship> .Enumerator enumerator2 = touchItems.get_Item(current).GetEnumerator()) { while (enumerator2.MoveNext()) { Mem_ship current2 = enumerator2.get_Current(); double num = Math.Sqrt((double)mst_slotitem.Saku); double num2 = Math.Sqrt((double)current2.Level); int num3 = (int)(num * num2); if (num3 > this.randInstance.Next(25)) { return(mst_slotitem.Id); } } } } } return(0); }
public static bool ValidFighter(Mst_slotitem mst_slot) { if (mst_slot.Api_mapbattle_type3 == 6 || mst_slot.Api_mapbattle_type3 == 7 || mst_slot.Api_mapbattle_type3 == 8 || mst_slot.Api_mapbattle_type3 == 11) { return(true); } return(false); }
protected virtual int getSyokusetuInfo(int seiku, BattleBaseData baseData) { int num = 0; List <Mst_slotitem> list = new List <Mst_slotitem>(); HashSet <int> hashSet = new HashSet <int>(); hashSet.Add(8); hashSet.Add(9); hashSet.Add(10); hashSet.Add(41); HashSet <int> hashSet2 = hashSet; foreach (var item in baseData.ShipData.Select((Mem_ship obj, int ship_idx) => new { obj, ship_idx })) { Mem_ship obj2 = item.obj; for (int i = 0; i < obj2.Onslot.Count(); i++) { if (obj2.Onslot[i] > 0 && obj2.Slot[i] > 0) { Mst_slotitem mst_slotitem = baseData.SlotData[item.ship_idx][i]; if (hashSet2.Contains(mst_slotitem.Api_mapbattle_type3)) { list.Add(mst_slotitem); } if (mst_slotitem.Api_mapbattle_type3 != 8) { num += (int)((double)mst_slotitem.Saku * Math.Sqrt(obj2.Onslot[i])); } } } } int maxValue = 70 - seiku * 15; if (num < randInstance.Next(maxValue)) { return(0); } int slotid = 0; int houm = -1; list.ForEach(delegate(Mst_slotitem x) { int num2 = randInstance.Next(20 - seiku * 2); if (houm < x.Houm && x.Saku > num2) { slotid = x.Id; houm = x.Houm; } }); return(slotid); }
public void UnsetSlot(Mst_slotitem unset_item) { Karyoku -= unset_item.Houg; Raisou -= unset_item.Raig; Sakuteki -= unset_item.Saku; Soukou -= unset_item.Souk; Taiku -= unset_item.Tyku; Taisen -= unset_item.Tais; Houm -= unset_item.Houm; Kaihi -= unset_item.Houk; }
public void ChangeSlot(Mst_slotitem pre_item, Mst_slotitem after_item) { Karyoku = after_item.Houg - pre_item.Houg; Raisou = after_item.Raig - pre_item.Raig; Sakuteki = after_item.Saku - pre_item.Saku; Soukou = after_item.Souk - pre_item.Souk; Taiku = after_item.Tyku - pre_item.Tyku; Taisen = after_item.Tais - pre_item.Tais; Houm = after_item.Houm - pre_item.Houm; Kaihi = after_item.Houk - pre_item.Houk; }
public void ChangeSlot(Mst_slotitem pre_item, Mst_slotitem after_item) { this.Karyoku = after_item.Houg - pre_item.Houg; this.Raisou = after_item.Raig - pre_item.Raig; this.Sakuteki = after_item.Saku - pre_item.Saku; this.Soukou = after_item.Souk - pre_item.Souk; this.Taiku = after_item.Tyku - pre_item.Tyku; this.Taisen = after_item.Tais - pre_item.Tais; this.Houm = after_item.Houm - pre_item.Houm; this.Kaihi = after_item.Houk - pre_item.Houk; }
public void UnsetSlot(Mst_slotitem unset_item) { this.Karyoku -= unset_item.Houg; this.Raisou -= unset_item.Raig; this.Sakuteki -= unset_item.Saku; this.Soukou -= unset_item.Souk; this.Taiku -= unset_item.Tyku; this.Taisen -= unset_item.Tais; this.Houm -= unset_item.Houm; this.Kaihi -= unset_item.Houk; }
public void SetSlot(int now_leng, Mst_slotitem set_item) { this.Karyoku = set_item.Houg; this.Raisou = set_item.Raig; this.Sakuteki = set_item.Saku; this.Soukou = set_item.Souk; this.Taiku = set_item.Tyku; this.Taisen = set_item.Tais; this.Houm = set_item.Houm; this.Kaihi = set_item.Houk; }
public void SetSlot(int now_leng, Mst_slotitem set_item) { Karyoku = set_item.Houg; Raisou = set_item.Raig; Sakuteki = set_item.Saku; Soukou = set_item.Souk; Taiku = set_item.Tyku; Taisen = set_item.Tais; Houm = set_item.Houm; Kaihi = set_item.Houk; }
protected virtual double getSlotPlus_Attack(Mst_slotitem mstItem, int slotLevel) { if (slotLevel <= 0) { return(0.0); } if (!this.enableRaigSlotPlusItems.Contains(mstItem.Api_mapbattle_type3)) { return(0.0); } return(Math.Sqrt((double)slotLevel) * 1.2); }
protected virtual double getSlotPlus_HitProb(Mst_slotitem mstItem, int slotLevel) { if (slotLevel <= 0) { return(0.0); } if (!enableRaigSlotPlusItems.Contains(mstItem.Api_mapbattle_type3)) { return(0.0); } return(Math.Sqrt(slotLevel) * 2.0); }
public ShipModel_Practice(Mem_ship mem_ship, List <Mst_slotitem> slotitems) : base(mem_ship) { this._slotitems = new List <ISlotitemModel>(); for (int i = 0; i < slotitems.get_Count(); i++) { Mst_slotitem mst = slotitems.get_Item(i); ISlotitemModel slotitemModel = new SlotitemModel_Battle(mst); this._slotitems.Add(slotitemModel); } while (this._slotitems.get_Count() < this.SlotCount) { this._slotitems.Add(null); } }
private double getSlotPlus_Attack(Mst_slotitem mstItem, int slotLevel) { double result = 0.0; if (slotLevel <= 0) { return(result); } if (this.disableSlotPlusAttackItems.Contains(mstItem.Api_mapbattle_type3)) { return(0.0); } return(Math.Sqrt((double)slotLevel)); }
public ShipModel_Practice(Mem_ship mem_ship, List <Mst_slotitem> slotitems) : base(mem_ship) { _slotitems = new List <ISlotitemModel>(); for (int i = 0; i < slotitems.Count; i++) { Mst_slotitem mst = slotitems[i]; ISlotitemModel item = new SlotitemModel_Battle(mst); _slotitems.Add(item); } while (_slotitems.Count < SlotCount) { _slotitems.Add(null); } }
protected virtual void battleBakurai(BattleBaseData attacker, BattleBaseData target, Dictionary <Mem_ship, List <FighterInfo> > fighter, ref BakuRaiInfo bakurai) { Mst_slotitem slotitem = (!attacker.ShipData[0].IsEnemy()) ? fTouchPlane : eTouchPlane; List <Mem_ship> list = target.ShipData.ToList(); list.RemoveAll((Mem_ship x) => (x.Nowhp <= 0) ? true : false); foreach (KeyValuePair <Mem_ship, List <FighterInfo> > item in fighter) { Mem_ship key = item.Key; foreach (FighterInfo item2 in item.Value) { if (key.Onslot[item2.SlotIdx] > 0 && item2.ValidBakurai()) { BattleDamageKinds dKind = BattleDamageKinds.Normal; Mem_ship atackTarget = getAtackTarget(key, list, overKill: true, subMarineFlag: false, rescueFlag: true, ref dKind); if (atackTarget != null) { int num = target.ShipData.IndexOf(atackTarget); int bakuraiAtkPow = getBakuraiAtkPow(item2, key.Onslot[item2.SlotIdx], atackTarget); bakuraiAtkPow = (int)((double)bakuraiAtkPow * getTouchPlaneKeisu(slotitem)); int soukou = atackTarget.Soukou; int hitPorb = getHitPorb(); int battleAvo = getBattleAvo(FormationDatas.GetFormationKinds.AIR, atackTarget); BattleHitStatus hitStatus = getHitStatus(hitPorb, battleAvo, key, atackTarget, 0.2, airAttack: true); int num2 = setDamageValue(hitStatus, bakuraiAtkPow, soukou, key, atackTarget, target.LostFlag); bakurai.Damage[num] += num2; BattleDamageKinds battleDamageKinds = dKind; if (battleDamageKinds == BattleDamageKinds.Rescue && bakurai.DamageType[num] != BattleDamageKinds.Rescue) { bakurai.DamageType[num] = BattleDamageKinds.Rescue; } if (bakurai.Clitical[num] != BattleHitStatus.Clitical && hitStatus == BattleHitStatus.Clitical) { bakurai.Clitical[num] = hitStatus; } if (item2.Kind == FighterInfo.FighterKinds.BAKU) { bakurai.IsBakugeki[num] = true; } else if (item2.Kind == FighterInfo.FighterKinds.RAIG) { bakurai.IsRaigeki[num] = true; } } } } } }
protected virtual double getTouchPlaneKeisu(Mst_slotitem slotitem) { if (slotitem == null) { return(1.0); } if (slotitem.Houm >= 3) { return(1.2); } if (slotitem.Houm == 2) { return(1.17); } return(1.12); }
public static FighterInfo.FighterKinds GetKind(Mst_slotitem mst_slot) { if (mst_slot.Api_mapbattle_type3 == 6) { return(FighterInfo.FighterKinds.FIGHTER); } if (mst_slot.Api_mapbattle_type3 == 7 || mst_slot.Api_mapbattle_type3 == 11) { return(FighterInfo.FighterKinds.BAKU); } if (mst_slot.Api_mapbattle_type3 == 8) { return(FighterInfo.FighterKinds.RAIG); } return((FighterInfo.FighterKinds) 0); }
private double getSlotPlus_HitProb(Mst_slotitem mstItem, int slotLevel) { double result = 0.0; if (slotLevel <= 0) { return(result); } if (disableSlotPlusHitItems.Contains(mstItem.Api_mapbattle_type3)) { return(0.0); } double num = (!enableSlotPlusHitDentan.Contains(mstItem.Api_mapbattle_type3) || mstItem.Houm < 3) ? 1.3 : 1.6; return(Math.Sqrt(slotLevel) * num); }
private bool isValidRaigeki(Mem_ship ship, List <Mst_slotitem> slotitems) { if (ship.Get_DamageState() > DamageState.Shouha || !ship.IsFight()) { return(false); } if (ship.GetBattleBaseParam().Raig <= 0) { return(false); } if (!ship.IsEnemy() || practiceFlag) { if (ship.Level >= 10 && Mst_DataManager.Instance.Mst_stype[ship.Stype].IsSubmarine()) { return(true); } if (slotitems == null || slotitems.Count == 0) { return(false); } Mst_slotitem item = Mst_DataManager.Instance.Mst_Slotitem[41]; if (slotitems.Contains(item)) { return(true); } return(false); } if (Mst_DataManager.Instance.Mst_stype[ship.Stype].IsSubmarine()) { Mst_ship mst_ship = Mst_DataManager.Instance.Mst_ship[ship.Ship_id]; return((mst_ship.Yomi.Equals("flagship") || mst_ship.Yomi.Equals("elite")) ? true : false); } if (slotitems == null || slotitems.Count == 0) { return(false); } Mst_slotitem item2 = Mst_DataManager.Instance.Mst_Slotitem[541]; if (slotitems.Contains(item2)) { return(true); } return(false); }
private double getShipTaikuPow(Mem_ship shipData, List <Mst_slotitem> mst_slotData, List <int> slotLevels) { double num; if (shipData.IsEnemy()) { num = Math.Sqrt(shipData.Taiku); } else { Ship_GrowValues battleBaseParam = shipData.GetBattleBaseParam(); num = (double)battleBaseParam.Taiku * 0.5; } double num2 = 0.0; double num3 = 0.0; for (int i = 0; i < mst_slotData.Count; i++) { Mst_slotitem mst_slotitem = mst_slotData[i]; if (mst_slotitem.Tyku > 0) { int slotLevel = slotLevels[i]; if (mst_slotitem.Type4 == 16 || mst_slotitem.Type4 == 30) { double a1Plus = getA1Plus(1, mst_slotitem.Tyku, slotLevel); num3 += a1Plus; num2 += (double)mst_slotitem.Tyku * 2.0; } else if (mst_slotitem.Type4 == 15) { double a1Plus2 = getA1Plus(2, mst_slotitem.Tyku, slotLevel); num3 += a1Plus2; num2 += (double)mst_slotitem.Tyku * 3.0; } else if (mst_slotitem.Type4 == 11) { num2 += (double)mst_slotitem.Tyku * 1.5; } } } return(num + num2 + num3); }
protected virtual double getHougSlotPlus_Hit(Mst_slotitem mstItem, int slotLevel) { double result = 0.0; if (slotLevel <= 0) { return(result); } if (mstItem.Api_mapbattle_type3 == 5 || mstItem.Api_mapbattle_type3 == 22) { return(result); } if ((mstItem.Api_mapbattle_type3 == 12 || mstItem.Api_mapbattle_type3 == 13) && mstItem.Houm > 2) { result = Math.Sqrt(slotLevel) * 1.7; } else if (mstItem.Api_mapbattle_type3 == 21 || mstItem.Api_mapbattle_type3 == 14 || mstItem.Api_mapbattle_type3 == 40 || mstItem.Api_mapbattle_type3 == 16 || mstItem.Api_mapbattle_type3 == 27 || mstItem.Api_mapbattle_type3 == 28 || mstItem.Api_mapbattle_type3 == 17 || mstItem.Api_mapbattle_type3 == 15) { result = Math.Sqrt(slotLevel); } return(result); }
private void setKindParam(Mst_slotitem mst_slot) { FighterInfo.FighterKinds kind = FighterInfo.GetKind(mst_slot); if (kind == FighterInfo.FighterKinds.FIGHTER) { this.Kind = kind; this.AttackShipPow = 0; return; } if (kind == FighterInfo.FighterKinds.BAKU) { this.Kind = kind; this.AttackShipPow = mst_slot.Baku; return; } if (kind == FighterInfo.FighterKinds.RAIG) { this.Kind = kind; this.AttackShipPow = mst_slot.Raig; return; } }
private void setKindParam(Mst_slotitem mst_slot) { FighterKinds kind = GetKind(mst_slot); switch (kind) { case FighterKinds.FIGHTER: Kind = kind; AttackShipPow = 0; break; case FighterKinds.BAKU: Kind = kind; AttackShipPow = mst_slot.Baku; break; case FighterKinds.RAIG: Kind = kind; AttackShipPow = mst_slot.Raig; break; } }
private int getSyokusetuPlane(Dictionary <Mst_slotitem, HashSet <Mem_ship> > touchItems) { IOrderedEnumerable <Mst_slotitem> orderedEnumerable = from x in touchItems.Keys orderby x.Houm descending select x; foreach (Mst_slotitem item in orderedEnumerable) { Mst_slotitem mst_slotitem = item; foreach (Mem_ship item2 in touchItems[item]) { double num = Math.Sqrt(mst_slotitem.Saku); double num2 = Math.Sqrt(item2.Level); int num3 = (int)(num * num2); if (num3 > randInstance.Next(25)) { return(mst_slotitem.Id); } } } return(0); }
private bool isValidRaigeki(Mem_ship ship, List <Mst_slotitem> slotitems) { if (ship.Get_DamageState() > DamageState.Shouha || !ship.IsFight()) { return(false); } if (ship.GetBattleBaseParam().Raig <= 0) { return(false); } if (!ship.IsEnemy() || this.practiceFlag) { if (ship.Level >= 10 && Mst_DataManager.Instance.Mst_stype.get_Item(ship.Stype).IsSubmarine()) { return(true); } if (slotitems == null || slotitems.get_Count() == 0) { return(false); } Mst_slotitem mst_slotitem = Mst_DataManager.Instance.Mst_Slotitem.get_Item(41); return(slotitems.Contains(mst_slotitem)); } else { if (Mst_DataManager.Instance.Mst_stype.get_Item(ship.Stype).IsSubmarine()) { Mst_ship mst_ship = Mst_DataManager.Instance.Mst_ship.get_Item(ship.Ship_id); return(mst_ship.Yomi.Equals("flagship") || mst_ship.Yomi.Equals("elite")); } if (slotitems == null || slotitems.get_Count() == 0) { return(false); } Mst_slotitem mst_slotitem2 = Mst_DataManager.Instance.Mst_Slotitem.get_Item(541); return(slotitems.Contains(mst_slotitem2)); } }
private double getSlotPlus_HitProb(Mst_slotitem mstItem, int slotLevel) { double result = 0.0; if (slotLevel <= 0) { return(result); } if (this.disableSlotPlusHitItems.Contains(mstItem.Api_mapbattle_type3)) { return(0.0); } double num; if (this.enableSlotPlusHitDentan.Contains(mstItem.Api_mapbattle_type3) && mstItem.Houm >= 3) { num = 1.6; } else { num = 1.3; } return(Math.Sqrt((double)slotLevel) * num); }
public BattleShipFmt(Mem_ship ship) { Id = ship.Rid; ShipId = ship.Ship_id; Level = ship.Level; NowHp = ship.Nowhp; MaxHp = ship.Maxhp; BattleParam = ship.GetBattleBaseParam().Copy(); EscapeFlag = ship.Escape_sts; Slot = new List <int>(); if (!ship.IsEnemy()) { ship.Slot.ForEach(delegate(int x) { int item = -1; if (Comm_UserDatas.Instance.User_slot.ContainsKey(x)) { item = Comm_UserDatas.Instance.User_slot[x].Slotitem_id; } Slot.Add(item); }); } else { ship.Slot.ForEach(delegate(int x) { Slot.Add(x); }); } Mst_slotitem mstSlotItemToExSlot = ship.GetMstSlotItemToExSlot(); if (mstSlotItemToExSlot != null) { ExSlot = mstSlotItemToExSlot.Id; } }
public BattleShipFmt(Mem_ship ship) { this.Id = ship.Rid; this.ShipId = ship.Ship_id; this.Level = ship.Level; this.NowHp = ship.Nowhp; this.MaxHp = ship.Maxhp; this.BattleParam = ship.GetBattleBaseParam().Copy(); this.EscapeFlag = ship.Escape_sts; this.Slot = new List <int>(); if (!ship.IsEnemy()) { ship.Slot.ForEach(delegate(int x) { int num = -1; if (Comm_UserDatas.Instance.User_slot.ContainsKey(x)) { num = Comm_UserDatas.Instance.User_slot.get_Item(x).Slotitem_id; } this.Slot.Add(num); }); } else { ship.Slot.ForEach(delegate(int x) { this.Slot.Add(x); }); } Mst_slotitem mstSlotItemToExSlot = ship.GetMstSlotItemToExSlot(); if (mstSlotItemToExSlot != null) { this.ExSlot = mstSlotItemToExSlot.Id; } }