Exemplo n.º 1
0
        protected virtual int getBakuraiAtkPow(FighterInfo fighter, int fighterNum, Mem_ship target)
        {
            if (!fighter.ValidBakurai())
            {
                return(0);
            }
            Mst_ship  mst_ship  = Mst_DataManager.Instance.Mst_ship[target.Ship_id];
            Mst_stype mst_stype = Mst_DataManager.Instance.Mst_stype[target.Stype];
            int       num       = fighter.AttackShipPow;

            if (fighter.Kind == FighterInfo.FighterKinds.RAIG && mst_stype.IsLandFacillity(mst_ship.Soku))
            {
                num = 0;
            }
            int    num2 = 150;
            double num3 = valance3 + (double)num * Math.Sqrt(fighterNum);

            if (fighter.Kind == FighterInfo.FighterKinds.RAIG)
            {
                num3 *= 0.8 + (double)randInstance.Next(2) * 0.7;
            }
            if (num3 > (double)num2)
            {
                num3 = (double)num2 + Math.Sqrt(num3 - (double)num2);
            }
            return((int)num3);
        }
Exemplo n.º 2
0
        protected void setPlaneData(BattleBaseData baseData, Dictionary <int, BattleShipSubInfo> subInfo, List <int> planeFrom, out Dictionary <Mem_ship, List <FighterInfo> > fighterData)
        {
            fighterData = null;
            int count = baseData.ShipData.Count;

            if (count > 0)
            {
                Dictionary <Mem_ship, List <FighterInfo> > dictionary = new Dictionary <Mem_ship, List <FighterInfo> >();
                foreach (var item3 in baseData.SlotData.Select((List <Mst_slotitem> items, int idx) => new
                {
                    items,
                    idx
                }))
                {
                    Mem_ship mem_ship = baseData.ShipData[item3.idx];
                    if (mem_ship.IsFight() && isAttackerFromTargetKind(subInfo[mem_ship.Rid]))
                    {
                        bool flag = false;
                        dictionary.Add(mem_ship, new List <FighterInfo>());
                        foreach (var item4 in item3.items.Select((Mst_slotitem item, int slot_pos) => new
                        {
                            item,
                            slot_pos
                        }))
                        {
                            if (mem_ship.Onslot[item4.slot_pos] > 0 && FighterInfo.ValidFighter(item4.item))
                            {
                                FighterInfo item2 = new FighterInfo(item4.slot_pos, item4.item);
                                dictionary[mem_ship].Add(item2);
                                flag = true;
                            }
                        }
                        if (!flag)
                        {
                            dictionary.Remove(mem_ship);
                        }
                        else
                        {
                            planeFrom.Add(mem_ship.Rid);
                        }
                    }
                }
                if (dictionary.Count > 0)
                {
                    fighterData = dictionary;
                }
            }
        }
Exemplo n.º 3
0
 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;
     }
 }
Exemplo n.º 4
0
        private BattleSupportKinds Init(ref bool[] undressing)
        {
            if (mst_support_data == null)
            {
                return(BattleSupportKinds.None);
            }
            if (E_Data.ShipData.FirstOrDefault((Mem_ship x) => x.Nowhp > 0) == null)
            {
                return(BattleSupportKinds.None);
            }
            if (supportDeck == null)
            {
                return(BattleSupportKinds.None);
            }
            supportShips = supportDeck.Ship.getMemShip();
            Dictionary <int, int> dictionary  = new Dictionary <int, int>();
            Dictionary <int, int> dictionary2 = new Dictionary <int, int>();

            foreach (IGrouping <int, int> mst_support_datum in mst_support_data)
            {
                int key = mst_support_datum.Key;
                dictionary.Add(key, 0);
                foreach (int item in mst_support_datum)
                {
                    dictionary2.Add(item, key);
                }
            }
            int        num  = 0;
            int        num2 = 0;
            List <int> list = new List <int>();
            List <List <Mst_slotitem> > list2 = new List <List <Mst_slotitem> >();

            foreach (var item2 in supportShips.Select((Mem_ship obj, int ship_idx) => new
            {
                obj,
                ship_idx
            }))
            {
                int num3 = dictionary2[item2.obj.Stype];
                list.Add(item2.obj.Stype);
                Dictionary <int, int> dictionary3;
                Dictionary <int, int> dictionary4 = dictionary3 = dictionary;
                int key2;
                int key3 = key2 = num3;
                key2 = dictionary3[key2];
                dictionary4[key3] = key2 + 1;
                if (item2.obj.Get_FatigueState() == FatigueState.Exaltation)
                {
                    int num4 = (item2.ship_idx != 0) ? 5 : 15;
                    num2 += num4;
                }
                if (item2.obj.Get_DamageState() >= DamageState.Tyuuha)
                {
                    undressing[item2.ship_idx] = true;
                }
                List <Mst_slotitem> list3 = new List <Mst_slotitem>();
                foreach (var item3 in item2.obj.Slot.Select((int rid, int idx) => new
                {
                    rid,
                    idx
                }))
                {
                    if (item3.rid <= 0)
                    {
                        break;
                    }
                    Mst_slotitem value = null;
                    if (!Mst_DataManager.Instance.Mst_Slotitem.TryGetValue(Comm_UserDatas.Instance.User_slot[item3.rid].Slotitem_id, out value))
                    {
                        break;
                    }
                    list3.Add(value);
                    if (item2.obj.Onslot[item3.idx] > 0)
                    {
                        FighterInfo.FighterKinds kind = FighterInfo.GetKind(value);
                        if (kind == FighterInfo.FighterKinds.BAKU || kind == FighterInfo.FighterKinds.RAIG)
                        {
                            num++;
                        }
                    }
                }
                list2.Add(list3);
            }
            int num5 = (supportType != MissionType.SupportForward) ? (num2 + 85) : (50 + num2);

            if (num5 < randInstance.Next(100))
            {
                return(BattleSupportKinds.None);
            }
            _f_Data                 = new BattleBaseData(supportDeck, supportShips, list, list2);
            _f_Data.Formation       = BattleFormationKinds1.TanJuu;
            _f_Data.BattleFormation = E_Data.BattleFormation;
            List <Mem_ship> memShip = _f_Data.Deck.Ship.getMemShip();

            _f_SubInfo = new Dictionary <int, BattleShipSubInfo>();
            for (int i = 0; i < memShip.Count; i++)
            {
                BattleShipSubInfo value2 = new BattleShipSubInfo(i, memShip[i]);
                _f_SubInfo.Add(memShip[i].Rid, value2);
            }
            int num6  = dictionary[1];
            int num7  = dictionary[2];
            int num8  = dictionary[3];
            int num9  = dictionary[4];
            int num10 = dictionary[5];
            int num11 = dictionary[6];

            if (num6 >= 3 && num > 0)
            {
                return(BattleSupportKinds.AirAtack);
            }
            if (num7 >= 2)
            {
                return(BattleSupportKinds.Raigeki);
            }
            if (num8 + num9 >= 4)
            {
                return(BattleSupportKinds.Hougeki);
            }
            if (num10 + num11 >= 4)
            {
                return(BattleSupportKinds.Raigeki);
            }
            return(BattleSupportKinds.Hougeki);
        }
Exemplo n.º 5
0
        private BattleSupportKinds Init(ref bool[] undressing)
        {
            if (this.mst_support_data == null)
            {
                return(BattleSupportKinds.None);
            }
            if (Enumerable.FirstOrDefault <Mem_ship>(this.E_Data.ShipData, (Mem_ship x) => x.Nowhp > 0) == null)
            {
                return(BattleSupportKinds.None);
            }
            if (this.supportDeck == null)
            {
                return(BattleSupportKinds.None);
            }
            this.supportShips = this.supportDeck.Ship.getMemShip();
            Dictionary <int, int> dictionary  = new Dictionary <int, int>();
            Dictionary <int, int> dictionary2 = new Dictionary <int, int>();

            using (IEnumerator <IGrouping <int, int> > enumerator = this.mst_support_data.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    IGrouping <int, int> current = enumerator.get_Current();
                    int key = current.get_Key();
                    dictionary.Add(key, 0);
                    using (IEnumerator <int> enumerator2 = current.GetEnumerator())
                    {
                        while (enumerator2.MoveNext())
                        {
                            int current2 = enumerator2.get_Current();
                            dictionary2.Add(current2, key);
                        }
                    }
                }
            }
            int        num  = 0;
            int        num2 = 0;
            List <int> list = new List <int>();
            List <List <Mst_slotitem> > list2 = new List <List <Mst_slotitem> >();

            using (var enumerator3 = Enumerable.Select(this.supportShips, (Mem_ship obj, int ship_idx) => new
            {
                obj,
                ship_idx
            }).GetEnumerator())
            {
                while (enumerator3.MoveNext())
                {
                    var current3 = enumerator3.get_Current();
                    int num3     = dictionary2.get_Item(current3.obj.Stype);
                    list.Add(current3.obj.Stype);
                    Dictionary <int, int> dictionary3;
                    Dictionary <int, int> expr_16B = dictionary3 = dictionary;
                    int num4;
                    int expr_170 = num4 = num3;
                    num4 = dictionary3.get_Item(num4);
                    expr_16B.set_Item(expr_170, num4 + 1);
                    if (current3.obj.Get_FatigueState() == FatigueState.Exaltation)
                    {
                        int num5 = (current3.ship_idx != 0) ? 5 : 15;
                        num2 += num5;
                    }
                    if (current3.obj.Get_DamageState() >= DamageState.Tyuuha)
                    {
                        undressing[current3.ship_idx] = true;
                    }
                    List <Mst_slotitem> list3 = new List <Mst_slotitem>();
                    using (var enumerator4 = Enumerable.Select(current3.obj.Slot, (int rid, int idx) => new
                    {
                        rid,
                        idx
                    }).GetEnumerator())
                    {
                        while (enumerator4.MoveNext())
                        {
                            var current4 = enumerator4.get_Current();
                            if (current4.rid <= 0)
                            {
                                break;
                            }
                            Mst_slotitem mst_slotitem = null;
                            if (!Mst_DataManager.Instance.Mst_Slotitem.TryGetValue(Comm_UserDatas.Instance.User_slot.get_Item(current4.rid).Slotitem_id, ref mst_slotitem))
                            {
                                break;
                            }
                            list3.Add(mst_slotitem);
                            if (current3.obj.Onslot.get_Item(current4.idx) > 0)
                            {
                                FighterInfo.FighterKinds kind = FighterInfo.GetKind(mst_slotitem);
                                if (kind == FighterInfo.FighterKinds.BAKU || kind == FighterInfo.FighterKinds.RAIG)
                                {
                                    num++;
                                }
                            }
                        }
                    }
                    list2.Add(list3);
                }
            }
            int num6;

            if (this.supportType == MissionType.SupportForward)
            {
                num6 = 50 + num2;
            }
            else
            {
                num6 = num2 + 85;
            }
            if (num6 < this.randInstance.Next(100))
            {
                return(BattleSupportKinds.None);
            }
            this._f_Data                 = new BattleBaseData(this.supportDeck, this.supportShips, list, list2);
            this._f_Data.Formation       = BattleFormationKinds1.TanJuu;
            this._f_Data.BattleFormation = this.E_Data.BattleFormation;
            List <Mem_ship> memShip = this._f_Data.Deck.Ship.getMemShip();

            this._f_SubInfo = new Dictionary <int, BattleShipSubInfo>();
            for (int i = 0; i < memShip.get_Count(); i++)
            {
                BattleShipSubInfo battleShipSubInfo = new BattleShipSubInfo(i, memShip.get_Item(i));
                this._f_SubInfo.Add(memShip.get_Item(i).Rid, battleShipSubInfo);
            }
            int num7  = dictionary.get_Item(1);
            int num8  = dictionary.get_Item(2);
            int num9  = dictionary.get_Item(3);
            int num10 = dictionary.get_Item(4);
            int num11 = dictionary.get_Item(5);
            int num12 = dictionary.get_Item(6);

            if (num7 >= 3 && num > 0)
            {
                return(BattleSupportKinds.AirAtack);
            }
            if (num8 >= 2)
            {
                return(BattleSupportKinds.Raigeki);
            }
            if (num9 + num10 >= 4)
            {
                return(BattleSupportKinds.Hougeki);
            }
            if (num11 + num12 >= 4)
            {
                return(BattleSupportKinds.Raigeki);
            }
            return(BattleSupportKinds.Hougeki);
        }
Exemplo n.º 6
0
 protected override int getBakuraiAtkPow(FighterInfo fighter, int fighterNum, Mem_ship target)
 {
     return(base.getBakuraiAtkPow(fighter, fighterNum, target));
 }