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); }
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)); }
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); }
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(); } } }
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(); } } }
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(); } } }
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); }
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); }
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; }
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(); } } } }
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); }
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(); } } } }
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; }
public static ResultType MagicMitigationBinary(int resistance) { return(Randomer.NextDouble() < AverageResistChance(resistance) ? ResultType.Hit : ResultType.Resist); }