Example #1
0
        public override ICalculationOptionBase DeserializeDataObject(string xml)
        {
            System.Xml.Serialization.XmlSerializer serializer =
                new System.Xml.Serialization.XmlSerializer(typeof(CalculationOptionsPriest));
            System.IO.StringReader   reader   = new System.IO.StringReader(xml);
            CalculationOptionsPriest calcOpts = serializer.Deserialize(reader) as CalculationOptionsPriest;

            return(calcOpts);
        }
 private void trkActivity_Scroll(object sender, EventArgs e)
 {
     if (!loading)
     {
         CalculationOptionsPriest calcOpts = Character.CalculationOptions as CalculationOptionsPriest;
         lblActivity.Text   = trkActivity.Value + "%";
         calcOpts.TimeInFSR = trkActivity.Value;
         Character.OnItemsChanged();
     }
 }
        protected override void LoadCalculationOptions()
        {
            loading = true;
            if (Character.CalculationOptions == null)
            {
                Character.CalculationOptions = new CalculationOptionsPriest();
            }

            CalculationOptionsPriest calcOpts = Character.CalculationOptions as CalculationOptionsPriest;

            trkActivity.Value = (int)calcOpts.TimeInFSR;
            lblActivity.Text  = trkActivity.Value + "%";

            loading = false;
        }
Example #4
0
        public override CharacterCalculationsBase GetCharacterCalculations(Character character, Item additionalItem)
        {
            Stats stats     = GetCharacterStats(character, additionalItem);
            Stats statsRace = GetRaceStats(character);
            CharacterCalculationsHolyPriest calculatedStats    = new CharacterCalculationsHolyPriest();
            CalculationOptionsPriest        calculationOptions = character.CalculationOptions as CalculationOptionsPriest;

            if (calculationOptions == null)
            {
                return(null);
            }

            calculatedStats.Race       = character.Race;
            calculatedStats.BasicStats = stats;
            calculatedStats.Talents    = character.Talents;

            calculatedStats.BasicStats.Health = (float)Math.Floor(calculatedStats.BasicStats.Health * (1 + character.Talents.GetTalent("Enlightenment").PointsInvested * 0.01f));
            calculatedStats.BasicStats.Spirit = (float)Math.Floor(calculatedStats.BasicStats.Spirit * (1 + character.Talents.GetTalent("Spirit of Redemption").PointsInvested * 0.05f));

            calculatedStats.SpiritRegen = (float)Math.Floor(5 * 0.0093271 * calculatedStats.BasicStats.Spirit * Math.Sqrt(calculatedStats.BasicStats.Intellect));

            calculatedStats.RegenInFSR = (float)Math.Floor((calculatedStats.BasicStats.Mp5 + character.Talents.GetTalent("Meditation").PointsInvested * 0.1f *
                                                            calculatedStats.SpiritRegen * (1 + calculatedStats.BasicStats.SpellCombatManaRegeneration)));
            calculatedStats.RegenOutFSR = calculatedStats.BasicStats.Mp5 + calculatedStats.SpiritRegen;

            calculatedStats.BasicStats.SpellCrit = (float)Math.Round((calculatedStats.BasicStats.Intellect / 80) +
                                                                     (calculatedStats.BasicStats.SpellCritRating / 22.08) + 1.24 + character.Talents.GetTalent("Holy Specialization").PointsInvested, 2);

            calculatedStats.BasicStats.Healing += calculatedStats.BasicStats.Spirit * character.Talents.GetTalent("Spiritual Guidance").PointsInvested * 0.05f;

            calculatedStats.HealPoints = calculatedStats.BasicStats.Healing
                                         + (calculatedStats.BasicStats.HealingDoneFor15SecOnUse2Min * 15f / 120f)
                                         + (calculatedStats.BasicStats.HealingDoneFor15SecOnUse90Sec * 15f / 90f)
                                         + (calculatedStats.BasicStats.HealingDoneFor20SecOnUse2Min * 20f / 120f)
                                         + (calculatedStats.BasicStats.SpiritFor20SecOnUse2Min * character.Talents.GetTalent("Spiritual Guidance").PointsInvested * 0.05f * 20f / 120f);

            float procSpiritRegen = 0;

            if (calculatedStats.BasicStats.SpiritFor20SecOnUse2Min > 0)
            {
                procSpiritRegen = ((float)Math.Floor(5 * 0.0093271 * calculatedStats.BasicStats.SpiritFor20SecOnUse2Min * Math.Sqrt(calculatedStats.BasicStats.Intellect)) * 20f / 120f);
                procSpiritRegen = procSpiritRegen * (100 - calculationOptions.TimeInFSR) * 0.01f +
                                  character.Talents.GetTalent("Meditation").PointsInvested * 0.1f * procSpiritRegen * (1 + calculatedStats.BasicStats.SpellCombatManaRegeneration) * calculationOptions.TimeInFSR * 0.01f;
            }

            float procSpiritRegen2 = 0;

            if (calculatedStats.BasicStats.BangleProc > 0)
            {
                procSpiritRegen2 = ((float)Math.Floor(5 * 0.0093271 * 130f * Math.Sqrt(calculatedStats.BasicStats.Intellect)) * 20f / 120f);
                procSpiritRegen2 = procSpiritRegen2 * (100 - calculationOptions.TimeInFSR) * 0.01f +
                                   character.Talents.GetTalent("Meditation").PointsInvested * 0.1f * procSpiritRegen2 * (1 + calculatedStats.BasicStats.SpellCombatManaRegeneration) * calculationOptions.TimeInFSR * 0.01f;
            }

            calculatedStats.RegenPoints = (calculatedStats.RegenInFSR * calculationOptions.TimeInFSR * 0.01f +
                                           calculatedStats.RegenOutFSR * (100 - calculationOptions.TimeInFSR) * 0.01f)
                                          + calculatedStats.BasicStats.MementoProc * 3f * 5f / (45f + 9.5f * 2f)
                                          + calculatedStats.BasicStats.ManaregenFor8SecOnUse5Min * 5f * (8f * (1 - calculatedStats.BasicStats.SpellHasteRating / 15.7f / 100f)) / (60f * 5f)
                                          + (calculatedStats.BasicStats.BonusManaPotion * 2400f * 5f / 120f)
                                          + procSpiritRegen + procSpiritRegen2
                                          + (calculatedStats.BasicStats.Mp5OnCastFor20SecOnUse2Min > 0 ? 588f * 5f / 120f : 0)
                                          + (calculatedStats.BasicStats.ManaregenOver20SecOnUse3Min * 5f / 180f)
                                          + (calculatedStats.BasicStats.ManaregenOver20SecOnUse5Min * 5f / 300f)
                                          + (calculatedStats.BasicStats.ManacostReduceWithin15OnHealingCast / (2.0f * 50f)) * 5f
                                          + (calculatedStats.BasicStats.FullManaRegenFor15SecOnSpellcast > 0?(((calculatedStats.RegenOutFSR - calculatedStats.RegenInFSR) / 5f) * 15f / 125f) * 5f: 0)
                                          + (calculatedStats.BasicStats.BangleProc > 0 ? (((calculatedStats.RegenOutFSR - calculatedStats.RegenInFSR) / 5f) * 0.25f * 15f / 125f) * 5f : 0);

            calculatedStats.HastePoints = calculatedStats.BasicStats.SpellHasteRating / 2f
                                          + calculatedStats.BasicStats.SpellHasteFor20SecOnUse2Min * 20f / 120f / 2f;

            calculatedStats.OverallPoints = calculatedStats.HealPoints + calculatedStats.RegenPoints + calculatedStats.HastePoints;

            return(calculatedStats);
        }