Exemplo n.º 1
0
        public List <TenTreasureInfo> GetTreasureList()
        {
            List <TenTreasureInfo> templist        = new List <TenTreasureInfo>();
            IEnumerable <XElement> TranslationList = GetTranslationList(TranslationType.TenTreasure);

            foreach (var item in TranslationList)
            {
                TenTreasureInfo temp = new TenTreasureInfo();

                temp.Name      = ElementOutput(item, "ItemName");
                temp.Proto     = Convert.ToInt32(ElementOutput(item, "Proto"));
                temp.Rust      = Convert.ToInt32(ElementOutput(item, "Rust"));
                temp.Element   = Convert.ToInt32(ElementOutput(item, "Element"));
                temp.First     = Convert.ToInt32(ElementOutput(item, "First"));
                temp.Second    = Convert.ToInt32(ElementOutput(item, "Second"));
                temp.Third     = Convert.ToInt32(ElementOutput(item, "Third"));
                temp.Fourth    = Convert.ToInt32(ElementOutput(item, "Fourth"));
                temp.Fifth     = Convert.ToInt32(ElementOutput(item, "Fifth"));
                temp.Sixth     = Convert.ToInt32(ElementOutput(item, "Sixth"));
                temp.ElementID = Convert.ToInt32(ElementOutput(item, "ElementID"));
                temp.Origin    = Convert.ToInt32(ElementOutput(item, "Origin"));

                templist.Add(temp);
            }

            return(templist);
        }
Exemplo n.º 2
0
        public List<TenTreasureInfo> GetTreasureList()
        {
            List<TenTreasureInfo> templist = new List<TenTreasureInfo>();
            IEnumerable<XElement> TranslationList = GetTranslationList(TranslationType.TenTreasure);
            foreach (var item in TranslationList)
            {
                TenTreasureInfo temp = new TenTreasureInfo();

                temp.Name = ElementOutput(item, "ItemName");
                temp.Proto = Convert.ToInt32(ElementOutput(item, "Proto"));
                temp.Rust = Convert.ToInt32(ElementOutput(item, "Rust"));
                temp.Element = Convert.ToInt32(ElementOutput(item, "Element"));
                temp.First = Convert.ToInt32(ElementOutput(item, "First"));
                temp.Second = Convert.ToInt32(ElementOutput(item, "Second"));
                temp.Third = Convert.ToInt32(ElementOutput(item, "Third"));
                temp.Fourth = Convert.ToInt32(ElementOutput(item, "Fourth"));
                temp.Fifth = Convert.ToInt32(ElementOutput(item, "Fifth"));
                temp.Sixth = Convert.ToInt32(ElementOutput(item, "Sixth"));
                temp.ElementID = Convert.ToInt32(ElementOutput(item, "ElementID"));
                temp.Origin = Convert.ToInt32(ElementOutput(item, "Origin"));

                templist.Add(temp);
            }

            return templist;
        }
Exemplo n.º 3
0
        private void RemoveCompleteTreasure()
        {
            if (GrandcypherClient.Current.TreasureHooker.CurrentTreasureList == null) return;
            if (GrandcypherClient.Current.TreasureHooker.CurrentTreasureList.Count < 1) return;

            List<TreasureInfo> temp = new List<TreasureInfo>(GrandcypherClient.Current.TreasureHooker.CurrentTreasureList.Values);
            List<TreasureInfo> result = new List<TreasureInfo>();

            List<TenTreasureInfo> targetList = new List<TenTreasureInfo>(GrandcypherClient.Current.Translations.GetTreasureList());
            List<TenTreasureInfo> ElementList = targetList.Where(x => x.ElementID != 0).ToList();
            List<TenTreasureInfo> AnotherList = targetList.Where(x => x.ElementID == 0).ToList();

            var Origin = ElementList.Where(x => x.Origin == 1).ToList();
            var Magna = ElementList.Where(x => x.Origin == 2).ToList();
            List<TenTreasureInfo> ProtoList = new List<TenTreasureInfo>();

            for (int i = 0; i < Origin.Count; i++)
            {
                if (Origin[i].ElementID == ElementTable[this.SelectedElement])
                {
                    Origin[i].Element += 3;
                    Origin[i].Second += 3;
                    Origin[i].Fourth += 3;
                }
            }

            for (int i = 0; i < Magna.Count; i++)
            {
                if (Magna[i].ElementID == ElementTable[this.SelectedElement])
                    Magna[i].Fifth += 60;
            }

            ProtoList = ElementList.Where(x => x.Proto > 0).ToList();

            switch (ElementTable[this.SelectedElement])
            {
                case 1:
                    ElementList = ElementList.Where(x => x.ElementID == 1 && x.Origin == 0).ToList();
                    break;
                case 2:
                    ElementList = ElementList.Where(x => x.ElementID == 2 && x.Origin == 0).ToList();
                    break;
                case 3:
                    ElementList = ElementList.Where(x => x.ElementID == 3 && x.Origin == 0).ToList();
                    break;
                case 4:
                    ElementList = ElementList.Where(x => x.ElementID == 4 && x.Origin == 0).ToList();
                    break;
                case 5:
                    ElementList = ElementList.Where(x => x.ElementID == 5 && x.Origin == 0).ToList();
                    break;
                case 6:
                    ElementList = ElementList.Where(x => x.ElementID == 6 && x.Origin == 0).ToList();
                    break;
            }
            targetList = new List<TenTreasureInfo>(AnotherList.Concat(ElementList).Concat(Magna).Concat(Origin).ToList());
            if (ElementTable[this.SelectedElement] != 5)
            {
                List<TenTreasureInfo> outputList = new List<TenTreasureInfo>();
                foreach (var item in ProtoList)
                {
                    TenTreasureInfo tempoutput = new TenTreasureInfo
                    {
                        Name = item.Name,
                        Proto = item.Proto
                    };
                    outputList.Add(tempoutput);
                }
                targetList = new List<TenTreasureInfo>(outputList.Concat(targetList).ToList());
            }
            //temp=현재 보유하고 있는 아이템목록
            //targetlist=정리된 십천중 필요목록
            targetList = new List<TenTreasureInfo>(GrandcypherClient.Current.Translations.SetItemIdxList(targetList));
            foreach (var item in targetList)
            {
                var search = temp.Where(x => x.ItemID == item.idx).ToList();
                TreasureInfo target = new TreasureInfo();

                //아이템 보유목록에 필요목록에 있는 아이템이 존재하는 경우
                if (search.Count > 0)
                {
                    target = search[0];
                }
                else//아이템이 비활성화인 경우 기초값으로 생성
                {
                    target = new TreasureInfo
                    {
                        Name = item.Name,
                        count = 0,
                        ItemID = -1,
                    };
                }
                if (target.Name == null || target.Name == string.Empty) continue;
                target.max = 0;//max값을 초기화

                //max값에 필요 아이템값을 모두 합산
                if (!Proto && item.Proto > 0)
                    target.max += item.Proto;
                if (!Rust && item.Rust > 0)
                    target.max += item.Rust;
                if (!Element && item.Element > 0)
                    target.max += item.Element;
                if (!First && item.First > 0)
                    target.max += item.First;
                if (!Second && item.Second > 0)
                    target.max += item.Second;
                if (!Third && item.Third > 0)
                    target.max += item.Third;
                if (!Fourth && item.Fourth > 0)
                    target.max += item.Fourth;
                if (!Fifth && item.Fifth > 0)
                    target.max += item.Fifth;

                target.max += item.Sixth;
                target.result = target.max - target.count;

                if (target.result > 0)
                    result.Add(target);
            }
            this.TreasureList = new List<TreasureInfo>(result);
        }