public override List <PhaseData> GetPhases(ParsedLog log, bool requirePhases) { // generic method for fractals long start = 0; long end = 0; long fightDuration = log.FightData.FightDuration; List <PhaseData> phases = GetInitialPhase(log); Boss mainTarget = Targets.Find(x => x.ID == TriggerID); if (mainTarget == null) { throw new InvalidOperationException("Main target of the fight not found"); } phases[0].Targets.Add(mainTarget); if (!requirePhases) { return(phases); } List <CombatItem> invulsBoss = GetFilteredList(log, 762, mainTarget); for (int i = 0; i < invulsBoss.Count; i++) { CombatItem c = invulsBoss[i]; if (c.IsBuffRemove == ParseEnum.BuffRemove.None) { end = c.Time - log.FightData.FightStart; phases.Add(new PhaseData(start, end)); if (i == invulsBoss.Count - 1) { mainTarget.AddCustomCastLog(new CastLog(end, -5, (int)(fightDuration - end), ParseEnum.Activation.None, (int)(fightDuration - end), ParseEnum.Activation.None), log); } } else { start = c.Time - log.FightData.FightStart; mainTarget.AddCustomCastLog(new CastLog(end, -5, (int)(start - end), ParseEnum.Activation.None, (int)(start - end), ParseEnum.Activation.None), log); } } if (fightDuration - start > 5000 && start >= phases.Last().End) { phases.Add(new PhaseData(start, fightDuration)); } for (int i = 1; i < phases.Count; i++) { phases[i].Name = "Phase " + i; phases[i].Targets.Add(mainTarget); } phases.RemoveAll(x => x.GetDuration() < 1000); return(phases); }
public override List <PhaseData> GetPhases(ParsedLog log, bool requirePhases) { long start = 0; long fightDuration = log.FightData.FightDuration; List <PhaseData> phases = GetInitialPhase(log); Boss mainTarget = Targets.Find(x => x.ID == (ushort)ParseEnum.BossIDS.Xera); if (mainTarget == null) { throw new InvalidOperationException("Main target of the fight not found"); } phases[0].Targets.Add(mainTarget); if (!requirePhases) { return(phases); } // split happened if (log.FightData.PhaseData.Count == 1) { CombatItem invulXera = log.GetBoonData(762).Find(x => x.DstInstid == mainTarget.InstID); if (invulXera == null) { invulXera = log.GetBoonData(34113).Find(x => x.DstInstid == mainTarget.InstID); } long end = invulXera.Time - log.FightData.FightStart; phases.Add(new PhaseData(start, end)); start = log.FightData.PhaseData[0] - log.FightData.FightStart; mainTarget.AddCustomCastLog(new CastLog(end, -5, (int)(start - end), ParseEnum.Activation.None, (int)(start - end), ParseEnum.Activation.None), log); } if (fightDuration - start > 5000 && start >= phases.Last().End) { phases.Add(new PhaseData(start, fightDuration)); } for (int i = 1; i < phases.Count; i++) { phases[i].Name = "Phase " + i; phases[i].DrawArea = true; phases[i].DrawStart = i > 1; phases[i].DrawEnd = i < phases.Count - 1; phases[i].Targets.Add(mainTarget); } return(phases); }
public override List <PhaseData> GetPhases(ParsedLog log, bool requirePhases) { long start = 0; long end = 0; long fightDuration = log.FightData.FightDuration; List <PhaseData> phases = GetInitialPhase(log); Boss mainTarget = Targets.Find(x => x.ID == (ushort)ParseEnum.BossIDS.Deimos); if (mainTarget == null) { throw new InvalidOperationException("Main target of the fight not found"); } phases[0].Targets.Add(mainTarget); if (!requirePhases) { return(phases); } // Determined + additional data on inst change CombatItem invulDei = log.GetBoonData(762).Find(x => x.IsBuffRemove == ParseEnum.BuffRemove.None && x.DstInstid == mainTarget.InstID); if (invulDei != null) { end = invulDei.Time - log.FightData.FightStart; phases.Add(new PhaseData(start, end)); start = (log.FightData.PhaseData.Count == 1 ? log.FightData.PhaseData[0] - log.FightData.FightStart : fightDuration); mainTarget.AddCustomCastLog(new CastLog(end, -6, (int)(start - end), ParseEnum.Activation.None, (int)(start - end), ParseEnum.Activation.None), log); } if (fightDuration - start > 5000 && start >= phases.Last().End) { phases.Add(new PhaseData(start, fightDuration)); } for (int i = 1; i < phases.Count; i++) { phases[i].Name = "Phase " + i; phases[i].Targets.Add(mainTarget); if (i == 2) { phases[i].DrawArea = true; } } int offsetDei = phases.Count; CombatItem teleport = log.GetBoonData(38169).FirstOrDefault(x => x.Time > log.FightData.FightStart); int splits = 0; while (teleport != null && splits < 3) { start = teleport.Time - log.FightData.FightStart; CombatItem teleportBack = log.GetBoonData(38169).FirstOrDefault(x => x.Time - log.FightData.FightStart > start + 10000); if (teleportBack != null) { end = Math.Min(teleportBack.Time - log.FightData.FightStart, fightDuration); } else { end = fightDuration; } phases.Add(new PhaseData(start, end)); splits++; teleport = log.GetBoonData(38169).FirstOrDefault(x => x.Time - log.FightData.FightStart > end + 10000); } string[] namesDeiSplit = new [] { "Thief", "Gambler", "Drunkard" }; for (int i = offsetDei; i < phases.Count; i++) { PhaseData phase = phases[i]; phase.Name = namesDeiSplit[i - offsetDei]; phase.DrawArea = true; List <ushort> ids = new List <ushort> { (ushort)Thief, (ushort)Drunkard, (ushort)Gambler, }; AddTargetsToPhase(phase, ids, log); } phases.Sort((x, y) => (x.Start < y.Start) ? -1 : 1); foreach (PhaseData phase in phases) { phase.DrawStart = true; phase.DrawEnd = true; } phases.RemoveAll(x => x.Targets.Count == 0); return(phases); }
public override List <PhaseData> GetPhases(ParsedLog log, bool requirePhases) { long start = 0; long end = 0; long fightDuration = log.FightData.FightDuration; List <PhaseData> phases = GetInitialPhase(log); Boss mainTarget = Targets.Find(x => x.ID == (ushort)ParseEnum.BossIDS.Sabetha); if (mainTarget == null) { throw new InvalidOperationException("Main target of the fight not found"); } phases[0].Targets.Add(mainTarget); if (!requirePhases) { return(phases); } // Invul check List <CombatItem> invulsSab = GetFilteredList(log, 757, mainTarget); for (int i = 0; i < invulsSab.Count; i++) { CombatItem c = invulsSab[i]; if (c.IsBuffRemove == ParseEnum.BuffRemove.None) { end = c.Time - log.FightData.FightStart; phases.Add(new PhaseData(start, end)); if (i == invulsSab.Count - 1) { mainTarget.AddCustomCastLog(new CastLog(end, -5, (int)(fightDuration - end), ParseEnum.Activation.None, (int)(fightDuration - end), ParseEnum.Activation.None), log); } } else { start = c.Time - log.FightData.FightStart; phases.Add(new PhaseData(end, start)); mainTarget.AddCustomCastLog(new CastLog(end, -5, (int)(start - end), ParseEnum.Activation.None, (int)(start - end), ParseEnum.Activation.None), log); } } if (fightDuration - start > 5000 && start >= phases.Last().End) { phases.Add(new PhaseData(start, fightDuration)); } string[] namesSab = new [] { "Phase 1", "Kernan", "Phase 2", "Knuckles", "Phase 3", "Karde", "Phase 4" }; for (int i = 1; i < phases.Count; i++) { PhaseData phase = phases[i]; phase.Name = namesSab[i - 1]; phase.DrawArea = i % 2 == 1; phase.DrawStart = i % 2 == 1 && i > 1; phase.DrawEnd = i % 2 == 1 && i < 7; phase.Targets.Add(mainTarget); if (i == 2 || i == 4 || i == 6) { List <ushort> ids = new List <ushort> { (ushort)Kernan, (ushort)Knuckles, (ushort)Karde, }; AddTargetsToPhase(phase, ids, log); } else { phase.Targets.Add(mainTarget); Boss addTarget; switch (i) { case 3: addTarget = Targets.Find(x => x.ID == (ushort)Kernan); if (addTarget == null) { throw new InvalidOperationException("Kernan not found when we should have been able to"); } phase.Targets.Add(addTarget); break; case 5: addTarget = Targets.Find(x => x.ID == (ushort)Knuckles); if (addTarget == null) { throw new InvalidOperationException("Knuckles not found when we should have been able to"); } phase.Targets.Add(addTarget); break; case 7: addTarget = Targets.Find(x => x.ID == (ushort)Karde); if (addTarget == null) { throw new InvalidOperationException("Karde not found when we should have been able to"); } phase.Targets.Add(addTarget); break; } } } return(phases); }
public override List<PhaseData> GetPhases(ParsedLog log, bool requirePhases) { long start = 0; long end = 0; long fightDuration = log.FightData.FightDuration; List<PhaseData> phases = GetInitialPhase(log); Boss mainTarget = Targets.Find(x => x.ID == (ushort)ParseEnum.BossIDS.Gorseval); if (mainTarget == null) { throw new InvalidOperationException("Main target of the fight not found"); } phases[0].Targets.Add(mainTarget); if (!requirePhases) { return phases; } // Ghostly protection check List<CombatItem> invulsGorse = log.GetBoonData(31790).Where(x => x.IsBuffRemove != ParseEnum.BuffRemove.Manual).ToList(); for (int i = 0; i < invulsGorse.Count; i++) { CombatItem c = invulsGorse[i]; if (c.IsBuffRemove == ParseEnum.BuffRemove.None) { end = c.Time - log.FightData.FightStart; phases.Add(new PhaseData(start, end)); if (i == invulsGorse.Count - 1) { mainTarget.AddCustomCastLog(new CastLog(end, -5, (int)(fightDuration - end), ParseEnum.Activation.None, (int)(fightDuration - end), ParseEnum.Activation.None), log); } } else { start = c.Time - log.FightData.FightStart; phases.Add(new PhaseData(end, start)); mainTarget.AddCustomCastLog(new CastLog(end, -5, (int)(start - end), ParseEnum.Activation.None, (int)(start - end), ParseEnum.Activation.None), log); } } if (fightDuration - start > 5000 && start >= phases.Last().End) { phases.Add(new PhaseData(start, fightDuration)); } string[] namesGorse = new [] { "Phase 1", "Split 1", "Phase 2", "Split 2", "Phase 3" }; for (int i = 1; i < phases.Count; i++) { PhaseData phase = phases[i]; phase.Name = namesGorse[i - 1]; phase.DrawArea = i == 1 || i == 3 || i == 5; phase.DrawStart = i == 3 || i == 5; phase.DrawEnd = i == 1 || i == 3; if (i == 1 || i == 3 || i == 5) { phase.Targets.Add(mainTarget); } else { List<ushort> ids = new List<ushort> { (ushort) ChargedSoul }; AddTargetsToPhase(phase, ids, log); } } return phases; }
public override List <PhaseData> GetPhases(ParsedLog log, bool requirePhases) { long start = 0; long end = 0; long fightDuration = log.FightData.FightDuration; List <PhaseData> phases = GetInitialPhase(log); Boss mainTarget = Targets.Find(x => x.ID == (ushort)ParseEnum.BossIDS.ValeGuardian); if (mainTarget == null) { throw new InvalidOperationException("Main target of the fight not found"); } phases[0].Targets.Add(mainTarget); if (!requirePhases) { return(phases); } // Invul check List <CombatItem> invulsVG = GetFilteredList(log, 757, mainTarget); for (int i = 0; i < invulsVG.Count; i++) { CombatItem c = invulsVG[i]; if (c.IsBuffRemove == ParseEnum.BuffRemove.None) { end = c.Time - log.FightData.FightStart; phases.Add(new PhaseData(start, end)); if (i == invulsVG.Count - 1) { mainTarget.AddCustomCastLog(new CastLog(end, -5, (int)(fightDuration - end), ParseEnum.Activation.None, (int)(fightDuration - end), ParseEnum.Activation.None), log); } } else { start = c.Time - log.FightData.FightStart; phases.Add(new PhaseData(end, start)); mainTarget.AddCustomCastLog(new CastLog(end, -5, (int)(start - end), ParseEnum.Activation.None, (int)(start - end), ParseEnum.Activation.None), log); } } if (fightDuration - start > 5000 && start >= phases.Last().End) { phases.Add(new PhaseData(start, fightDuration)); } string[] namesVG = new [] { "Phase 1", "Split 1", "Phase 2", "Split 2", "Phase 3" }; bool[] drawStartVG = { false, false, true, false, true }; bool[] drawEndVG = { true, false, true, false, false }; bool[] drawAreaVG = { true, false, true, false, true }; for (int i = 1; i < phases.Count; i++) { PhaseData phase = phases[i]; phase.Name = namesVG[i - 1]; phase.DrawStart = drawStartVG[i - 1]; phase.DrawEnd = drawEndVG[i - 1]; phase.DrawArea = drawAreaVG[i - 1]; if (i == 2 || i == 4) { List <ushort> ids = new List <ushort> { (ushort)BlueGuardian, (ushort)GreenGuardian, (ushort)RedGuardian }; AddTargetsToPhase(phase, ids, log); } else { phase.Targets.Add(mainTarget); } } return(phases); }