public virtual void Calculate()
        {
            Player.Instance.Recalculate();
            Player.Instance.Hit1From        = CalculateTarget1HitFrom();
            Player.Instance.Hit1To          = CalculateTarget1HitTo();
            Player.Instance.CastingTime     = CalculateCastingTime();
            Player.Instance.HotRiptide      = CalculateAverageHOT1();
            Player.Instance.EarthlivingTick = CalculateEarthlivingTick();

            ModifyWithModifiers();

            Player.Instance.CastingTime = CalculateCastingTime();

            Modifiers.FirstOrDefault(x => x.Name == Constants.ModTidalWavesHaste && x.IsCheckBoxChecked)?.Modify();

            Player.Instance.EarthlivingAvgHpsCH  = CalculateEarthlivingAvgHpsCH();
            Player.Instance.EarthlivingAvgHpsHW  = CalculateEarthlivingAvgHpsHW();
            Player.Instance.EarthlivingAvgHpsLHW = CalculateEarthlivingAvgHpsLHW();
            Player.Instance.EarthlivingAvgHpsRP  = CalculateEarthlivingAvgHpsRP();
            Player.Instance.Hit2From             = CalculateTarget2HitFrom();
            Player.Instance.Hit3From             = CalculateTarget3HitFrom();
            Player.Instance.Hit4From             = CalculateTarget4HitFrom();
            Player.Instance.Hit2To    = CalculateTarget2HitTo();
            Player.Instance.Hit3To    = CalculateTarget3HitTo();
            Player.Instance.Hit4To    = CalculateTarget4HitTo();
            Player.Instance.Hit1Avg   = CalculateTarget1HitAvg();
            Player.Instance.Hit2Avg   = CalculateTarget2HitAvg();
            Player.Instance.Hit3Avg   = CalculateTarget3HitAvg();
            Player.Instance.Hit4Avg   = CalculateTarget4HitAvg();
            Player.Instance.Crit1To   = CalculateTarget1CritTo();
            Player.Instance.Crit2To   = CalculateTarget2CritTo();
            Player.Instance.Crit3To   = CalculateTarget3CritTo();
            Player.Instance.Crit4To   = CalculateTarget4CritTo();
            Player.Instance.Crit1From = CalculateTarget1CritFrom();
            Player.Instance.Crit2From = CalculateTarget2CritFrom();
            Player.Instance.Crit3From = CalculateTarget3CritFrom();
            Player.Instance.Crit4From = CalculateTarget4CritFrom();
            Player.Instance.Crit1Avg  = CalculateTarget1CritAvg();
            Player.Instance.Crit2Avg  = CalculateTarget2CritAvg();
            Player.Instance.Crit3Avg  = CalculateTarget3CritAvg();
            Player.Instance.Crit4Avg  = CalculateTarget4CritAvg();
            Player.Instance.AvgHot1   = CalculateAverageHOT1();
            Player.Instance.AvgHot2   = CalculateAverageHOT2();
            Player.Instance.AvgHot3   = CalculateAverageHOT3();
            Player.Instance.AvgHot4   = CalculateAverageHOT4();
            Player.Instance.AncestralAwaceningFrom = CalculateAncestralAwakeningFrom();
            Player.Instance.AncestralAwaceningTo   = CalculateAncestralAwakeningTo();
            Player.Instance.AncestralAwaceningAvg  = CalculateAncestralAwakeningAvg();
            Player.Instance.AvgHps                = CalculateAverageHPS();
            Player.Instance.AvgHotHps             = CalculateAverageHotHPS();
            Player.Instance.AvgAAHps              = CalculateAverageAAHPS();
            Player.Instance.AvgGlyphOfHealingWave = CalculateAvgGlyphOfHealingWave();
            Player.Instance.AvgHpm                = CalculateAvgHpm();
            Player.Instance.AvgHpmOneTarget       = CalculateAvgHpmOneTarget();
            Player.Instance.EarthlivingEHPS       = CalculateEarthlivingEHPS();

            Modifiers
            .FirstOrDefault(x => x.Name == Constants.ModGlyphOfChainHeal && x.IsCheckBoxChecked == false)
            ?.Modify();
        }
        public override void Calculate()
        {
            Player.Instance.Recalculate();

            ModifyWithModifiers();

            var modifier = Modifiers
                           .FirstOrDefault(x => x.Name == Constants.ModTidalWavesHaste && x.IsCheckBoxChecked);

            if (modifier != null)
            {
                modifier.Modify();
            }

            Player.Instance.Mp5TimeDec        = CalculateMp5TotalDec();
            Player.Instance.Mp5RPM            = CalculateMp5RPM();
            Player.Instance.Mp5HWPM           = CalculateMp5HWPM();
            Player.Instance.Mp5LHWPM          = CalculateMp5LHWPM();
            Player.Instance.Mp5CHPM           = CalculateMp5CHPM();
            Player.Instance.Mp5Crit           = CalculateMp5Crit();
            Player.Instance.Mp5TotalCrit      = CalculateMp5TotalCrit();
            Player.Instance.Mp5Totems         = CalculateMp5Totems();
            Player.Instance.Mp5Innervates     = CalculateMp5Innervates();
            Player.Instance.Mp5Replenish      = CalculateMp5Replenish();
            Player.Instance.Mp5Diamond        = CalculateMp5Diamond();
            Player.Instance.Mp5RevitalizeMana = CalculateMp5RevitalizeMana();
            Player.Instance.Mp5RaptureMana    = CalculateMp5RaptureMana();
            Player.Instance.Mp5TotalManaGain  = CalculateMp5TotalManaGain();
            Player.Instance.Mp5TotalManaSpent = CalculateMp5TotalManaSpent();
            Player.Instance.Mp5ManaDifference = CalculateMp5ManaDifference();
        }
Exemplo n.º 3
0
        public override double CalculateAvgHpm()
        {
            var mod2Pt7    = Modifiers.FirstOrDefault(x => x.Name == Constants.Mod2PT7Bonus).IsCheckBoxChecked;
            var multiplier = mod2Pt7 ? 5.35 : 4.92;

            // {Rip HIT * [Crtit% / 100 * 1.5 + (1 - Crit% / 100)] + [5 * Rip TICK]} / [751 - (Crit% * 4.92 )]
            var isGlyphOfRiptide = Modifiers
                                   .Any(x => x.Name == Constants.ModGlyphOfRiptide && x.IsCheckBoxChecked);

            var critChance = Player.Instance.CriticalPercent;
            var critValue  = Player.Instance.CriticalMultiplier;

            double?avgHps;

            if (isGlyphOfRiptide)
            {
                avgHps = (((critChance / 100 * critValue) +
                           (1 - critChance / 100)) * Player.Instance.Hit1Avg + (7 * Player.Instance.HotRiptide));
            }
            else
            {
                avgHps = (((critChance / 100 * critValue) +
                           (1 - critChance / 100)) * Player.Instance.Hit1Avg + (5 * Player.Instance.HotRiptide));
            }

            avgHps += Player.Instance.EarthlivingAvgHpsRP;
            avgHps += Player.Instance.AncestralAwaceningAvg * Player.Instance.CriticalPercent / 100;

            avgHps /= 751;

            return(Math.Round(avgHps ?? 0, 1));
        }
Exemplo n.º 4
0
        public override double CalculateAvgHpm()
        {
            var mod2Pt7 = Modifiers.FirstOrDefault(x => x.Name == Constants.Mod2PT7Bonus).IsCheckBoxChecked;

            var result = (Player.Instance.Hit1Avg * (Player.Instance.CriticalPercent / 100 * Player.Instance.CriticalMultiplier +
                                                     (1 - Player.Instance.CriticalPercent / 100)));

            result += Player.Instance.EarthlivingAvgHpsLHW;

            result += Player.Instance.AncestralAwaceningAvg * Player.Instance.CriticalPercent / 100;

            result /= 626;
            return(Math.Round(result ?? 0, 1));
        }
Exemplo n.º 5
0
        public override void AppendToOperation(IOperationBuilder operationBuilder)
        {
            var builder = (MudLikeOperationBuilder)operationBuilder;

            if (TargetEntities.Count == 0)
            {
                return;
            }

            builder
            .StartContainer("action");

            foreach (var target in TargetEntities)
            {
                var primaryAffectedStat = Modifiers.FirstOrDefault();
                if (primaryAffectedStat == null)
                {
                    continue;
                }

                var elementInfo = Element.GetRange(primaryAffectedStat.Value);

                // dude's actionName hits target for # statname
                builder.AddText($"{SourceEntity.Name}'s ")
                .AddText($"{Name}", Element.TextColor)
                .AddText($" {elementInfo.Text}", elementInfo.TextColor)
                .AddText($" {target.Name} for ")
                .AddTextLine($" {Math.Abs(primaryAffectedStat.Value)}", TextColor.Red)

                //  .AddText(" for ")
                //  .AddTextLine($" {Math.Abs(primaryAffectedStat.Value)}", elementInfo.TextColor)
                ;
            }



            //   .AddText($"{DamageDone}", TextColor.Red)
            //   .AddTextLine(" damage")
            builder.EndContainer("action");

            //return $"{SourceEntity?.Name} spit on {TargetEntity?.Name} for {_damageDone}";
        }
        public override double?CalculateMp5Crit()
        {
            var mod2Pt7    = Modifiers.FirstOrDefault(x => x.Name == Constants.Mod2PT7Bonus).IsCheckBoxChecked;
            var multiplier = mod2Pt7 ? 5.35 : 4.92;

            //RPM * 0.00971 + HWPM * 0.00971 + LHWPM * 0.005826 + CHPM * 0.002913
            if (mod2Pt7)
            {
                var rezult = (Player.Instance.Mp5RPM ?? 0) * 0.00971 +
                             (Player.Instance.Mp5HWPM ?? 0) * 0.00971 +
                             (Player.Instance.Mp5LHWPM ?? 0) * 0.005826 +
                             (Player.Instance.Mp5CHPM ?? 0) * 0.002913;
                return(Math.Round(rezult, 4));
            }

            //RPM * 0.00893 + HWPM * 0.00893 + LHWPM * 0.005358 + CHPM * 0.00268
            var r = (Player.Instance.Mp5RPM ?? 0) * 0.00893 +
                    (Player.Instance.Mp5HWPM ?? 0) * 0.00893 +
                    (Player.Instance.Mp5LHWPM ?? 0) * 0.005358 +
                    (Player.Instance.Mp5CHPM ?? 0) * 0.00268;

            return(Math.Round(r, 4));
        }
        public override double CalculateAvgHpm()
        {
            var isGlyphHealingWave = Modifiers.FirstOrDefault(x => x.Name == Constants.ModGlyphOfHealingWave).IsCheckBoxChecked;

            var mod2Pt7    = Modifiers.FirstOrDefault(x => x.Name == Constants.Mod2PT7Bonus).IsCheckBoxChecked;
            var multiplier = mod2Pt7 ? 5.35 : 4.92;

            var isTotemOfMisery = Modifiers.Any(x => x.Name == Constants.ModTotemOfMisery && x.IsCheckBoxChecked);
            var totemModifier   = isTotemOfMisery ? 969 : 1044;

            var result = (Player.Instance.Hit1Avg * (Player.Instance.CriticalPercent / 100 * Player.Instance.CriticalMultiplier +
                                                     (1 - Player.Instance.CriticalPercent / 100)));

            result += Player.Instance.EarthlivingAvgHpsHW;

            if (isGlyphHealingWave)
            {
                result += result * 0.2;
            }
            result += Player.Instance.AncestralAwaceningAvg * Player.Instance.CriticalPercent / 100;
            result /= totemModifier;

            return(Math.Round(result ?? 0, 1));
        }
Exemplo n.º 8
0
 public Modifier GetModifier(string name) =>
 Modifiers.FirstOrDefault(m => m.Name == name);