示例#1
0
        /// <summary>
        /// 덱 편성 화면. 공인계산기 포함
        /// </summary>
        /// <param name="oS"></param>
        private void DeckDetail(Session oS)
        {
            this.ListIsEnd = false;
            this.DeckIsEnd = false;

            this.WeaponListLoad();
            int MasterAttribute = 0;

            this.SkillCounter = new Skills();
            this.ConBahaList = new List<decimal>();
            this.VisBahaList = new List<decimal>();

            if (this.WeaponLists == null)
                this.WeaponLists = new List<WeaponInfo>();
            else
            {
                this.WeaponLists.Clear();
                this.WeaponLists.TrimExcess();
            }

            if (this.NPCList == null)
                this.NPCList = new List<NpcInfo>();
            else
            {
                this.NPCList.Clear();
                this.NPCList.TrimExcess();
            }

            JObject jsonFull = JObject.Parse(oS.GetResponseBodyAsString()) as JObject;
            dynamic test = jsonFull;
            dynamic list = test.deck.pc.weapons;
            dynamic npcList = test.deck.npc;

            if (test.deck.pc.skill.count > 0)
            {
                this.SkillList = new List<string>();
                dynamic skilllist = test.deck.pc.skill.description;
                foreach (var item in skilllist)
                {
                    JProperty SkillProperty = item;
                    var Firsts = SkillProperty.First;
                    string SkillComment = (string)Firsts["comment"];
                    int over = (int)Firsts["over"];

                    if (over > 1) SkillList.Add("◎ " + GrandcypherClient.Current.ScenarioHooker.Translator(SkillComment, GrandcypherClient.Current.ScenarioHooker.TranslateSite) + " + " + over.ToString());
                    else SkillList.Add("◎ " + GrandcypherClient.Current.ScenarioHooker.Translator(SkillComment, GrandcypherClient.Current.ScenarioHooker.TranslateSite));
                }
            }
            if (test.deck.pc.param.attribute != null)
            {
                MasterAttribute = Convert.ToInt32(test.deck.pc.param.attribute);
            }
            this.ProgressStatus = new LimitedValue();
            this.ProgressStatus.Max = 15;
            this.ProgressStatus.Min = 0;
            this.ProgressStatus.Current = 0;

            //캐릭터의 속성을 구별할 방법이 외부 DB를 추가로 만드는 방법밖에 없기때문에 일단 모두 같은 속성으로 간주.
            //즉 디 오더 그랑데나 속성 불일치 종족파티를 쓰는 유저는 이 계산기를 사용할수없음
            for (int i = 1; i < 6; i++)
            {
                NpcInfo npc = new NpcInfo();
                string temp = i.ToString();
                JObject jobject = (JObject)npcList[temp];
                JObject param;
                JObject master;
                try
                {
                    param = (JObject)jobject["param"];
                    master = (JObject)jobject["master"];
                }
                catch
                {
                    this.NPCList.Add(npc);
                    continue;
                }
                npc.name = (string)master["name"];
                npc.attack = (int)param["attack"];
                this.NPCList.Add(npc);
                this.ProgressStatus.Current++;
                this.ProgressBar();
            }

            for (int i = 1; i < 11; i++)
            {
                WeaponInfo deck = new WeaponInfo();
                string temp = i.ToString();
                JObject jobject = (JObject)list[temp];
                JObject master;
                JObject param;
                try
                {
                    master = (JObject)jobject["master"];
                    param = (JObject)jobject["param"];
                }
                catch
                {
                    deck.vSkillLv1 = Visibility.Collapsed;
                    deck.vSkillLv2 = Visibility.Collapsed;
                    WeaponLists.Add(deck);
                    continue;
                }
                deck.MasterId = (int)master["id"];
                deck.ParamId = (int)param["id"];//무기 스킬레벨등을 저장하고 구별하기 위한 부분
                deck.ItemName = GrandcypherClient.Current.Translations.GetTranslation(Translations.TranslationType.WeaponList, "", TranslateKind.Google, deck.MasterId);
                if (deck.ItemName == string.Empty)
                {
                    int msid = deck.MasterId;
                    deck = MasterInfoLoad(deck.MasterId, (int)param["id"]);
                    if (deck.SkillName1 != string.Empty) deck.SkillDetail1 = GrandcypherClient.Current.Translations.GetSkillInfo(deck.SkillName1, true);
                    else deck.SkillDetail1 = string.Empty;
                    if (deck.SkillName2 != string.Empty) deck.SkillDetail2 = GrandcypherClient.Current.Translations.GetSkillInfo(deck.SkillName2, true);
                    else deck.SkillDetail2 = string.Empty;
                }
                deck.vSkillLv1 = Visibility.Collapsed;
                deck.vSkillLv2 = Visibility.Collapsed;

                deck = this.InputSkillInfo(deck);
                deck.attribute = (int)master["attribute"];
                if (!deck.IsManual) deck.Kind = GrandcypherClient.Current.Translations.GetTranslation(Translations.TranslationType.WeaponType, "", TranslateKind.Google, deck.MasterId);

                if (i == 1)
                {
                    MainWeapon = deck;
                }
                else WeaponLists.Add(deck);

                this.ProgressStatus.Current++;
                this.ProgressBar();
            }

            for (int i = 0; i < WeaponLists.Count; i++)
            {
                if (WeaponLists[i].SkillAttribute1 == MasterAttribute
                    || WeaponLists[i].SkillAttribute1 >= 7)
                    this.SumAtt(WeaponLists[i].GeneralType1, WeaponLists[i]);
                if (WeaponLists[i].SkillAttribute2 == MasterAttribute
                    || WeaponLists[i].SkillAttribute2 >= 7)
                    this.SumAtt(WeaponLists[i].GeneralType2, WeaponLists[i], true);
            }
            if (MainWeapon.SkillAttribute1 == MasterAttribute
                || MainWeapon.SkillAttribute1 >= 7)
                this.SumAtt(MainWeapon.GeneralType1, MainWeapon);
            if (MainWeapon.SkillAttribute2 == MasterAttribute
                || MainWeapon.SkillAttribute2 >= 7)
                this.SumAtt(MainWeapon.GeneralType2, MainWeapon, true);

            this.SkillCounter.Baha += this.TotalBaha(this.ConBahaList);
            this.SkillCounter.Baha += this.TotalBaha(this.VisBahaList);

            this.DeckIsEnd = true;
            if (test.deck.pc.param != null) SkillCounter.BasicAttack = test.deck.pc.param.attack;
            this.DeckLoadingEnd();
        }
示例#2
0
        /// <summary>
        /// 덱 편성 화면. 공인계산기 포함
        /// </summary>
        /// <param name="oS"></param>
        private void DeckDetail(Session oS)
        {
            this.ListIsEnd = false;
            this.DeckIsEnd = false;

            this.WeaponListLoad();
            int MasterAttribute = 0;

            this.SkillCounter = new Skills();
            this.ConBahaList  = new List <decimal>();
            this.VisBahaList  = new List <decimal>();

            if (this.WeaponLists == null)
            {
                this.WeaponLists = new List <WeaponInfo>();
            }
            else
            {
                this.WeaponLists.Clear();
                this.WeaponLists.TrimExcess();
            }

            if (this.NPCList == null)
            {
                this.NPCList = new List <NpcInfo>();
            }
            else
            {
                this.NPCList.Clear();
                this.NPCList.TrimExcess();
            }

            JObject jsonFull = JObject.Parse(oS.GetResponseBodyAsString()) as JObject;
            dynamic test     = jsonFull;
            dynamic list     = test.deck.pc.weapons;
            dynamic npcList  = test.deck.npc;

            if (test.deck.pc.skill.count > 0)
            {
                this.SkillList = new List <string>();
                dynamic skilllist = test.deck.pc.skill.description;
                foreach (var item in skilllist)
                {
                    JProperty SkillProperty = item;
                    var       Firsts        = SkillProperty.First;
                    string    SkillComment  = (string)Firsts["comment"];
                    int       over          = (int)Firsts["over"];

                    if (over > 1)
                    {
                        SkillList.Add("◎ " + GrandcypherClient.Current.ScenarioHooker.Translator(SkillComment, GrandcypherClient.Current.ScenarioHooker.TranslateSite) + " + " + over.ToString());
                    }
                    else
                    {
                        SkillList.Add("◎ " + GrandcypherClient.Current.ScenarioHooker.Translator(SkillComment, GrandcypherClient.Current.ScenarioHooker.TranslateSite));
                    }
                }
            }
            if (test.deck.pc.param.attribute != null)
            {
                MasterAttribute = Convert.ToInt32(test.deck.pc.param.attribute);
            }
            this.ProgressStatus         = new LimitedValue();
            this.ProgressStatus.Max     = 15;
            this.ProgressStatus.Min     = 0;
            this.ProgressStatus.Current = 0;

            //캐릭터의 속성을 구별할 방법이 외부 DB를 추가로 만드는 방법밖에 없기때문에 일단 모두 같은 속성으로 간주.
            //즉 디 오더 그랑데나 속성 불일치 종족파티를 쓰는 유저는 이 계산기를 사용할수없음
            for (int i = 1; i < 6; i++)
            {
                NpcInfo npc     = new NpcInfo();
                string  temp    = i.ToString();
                JObject jobject = (JObject)npcList[temp];
                JObject param;
                JObject master;
                try
                {
                    param  = (JObject)jobject["param"];
                    master = (JObject)jobject["master"];
                }
                catch
                {
                    this.NPCList.Add(npc);
                    continue;
                }
                npc.name   = (string)master["name"];
                npc.attack = (int)param["attack"];
                this.NPCList.Add(npc);
                this.ProgressStatus.Current++;
                this.ProgressBar();
            }

            for (int i = 1; i < 11; i++)
            {
                WeaponInfo deck    = new WeaponInfo();
                string     temp    = i.ToString();
                JObject    jobject = (JObject)list[temp];
                JObject    master;
                JObject    param;
                try
                {
                    master = (JObject)jobject["master"];
                    param  = (JObject)jobject["param"];
                }
                catch
                {
                    deck.vSkillLv1 = Visibility.Collapsed;
                    deck.vSkillLv2 = Visibility.Collapsed;
                    WeaponLists.Add(deck);
                    continue;
                }
                deck.MasterId = (int)master["id"];
                deck.ParamId  = (int)param["id"];               //무기 스킬레벨등을 저장하고 구별하기 위한 부분
                deck.ItemName = GrandcypherClient.Current.Translations.GetTranslation(Translations.TranslationType.WeaponList, "", TranslateKind.Google, deck.MasterId);
                if (deck.ItemName == string.Empty)
                {
                    int msid = deck.MasterId;
                    deck = MasterInfoLoad(deck.MasterId, (int)param["id"]);
                    if (deck.SkillName1 != string.Empty)
                    {
                        deck.SkillDetail1 = GrandcypherClient.Current.Translations.GetSkillInfo(deck.SkillName1, true);
                    }
                    else
                    {
                        deck.SkillDetail1 = string.Empty;
                    }
                    if (deck.SkillName2 != string.Empty)
                    {
                        deck.SkillDetail2 = GrandcypherClient.Current.Translations.GetSkillInfo(deck.SkillName2, true);
                    }
                    else
                    {
                        deck.SkillDetail2 = string.Empty;
                    }
                }
                deck.vSkillLv1 = Visibility.Collapsed;
                deck.vSkillLv2 = Visibility.Collapsed;

                deck           = this.InputSkillInfo(deck);
                deck.attribute = (int)master["attribute"];
                if (!deck.IsManual)
                {
                    deck.Kind = GrandcypherClient.Current.Translations.GetTranslation(Translations.TranslationType.WeaponType, "", TranslateKind.Google, deck.MasterId);
                }

                if (i == 1)
                {
                    MainWeapon = deck;
                }
                else
                {
                    WeaponLists.Add(deck);
                }

                this.ProgressStatus.Current++;
                this.ProgressBar();
            }


            for (int i = 0; i < WeaponLists.Count; i++)
            {
                if (WeaponLists[i].SkillAttribute1 == MasterAttribute ||
                    WeaponLists[i].SkillAttribute1 >= 7)
                {
                    this.SumAtt(WeaponLists[i].GeneralType1, WeaponLists[i]);
                }
                if (WeaponLists[i].SkillAttribute2 == MasterAttribute ||
                    WeaponLists[i].SkillAttribute2 >= 7)
                {
                    this.SumAtt(WeaponLists[i].GeneralType2, WeaponLists[i], true);
                }
            }
            if (MainWeapon.SkillAttribute1 == MasterAttribute ||
                MainWeapon.SkillAttribute1 >= 7)
            {
                this.SumAtt(MainWeapon.GeneralType1, MainWeapon);
            }
            if (MainWeapon.SkillAttribute2 == MasterAttribute ||
                MainWeapon.SkillAttribute2 >= 7)
            {
                this.SumAtt(MainWeapon.GeneralType2, MainWeapon, true);
            }

            this.SkillCounter.Baha += this.TotalBaha(this.ConBahaList);
            this.SkillCounter.Baha += this.TotalBaha(this.VisBahaList);

            this.DeckIsEnd = true;
            if (test.deck.pc.param != null)
            {
                SkillCounter.BasicAttack = test.deck.pc.param.attack;
            }
            this.DeckLoadingEnd();
        }