Exemplo n.º 1
0
        private async Task LoadTDollInfo(bool isRefresh = false)
        {
            await Task.Delay(10);

            isDollLoad = true;

            try
            {
                TDollDic_SplitContainer.Panel1.Show();
                TDollDic_TDollInfo_FullImageLoadProcessBar.Visible = true;
                TDollDic_TDollInfo_FullImageLoadProcessBar.Style   = ProgressBarStyle.Marquee;

                if (doll.HasMod)
                {
                    TDollDic_TDollInfo_ModStoryButton.Enabled = true;
                    TDollDic_TDollInfo_ModSkillButton.Enabled = true;
                }
                else
                {
                    TDollDic_TDollInfo_ModStoryButton.Enabled = false;
                    TDollDic_TDollInfo_ModSkillButton.Enabled = false;
                }

                das = new DollAbilitySet(doll.Type);

                if (doll.HasMod)
                {
                    TDollDic_TDollInfo_ModSelector1.Enabled = true;
                    TDollDic_TDollInfo_ModSelector2.Enabled = true;
                    TDollDic_TDollInfo_ModSelector3.Enabled = true;
                }
                else
                {
                    TDollDic_TDollInfo_ModSelector1.Enabled = false;
                    TDollDic_TDollInfo_ModSelector2.Enabled = false;
                    TDollDic_TDollInfo_ModSelector3.Enabled = false;
                }

                TDollDic_TDollInfo_ModSelector0.Checked = true;

                TDollDic_TDollInfo_DicNumber.Text        = $"No. {doll.DicNumber}";
                TDollDic_TDollInfo_Name.Text             = doll.Name;
                TDollDic_TDollInfo_CodeName.Text         = doll.CodeName;
                TDollDic_TDollInfo_ProductTimeLabel.Text =
                    $"{(doll.GetProductTimeToString == "None" ? "제조 불가" : doll.GetProductTimeToString)}";
                TDollDic_TDollInfo_IllustratorInfo.Text = doll.Illustrator;
                TDollDic_TDollInfo_NickNameInfo.Text    = doll.NickName;

                await LoadDollImages(isRefresh);

                Bitmap gBitmap;

                switch (doll.Grade)
                {
                default:
                case 0:
                    gBitmap = Resources.PSGrade_0;
                    break;

                case 2:
                    gBitmap = Resources.PSGrade_2;
                    break;

                case 3:
                    gBitmap = Resources.PSGrade_3;
                    break;

                case 4:
                    gBitmap = Resources.PSGrade_4;
                    break;

                case 5:
                    gBitmap = Resources.PSGrade_5;
                    break;
                }

                TDollDic_TDollInfo_FullImageView.BackgroundImage = gBitmap;

                switch (doll.Type)
                {
                default:
                case "HG":
                    TDollDic_TDollInfo_TypeIconImage.Image = Resources.HG;
                    break;

                case "SMG":
                    TDollDic_TDollInfo_TypeIconImage.Image = Resources.SMG;
                    break;

                case "AR":
                    TDollDic_TDollInfo_TypeIconImage.Image = Resources.AR;
                    break;

                case "RF":
                    TDollDic_TDollInfo_TypeIconImage.Image = Resources.RF;
                    break;

                case "MG":
                    TDollDic_TDollInfo_TypeIconImage.Image = Resources.MG;
                    break;

                case "SG":
                    TDollDic_TDollInfo_TypeIconImage.Image = Resources.SG;
                    break;
                }

                LoadFormationBuff();

                // 능력치 정보 불러오기도 동시 실행됨
                abilityLv = 1;

                if (TDollDic_TDollInfo_AbilityFavorSelector.SelectedIndex != 1)
                {
                    TDollDic_TDollInfo_AbilityFavorSelector.SelectedIndex = 1;
                }
                else
                {
                    _ = LoadAbility();
                }

                if (doll.HasVoice)
                {
                    TDollDic_TDollInfo_VoiceGroup.Visible = true;
                    LoadCostumeVoiceList();
                }
                else
                {
                    TDollDic_TDollInfo_VoiceGroup.Visible = false;
                }

                TDollDic_TDollInfo_GainTooltip.SetToolTip(TDollDic_TDollInfo_FullImageView, doll.ProductDialog);
            }
            catch (Exception ex)
            {
                ETC.LogError(ex);
                ETC.ShowErrorMessage("인형 불러오기 오류", "인형 정보를 불러오는 중 오류가 발생했습니다.");
            }
            finally
            {
                isDollLoad = false;
            }
        }
Exemplo n.º 2
0
        internal static void InitializeAverageAbility()
        {
            string[]  AbilityList  = { "HP", "FireRate", "Evasion", "Accuracy", "AttackSpeed" };
            const int TypeCount    = 6;
            const int AbilityCount = 6;

            AverageAbility Avg_HG  = new AverageAbility();
            AverageAbility Avg_SMG = new AverageAbility();
            AverageAbility Avg_AR  = new AverageAbility();
            AverageAbility Avg_RF  = new AverageAbility();
            AverageAbility Avg_MG  = new AverageAbility();
            AverageAbility Avg_SG  = new AverageAbility();

            Avg_List = new AverageAbility[TypeCount]
            {
                Avg_HG,
                Avg_SMG,
                Avg_AR,
                Avg_RF,
                Avg_MG,
                Avg_SG
            };

            int[] count = { 0, 0, 0, 0, 0, 0 };
            int[,] total = new int[TypeCount, AbilityCount];

            for (int i = 0; i < TypeCount; ++i)
            {
                for (int j = 0; j < AbilityCount; ++j)
                {
                    total[i, j] = 0;
                }
            }

            for (int i = 0; i < dollList.Rows.Count; ++i)
            {
                Doll           doll  = new Doll(dollList.Rows[i]);
                DollAbilitySet DAS   = new DollAbilitySet(doll.Type);
                int            index = 0;

                switch (doll.Type)
                {
                case "HG":
                    index = 0;
                    break;

                case "SMG":
                    index = 1;
                    break;

                case "AR":
                    index = 2;
                    break;

                case "RF":
                    index = 3;
                    break;

                case "MG":
                    index = 4;
                    break;

                case "SG":
                    index = 5;
                    break;
                }

                count[index] += 1;

                int grow_value = int.Parse(doll.Abilities["Grow"].Split(';')[0]);

                for (int j = 0; j < AbilityList.Length; ++j)
                {
                    int ability_value = int.Parse(doll.Abilities[AbilityList[j]].Split(';')[0]);

                    total[index, j] += DAS.CalcAbility(AbilityList[j], ability_value, grow_value, 100, 100, false);
                }

                if (doll.Type == "SG")
                {
                    int ability_value = int.Parse(doll.Abilities["Armor"].Split(';')[0]);

                    total[index, 5] += DAS.CalcAbility("Armor", ability_value, grow_value, 100, 100, false);
                }
            }

            for (int i = 0; i < TypeCount; ++i)
            {
                for (int j = 0; j < AbilityCount; ++j)
                {
                    int value = Convert.ToInt32(Math.Round((double)total[i, j] / count[i]));

                    switch (j)
                    {
                    case 0:
                        Avg_List[i].HP = value;
                        break;

                    case 1:
                        Avg_List[i].FR = value;
                        break;

                    case 2:
                        Avg_List[i].EV = value;
                        break;

                    case 3:
                        Avg_List[i].AC = value;
                        break;

                    case 4:
                        Avg_List[i].AS = value;
                        break;

                    case 5:
                        Avg_List[i].AM = value;
                        break;
                    }
                }
            }
        }