示例#1
0
        private void updateRadingEscortShipExp(List <RadingResultData> radingData)
        {
            HashSet <int> radingArea = new HashSet <int>();

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

            foreach (Mem_esccort_deck value3 in Comm_UserDatas.Instance.User_EscortDeck.Values)
            {
                if (value3.Ship.Count() > 0)
                {
                    int             num     = radingArea.Contains(value3.Maparea_id) ? 1 : 2;
                    List <Mem_ship> memShip = value3.Ship.getMemShip();
                    foreach (Mem_ship item in memShip)
                    {
                        if (item.IsFight() && !item.IsBlingShip())
                        {
                            double       num2         = Math.Sqrt(item.Level);
                            int          addExp       = (num != 1) ? ((int)(num2 * (1.0 + Utils.GetRandDouble(0.0, 3.0, 1.0, 1) + 0.5))) : ((int)(num2 * (20.0 + Utils.GetRandDouble(0.0, 80.0, 1.0, 1) + 0.5)));
                            Mem_shipBase mem_shipBase = new Mem_shipBase(item);
                            List <int>   lvupInfo     = new List <int>();
                            int          num3         = mem_shipBase.Level = item.getLevelupInfo(mstLevel, mem_shipBase.Level, mem_shipBase.Exp, ref addExp, out lvupInfo);
                            mem_shipBase.Exp += addExp;
                            int num4 = num3 - item.Level;
                            Dictionary <Mem_ship.enumKyoukaIdx, int> dictionary = item.Kyouka;
                            for (int i = 0; i < num4; i++)
                            {
                                dictionary = item.getLevelupKyoukaValue(item.Ship_id, dictionary);
                            }
                            mem_shipBase.SetKyoukaValue(dictionary);
                            int value  = 0;
                            int value2 = 0;
                            mstLevel.TryGetValue(mem_shipBase.Level - 1, out value);
                            mstLevel.TryGetValue(mem_shipBase.Level + 1, out value2);
                            item.SetRequireExp(mem_shipBase.Level, mstLevel);
                            Mst_ship mst_data = Mst_DataManager.Instance.Mst_ship[mem_shipBase.Ship_id];
                            item.Set_ShipParam(mem_shipBase, mst_data, enemy_flag: false);
                        }
                    }
                }
            }
        }
        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);
                                }
                            }
                        }
                    }
                }
            }
        }