Skip to content

Commit 3820b69

Browse files
authored
Merge pull request #846 from Linkaaaaa/master
Cosmic Observatory combat replay
2 parents 8379cd9 + 2645ddc commit 3820b69

File tree

7 files changed

+266
-9
lines changed

7 files changed

+266
-9
lines changed

GW2EIEvtcParser/EIData/Buffs/EncounterBuffs.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ internal static class EncounterBuffs
582582
new Buff("Planetary Weight", PlanetaryWeight, Source.FightSpecific, BuffStackType.Stacking, 6, BuffClassification.Other, BuffImages.ChallengeOfTheAncients),
583583
new Buff("Summoned Phantom", SummonedPhantom, Source.FightSpecific, BuffClassification.Other, BuffImages.Unknown),
584584
new Buff("Immune to Damage", ImmuneToDamage, Source.FightSpecific, BuffClassification.Other, BuffImages.Unknown),
585+
new Buff("Shared Destruction Target (Meteor Crash)", DagdaSharedDestruction_MeteorCrash, Source.FightSpecific, BuffClassification.Other, BuffImages.Unknown),
585586
// Temple of Febe
586587
new Buff("Insatiable", Insatiable, Source.FightSpecific, BuffStackType.Stacking, 99, BuffClassification.Other, BuffImages.VoidCorruption),
587588
new Buff("Malicious Intent Target", MaliciousIntentTargetBuff, Source.FightSpecific, BuffClassification.Other, BuffImages.Unknown),

GW2EIEvtcParser/EIData/CombatReplay/CombatReplay.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,40 @@ internal void AddTetherByEffectGUID(ParsedEvtcLog log, EffectEvent effect, strin
397397
Decorations.Add(new LineDecoration(lifespan, color, new AgentConnector(effect.Dst), new AgentConnector(effect.Src)));
398398
}
399399
}
400+
401+
/// <summary>
402+
/// Add tether decoration connecting a player to an agent.<br></br>
403+
/// The <paramref name="buffId"/> is sourced by an agent that isn't the one to tether to.
404+
/// </summary>
405+
/// <param name="log">The log.</param>
406+
/// <param name="player">The player to tether to <paramref name="toTetherAgentId"/>.</param>
407+
/// <param name="buffId">ID of the buff sourced by <paramref name="buffSrcAgentId"/>.</param>
408+
/// <param name="buffSrcAgentId">ID of the agent sourcing the <paramref name="buffId"/>. Either <see cref="ArcDPSEnums.TargetID"/> or <see cref="ArcDPSEnums.TrashID"/>.</param>
409+
/// <param name="toTetherAgentId">ID of the agent to tether to the <paramref name="player"/>. Either <see cref="ArcDPSEnums.TargetID"/> or <see cref="ArcDPSEnums.TrashID"/>.</param>
410+
/// <param name="color">Color of the tether.</param>
411+
/// <param name="firstAwareThreshold">Time threshold in case the agent spawns before the buff application.</param>
412+
internal void AddTetherByThirdPartySrcBuff(ParsedEvtcLog log, AbstractPlayer player, long buffId, int buffSrcAgentId, int toTetherAgentId, string color, int firstAwareThreshold = 2000)
413+
{
414+
var buffEvents = log.CombatData.GetBuffData(buffId).Where(x => x.To == player.AgentItem && x.CreditedBy.IsSpecies(buffSrcAgentId)).ToList();
415+
var buffApplies = buffEvents.OfType<BuffApplyEvent>().ToList();
416+
var buffRemoves = buffEvents.OfType<BuffRemoveAllEvent>().ToList();
417+
var agentsToTether = log.AgentData.GetNPCsByID(toTetherAgentId).ToList();
418+
419+
foreach (BuffApplyEvent buffApply in buffApplies)
420+
{
421+
BuffRemoveAllEvent remove = buffRemoves.FirstOrDefault(x => x.Time > buffApply.Time);
422+
long removalTime = remove != null ? remove.Time : log.FightData.LogEnd;
423+
(long, long) lifespan = (buffApply.Time, removalTime);
424+
425+
foreach (AgentItem agent in agentsToTether)
426+
{
427+
if ((Math.Abs(agent.FirstAware - buffApply.Time) < firstAwareThreshold || agent.FirstAware >= buffApply.Time) && agent.FirstAware < removalTime)
428+
{
429+
Decorations.Add(new LineDecoration(lifespan, color, new AgentConnector(agent), new AgentConnector(player)));
430+
}
431+
}
432+
}
433+
}
400434
}
401435
}
402436

GW2EIEvtcParser/EncounterLogic/Raids/W7/PeerlessQadim.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,10 @@ internal override void ComputeNPCCombatReplayActors(NPC target, ParsedEvtcLog lo
296296
{
297297
var connector = (AgentConnector)new AgentConnector(target).WithOffset(new Point3D(chaosLength / 2, 0), true);
298298
var rotationConnector = new AgentFacingConnector(target);
299-
replay.Decorations.Add(new RectangleDecoration(chaosLength, chaosWidth, (start, end), "rgba(255,100,0,0.3)", connector).UsingRotationConnector(new AgentFacingConnector(target)));
299+
replay.Decorations.Add(new RectangleDecoration(chaosLength, chaosWidth, (start, end), "rgba(255,100,0,0.3)", connector).UsingRotationConnector(rotationConnector));
300300
if (end > start + aimTime)
301301
{
302-
replay.Decorations.Add(new RectangleDecoration(chaosLength, chaosWidth, (start + aimTime, end), "rgba(100,100,100,0.7)", connector).UsingRotationConnector(new AgentFacingConnector(target)));
302+
replay.Decorations.Add(new RectangleDecoration(chaosLength, chaosWidth, (start + aimTime, end), "rgba(100,100,100,0.7)", connector).UsingRotationConnector(rotationConnector));
303303
}
304304
}
305305
}

GW2EIEvtcParser/EncounterLogic/Strikes/EndOfDragons/XunlaiJadeJunkyard.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,12 @@ internal override void ComputePlayerCombatReplayActors(AbstractPlayer p, ParsedE
432432
// Tethering Players to Lich
433433
List<AbstractBuffEvent> lichTethers = GetFilteredList(log.CombatData, AnkkaLichHallucinationFixation, p, true, true);
434434
replay.AddTether(lichTethers, "rgba(0, 255, 255, 0.5)");
435+
435436
// Reanimated Hatred Fixation
436437
IEnumerable<Segment> hatredFixations = p.GetBuffStatus(log, FixatedAnkkaKainengOverlook, log.FightData.LogStart, log.FightData.LogEnd).Where(x => x.Value > 0);
437438
replay.AddOverheadIcons(hatredFixations, p, ParserIcons.FixationPurpleOverhead);
439+
// Reanimated Hatred Tether to player - The buff is applied by Ankka to the player - The Reanimated Hatred spawns before the buff application
440+
replay.AddTetherByThirdPartySrcBuff(log, p, FixatedAnkkaKainengOverlook, (int)ArcDPSEnums.TargetID.Ankka, (int)ArcDPSEnums.TrashID.ReanimatedHatred, "rgba(255, 0, 255, 0.5)");
438441
}
439442

440443
private static void AddDeathsHandDecoration(CombatReplay replay, Point3D position, int start, int delay, int radius, int duration)

0 commit comments

Comments
 (0)