예제 #1
0
        public override void DoAction()
        {
            ResultType res = Player.YellowAttackEnemy(Player.Sim.Boss);

            int damage = (int)Math.Round(Randomer.Next(DMG_MIN, DMG_MAX + 1)
                                         * (Player.Sim.DamageMod(res) + (res == ResultType.Crit ? 0 + (0.1 * Player.GetTalentPoints("Impale")) : 0))
                                         * Simulation.ArmorMitigation(Player.Sim.Boss.Armor)
                                         * Player.DamageMod
                                         * (Player.DualWielding ? 1 : (1 + 0.01 * Player.GetTalentPoints("2HS")))
                                         );

            int threat = (int)Math.Round((damage + BONUS_THREAT) * Player.ThreatMod);

            CommonAction();
            if (res == ResultType.Parry || res == ResultType.Dodge)
            {
                // TODO à vérifier
                Player.Resource -= Cost / 2;
            }
            else
            {
                Player.Resource -= Cost;
            }

            RegisterDamage(new ActionResult(res, damage, threat));

            Player.CheckOnHits(true, false, res);
        }
예제 #2
0
        public double GlancingDamage(int level = 60, int enemyLevel = 63)
        {
            double low  = Math.Max(0.01, Math.Min(0.91, 1.3 - 0.05 * (enemyLevel - level)));
            double high = Math.Max(0.2, Math.Min(0.99, 1.2 - 0.03 * (enemyLevel - level)));

            return(Randomer.NextDouble() * (high - low) + low);
        }
예제 #3
0
        public override void DoAction()
        {
            base.DoAction();

            double winterChillBonusCrit = 0.1;

            ResultType res;
            double     mitigation = Simulation.MagicMitigation(Player.Sim.Boss.ResistChances[School]);

            if (mitigation == 0)
            {
                res = ResultType.Resist;
            }
            else
            {
                res = Player.SpellAttackEnemy(Player.Sim.Boss, true, 0.02 * Player.GetTalentPoints("EP"), winterChillBonusCrit);
            }

            CommonManaSpell();

            int minDmg = MIN_DMG;
            int maxDmg = MAX_DMG;

            int damage = (int)Math.Round((Randomer.Next(minDmg, maxDmg + 1) + (Player.SP * RATIO))
                                         * (Player.Sim.DamageMod(res, School) + (res == ResultType.Crit ? 0.1 * Player.GetTalentPoints("IS") : 0))
                                         * (1 + 0.02 * Player.GetTalentPoints("PI"))
                                         * mitigation
                                         * Player.DamageMod
                                         );

            RegisterDamage(new ActionResult(res, damage));
        }
예제 #4
0
        public override void DoAction()
        {
            Player.applyAtNextAA = null;

            Weapon weapon = Player.MH;

            LockedUntil = Player.Sim.CurrentTime + weapon.Speed / Player.HasteMod;

            ResultType res = Player.YellowAttackEnemy(Player.Sim.Boss);

            int minDmg = (int)Math.Round(weapon.DamageMin + weapon.Speed * (Player.AP + Player.nextAABonus) / 14);
            int maxDmg = (int)Math.Round(weapon.DamageMax + weapon.Speed * (Player.AP + Player.nextAABonus) / 14);

            Player.nextAABonus = 0;

            int damage = (int)Math.Round((Randomer.Next(minDmg, maxDmg + 1) + 157)
                                         * (Player.Sim.DamageMod(res) + (res == ResultType.Crit ? 0 + (0.1 * Player.GetTalentPoints("Impale")) : 0))
                                         * Simulation.ArmorMitigation(Player.Sim.Boss.Armor)
                                         * Player.DamageMod
                                         * (Player.DualWielding ? 1 : (1 + 0.01 * Player.GetTalentPoints("2HS"))));

            if (res == ResultType.Parry || res == ResultType.Dodge)
            {
                // TODO à vérifier
                Player.Resource -= Cost / 2;
            }
            else
            {
                Player.Resource -= Cost;
            }

            RegisterDamage(new ActionResult(res, damage));

            Player.CheckOnHits(true, false, res);
        }
예제 #5
0
        public override void DoAction()
        {
            //Player.Life -= Randomer.Next(LIFE_MIN, LIFE_MAX + 1);
            Player.Mana += Randomer.Next(MANA_MIN, MANA_MAX + 1);

            LogAction();
        }
예제 #6
0
        public override void DoAction()
        {
            base.DoAction();

            ResultType res;
            double     mitigation = Simulation.MagicMitigation(Player.Sim.Boss.ResistChances[School]);

            if (mitigation == 0)
            {
                res = ResultType.Resist;
            }
            else
            {
                res = Player.SpellAttackEnemy(Player.Sim.Boss, true, 0, 0.02 * Player.GetTalentPoints("Deva"));
            }

            CommonManaSpell();

            int minDmg = MIN_DMG;
            int maxDmg = MAX_DMG;

            int damage = (int)Math.Round((Randomer.Next(minDmg, maxDmg + 1) + (Player.SP * RATIO))
                                         * (Player.Sim.DamageMod(res, School) + (res == ResultType.Crit ? 0.5 * Player.GetTalentPoints("Ruin") : 0))
                                         * (1 + 0.02 * Player.GetTalentPoints("SM"))
                                         * (1 + 0.15 * Player.GetTalentPoints("DS"))
                                         * (Player.Sim.Boss.Effects.ContainsKey(ShadowVulnerability.NAME) ? ((ShadowVulnerability)Player.Sim.Boss.Effects[ShadowVulnerability.NAME]).Modifier : 1)
                                         * mitigation
                                         * Player.DamageMod
                                         );

            ShadowVulnerability.CheckProc(Player, this, res);
            RegisterDamage(new ActionResult(res, damage));
        }
예제 #7
0
        public override void StartEffect()
        {
            base.StartEffect();

            Player.Resource += Randomer.Next(45, 347);
            Player.BonusAttributes.SetValue(Attribute.Strength, Player.BonusAttributes.GetValue(Attribute.Strength) + 60);
            Player.BonusAttributes.SetValue(Attribute.AP, Player.BonusAttributes.GetValue(Attribute.AP) + 120);
        }
예제 #8
0
        public override void DoAction()
        {
            //  Don't call base.DoAction, since that resets the swing timer
            Player.casting = null;

            LogAction();

            //  Find out whether it hits/crits
            ResultType res = Player.WhiteAttackEnemy(Player.Sim.Boss, true);

            int damage = 0;

            //  Can't glance, so treat glance as a hit
            if (res == ResultType.Glance)
            {
                res = ResultType.Hit;
            }

            if (res == ResultType.Hit || res == ResultType.Crit)
            {
                //  Calculate weapon dmg
                double weapMin = Player.MH.DamageMin + Player.MH.Speed * (Player.AP + Player.nextAABonus) / 14;
                double weapMax = Player.MH.DamageMax + Player.MH.Speed * (Player.AP + Player.nextAABonus) / 14;

                //  70% weapon damage
                int minDmg = (int)(0.7 * weapMin);
                int maxDmg = (int)(0.7 * weapMax);

                //  Include SotC bonus
                int holyBoost = 0;
                if (Player.Sim.Boss.Effects.ContainsKey(JudgementOfTheCrusaderDebuff.NAME))
                {
                    holyBoost = ((JudgementOfTheCrusaderDebuff)Player.Sim.Boss.Effects[JudgementOfTheCrusaderDebuff.NAME]).HolyDmgIncrease;
                }

                //  Include spell resistance
                double spellResist = 1.0;

                /*  I don't think this factors in, for some reason, or there is a different dmg *boost* missing to offset this
                 * spellResist = 1 - Simulation.AverageResistChance(315);
                 */

                damage = (int)Math.Round((Randomer.Next(minDmg, maxDmg + 1) + ((holyBoost + Player.SP) * RATIO))
                                         * Player.Sim.DamageMod(res, School.Physical) //  Crit modifier using Melee multiplier
                                         * (Player.Sim.Boss.Effects.ContainsKey(SpellVulnerability.NAME) ? ((SpellVulnerability)Player.Sim.Boss.Effects[SpellVulnerability.NAME]).Modifier : 1)
                                         * spellResist
                                         * Player.DamageMod
                                         );

                //  Turn on Vengeance
                if (Player.GetTalentPoints("Veng") > 0)
                {
                    Vengeance.CheckProc(Player, res);
                }
            }

            RegisterDamage(new ActionResult(res, damage));
        }
예제 #9
0
        public override void DoAction()
        {
            base.DoAction();

            Player.Resource = 0
                              + ((Randomer.NextDouble() < Player.GetTalentPoints("Furor") * 0.2) ? 40 : 0)
                              + (Player.Equipment[Player.Slot.Head].Name == "Wolfshead Helm" ? 20 : 0);

            LogAction();
            Player.Sim.RegisterAction(new RegisteredAction(this, new ActionResult(ResultType.Hit, 0), Player.Sim.CurrentTime));
        }
예제 #10
0
 public static bool CheckProc(Player p, ResultType res, int points)
 {
     if (res == ResultType.Hit || res == ResultType.Crit || res == ResultType.Block || res == ResultType.Glance)
     {
         if (Randomer.NextDouble() < (0.08 * points))
         {
             p.Resource += 1;
             return(true);
         }
     }
     return(false);
 }
예제 #11
0
 public static void CheckProc(Player p, ResultType type, int points)
 {
     if (type == ResultType.Hit || type == ResultType.Crit || type == ResultType.Glance)
     {
         //  SoC is normalized by 7 procs-per-minute using the following formula
         double procRate = 7 * p.MH.Speed / 60;
         if (Randomer.NextDouble() < procRate)
         {
             //  It proc'ed, so see if it hits/does damage
             new SealOfCommandProc(p, p.Sim.Boss).DoAction();
         }
     }
 }
예제 #12
0
 public static void CheckProc(Player p)
 {
     if (Randomer.NextDouble() < ProcRate(p))
     {
         if (p.Sim.Boss.Effects.ContainsKey(NAME))
         {
             p.Sim.Boss.Effects[NAME].Refresh();
         }
         else
         {
             new ShadowTrance(p).StartEffect();
         }
     }
 }
예제 #13
0
 public static void CheckProc(Player p)
 {
     if (Randomer.NextDouble() < PROC_RATE)
     {
         if (p.Effects.ContainsKey(NAME))
         {
             p.Effects[NAME].Refresh();
         }
         else
         {
             new ClearCasting(p).StartEffect();
         }
     }
 }
예제 #14
0
        public static double MagicMitigation(Dictionary <double, double> dic)
        {
            double r   = Randomer.NextDouble();
            double tot = 0;

            foreach (double d in dic.Keys)
            {
                tot += dic[d] / 100;
                if (r <= tot)
                {
                    return(1 - d);
                }
            }
            return(1);
        }
예제 #15
0
        public override void DoAction()
        {
            ResultType res = Player.YellowAttackEnemy(Player.Sim.Boss);

            int minDmg = (int)Math.Round(Player.Level * 0.85 + Player.AP / 14);
            int maxDmg = (int)Math.Round(Player.Level * 1.25 + Player.AP / 14);

            int damage = (int)Math.Round(
                (Randomer.Next(minDmg, maxDmg + 1) * 2.25 + 180)
                * (1 + Player.GetTalentPoints("NW") * 0.02)
                * Player.Sim.DamageMod(res)
                * Simulation.ArmorMitigation(Player.Sim.Boss.Armor)
                * Player.DamageMod);

            CommonAction();

            int cost = Cost;

            if (Player.Effects.ContainsKey(ClearCasting.NAME))
            {
                cost = 0;
                Player.Effects[ClearCasting.NAME].StackRemove();
            }

            if (res == ResultType.Parry || res == ResultType.Dodge)
            {
                // TODO à vérifier
                Player.Resource -= cost / 2;
            }
            else
            {
                Player.Resource -= cost;
            }

            if (res == ResultType.Hit || res == ResultType.Crit || res == ResultType.Block || res == ResultType.Glance)
            {
                Player.Combo++;
            }

            if (res == ResultType.Crit && Randomer.NextDouble() < 0.5 * Player.GetTalentPoints("BF"))
            {
                Player.Combo++;
            }

            RegisterDamage(new ActionResult(res, damage));

            Player.CheckOnHits(true, false, res);
        }
예제 #16
0
        public override void DoAction()
        {
            Weapon weapon = Player.MH;

            ResultType res = Player.YellowAttackEnemy(Player.Sim.Boss);

            int minDmg = (int)Math.Round(weapon.DamageMin + Simulation.Normalization(weapon) * (Player.AP + Player.nextAABonus) / 14);
            int maxDmg = (int)Math.Round(weapon.DamageMax + Simulation.Normalization(weapon) * (Player.AP + Player.nextAABonus) / 14);

            Player.nextAABonus = 0;

            int damage = (int)Math.Round((Randomer.Next(minDmg, maxDmg + 1) + 68)
                                         * Player.Sim.DamageMod(res)
                                         * Simulation.ArmorMitigation(Player.Sim.Boss.Armor)
                                         * (1 + (0.02 * Player.GetTalentPoints("Agg")))
                                         * (res == ResultType.Crit ? 1 + (0.06 * Player.GetTalentPoints("Letha")) : 1)
                                         * (1 + (0.01 * Player.GetTalentPoints("Murder")))
                                         * Player.DamageMod
                                         );

            CommonAction();

            if (res == ResultType.Parry || res == ResultType.Dodge)
            {
                // TODO à vérifier
                Player.Resource -= Cost / 2;
            }
            else
            {
                Player.Resource -= Cost;
            }

            if (res == ResultType.Hit || res == ResultType.Crit || res == ResultType.Block || res == ResultType.Glance)
            {
                Player.Combo++;
            }

            /*
             * if (res == ResultType.Crit && Randomer.NextDouble() < 0.2 * Player.GetTalentPoints("SF"))
             * {
             *  Player.Combo++;
             * }
             */

            RegisterDamage(new ActionResult(res, damage));

            Player.CheckOnHits(true, false, res);
        }
예제 #17
0
        public override void DoAction()
        {
            //  Don't call base.DoAction, since that resets the swing timer
            Player.casting = null;

            LogAction();

            ResultType res = Player.SpellAttackEnemy(Player.Sim.Boss);

            int damage = 0;

            //  Can't glance
            if (res == ResultType.Hit || res == ResultType.Crit)
            {
                //  Include SotC bonus
                int holyBoost = 0;
                if (Player.Sim.Boss.Effects.ContainsKey(JudgementOfTheCrusaderDebuff.NAME))
                {
                    holyBoost = ((JudgementOfTheCrusaderDebuff)Player.Sim.Boss.Effects[JudgementOfTheCrusaderDebuff.NAME]).HolyDmgIncrease;
                }

                //  Include spell resistance
                double spellResist = 1.0;

                /*  I don't think this factors in, for some reason, or there is a different dmg *boost* missing to offset this
                 * spellResist = 1 - Simulation.AverageResistChance(315);
                 */

                //  Include talented SoR
                double impSoRMultiplier = 1.0 + 0.03 * Player.GetTalentPoints("ImpSoR");

                damage = (int)Math.Round((Randomer.Next(minDmg, maxDmg + 1) + ((holyBoost + Player.SP) * RATIO))
                                         * Player.Sim.DamageMod(ResultType.Hit, School.Light)
                                         * (Player.Sim.Boss.Effects.ContainsKey(SpellVulnerability.NAME) ? ((SpellVulnerability)Player.Sim.Boss.Effects[SpellVulnerability.NAME]).Modifier : 1)
                                         * spellResist
                                         * Player.DamageMod
                                         * impSoRMultiplier
                                         );

                //  Turn on Vengeance
                if (Player.GetTalentPoints("Veng") > 0)
                {
                    Vengeance.CheckProc(Player, res);
                }
            }

            RegisterDamage(new ActionResult(res, damage));
        }
예제 #18
0
        public override void DoAction()
        {
            //  Don't call base.DoAction, since that resets the swing timer
            Player.casting = null;

            LogAction();

            ResultType res = Player.MeleeSpellAttackEnemy(Player.Sim.Boss);

            int damage = 0;

            //  Can't glance
            if (res == ResultType.Hit || res == ResultType.Crit)
            {
                int minDmg = minDmg_Normal;
                int maxDmg = maxDmg_Normal;

                //  Double dmg if target is stunned
                if (Player.Sim.Boss.Effects.ContainsKey(HammerOfJusticeDebuff.NAME))
                {
                    minDmg = minDmg_Stunned;
                    maxDmg = maxDmg_Stunned;
                }

                //  Include SotC bonus
                int holyBoost = 0;
                if (Player.Sim.Boss.Effects.ContainsKey(JudgementOfTheCrusaderDebuff.NAME))
                {
                    holyBoost = ((JudgementOfTheCrusaderDebuff)Player.Sim.Boss.Effects[JudgementOfTheCrusaderDebuff.NAME]).HolyDmgIncrease;
                }

                damage = (int)Math.Round((Randomer.Next(minDmg, maxDmg + 1) + ((holyBoost + Player.SP) * RATIO))
                                         * Player.Sim.DamageMod(res, School.Physical) //  Crit modifier using Melee multiplier
                                         * (Player.Sim.Boss.Effects.ContainsKey(SpellVulnerability.NAME) ? ((SpellVulnerability)Player.Sim.Boss.Effects[SpellVulnerability.NAME]).Modifier : 1)
                                         * (1 - Simulation.AverageResistChance(315))
                                         * Player.DamageMod
                                         );

                //  Turn on Vengeance
                if (Player.GetTalentPoints("Veng") > 0)
                {
                    Vengeance.CheckProc(Player, res);
                }
            }

            RegisterDamage(new ActionResult(res, damage));
        }
예제 #19
0
 public static void CheckProc(Player p, ResultType type, double weaponSpeed)
 {
     if (type == ResultType.Hit || type == ResultType.Crit || type == ResultType.Block || type == ResultType.Glance)
     {
         if (Randomer.NextDouble() < weaponSpeed / 60)
         {
             if (p.Effects.ContainsKey(Crusader.NAME))
             {
                 p.Effects[Crusader.NAME].Refresh();
             }
             else
             {
                 new Crusader(p).StartEffect();
             }
         }
     }
 }
예제 #20
0
        public override void DoAction()
        {
            Player.applyAtNextAA = null;

            Weapon weapon = Player.MH;

            LockedUntil = Player.Sim.CurrentTime + weapon.Speed / Player.HasteMod;

            ResultType res = Player.YellowAttackEnemy(Player.Sim.Boss);

            int minDmg = (int)Math.Round(Player.Level * 0.85 + 2.5 * (Player.AP + Player.nextAABonus) / 14);
            int maxDmg = (int)Math.Round(Player.Level * 1.25 + 2.5 * (Player.AP + Player.nextAABonus) / 14);

            Player.nextAABonus = 0;

            int damage = (int)Math.Round((Randomer.Next(minDmg, maxDmg + 1) + 101)
                                         * Player.Sim.DamageMod(res)
                                         * Simulation.ArmorMitigation(Player.Sim.Boss.Armor)
                                         * (1 + Player.GetTalentPoints("SF") * 0.1)
                                         * Player.DamageMod
                                         );

            int threat = (int)Math.Round(damage * THREAT_MOD * Player.ThreatMod);

            int cost = Cost;

            if (Player.Effects.ContainsKey(ClearCasting.NAME))
            {
                cost = 0;
                Player.Effects[ClearCasting.NAME].StackRemove();
            }

            if (res == ResultType.Parry || res == ResultType.Dodge)
            {
                // TODO à vérifier
                Player.Resource -= Cost / 2;
            }
            else
            {
                Player.Resource -= Cost;
            }

            RegisterDamage(new ActionResult(res, damage, threat));

            Player.CheckOnHits(true, false, res);
        }
예제 #21
0
        public Simulation(Player player, Boss boss, double fightLength, bool autoBossLife = true, double lowLifeTime = 0, double fightLengthMod = 0.2)
        {
            Player      = player;
            Boss        = boss;
            player.Sim  = this;
            Boss.Sim    = this;
            FightLength = fightLength * (1 + fightLengthMod / 2 - (Randomer.NextDouble() * fightLengthMod));
            Results     = new SimResult(FightLength);
            Damage      = 0;
            CurrentTime = 0;
            AutoLife    = autoBossLife;
            LowLifeTime = lowLifeTime;

            lastHit = -hitEvery;

            Ended = false;
        }
예제 #22
0
        public override void DoAction()
        {
            ResultType res = Player.YellowAttackEnemy(Player.Sim.Boss);

            int minDmg = min[Player.Combo - 1];
            int maxDmg = max[Player.Combo - 1];

            int damage = (int)Math.Round(
                (Randomer.Next(minDmg, maxDmg + 1) + Player.AP * 0.15)
                * Player.Sim.DamageMod(res)
                * Simulation.ArmorMitigation(Player.Sim.Boss.Armor)
                * Player.DamageMod
                * (1 + (0.02 * Player.GetTalentPoints("Agg")))
                * (1 + (0.05 * Player.GetTalentPoints("IE")))
                * (1 + (0.01 * Player.GetTalentPoints("Murder")))
                );

            CommonAction();
            if (res == ResultType.Parry || res == ResultType.Dodge)
            {
                // TODO à vérifier
                Player.Resource -= Cost / 2;
            }
            else
            {
                Player.Resource -= Cost;

                if (Player.GetTalentPoints("RS") > 0 && Randomer.NextDouble() < 0.2 * Player.Combo)
                {
                    Player.Resource += 25;
                }

                Player.Combo = 0;

                if (Randomer.NextDouble() < 0.2 * Player.GetTalentPoints("Ruth"))
                {
                    Player.Combo++;
                }
            }

            RegisterDamage(new ActionResult(res, damage));

            Player.CheckOnHits(true, false, res);
        }
예제 #23
0
 public static void CheckProc(Player p, Spell s, ResultType res)
 {
     if (p.MH.Name == "Nightfall")
     {
         //  Raid bosses seems to have an 8% proc rate, while blasted lands mobs seem to have 11%
         double procRate = 0.08;
         if (Randomer.NextDouble() < procRate)
         {
             if (p.Sim.Boss.Effects.ContainsKey(NAME))
             {
                 p.Sim.Boss.Effects[NAME].Refresh();
             }
             else
             {
                 new SpellVulnerability(p).StartEffect();
             }
         }
     }
 }
예제 #24
0
        public override void DoAction()
        {
            //  Don't call base.DoAction, since that resets the swing timer
            Player.casting = null;

            LogAction();

            ResultType res = Player.SpellAttackEnemy(Player.Sim.Boss, false, 0, 0);

            //  Can't glance
            if (res == ResultType.Hit || res == ResultType.Crit)
            {
                int minDmg = 504;
                int maxDmg = 556;

                //  Uses melee crit multiplier
                if (res == ResultType.Crit)
                {
                    minDmg *= 2;
                    maxDmg *= 2;
                }

                //  Include SotC bonus
                int holyBoost = 0;
                if (Player.Sim.Boss.Effects.ContainsKey(JudgementOfTheCrusaderDebuff.NAME))
                {
                    holyBoost = ((JudgementOfTheCrusaderDebuff)Player.Sim.Boss.Effects[JudgementOfTheCrusaderDebuff.NAME]).HolyDmgIncrease;
                }

                int damage = (int)Math.Round((Randomer.Next(minDmg, maxDmg + 1) + ((holyBoost + Player.SP) * RATIO))
                                             * Player.Sim.DamageMod(res, School)
                                             * (Player.Sim.Boss.Effects.ContainsKey(SpellVulnerability.NAME) ? ((SpellVulnerability)Player.Sim.Boss.Effects[SpellVulnerability.NAME]).Modifier : 1)
                                             * Player.DamageMod
                                             );

                RegisterDamage(new ActionResult(res, damage));
            }

            //  Does trigger GCD after cast
            CommonManaSpell();
        }
예제 #25
0
        public override void DoAction()
        {
            ResultType res = Player.YellowAttackEnemy(Player.Sim.Boss);

            CommonAction();
            Player.Resource -= Cost;

            int minDmg = (int)Math.Round(Player.MH.DamageMin + Simulation.Normalization(Player.MH) * Player.AP / 14);
            int maxDmg = (int)Math.Round(Player.MH.DamageMax + Simulation.Normalization(Player.MH) * Player.AP / 14);

            int damage = (int)Math.Round(Randomer.Next(minDmg, maxDmg + 1)
                                         * Player.Sim.DamageMod(res)
                                         * Simulation.ArmorMitigation(Player.Sim.Boss.Armor)
                                         * Player.DamageMod
                                         * (res == ResultType.Crit ? 1 + (0.1 * Player.GetTalentPoints("Impale")) : 1)
                                         * (Player.DualWielding ? 1 : (1 + 0.01 * Player.GetTalentPoints("2HS"))));

            RegisterDamage(new ActionResult(res, damage));

            Player.CheckOnHits(true, false, res);
        }
예제 #26
0
        public void DoAA(List <string> alreadyProc = null, bool extra = false)
        {
            ResultType res;

            if (Player.Class == Player.Classes.Warrior && !MH && Player.applyAtNextAA != null)
            {
                res = Player.YellowAttackEnemy(Player.Sim.Boss);
            }
            else
            {
                res = Player.WhiteAttackEnemy(Player.Sim.Boss, MH);
            }

            int minDmg = (int)Math.Round(
                Player.Form == Player.Forms.Cat ? Player.Level * 0.85 + (Player.AP + Player.nextAABonus) / 14 :
                Weapon.DamageMin + Weapon.Speed * (Player.AP + Player.nextAABonus) / 14);
            int maxDmg = (int)Math.Round(
                Player.Form == Player.Forms.Cat ? Player.Level * 1.25 + (Player.AP + Player.nextAABonus) / 14 :
                Weapon.DamageMax + Weapon.Speed * (Player.AP + Player.nextAABonus) / 14);

            Player.nextAABonus = 0;

            int damage = (int)Math.Round(Randomer.Next(minDmg, maxDmg + 1)
                                         * Player.Sim.DamageMod(res)
                                         * Simulation.ArmorMitigation(Player.Sim.Boss.Armor)
                                         * (Player.Class == Player.Classes.Paladin ? (1 + 0.02 * Player.GetTalentPoints("2HWS")) : 1.0)
                                         * Player.DamageMod
                                         * (Player.DualWielding ? (MH ? 1 : 0.5 * (1 + (0.05 * Player.GetTalentPoints("DWS")))) : (1 + 0.01 * Player.GetTalentPoints("2HS")))
                                         );

            if (Player.Class == Player.Classes.Warrior || Player.Form == Player.Forms.Bear)
            {
                Player.Resource += (int)Math.Round(Simulation.RageGained(damage, Player.Level));
                //Player.Resource += (int)Math.Round(Simulation.RageGained2(damage, Weapon.Speed, MH, res == ResultType.Crit, Player.Level));
            }

            RegisterDamage(new ActionResult(res, damage));

            Player.CheckOnHits(MH, true, res, extra, alreadyProc);
        }
예제 #27
0
        public override void DoAction()
        {
            base.DoAction();

            bool inner = Player.Effects.ContainsKey(InnerFocusBuff.NAME);

            ResultType res;
            double     mitigation = Simulation.MagicMitigation(Player.Sim.Boss.ResistChances[School]);

            if (mitigation == 0)
            {
                res = ResultType.Resist;
            }
            else
            {
                res = Player.SpellAttackEnemy(Player.Sim.Boss, true, 0.02 * Player.GetTalentPoints("SF"), inner ? 0.25 : 0);
            }

            CommonManaSpell(inner ? 0 : Cost);

            if (inner)
            {
                Player.Effects[InnerFocusBuff.NAME].EndEffect();
            }

            int minDmg = MIN_DMG;
            int maxDmg = MAX_DMG;

            int damage = (int)Math.Round((Randomer.Next(minDmg, maxDmg + 1) + (Player.SP * RATIO))
                                         * Player.Sim.DamageMod(res, School)
                                         * (1 + 0.02 * Player.GetTalentPoints("Darkness"))
                                         * 1.15 // shadow weaving
                                         * 1.15 // shadow form
                                         * mitigation
                                         * Player.DamageMod
                                         );

            RegisterDamage(new ActionResult(res, damage));
        }
예제 #28
0
        public override void DoAction()
        {
            ResultType res = Player.YellowAttackEnemy(Player.Sim.Boss);

            int minDmg = min[Player.Combo - 1];
            int maxDmg = max[Player.Combo - 1];


            int cost = Cost;

            if (Player.Effects.ContainsKey(ClearCasting.NAME))
            {
                cost = 0;
                Player.Effects[ClearCasting.NAME].StackRemove();
            }

            int damage = (int)Math.Round(
                (Randomer.Next(minDmg, maxDmg + 1) + Player.AP * 0.15 + 2.5 * (Player.Resource - cost))
                * (1 + Player.GetTalentPoints("FA") * 0.03)
                * Player.Sim.DamageMod(res)
                * Simulation.ArmorMitigation(Player.Sim.Boss.Armor)
                * Player.DamageMod);

            CommonAction();
            if (res == ResultType.Parry || res == ResultType.Dodge)
            {
                // TODO à vérifier
                Player.Resource = cost / 2;
            }
            else
            {
                Player.Resource = 0;
                Player.Combo    = 0;
            }

            RegisterDamage(new ActionResult(res, damage));

            Player.CheckOnHits(true, false, res);
        }
예제 #29
0
        public Simulation(Player player, Boss boss, double fightLength, bool autoBossLife = true, double lowLifeTime = 0, double fightLengthMod = 0.2, bool unlimitedMana = false, bool unlimitedResource = false, bool tanking = false, double tankHitEvery = 1, double tankHitRage = 25)
        {
            Player      = player;
            Boss        = boss;
            player.Sim  = this;
            Boss.Sim    = this;
            FightLength = fightLength * (1 + fightLengthMod / 2 - (Randomer.NextDouble() * fightLengthMod));
            Results     = new SimResult(FightLength);
            Damage      = 0;
            Threat      = 0;
            CurrentTime = 0;
            AutoLife    = autoBossLife;
            LowLifeTime = lowLifeTime;

            UnlimitedMana     = unlimitedMana;
            UnlimitedResource = unlimitedResource;
            Tanking           = tanking;
            TankHitEvery      = tankHitEvery;
            TankHitRage       = tankHitRage;

            LastHit = -TankHitEvery;

            Ended = false;
        }
예제 #30
0
        public void DoAA(List <string> alreadyProc = null, bool extra = false)
        {
            double     mitigation = 1;
            ResultType res;

            if (Type == AAType.Wand)
            {
                mitigation = Simulation.MagicMitigation(Player.Sim.Boss.ResistChances[School]);
                if (mitigation == 0)
                {
                    res = ResultType.Resist;
                }
                res = Player.RangedMagicAttackEnemy(Player.Sim.Boss);
            }
            else if (Type == AAType.Ranged)
            {
                res = ResultType.Hit;
                // TODO
            }
            else if (Player.Class == Player.Classes.Warrior && !MH && Player.applyAtNextAA != null)
            {
                res = Player.YellowAttackEnemy(Player.Sim.Boss);
            }
            else
            {
                res = Player.WhiteAttackEnemy(Player.Sim.Boss, MH);
            }


            Player.nextAABonus = 0;
            int minDmg, maxDmg, damage;

            if (Type == AAType.Wand)
            {
                minDmg = (int)Math.Round(Weapon.DamageMin);
                maxDmg = (int)Math.Round(Weapon.DamageMax);
                damage = (int)Math.Round(Randomer.Next(minDmg, maxDmg + 1)
                                         * Player.Sim.DamageMod(res, Weapon.School, Player.Level, Player.Sim.Boss.Level, true)
                                         * Player.DamageMod
                                         * (1 + (Player.Class == Player.Classes.Priest ? 0.05 : 0.125) * Player.GetTalentPoints("Wand"))
                                         * mitigation
                                         * (School == School.Shadow && Player.Class == Player.Classes.Priest ? 1.15 * 1.15 : 1) // shadow weaving + form
                                         );
            }
            else
            {
                minDmg = (int)Math.Round(
                    Player.Form == Player.Forms.Cat ? Player.Level * 0.85 + (Player.AP + Player.nextAABonus) / 14 :
                    Weapon.DamageMin + Weapon.Speed * (Player.AP + Player.nextAABonus) / 14);
                maxDmg = (int)Math.Round(
                    Player.Form == Player.Forms.Cat ? Player.Level * 1.25 + (Player.AP + Player.nextAABonus) / 14 :
                    Weapon.DamageMax + Weapon.Speed * (Player.AP + Player.nextAABonus) / 14);

                damage = (int)Math.Round(Randomer.Next(minDmg, maxDmg + 1)
                                         * Player.Sim.DamageMod(res, Weapon.School, Player.Level, Player.Sim.Boss.Level, true)
                                         * Simulation.ArmorMitigation(Player.Sim.Boss.Armor)
                                         * Player.DamageMod
                                         * (Player.DualWielding ? (MH ? 1 : 0.5 * (1 + (0.05 * Player.GetTalentPoints("DWS")))) : (1 + 0.01 * Player.GetTalentPoints("2HS")))
                                         * mitigation
                                         );
            }

            int threat = (int)Math.Round(damage * Player.ThreatMod);

            if (Player.Class == Player.Classes.Warrior || Player.Form == Player.Forms.Bear)
            {
                Player.Resource += (int)Math.Round(Simulation.RageGained(damage, Player.Level));
                //Player.Resource += (int)Math.Round(Simulation.RageGained2(damage, Weapon.Speed, MH, res == ResultType.Crit, Player.Level));
            }

            RegisterDamage(new ActionResult(res, damage, threat));

            if (Type == AAType.Melee)
            {
                Player.CheckOnHits(MH, true, res, extra, alreadyProc);
            }
        }