public object this[string szFieldName]
        {
            get
            {
                CalculationOptionsRestoSham options = Character.CalculationOptions as CalculationOptionsRestoSham;
                Type         t        = options.GetType();
                PropertyInfo property = t.GetProperty(szFieldName);
                if (property != null)
                {
                    return(property.GetValue(options, null));
                }

                return(null);
            }
            set
            {
                CalculationOptionsRestoSham options = Character.CalculationOptions as CalculationOptionsRestoSham;
                Type         t        = options.GetType();
                PropertyInfo property = t.GetProperty(szFieldName);
                if (property != null)
                {
                    property.SetValue(options, value, null);
                }
            }
        }
        public object this[string szFieldName]
        {
            get
            {
                CalculationOptionsRestoSham options = Character.CalculationOptions as CalculationOptionsRestoSham;
                Type      t     = options.GetType();
                FieldInfo field = t.GetField(szFieldName);
                if (field != null)
                {
                    return(field.GetValue(options));
                }

                return(null);
            }
            set
            {
                CalculationOptionsRestoSham options = Character.CalculationOptions as CalculationOptionsRestoSham;
                Type      t     = options.GetType();
                FieldInfo field = t.GetField(szFieldName);
                if (field != null)
                {
                    field.SetValue(options, value);
                }
            }
        }
Exemplo n.º 3
0
        public override void Calcluate(Stats stats, Character character)
        {
            // Earth Shield only gets the Purification talent bonus if cast on the Shaman. Also, it
            //  can crit but uses the crit chance of the person it is cast on.  Since in the majority
            //  of cases Earth Shield will probably be cast on a person other than the Shaman these factors
            //  will be left out of the computations.

            CalculationOptionsRestoSham options = character.CalculationOptions as CalculationOptionsRestoSham;

            // Base heal amount:

            float baseHeal = (SpellRanks[Rank].MaxHeal + SpellRanks[Rank].MinHeal) / 2;

            // Bonus amount (Earth Shield not subject to downrank penalties?):

            float bonus = stats.Healing;

            bonus *= SpellCoefficient;

            AverageHealed = (baseHeal + bonus) * 6;
            HealPerCharge = baseHeal + bonus;

            // Cast time is considered to be the global cooldown (which won't reduce below 1 sec):

            CastTime = Math.Max(SpellRanks[Rank].CastTime / (1 + (stats.SpellHasteRating / 1570)), 1.0f);

            // Mana not reduced by Tidal Focus:

            ManaCost = SpellRanks[Rank].Mana;
        }
        protected override void LoadCalculationOptions()
        {
            if (Character.CalculationOptions == null)
            {
                Character.CalculationOptions = new CalculationOptionsRestoSham();
            }
            CalculationOptionsRestoSham options = Character.CalculationOptions as CalculationOptionsRestoSham;

            _bLoading = true;

            #region General tab page:
            txtFightLength.Text    = options.FightLength.ToString();
            chkManaTide.Checked    = options.ManaTideEveryCD;
            chkWaterShield.Checked = options.WaterShield;
            chkEarthShield.Checked = options.EarthShield;
            txtCleanse.Text        = options.Decurse.ToString();
            cboBurstStyle.Text     = options.BurstStyle.ToString();
            cboSustStyle.Text      = options.SustStyle.ToString();
            cboHeroism.Text        = options.Heroism.ToString();
            txtInnervates.Text     = options.Innervates.ToString();
            cboTargets.Text        = options.Targets.ToString();
            txtLatency.Text        = options.Latency.ToString();
            txtWSPops.Text         = options.WSPops.ToString();
            #region The track bars
            tbReplenishment.Value = (Int32)options.ReplenishmentPercentage;
            UpdateTrackBarLabel(tbReplenishment);
            tbSurvival.Value = (Int32)options.SurvivalPerc;
            UpdateTrackBarLabel(tbSurvival);
            tbActivity.Value = (Int32)options.ActivityPerc;
            UpdateTrackBarLabel(tbActivity);
            #endregion
            #endregion

            _bLoading = false;
        }
Exemplo n.º 5
0
        public override void Calcluate(Stats stats, Character character)
        {
            base.Calcluate(stats, character);

            // Improved Chain Heal talent:

            float impCH  = 1.0f;
            int   points = CalculationsRestoSham.GetTalentPoints("Improved Chain Heal", "Restoration", character.Talents);

            impCH = 1f + .1f * points;

            // Skyshatter 4-piece bonus:

            impCH += stats.CHHealIncrease;

            // Now compute the chain heal numbers:

            _targetHeals[0] = this.AverageHealed * impCH;
            _targetHeals[1] = _targetHeals[0] / 2;
            _targetHeals[2] = _targetHeals[1] / 2;

            CalculationOptionsRestoSham options = character.CalculationOptions as CalculationOptionsRestoSham;

            this.AverageHealed = _targetHeals[0];
            if (options.NumCHTargets > 1)
            {
                this.AverageHealed += _targetHeals[1];
            }
            if (options.NumCHTargets == 3)
            {
                this.AverageHealed += _targetHeals[2];
            }
        }
 public void LoadCalculationOptions()
 {
     _loadingCalculationOptions = true;
     if (Character.CalculationOptions == null) Character.CalculationOptions = new CalculationOptionsRestoSham();
     calcOpts = Character.CalculationOptions as CalculationOptionsRestoSham;
     // Model Specific Code
     //
     _loadingCalculationOptions = false;
 }
Exemplo n.º 7
0
        //
        // Retrieve our options from XML:
        //
        public override ICalculationOptionBase DeserializeDataObject(string xml)
        {
            System.Xml.Serialization.XmlSerializer serializer =
                new System.Xml.Serialization.XmlSerializer(typeof(CalculationOptionsRestoSham));
            System.IO.StringReader      reader   = new System.IO.StringReader(xml);
            CalculationOptionsRestoSham calcOpts = serializer.Deserialize(reader) as CalculationOptionsRestoSham;

            return(calcOpts);
        }
Exemplo n.º 8
0
 public void LoadCalculationOptions()
 {
     _loadingCalculationOptions = true;
     if (Character.CalculationOptions == null)
     {
         Character.CalculationOptions = new CalculationOptionsRestoSham();
     }
     calcOpts = Character.CalculationOptions as CalculationOptionsRestoSham;
     // Model Specific Code
     //
     _loadingCalculationOptions = false;
 }
        protected override void LoadCalculationOptions()
        {
            if (Character.CalculationOptions == null)
            {
                Character.CalculationOptions = new CalculationOptionsRestoSham();
            }
            CalculationOptionsRestoSham options = Character.CalculationOptions as CalculationOptionsRestoSham;

            _bLoading = true;

            // Init General tab page:

            txtFightLength.Text     = options.FightLength.ToString();
            txtOutsideFSR.Text      = Math.Round(100 * options.OutsideFSRPct, 0).ToString();
            txtSPriestMp5.Text      = options.SPriestMP5.ToString();
            cboManaPotAmount.Text   = options.ManaPotAmount.ToString();
            txtManaPotInterval.Text = options.ManaPotTime.ToString();
            chkManaTide.Checked     = options.ManaTideEveryCD;
            chkWaterShield.Checked  = options.WaterShield;
            radioAldor.Checked      = (options.ExaltedFaction == Faction.Aldor);
            radioScryers.Checked    = (options.ExaltedFaction == Faction.Scryers);
            chkExalted.Checked      = (options.ExaltedFaction != Faction.None);

            // Init Spells tab page:

            txtHWRatio.Text               = options.HWRatio.ToString();
            txtLHWRatio.Text              = options.LHWRatio.ToString();
            txtCHRatio.Text               = options.CHRatio.ToString();
            txtESInterval.Text            = options.ESInterval.ToString();
            cboESRank.SelectedIndex       = options.ESRank - 1;
            cboNumCHTargets.SelectedIndex = options.NumCHTargets - 1;

            trkHW.Value      = 100 - options.HWDownrank.Ratio;
            trkCH.Value      = 100 - options.CHDownrank.Ratio;
            lblHWMaxPct.Text = String.Format("{0}%", 100 - trkHW.Value);
            lblHWMinPct.Text = String.Format("{0}%", trkHW.Value);
            lblCHMaxPct.Text = String.Format("{0}%", 100 - trkCH.Value);
            lblCHMinPct.Text = String.Format("{0}%", trkCH.Value);
            SetRankBoxes(cboHWMaxRank, cboHWMinRank, options.HWDownrank.MaxRank, options.HWDownrank.MinRank, 12);
            SetRankBoxes(cboCHMaxRank, cboCHMinRank, options.CHDownrank.MaxRank, options.CHDownrank.MinRank, 5);

            // Init Totems tab page:

            cboHWTotem.SelectedIndex  = FindIndex(cboHWTotem, options.Totems[HealSpells.HealingWave]);
            cboLHWTotem.SelectedIndex = FindIndex(cboLHWTotem, options.Totems[HealSpells.LesserHealingWave]);
            cboCHTotem.SelectedIndex  = FindIndex(cboCHTotem, options.Totems[HealSpells.ChainHeal]);
            chkEquipTotems.Checked    = options.EquipTotemsDuringFight;

            _bLoading = false;
        }
Exemplo n.º 10
0
        internal void FullCalculate(Character character, Item additionalItem)
        {
            // Stats
            _TotalStats = _Calculations.GetCharacterStats(character, additionalItem);

            // Options
            _CalculationOptions = character.CalculationOptions as CalculationOptionsRestoSham;

            // Network calcs
            _GcdLatency = _CalculationOptions.Latency / 1000f;
            _Latency    = Math.Max(Math.Min(_GcdLatency, 0.275f) - 0.14f, 0f) + Math.Max(_GcdLatency - 0.275f, 0f);

            GenerateSpellList(character);
            _PerformSequencing = true;
        }
Exemplo n.º 11
0
        public RestoShamTestCharacter()
        {
            this.Name = "RestoShamTestGuy";
            this.Realm = "TestRealm";
            this.Race = CharacterRace.Tauren;       // needs more cowbell
            this.Class = CharacterClass.Shaman;
            this.CurrentModel = "RestoSham";

            // Use the default options
            CalculationOptionsRestoSham opts = new CalculationOptionsRestoSham();
            this.CalculationOptions = opts;

            // 0/14/57
            // http://www.wowarmory.com/talent-calc.xml?cid=7&tal=00000000000000000000000003050003300000000000000000000050005330335310501122331251
            // CH, Water Mastery, and ES major glyphs
            // Water Shield minor glyph
            this.ShamanTalents = new ShamanTalents("00000000000000000000000003050003300000000000000000000050005330335310501122331251.00000000000100011000000000000");
        }
Exemplo n.º 12
0
        public static ICollection <ComparisonCalculationBase> CalculateSequencesChart(Character character, CalculationsRestoSham baseCalculations)
        {
            List <ComparisonCalculationBase> list            = new List <ComparisonCalculationBase>();
            CalculationOptionsRestoSham      originalOptions = character.CalculationOptions as CalculationOptionsRestoSham;

            if (originalOptions == null)
            {
                originalOptions = new CalculationOptionsRestoSham();
            }

            CalculationOptionsRestoSham opts = originalOptions;

            string[] styles = new string[] { "CH Spam", "HW Spam", "LHW Spam", "RT+HW", "RT+CH", "RT+LHW" };
            string[] descs  = new string[] {
                "All chain heal, all the time.  \nMana available for use per minute added to sustained.",
                "All healing wave, all the time  \nMana available for use per minute added to sustained.",
                "All lesser healing wave, all the time  \nMana available for use per minute added to sustained.",
                "Riptide + Healing Wave.  \nMana available for use per minute added to sustained.",
                "Riptide + Chain Heal.  \nMana available for use per minute added to sustained.",
                "Riptide + Lesser Healing Wave.\nMana available for use per minute added to sustained."
            };
            for (int i = 0; i < styles.Length; i++)
            {
                opts.SustStyle  = styles[i];
                opts.BurstStyle = styles[i];
                character.CalculationOptions = opts;
                CharacterCalculationsRestoSham statCalc = (CharacterCalculationsRestoSham)baseCalculations.GetCharacterCalculations(character);

                // normalize the mana a bit to make a better chart
                float mana = statCalc.ManaUsed / (opts.FightLength);

                ComparisonCalculationRestoSham hsComp = new ComparisonCalculationRestoSham(styles[i]);
                hsComp.OverallPoints = statCalc.BurstHPS + statCalc.SustainedHPS + mana;
                hsComp.SubPoints     = new float[] { statCalc.BurstHPS, statCalc.SustainedHPS + mana, 0f };
                hsComp.Description   = descs[i];
                list.Add(hsComp);
            }

            return(list);
        }
Exemplo n.º 13
0
        internal void FullCalculate(Character character, Item additionalItem)
        {
            // Stats
            _TotalStats = _Calculations.GetCharacterStats(character, additionalItem);

            // Options
            _CalculationOptions = character.CalculationOptions as CalculationOptionsRestoSham;
            
            // Network calcs
            _GcdLatency = _CalculationOptions.Latency / 1000f;
            _Latency = Math.Max(Math.Min(_GcdLatency, 0.275f) - 0.14f, 0f) + Math.Max(_GcdLatency - 0.275f, 0f);

            GenerateSpellList(character);
            _PerformSequencing = true;
        }
Exemplo n.º 14
0
        /// <summary>
        /// Given some character statistics, and some fight criteria, compute various performance aspects
        ///  of this spell.
        /// </summary>
        public virtual void Calcluate(Stats stats, Character character)
        {
            CalculationOptionsRestoSham options = character.CalculationOptions as CalculationOptionsRestoSham;

            // Base heal amount:

            float baseHeal = (SpellRanks[Rank].MaxHeal + SpellRanks[Rank].MinHeal) / 2;

            if (options.Totems[HealType].ID != 0 && options.Totems[HealType].Effect == TotemEffect.BaseHeal)
            {
                baseHeal += options.Totems[HealType].Amount;
            }

            // Bonus amount:

            float bonus = stats.Healing;

            if (options.Totems[HealType].ID != 0 && options.Totems[HealType].Effect == TotemEffect.BonusHeal)
            {
                bonus += options.Totems[HealType].Amount;
            }
            bonus *= SpellCoefficient;
            if (Rank < 70)
            {
                bonus *= DownrankCoefficient;
            }

            // Crit rate:

            float crit = .022f + ((stats.Intellect / 80f) / 100) + ((stats.SpellCritRating / 22.08f) / 100) +
                         stats.SpellCrit;
            float critRate = 1 + 0.5f * crit;

            // Purification talent:

            float purificationBonus = 1.0f;
            int   points            = CalculationsRestoSham.GetTalentPoints("Purification", "Restoration", character.Talents);

            purificationBonus = 1f + .02f * points;

            // Now get total average heal:

            AverageHealed = (baseHeal + bonus) * critRate * purificationBonus;

            // Compute spell cast time:

            CastTime = SpellRanks[Rank].CastTime / (1 + (stats.SpellHasteRating / 1570));

            // Compute mana cost:

            points = CalculationsRestoSham.GetTalentPoints("Tidal Focus", "Restoration", character.Talents);
            float f = 0.0f;

            if (options.Totems[HealType].ID != 0 && options.Totems[HealType].Effect == TotemEffect.ReduceMana)
            {
                f = options.Totems[HealType].Amount;
            }

            if (HealType == HealSpells.ChainHeal)
            {
                f += stats.CHManaReduction * SpellRanks[Rank].Mana;
            }
            if (HealType == HealSpells.LesserHealingWave)
            {
                f += stats.LHWManaReduction * SpellRanks[Rank].Mana;
            }

            ManaCost = (SpellRanks[Rank].Mana - f) * (1 - .01f * points);
        }
Exemplo n.º 15
0
        public Stats GetCharacterStats(Character character, Item additionalItem, Stats statModifier)
        {
            Stats statsRace;

            switch (character.Race)
            {
            case Character.CharacterRace.Draenei:
                statsRace = new Stats()
                {
                    Health = 3159, Mana = 2958, Stamina = 113, Intellect = 109, Spirit = 122
                };
                break;

            case Character.CharacterRace.Tauren:
                statsRace = new Stats()
                {
                    Health = 3159, Mana = 2958, Stamina = 116, Intellect = 103, Spirit = 122
                };
                statsRace.BonusHealthMultiplier = 0.05f;
                break;

            case Character.CharacterRace.Orc:
                statsRace = new Stats()
                {
                    Health = 3159, Mana = 2958, Stamina = 116, Intellect = 105, Spirit = 123
                };
                break;

            case Character.CharacterRace.Troll:
                statsRace = new Stats()
                {
                    Health = 3159, Mana = 2958, Stamina = 115, Intellect = 104, Spirit = 121
                };
                break;

            default:
                statsRace = new Stats();
                break;
            }

            Stats statsBaseGear = GetItemStats(character, additionalItem);
            Stats statsEnchants = GetEnchantsStats(character);
            Stats statsBuffs    = GetBuffsStats(character.ActiveBuffs);
            Stats statsTotal    = statsBaseGear + statsEnchants + statsBuffs + statsRace;

            if (statModifier != null)
            {
                statsTotal += statModifier;
            }

            statsTotal.Stamina   = (float)Math.Round((statsTotal.Stamina) * (1 + statsTotal.BonusStaminaMultiplier));
            statsTotal.Intellect = (float)Math.Round((statsTotal.Intellect)) * (1 + statsTotal.BonusIntellectMultiplier);
            statsTotal.Spirit    = (float)Math.Round((statsTotal.Spirit) * (1 + statsTotal.BonusSpiritMultiplier));
            statsTotal.Healing   = (float)Math.Round(statsTotal.Healing);
            statsTotal.Mana      = statsTotal.Mana + 20 + ((statsTotal.Intellect - 20) * 15);
            statsTotal.Health    = (statsTotal.Health + 20 + ((statsTotal.Stamina - 20) * 10f)) * (1 + statsTotal.BonusHealthMultiplier);

            // Apply talents to stats:

            ApplyTalents(statsTotal, character.Talents);

            // Fight options:

            CalculationOptionsRestoSham options = character.CalculationOptions as CalculationOptionsRestoSham;

            statsTotal.Mp5 += (options.WaterShield ? 50 : 0);

            return(statsTotal);
        }
Exemplo n.º 16
0
        public CharacterCalculationsBase GetCharacterCalculations(Character character, Item additionalItem,
                                                                  Stats statModifier)
        {
            Stats stats = GetCharacterStats(character, additionalItem, statModifier);
            CharacterCalculationsRestoSham calcStats = new CharacterCalculationsRestoSham();

            calcStats.BasicStats = stats;

            calcStats.Mp5OutsideFSR = 5f * (.001f + (float)Math.Sqrt((double)stats.Intellect) * stats.Spirit * .009327f) + stats.Mp5;
            calcStats.SpellCrit     = .022f + ((stats.Intellect / 80f) / 100) + ((stats.SpellCritRating / 22.08f) / 100) +
                                      stats.SpellCrit;

            CalculationOptionsRestoSham options = character.CalculationOptions as CalculationOptionsRestoSham;

            // Total Mana Pool for the fight:

            float onUse = 0.0f;

            if (options.ManaPotTime > 0)
            {
                onUse += (float)Math.Truncate(options.FightLength / options.ManaPotTime) *
                         (options.ManaPotAmount * (1 + stats.BonusManaPotion));
            }
            if (options.ManaTideEveryCD)
            {
                onUse += ((float)Math.Truncate(options.FightLength / 5.025f) + 1) * (stats.Mana * .24f);
            }

            float mp5 = (stats.Mp5 * (1f - (options.OutsideFSRPct / 100f)));

            mp5 += (calcStats.Mp5OutsideFSR * (options.OutsideFSRPct / 100f));
            mp5 += options.SPriestMP5;
            if (character.ActiveBuffsContains("Mana Spring Totem"))
            {
                int points = GetTalentPoints("Restorative Totems", "Restoration", character.Talents);
                mp5 += 50f * (points * .05f);

                mp5 += stats.ManaSpringMp5Increase;
            }

            calcStats.TotalManaPool = stats.Mana + onUse + (mp5 * (60f / 5f) * options.FightLength);

            // Get a list of the heals we're casting, and assign relative weights to them:

            List <HealSpell> list       = new List <HealSpell>();
            float            totalRatio = options.HWRatio + options.LHWRatio + options.CHRatio;

            if (options.LHWRatio > 0)
            {
                LesserHealingWave lhw = new LesserHealingWave();
                lhw.Calcluate(stats, character);
                lhw.Weight = options.LHWWeight;
                list.Add(lhw);
            }

            if (options.HWRatio > 0)
            {
                if (options.HWDownrank.Ratio > 0)
                {
                    HealingWave hw = new HealingWave(options.HWDownrank.MaxRank);
                    hw.Calcluate(stats, character);
                    hw.Weight = options.HWWeight * (options.HWDownrank.Ratio / 100f);
                    list.Add(hw);
                }
                if (options.HWDownrank.Ratio < 100)
                {
                    HealingWave hw = new HealingWave(options.HWDownrank.MinRank);
                    hw.Calcluate(stats, character);
                    hw.Weight = options.HWWeight * ((100 - options.HWDownrank.Ratio) / 100f);
                    list.Add(hw);
                }
            }

            if (options.CHRatio > 0)
            {
                if (options.CHDownrank.Ratio > 0)
                {
                    ChainHeal ch = new ChainHeal(options.CHDownrank.MaxRank);
                    ch.Calcluate(stats, character);
                    ch.Weight = options.CHWeight * (options.CHDownrank.Ratio / 100f);
                    list.Add(ch);
                }
                if (options.CHDownrank.Ratio < 100)
                {
                    ChainHeal ch = new ChainHeal(options.CHDownrank.MinRank);
                    ch.Calcluate(stats, character);
                    ch.Weight = options.CHWeight * ((100 - options.CHDownrank.Ratio) / 100f);
                    list.Add(ch);
                }
            }

            // Now get weighted average heal, weighted average mana cost, and weighted average cast time:

            calcStats.AverageHeal     = 0;
            calcStats.AverageManaCost = 0;
            calcStats.AverageCastTime = 0;
            foreach (HealSpell spell in list)
            {
                calcStats.AverageHeal     += spell.AverageHealed * spell.Weight;
                calcStats.AverageCastTime += spell.CastTime * spell.Weight;
                calcStats.AverageManaCost += spell.ManaCost * spell.Weight;
            }
            calcStats.AverageManaCost -= stats.ManaRestorePerCast_5_15 * .02f;  // Insightful Earthstorm Diamond

            // Earth Shield computations:

            float esMana = 0f;
            float esHeal = 0f;
            float esNum  = 0f;

            if (options.ESInterval > 0)
            {
                EarthShield es = new EarthShield(options.ESRank);
                es.Calcluate(stats, character);
                esNum  = (float)Math.Round((options.FightLength / (options.ESInterval / 60f)) + 1, 0);
                esMana = es.ManaCost * esNum;
                esHeal = es.AverageHealed * esNum;
            }
            float numHeals = Math.Min((options.FightLength * 60) / calcStats.AverageCastTime, (calcStats.TotalManaPool - esMana) / calcStats.AverageManaCost);

            // Now, Shattered Sun Pendant of Restoration Aldor proc.  From what I understand, this has a
            //  4% proc rate with no cooldown. This is a rough estimation of the value of this proc, and
            //  doesn't take into account other things that might proc it (Gift of the Naaru, Earth Shield
            //  if cast on the shaman, etc):

            if (options.ExaltedFaction == Faction.Aldor && stats.ShatteredSunRestoProc > 0)
            {
                // Determine how many more "casts" we get from Chain Heal second / third targets
                //  and Earth Shield (assumption is Earth Shield procs it?):

                float ssNumHeals = numHeals;
                if (options.CHRatio > 0)
                {
                    ssNumHeals += numHeals * options.CHWeight * (options.NumCHTargets - 1);
                }
                ssNumHeals += esNum;
                float ssHeal = (((ssNumHeals * .04f) * 10f) / (options.FightLength * 60f)) * 220f;

                // Now, we have to recalculate the amount healed based on the proc's addition to healing bonus:

                stats.Healing        += ssHeal;
                calcStats.AverageHeal = 0f;
                foreach (HealSpell spell in list)
                {
                    spell.Calcluate(stats, character);
                    calcStats.AverageHeal += spell.AverageHealed * spell.Weight;
                }
                stats.Healing -= ssHeal;
            }

            calcStats.TotalHealed = (numHeals * calcStats.AverageHeal) + esHeal;

            // Shattered Sun Pendant of Restoration Scryers proc. This is going to be a best case
            //  scenario (procs every cooldown, and the proc actually heals someone. Healers using
            //  a mouseover healing system (like Clique) might not benefit at all from this proc):

            if (options.ExaltedFaction == Faction.Scryers && stats.ShatteredSunRestoProc > 0)
            {
                float numProcs = (float)Math.Round((options.FightLength / 60f) / 45f, 0) + 1f;
                float crit     = .022f + ((stats.Intellect / 80f) / 100) + ((stats.SpellCritRating / 22.08f) / 100) +
                                 stats.SpellCrit;
                float critRate = 1 + 0.5f * crit;
                float ssHealed = numProcs * 650 * critRate;

                calcStats.TotalHealed += ssHealed;
            }

            calcStats.FightHPS = calcStats.TotalHealed / (options.FightLength * 60);

            calcStats.OverallPoints = calcStats.TotalHealed / 10f;
            calcStats.SubPoints[0]  = calcStats.TotalHealed / 10f;

            return(calcStats);
        }
Exemplo n.º 17
0
        //
        // Data for custom charts:
        //
        public override ComparisonCalculationBase[] GetCustomChartData(Character character, string chartName)
        {
            CharacterCalculationsRestoSham calc = GetCharacterCalculations(character) as CharacterCalculationsRestoSham;

            if (calc == null)
            {
                calc = new CharacterCalculationsRestoSham();
            }

            CalculationOptionsRestoSham options = character.CalculationOptions as CalculationOptionsRestoSham;

            if (options == null)
            {
                options = new CalculationOptionsRestoSham();
            }

            List <ComparisonCalculationBase> list = new List <ComparisonCalculationBase>();

            switch (chartName)
            {
            case "Stat Relative Weights":
                StatRelativeWeight[] stats = new StatRelativeWeight[] {
                    new StatRelativeWeight("Int", new Stats()
                    {
                        Intellect = 1f
                    }),
                    new StatRelativeWeight("Spirit", new Stats()
                    {
                        Spirit = 1f
                    }),
                    new StatRelativeWeight("+Heal", new Stats()
                    {
                        Healing = 1f
                    }),
                    new StatRelativeWeight("Mp5", new Stats()
                    {
                        Mp5 = 1f
                    }),
                    new StatRelativeWeight("Spell Crit", new Stats()
                    {
                        SpellCritRating = 1f
                    })
                };

                // Get the percentage total healing is changed by a change in a single stat:

                float healPct = 0f;
                foreach (StatRelativeWeight weight in stats)
                {
                    CharacterCalculationsRestoSham statCalc = (CharacterCalculationsRestoSham)GetCharacterCalculations(character, null, weight.Stat);
                    weight.PctChange = (statCalc.TotalHealed - calc.TotalHealed) / calc.TotalHealed;
                    if (weight.Name == "+Heal")
                    {
                        healPct = weight.PctChange;
                    }
                }

                // Create the chart data points:

                foreach (StatRelativeWeight weight in stats)
                {
                    ComparisonCalculationRestoSham comp = new ComparisonCalculationRestoSham(weight.Name);
                    comp.OverallPoints = weight.PctChange / healPct;
                    comp.SubPoints[0]  = comp.OverallPoints;
                    list.Add(comp);
                }

                break;

            case "Healing Spell Ranks":
                // Healing Wave ranks:

                for (int i = 1; i <= 12; i++)
                {
                    HealingWave hw = new HealingWave(i);
                    hw.Calcluate(calc.BasicStats, character);
                    ComparisonCalculationRestoSham comp = new ComparisonCalculationRestoSham(hw.FullName);
                    comp.OverallPoints = hw.AverageHealed + hw.HealingWay;
                    comp.SubPoints[0]  = hw.AverageHealed;
                    comp.SubPoints[3]  = hw.HealingWay;
                    list.Add(comp);
                }

                // Lesser Healing Wave ranks:

                for (int i = 1; i <= 7; i++)
                {
                    LesserHealingWave lhw = new LesserHealingWave(i);
                    lhw.Calcluate(calc.BasicStats, character);
                    ComparisonCalculationRestoSham comp = new ComparisonCalculationRestoSham(lhw.FullName);
                    comp.OverallPoints = comp.SubPoints[0] = lhw.AverageHealed;
                    list.Add(comp);
                }

                // Chain Heal ranks:

                for (int i = 1; i <= 5; i++)
                {
                    ChainHeal ch = new ChainHeal(i);
                    ch.Calcluate(calc.BasicStats, character);
                    ComparisonCalculationRestoSham comp = new ComparisonCalculationRestoSham(ch.FullName);
                    comp.OverallPoints = ch.TotalHealed;
                    for (int j = 0; j < 3; j++)
                    {
                        comp.SubPoints[j] = ch.HealsOnTargets[j];
                    }
                    list.Add(comp);
                }

                // The Draenei racial:

                if (character.Race == Character.CharacterRace.Draenei)
                {
                    GiftOfTheNaaru gift = new GiftOfTheNaaru();
                    gift.Calcluate(calc.BasicStats, character);
                    ComparisonCalculationRestoSham comp = new ComparisonCalculationRestoSham(gift.FullName);
                    comp.OverallPoints = comp.SubPoints[0] = gift.AverageHealed;
                    list.Add(comp);
                }

                break;
            }

            ComparisonCalculationBase[] retVal = new ComparisonCalculationBase[list.Count];
            if (list.Count > 0)
            {
                list.CopyTo(retVal);
            }
            return(retVal);
        }