public QuestLogicBase()
 {
     this.questData         = Comm_UserDatas.Instance.User_quest;
     this.mem_count         = Comm_UserDatas.Instance.User_questcount;
     this.mst_count         = Mst_DataManager.Instance.Mst_questcount;
     this.mst_counter_limit = ArrayMaster.GetQuestCounterLimit();
 }
Пример #2
0
 private void getClearShip(DifficultKind kind, BattleWinRankKinds rank, out ItemGetFmt out_items)
 {
     out_items = null;
     if (Utils.IsBattleWin(rank))
     {
         List <int> clearRewardShipList      = ArrayMaster.GetClearRewardShipList(kind);
         Dictionary <int, Mst_ship> mst_ship = Mst_DataManager.Instance.Mst_ship;
         int num = 0;
         foreach (int item in clearRewardShipList)
         {
             string targetYomi = mst_ship[item].Yomi;
             if (!Comm_UserDatas.Instance.User_ship.Values.Any(delegate(Mem_ship x)
             {
                 int ship_id = x.Ship_id;
                 string yomi = mst_ship[ship_id].Yomi;
                 return(yomi.Equals(targetYomi));
             }))
             {
                 num = item;
                 break;
             }
         }
         if (num != 0)
         {
             out_items          = new ItemGetFmt();
             out_items.Category = ItemGetKinds.Ship;
             out_items.Count    = 1;
             out_items.Id       = num;
         }
     }
 }
Пример #3
0
        public static void SetFleetLevel(int fleetLevel)
        {
            Mem_record user_record = Comm_UserDatas.Instance.User_record;

            if (user_record.Level == fleetLevel)
            {
                return;
            }
            Dictionary <int, int> mstLevelUser = ArrayMaster.GetMstLevelUser();
            int num = 0;

            if (!mstLevelUser.TryGetValue(fleetLevel, ref num))
            {
                return;
            }
            uint exp  = user_record.Exp;
            int  num2 = (int)((long)num - (long)((ulong)exp));

            if (num2 < 0)
            {
                user_record.GetType().InvokeMember("_level", 2084, null, user_record, new object[]
                {
                    1
                });
                user_record.GetType().InvokeMember("_exp", 2084, null, user_record, new object[]
                {
                    0u
                });
                num2 = num;
            }
            user_record.UpdateExp(num2, mstLevelUser);
        }
Пример #4
0
        public static void SetFleetLevel(int fleetLevel)
        {
            Mem_record user_record = Comm_UserDatas.Instance.User_record;

            if (user_record.Level == fleetLevel)
            {
                return;
            }
            Dictionary <int, int> mstLevelUser = ArrayMaster.GetMstLevelUser();
            int value = 0;

            if (mstLevelUser.TryGetValue(fleetLevel, out value))
            {
                uint exp = user_record.Exp;
                int  num = (int)(value - exp);
                if (num < 0)
                {
                    user_record.GetType().InvokeMember("_level", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.SetField, null, user_record, new object[1]
                    {
                        1
                    });
                    user_record.GetType().InvokeMember("_exp", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.SetField, null, user_record, new object[1]
                    {
                        0u
                    });
                    num = value;
                }
                user_record.UpdateExp(num, mstLevelUser);
            }
        }
        public void InitBookData()
        {
            IEnumerable <XElement> enumerable  = Utils.Xml_Result("mst_shiptext", "mst_shiptext", null);
            IEnumerable <XElement> enumerable2 = Utils.Xml_Result("mst_slotitemtext", "mst_slotitemtext", null);
            IEnumerable <XElement> enumerable3 = Utils.Xml_Result("mst_ship_class", "mst_ship_class", null);

            this.tempShipBookText = Enumerable.ToDictionary <XElement, int, string>(enumerable, (XElement key) => int.Parse(key.Element("Id").get_Value()), (XElement value) => value.Element("Sinfo").get_Value());
            this.tempSlotBookText = Enumerable.ToDictionary <XElement, int, string>(enumerable2, (XElement key) => int.Parse(key.Element("Id").get_Value()), (XElement value) => value.Element("Info").get_Value());
            this.tempShipClass    = Enumerable.ToDictionary <XElement, int, string>(enumerable3, (XElement key) => int.Parse(key.Element("Id").get_Value()), (XElement value) => value.Element("Name").get_Value());
            this.tempMstShipBook  = ArrayMaster.GetShipBookInfo();
        }
Пример #6
0
        public void InitBookData()
        {
            IEnumerable <XElement> source  = Utils.Xml_Result("mst_shiptext", "mst_shiptext", null);
            IEnumerable <XElement> source2 = Utils.Xml_Result("mst_slotitemtext", "mst_slotitemtext", null);
            IEnumerable <XElement> source3 = Utils.Xml_Result("mst_ship_class", "mst_ship_class", null);

            tempShipBookText = source.ToDictionary((XElement key) => int.Parse(key.Element("Id").Value), (XElement value) => value.Element("Sinfo").Value);
            tempSlotBookText = source2.ToDictionary((XElement key) => int.Parse(key.Element("Id").Value), (XElement value) => value.Element("Info").Value);
            tempShipClass    = source3.ToDictionary((XElement key) => int.Parse(key.Element("Id").Value), (XElement value) => value.Element("Name").Value);
            tempMstShipBook  = ArrayMaster.GetShipBookInfo();
        }
Пример #7
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);
                                }
                            }
                        }
                    }
                }
            }
        }