Beispiel #1
0
        private void updateShipPracticeEnemy(SerializableDictionary <int, int> getShipExp, ref SerializableDictionary <int, List <int> > lvupInfo)
        {
            List <Mem_ship>       shipData  = E_Data.ShipData;
            Dictionary <int, int> mst_level = mst_shiplevel;

            foreach (Mem_ship item in shipData)
            {
                Mem_ship     mem_ship     = Comm_UserDatas.Instance.User_ship[item.Rid];
                Mem_shipBase mem_shipBase = new Mem_shipBase(mem_ship);
                Mst_ship     mst_data     = Mst_DataManager.Instance.Mst_ship[mem_shipBase.Ship_id];
                int          addExp       = getShipExp[mem_ship.Rid];
                List <int>   lvupInfo2    = null;
                int          levelupInfo  = mem_ship.getLevelupInfo(mst_level, mem_shipBase.Level, mem_shipBase.Exp, ref addExp, out lvupInfo2);
                lvupInfo.Add(mem_ship.Rid, lvupInfo2);
                mem_shipBase.Level = levelupInfo;
                mem_shipBase.Exp  += addExp;
                int num = levelupInfo - mem_ship.Level;
                Dictionary <Mem_ship.enumKyoukaIdx, int> dictionary = mem_ship.Kyouka;
                for (int i = 0; i < num; i++)
                {
                    dictionary = mem_ship.getLevelupKyoukaValue(mem_ship.Ship_id, dictionary);
                }
                mem_shipBase.SetKyoukaValue(dictionary);
                mem_ship.SetRequireExp(mem_shipBase.Level, mst_level);
                mem_ship.Set_ShipParam(mem_shipBase, mst_data, enemy_flag: false);
            }
        }
Beispiel #2
0
        private Dictionary <int, List <int> > updateShip(DeckPracticeType type, Dictionary <int, int> getShipExp, Dictionary <int, PowUpInfo> powerUp)
        {
            Dictionary <int, List <int> > dictionary = new Dictionary <int, List <int> >();

            double[] array = this.useMaterial.get_Item(type);
            using (List <Mem_ship> .Enumerator enumerator = this.mem_ship.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    Mem_ship     current      = enumerator.get_Current();
                    int          rid          = current.Rid;
                    Mem_shipBase mem_shipBase = new Mem_shipBase(current);
                    Mst_ship     mst_data     = Mst_DataManager.Instance.Mst_ship.get_Item(mem_shipBase.Ship_id);
                    int          num          = getShipExp.get_Item(rid);
                    List <int>   list         = null;
                    int          levelupInfo  = current.getLevelupInfo(this.mstLevelShip, current.Level, current.Exp, ref num, out list);
                    getShipExp.set_Item(rid, num);
                    if (getShipExp.get_Item(rid) != 0)
                    {
                        mem_shipBase.Exp  += num;
                        mem_shipBase.Level = levelupInfo;
                    }
                    dictionary.Add(rid, list);
                    Dictionary <Mem_ship.enumKyoukaIdx, int> dictionary2 = current.Kyouka;
                    if (!powerUp.get_Item(current.Rid).IsAllZero())
                    {
                        this.addKyoukaValues(powerUp.get_Item(current.Rid), dictionary2);
                    }
                    int num2 = levelupInfo - current.Level;
                    for (int i = 0; i < num2; i++)
                    {
                        dictionary2 = current.getLevelupKyoukaValue(current.Ship_id, dictionary2);
                    }
                    mem_shipBase.SetKyoukaValue(dictionary2);
                    current.SetRequireExp(mem_shipBase.Level, this.mstLevelShip);
                    mem_shipBase.Fuel = (int)((double)mem_shipBase.Fuel - (double)mem_shipBase.Fuel * array[0]);
                    mem_shipBase.Bull = (int)((double)mem_shipBase.Bull - (double)mem_shipBase.Bull * array[1]);
                    if (mem_shipBase.Fuel < 0)
                    {
                        mem_shipBase.Fuel = 0;
                    }
                    if (mem_shipBase.Bull < 0)
                    {
                        mem_shipBase.Bull = 0;
                    }
                    current.Set_ShipParam(mem_shipBase, mst_data, false);
                }
            }
            return(dictionary);
        }
        private void updateRadingEscortShipExp(List <RadingResultData> radingData)
        {
            HashSet <int> radingArea = new HashSet <int>();

            if (radingData != null && radingData.get_Count() > 0)
            {
                radingData.ForEach(delegate(RadingResultData x)
                {
                    radingArea.Add(x.AreaId);
                });
            }
            Dictionary <int, int> mstLevel = ArrayMaster.GetMstLevel();

            using (Dictionary <int, Mem_esccort_deck> .ValueCollection.Enumerator enumerator = Comm_UserDatas.Instance.User_EscortDeck.get_Values().GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    Mem_esccort_deck current = enumerator.get_Current();
                    if (current.Ship.Count() > 0)
                    {
                        int             num     = (!radingArea.Contains(current.Maparea_id)) ? 2 : 1;
                        List <Mem_ship> memShip = current.Ship.getMemShip();
                        using (List <Mem_ship> .Enumerator enumerator2 = memShip.GetEnumerator())
                        {
                            while (enumerator2.MoveNext())
                            {
                                Mem_ship current2 = enumerator2.get_Current();
                                if (current2.IsFight() && !current2.IsBlingShip())
                                {
                                    double num2 = Math.Sqrt((double)current2.Level);
                                    int    num3 = 0;
                                    if (num == 1)
                                    {
                                        num3 = (int)(num2 * (20.0 + Utils.GetRandDouble(0.0, 80.0, 1.0, 1) + 0.5));
                                    }
                                    else
                                    {
                                        num3 = (int)(num2 * (1.0 + Utils.GetRandDouble(0.0, 3.0, 1.0, 1) + 0.5));
                                    }
                                    Mem_shipBase mem_shipBase = new Mem_shipBase(current2);
                                    List <int>   list         = new List <int>();
                                    int          levelupInfo  = current2.getLevelupInfo(mstLevel, mem_shipBase.Level, mem_shipBase.Exp, ref num3, out list);
                                    mem_shipBase.Level = levelupInfo;
                                    mem_shipBase.Exp  += num3;
                                    int num4 = levelupInfo - current2.Level;
                                    Dictionary <Mem_ship.enumKyoukaIdx, int> dictionary = current2.Kyouka;
                                    for (int i = 0; i < num4; i++)
                                    {
                                        dictionary = current2.getLevelupKyoukaValue(current2.Ship_id, dictionary);
                                    }
                                    mem_shipBase.SetKyoukaValue(dictionary);
                                    int num5 = 0;
                                    int num6 = 0;
                                    mstLevel.TryGetValue(mem_shipBase.Level - 1, ref num5);
                                    mstLevel.TryGetValue(mem_shipBase.Level + 1, ref num6);
                                    current2.SetRequireExp(mem_shipBase.Level, mstLevel);
                                    Mst_ship mst_data = Mst_DataManager.Instance.Mst_ship.get_Item(mem_shipBase.Ship_id);
                                    current2.Set_ShipParam(mem_shipBase, mst_data, false);
                                }
                            }
                        }
                    }
                }
            }
        }
Beispiel #4
0
        private void updateShip(BattleWinRankKinds rank, int mvpShip, SerializableDictionary <int, int> getShipExp, out SerializableDictionary <int, List <int> > lvupInfo)
        {
            lvupInfo = new SerializableDictionary <int, List <int> >();
            List <Mem_ship> shipData = F_Data.ShipData;
            int             count    = shipData.Count;
            bool            flag     = true;
            double          num      = 1.0;
            double          num2     = 0.0;

            if (!practiceFlag)
            {
                flag = E_Data.ShipData.Exists((Mem_ship x) => (!Mst_DataManager.Instance.Mst_stype[x.Stype].IsSubmarine()) ? true : false);
                if (!flag)
                {
                    num  = 0.25;
                    num2 = 0.5;
                }
            }
            Dictionary <int, int> dictionary = mst_shiplevel;

            for (int i = 0; i < count; i++)
            {
                Mem_ship     mem_ship     = shipData[i];
                Mem_shipBase mem_shipBase = new Mem_shipBase(mem_ship);
                Mst_ship     mst_ship     = Mst_DataManager.Instance.Mst_ship[mem_shipBase.Ship_id];
                int          addExp       = getShipExp[mem_ship.Rid];
                List <int>   lvupInfo2    = null;
                int          levelupInfo  = mem_ship.getLevelupInfo(dictionary, mem_shipBase.Level, mem_shipBase.Exp, ref addExp, out lvupInfo2);
                lvupInfo.Add(mem_ship.Rid, lvupInfo2);
                if (!mem_ship.Escape_sts)
                {
                    mem_shipBase.Level = levelupInfo;
                    mem_shipBase.Exp  += addExp;
                    mem_shipBase.Fuel -= mst_ship.Use_fuel;
                    if (mem_shipBase.Fuel < 0)
                    {
                        mem_shipBase.Fuel = 0;
                    }
                    int num3 = mst_ship.Use_bull;
                    if (battleKinds == ExecBattleKinds.DayToNight)
                    {
                        num3 = (int)Math.Ceiling((double)num3 * 1.5);
                    }
                    num3 = (int)((double)num3 * num + num2);
                    if (!flag && num3 <= 0)
                    {
                        num3 = 1;
                    }
                    mem_shipBase.Bull -= num3;
                    if (mem_shipBase.Bull < 0)
                    {
                        mem_shipBase.Bull = 0;
                    }
                    setCondSubValue(ref mem_shipBase.Cond);
                    bool mvp   = (mvpShip == mem_ship.Rid) ? true : false;
                    bool flag2 = (F_SubInfo[mem_ship.Rid].DeckIdx == 0) ? true : false;
                    setCondBonus(rank, flag2, mvp, ref mem_shipBase.Cond);
                    int num4 = levelupInfo - mem_ship.Level;
                    Dictionary <Mem_ship.enumKyoukaIdx, int> dictionary2 = mem_ship.Kyouka;
                    for (int j = 0; j < num4; j++)
                    {
                        dictionary2 = mem_ship.getLevelupKyoukaValue(mem_ship.Ship_id, dictionary2);
                    }
                    mem_shipBase.SetKyoukaValue(dictionary2);
                    if (mem_ship.Get_DamageState() >= DamageState.Tyuuha)
                    {
                        clothBrokenIds.Add(mem_ship.Ship_id);
                    }
                    if (practiceFlag)
                    {
                        mem_shipBase.Nowhp = F_Data.StartHp[i];
                    }
                    else if (mem_shipBase.Nowhp <= 0)
                    {
                        deleteTargetShip.Add(mem_ship);
                    }
                    int value  = 0;
                    int value2 = 0;
                    dictionary.TryGetValue(mem_shipBase.Level - 1, out value);
                    dictionary.TryGetValue(mem_shipBase.Level + 1, out value2);
                    mem_ship.SetRequireExp(mem_shipBase.Level, dictionary);
                    mem_ship.SumLovToBattle(rank, flag2, mvp, F_Data.StartHp[i], mem_ship.Nowhp);
                    mem_shipBase.Lov = mem_ship.Lov;
                    mem_ship.Set_ShipParam(mem_shipBase, mst_ship, enemy_flag: false);
                }
            }
        }