Exemplo n.º 1
0
        public void ReCalcSendCost()
        {
            switch (this.CostSets)
            {
            case ArCostSets.Fate:
            {
                var nFCv = new ObservableCollection <BindableValue <int> >();
                for (var i = 0; i < 5; i++)
                {
                    nFCv.Add(new BindableValue <int>(0));
                }
                nFCv[(int)ArResource.Fate].Value = -this.FateCost;

                this.SendingCost.ClearAllEvents();
                this.SendingCost = new ArCost()
                {
                    CostGroup = "Fate使用",
                    CostName  = FateType.Text(),
                    Items     = nFCv
                };
                break;
            }

            case ArCostSets.Damage:
            {
                var nDCv = new ObservableCollection <BindableValue <int> >();
                for (var i = 0; i < 5; i++)
                {
                    nDCv.Add(new BindableValue <int>(0));
                }
                nDCv[(int)TargetValue].Value = this.DamageCorrected;

                var nCostName = this.DamageBase.ToString("0;-0")
                                + this.DefPoint.ToString("-0;+0;#")
                                + this.DamageCorrect1.ToString("+0;-0;#")
                                + this.DamageCorrect2.ToString("+0;-0;#");
                //+ "="
                //+ ((this.DamageType == ArDamageType.Heal) ? this.DamageCorrected.ToString("0;-0;0") : this.DamageCorrected.ToString("-0;0;0"));

                this.SendingCost.ClearAllEvents();
                this.SendingCost = new ArCost()
                {
                    CostGroup = (DamageType == ArDamageType.Heal ? TargetValue.ResourceName() : "") + DamageType.Text(),
                    CostName  = nCostName,
                    Items     = nDCv
                };
                break;
            }

            case ArCostSets.SkillCost:
            {
                this.SendingCost = new ArCost(this.SelectedItem);
                break;
            }
            }
            this.SendingText = this.SendingCost.ToString();
            this.CostChanged?.Invoke(this, null);
        }