public static Boss ToBoss(JsonBoss jb, double armorPen = 0) { int armor = jb.Armor - (int)Math.Round(armorPen); Dictionary <School, int> magicResist = null; if (jb.SchoolResists != null) { magicResist = new Dictionary <School, int>(); foreach (SchoolResist sr in jb.SchoolResists) { magicResist.Add(SchoolResist.StringToSchool(sr.School), sr.Resist); } } List <string> debuffs = jb.Debuffs; if (debuffs != null && debuffs.Count > 0) { armor -= (debuffs.Any(d => d.ToLower().Contains("expose armor")) ? 2550 : (debuffs.Any(d => d.ToLower().Contains("sunder armor")) ? 2250 : 0)) + (debuffs.Any(d => d.ToLower().Contains("curse of recklessness")) ? 640 : 0) + (debuffs.Any(d => d.ToLower().Contains("faerie fire")) ? 505 : 0) + (debuffs.Any(d => d.ToLower().Contains("annihilator")) ? 600 : 0); } return(new Boss(ToType(jb.Type), jb.Level, Math.Max(0, armor), magicResist)); }
public static Boss ToBoss(JsonBoss jb, double armorPen = 0) { int armor = jb.Armor - (int)Math.Round(armorPen); Dictionary <School, int> magicResist = null; if (jb.SchoolResists != null) { magicResist = new Dictionary <School, int>(); foreach (string sr in jb.SchoolResists.Keys) { magicResist.Add(StringToSchool(sr), jb.SchoolResists[sr]); } } List <string> debuffsList = jb.Debuffs; Dictionary <string, Effect> debuffs = null; if (debuffsList != null && debuffsList.Count > 0) { armor -= (debuffsList.Any(d => d.ToLower().Contains("expose armor")) ? 2550 : (debuffsList.Any(d => d.ToLower().Contains("sunder armor")) ? 2250 : 0)) + (debuffsList.Any(d => d.ToLower().Contains("curse of recklessness")) ? 640 : 0) + (debuffsList.Any(d => d.ToLower().Contains("faerie fire")) ? 505 : 0) + (debuffsList.Any(d => d.ToLower().Contains("annihilator")) ? 600 : 0); debuffs = new Dictionary <string, Effect>(); foreach (string s in debuffsList) { debuffs.Add(s, new CustomEffect(null, null, s, false, -1)); } } return(new Boss(ToType(jb.Type), jb.Level, Math.Max(0, armor), magicResist, debuffs)); }
private void SetBoss(JsonLog log) { log.Boss = new List <JsonBoss>(); foreach (Boss target in _log.FightData.Logic.Targets) { JsonBoss boss = new JsonBoss(); boss.Id = target.ID; boss.Name = target.Character; boss.TotalHealth = target.Health; int finalBossHealth = target.HealthOverTime.Count > 0 ? target.HealthOverTime.Last().Y : 10000; boss.FinalHealth = target.Health * (finalBossHealth * 0.01); boss.HealthPercentBurned = 100.0 - finalBossHealth * 0.01; boss.AvgBoons = _statistics.AvgBossBoons[target]; boss.AvgConditions = _statistics.AvgBossConditions[target]; boss.Dps = BuildDPS(_statistics.BossDps[target]); boss.Buffs = BuildBossBuffs(_statistics.BossConditions[target], target); boss.HitboxHeight = target.HitboxHeight; boss.HitboxWidth = target.HitboxWidth; boss.Dps1s = Build1SDPS(target, null); boss.Rotation = BuildRotation(target.GetCastLogs(_log, 0, _log.FightData.FightDuration)); boss.FirstAware = (int)(target.FirstAware - _log.FightData.FightStart); boss.LastAware = (int)(target.LastAware - _log.FightData.FightStart); boss.Minions = BuildMinions(target); boss.TotalDamageDist = BuildDamageDist(target, null); boss.AvgBoonsStates = BuildBuffStates(target.GetBoonGraphs(_log)[-2]); boss.AvgConditionsStates = BuildBuffStates(target.GetBoonGraphs(_log)[-3]); log.Boss.Add(boss); if (_devMode) { _actorIconData[target.Character] = GeneralHelper.GetNPCIcon(target.ID); } } }
public JsonSim(JsonBoss boss = null, double fightLength = 300, double fightLengthMod = 0.2, int nbSim = 1000, double targetErrorPct = 0.5, bool targetError = true, bool logFight = false, bool statsWeights = false, bool bossAutoLife = true, double bossLowLifeTime = 0) { Boss = boss; FightLength = fightLength; FightLengthMod = fightLengthMod; NbSim = nbSim; TargetErrorPct = targetErrorPct; TargetError = targetError; LogFight = logFight; StatsWeights = statsWeights; BossAutoLife = bossAutoLife; BossLowLifeTime = bossLowLifeTime; }
public JsonSim(JsonPlayer player = null, JsonBoss boss = null, double fightLength = 300, double fightLengthMod = 0.2, int nbSim = 1000, double targetErrorPct = 0.5, bool targetError = true, bool logFight = false, List <string> simStatWeight = null, bool bossAutoLife = true, double bossLowLifeTime = 0) { Player = player; Boss = boss; FightLength = fightLength; FightLengthMod = fightLengthMod; NbSim = nbSim; TargetErrorPct = targetErrorPct; TargetError = targetError; LogFight = logFight; SimStatWeight = simStatWeight; BossAutoLife = bossAutoLife; BossLowLifeTime = bossLowLifeTime; }
public static Boss ToBoss(JsonBoss jb, double armorPen = 0) { int armor = jb.Armor - (int)Math.Round(armorPen); List <string> debuffs = jb.Debuffs; if (debuffs != null && debuffs.Count > 0) { armor -= (debuffs.Contains("Expose Armor") ? 2550 : (debuffs.Contains("Sunder Armor") ? 2250 : 0)) + (debuffs.Contains("Curse of Recklessness") ? 640 : 0) + (debuffs.Contains("Faerie Fire") ? 505 : 0) + (debuffs.Contains("Annihilator") ? 600 : 0); } return(new Boss(jb.Level, Math.Max(0, armor))); }
public JsonSim(JsonBoss boss = null, double fightLength = 300, double fightLengthMod = 0.2, int nbSim = 1000, double targetErrorPct = 0.5, bool targetError = true, bool logFight = false, bool statsWeights = false, bool bossAutoLife = true, double bossLowLifeTime = 0, bool unlimitedMana = false, bool unlimitedResource = false, bool tanking = false, double tankHitEvery = 1, double tankHitRage = 25) { Boss = boss; FightLength = fightLength; FightLengthMod = fightLengthMod; NbSim = nbSim; TargetErrorPct = targetErrorPct; TargetError = targetError; LogFight = logFight; StatsWeights = statsWeights; BossAutoLife = bossAutoLife; BossLowLifeTime = bossLowLifeTime; UnlimitedMana = unlimitedMana; UnlimitedResource = unlimitedResource; Tanking = tanking; TankHitEvery = tankHitEvery; TankHitRage = tankHitRage; }