Skip to content

Commit

Permalink
Merge pull request #790 from Linkaaaaa/encounters
Browse files Browse the repository at this point in the history
Kanaxai Decorations
  • Loading branch information
EliphasNUIT authored Jul 29, 2023
2 parents 8bc75fa + ed38cf5 commit d096c1d
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</span>
</td>
<td class="text-left" :class="getBodyClass('Name')">
<span class="ellipsis" :title="row.player.name">
<span class="ellipsis" :title="row.player.acc">
{{row.player.name}}
</span>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h5 v-show="!singleGroup" class="mt-2" style="min-width:80px;max-width:80px; tex
<div class="d-flex flex-row flex-wrap align-items-center ml-1" style="max-width:370px;">
<span v-for="player in group.players"
@click="selectActor(player.uniqueID);"
class="btn btn-small ply-btn" :class="{'active': selectedplayerid === player.uniqueID, 'btn-dark': !light, 'btn-light': light}" :title="player.name">
class="btn btn-small ply-btn" :class="{'active': selectedplayerid === player.uniqueID, 'btn-dark': !light, 'btn-light': light}" :title="player.acc">
<img v-if="player.isCommander" src="https://wiki.guildwars2.com/images/5/54/Commander_tag_%28blue%29.png" alt="Commander" class="icon">
<img :src="player.icon" :alt="player.profession" class="icon">
{{ player.name }}
Expand Down
3 changes: 3 additions & 0 deletions GW2EIEvtcParser/EIData/Buffs/EncounterBuffs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,9 @@ internal static class EncounterBuffs
new Buff("Thess's Ward", ThesssWard, Source.FightSpecific, BuffClassification.Other, BuffImages.Hallucinations),
new Buff("Spirit Fang", SpiritFang, Source.FightSpecific, BuffClassification.Other, BuffImages.ExposeWeakness),
new Buff("Aspect Tether", AspectTetherBuff, Source.FightSpecific, BuffClassification.Other, BuffImages.Target),
new Buff("Rending Storm Target (Axe 1)", RendingStormAxeTargetBuff1, Source.FightSpecific, BuffClassification.Other, BuffImages.ConjureFlameAxe),
new Buff("Rending Storm Target (Axe 2)", RendingStormAxeTargetBuff2, Source.FightSpecific, BuffClassification.Other, BuffImages.ConjureFlameAxe),
new Buff("Spread AoE", KanaxaiSpreadOrangeAoEBuff, Source.FightSpecific, BuffClassification.Other, BuffImages.Unknown),
new Buff("Achievement Eligibility: Unsundered", AchievementEligibilityUnsundered, Source.FightSpecific, BuffClassification.Other, BuffImages.AchievementEffect),
new Buff("Achievement Eligibility: The Fearless Few", AchievementEligibilityTheFearlessFew, Source.FightSpecific, BuffClassification.Other, BuffImages.AchievementEffect),
new Buff("Achievement Eligibility: Peace and Quiet", AchievementEligibilityPeaceAndQuiet, Source.FightSpecific, BuffClassification.Other, BuffImages.AchievementEffect),
Expand Down
131 changes: 121 additions & 10 deletions GW2EIEvtcParser/EncounterLogic/Fractals/SilentSurf/Kanaxai.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ public Kanaxai(int triggerID) : base(triggerID)
long diff = dead.Time - remove.Time;
return diff > -ServerDelayConstant && diff <= 1000;
});
})
}),
new PlayerDstBuffApplyMechanic(new long [] { RendingStormAxeTargetBuff1, RendingStormAxeTargetBuff2 }, "Rending Storm Target", new MechanicPlotlySetting(Symbols.CircleX, Colors.LightPurple), "RendStm.T", "Targetted by Rending Storm (Axe Throw)", "Rending Storm Target", 150),
});
Extension = "kanaxai";
Icon = EncounterIconKanaxai;
Expand Down Expand Up @@ -111,7 +112,7 @@ internal override void EIEvtcParse(ulong gw2Build, FightData fightData, AgentDat
var aspectCounts = new Dictionary<int, int>();
foreach (AbstractSingleActor actor in Targets)
{
switch(actor.ID)
switch (actor.ID)
{
case (int)ArcDPSEnums.TrashID.AspectOfTorment:
case (int)ArcDPSEnums.TrashID.AspectOfLethargy:
Expand All @@ -122,7 +123,7 @@ internal override void EIEvtcParse(ulong gw2Build, FightData fightData, AgentDat
{
actor.OverrideName(actor.Character + " " + count);
aspectCounts[actor.ID] = count + 1;
}
}
else
{
actor.OverrideName(actor.Character + " 1");
Expand Down Expand Up @@ -167,14 +168,14 @@ internal override List<PhaseData> GetPhases(ParsedEvtcLog log, bool requirePhase
{
isRepeatedWorldCleaverPhase.Add(false);
curPhase.Name = baseName + (++worldCleaverCount);
}
}
else
{
isRepeatedWorldCleaverPhase.Add(true);
curPhase.Name = baseName + (worldCleaverCount) + " Repeated " + repeatedCount;
}
repeatedCount++;
}
}
else if (kanaxai.GetCurrentHealthPercent(log, midPhase) > 25)
{
if (worldCleaverCount == 1)
Expand All @@ -192,7 +193,7 @@ internal override List<PhaseData> GetPhases(ParsedEvtcLog log, bool requirePhase
curPhase.Name = baseName + (worldCleaverCount) + " Repeated " + repeatedCount;
}
repeatedCount++;
}
}
else
{
// No hp update events, buggy log
Expand All @@ -215,7 +216,7 @@ internal override List<PhaseData> GetPhases(ParsedEvtcLog log, bool requirePhase
}
}
curPhase.AddTarget(kanaxai);
}
}
else
{
isRepeatedWorldCleaverPhase.Add(false);
Expand All @@ -234,13 +235,13 @@ internal override List<PhaseData> GetPhases(ParsedEvtcLog log, bool requirePhase
if (isRepeatedWorldCleaverPhase[i + 1])
{
curPhase.Name = baseName + (phaseCount) + " Repeated " + (++repeatedCount);
}
}
else
{
curPhase.Name = baseName + (++phaseCount);
repeatedCount = 0;
}
}
}
else
{
curPhase.Name = baseName + (++phaseCount);
Expand All @@ -266,9 +267,10 @@ internal override void CheckSuccess(CombatData combatData, AgentData agentData,
fightData.SetSuccess(true, invul762Gain.Time);
}
}

internal override void ComputePlayerCombatReplayActors(AbstractPlayer player, ParsedEvtcLog log, CombatReplay replay)
{
// Orange Tether from Aspect to player
IEnumerable<AbstractBuffEvent> tethers = log.CombatData.GetBuffData(AspectTetherBuff).Where(x => x.To == player.AgentItem);
IEnumerable<BuffApplyEvent> tetherApplies = tethers.OfType<BuffApplyEvent>();
IEnumerable<BuffRemoveAllEvent> tetherRemoves = tethers.OfType<BuffRemoveAllEvent>();
Expand All @@ -286,6 +288,8 @@ internal override void ComputePlayerCombatReplayActors(AbstractPlayer player, Pa
}
}

// Blue tether from Aspect to player, appears when the player gains phantasmagoria
// Custom decoration not visible in game
IEnumerable<AbstractBuffEvent> phantasmagoria = log.CombatData.GetBuffData(Phantasmagoria).Where(x => x.To == player.AgentItem);
IEnumerable<BuffRemoveAllEvent> phantasmagoriaRemoves = phantasmagoria.OfType<BuffRemoveAllEvent>();
foreach (BuffApplyEvent apply in phantasmagoria.OfType<BuffApplyEvent>())
Expand All @@ -297,6 +301,113 @@ internal override void ComputePlayerCombatReplayActors(AbstractPlayer player, Pa
replay.Decorations.Add(new LineDecoration(0, (start, (int)remove.Time), "rgba(0, 100, 255, 0.5)", new AgentConnector(apply.By), new AgentConnector(player)));
}
}

// Rending Storm - Axe AoE attached to players - There are 2 buffs for the targetting
var axes = new List<Segment>();
axes.AddRange(player.GetBuffStatus(log, RendingStormAxeTargetBuff1, log.FightData.LogStart, log.FightData.LogEnd).Where(x => x.Value > 0));
axes.AddRange(player.GetBuffStatus(log, RendingStormAxeTargetBuff2, log.FightData.LogStart, log.FightData.LogEnd).Where(x => x.Value > 0));
foreach (Segment segment in axes)
{
replay.Decorations.Add(new CircleDecoration(true, 0, 180, ((int)segment.Start, (int)segment.End), "rgba(200, 120, 0, 0.2)", new AgentConnector(player)));
replay.Decorations.Add(new CircleDecoration(true, (int)segment.End, 180, ((int)segment.Start, (int)segment.End), "rgba(200, 120, 0, 0.2)", new AgentConnector(player)));
}

// Frightening Speed - Numbers spread AoEs
IEnumerable<Segment> spreads = player.GetBuffStatus(log, KanaxaiSpreadOrangeAoEBuff, log.FightData.LogStart, log.FightData.LogEnd).Where(x => x.Value > 0);
foreach (Segment spreadSegment in spreads)
{
replay.Decorations.Add(new CircleDecoration(true, 0, 380, ((int)spreadSegment.Start, (int)spreadSegment.End), "rgba(200, 120, 0, 0.2)", new AgentConnector(player)));
}
}

internal override void ComputeEnvironmentCombatReplayDecorations(ParsedEvtcLog log)
{
base.ComputeEnvironmentCombatReplayDecorations(log);

// Frightening Speed - Red AoE
if (log.CombatData.TryGetEffectEventsByGUID(EffectGUIDs.FrighteningSpeedRedAoE, out IReadOnlyList<EffectEvent> frighteningSpeedRedAoEs))
{
foreach (EffectEvent aoe in frighteningSpeedRedAoEs)
{
int duration = 1500;
int start = (int)aoe.Time;
int effectEnd = start + duration;
EnvironmentDecorations.Add(new CircleDecoration(true, 0, 380, (start, effectEnd), "rgba(255, 0, 0, 0.2)", new PositionConnector(aoe.Position)));
EnvironmentDecorations.Add(new CircleDecoration(false, 0, 380, (start, effectEnd), "rgba(255, 0, 0, 0.2)", new PositionConnector(aoe.Position), 10));
}
}

// Rending Storm - Red Axe AoE
if (log.CombatData.TryGetEffectEventsByGUID(EffectGUIDs.AxeGroundAoE, out IReadOnlyList<EffectEvent> axeAoEs))
{
// Get World Cleaver casts
AbstractSingleActor kanaxai = Targets.FirstOrDefault(x => x.IsSpecies(ArcDPSEnums.TargetID.KanaxaiScytheOfHouseAurkusCM));
IReadOnlyList<AbstractCastEvent> casts = kanaxai.GetCastEvents(log, log.FightData.FightStart, log.FightData.FightEnd);

// Get Axe AoE Buffs
var axes = new List<AbstractBuffEvent>();
axes.AddRange(log.CombatData.GetBuffData(RendingStormAxeTargetBuff1));
axes.AddRange(log.CombatData.GetBuffData(RendingStormAxeTargetBuff2));
var orderedAxes = axes.OfType<BuffRemoveAllEvent>().OrderBy(x => x.Time).ToList();

foreach (EffectEvent aoe in axeAoEs)
{
// Find the first cast time event present after the AoE effect time
AbstractCastEvent cast = casts.Where(x => x.SkillId == WorldCleaver).FirstOrDefault(x => x.Time > aoe.Time);
long worldCleaverTime = cast != null ? cast.Time : 0;

// Find the first BuffRemoveAllEvent after the AoE effect Time or next World Cleaver cast time
// World Cleaver is the time-limit of when the AoEs reset, in third phase we use FightEnd
if (worldCleaverTime != 0)
{
AbstractBuffEvent axeBuffRemoval = orderedAxes.FirstOrDefault(buff => buff.Time > aoe.Time && buff.Time < worldCleaverTime);
AddAxeAoeDecoration(aoe, axeBuffRemoval, worldCleaverTime);
}
else
{
AbstractBuffEvent axeBuffRemoval = orderedAxes.FirstOrDefault(buff => buff.Time > aoe.Time);
AddAxeAoeDecoration(aoe, axeBuffRemoval, log.FightData.FightEnd);
}
}
}

// Harrowshot - Boonstrip AoE
if (log.CombatData.TryGetEffectEventsByGUID(EffectGUIDs.HarrowshotAoE, out IReadOnlyList<EffectEvent> harrowshots))
{
foreach (EffectEvent harrowshot in harrowshots)
{
int duration = 3000;
int start = (int)harrowshot.Time;
int end = (int)harrowshot.Time + duration;
EnvironmentDecorations.Add(new CircleDecoration(true, 0, 280, (start, end), "rgba(255, 120, 0, 0.2)", new PositionConnector(harrowshot.Position)));
EnvironmentDecorations.Add(new CircleDecoration(true, end, 280, (start, end), "rgba(255, 120, 0, 0.2)", new PositionConnector(harrowshot.Position)));
}
}
}

/// <summary>
/// Adds the Axe AoE decoration.<br></br>
/// If the next orange AoE <see cref="BuffRemoveAllEvent"/> on players is after <see cref="WorldCleaver"/> cast time or not present,<br></br>
/// utilise the <see cref="WorldCleaver"/> cast time or <see cref="FightData.LogEnd"/>.
/// </summary>
/// <param name="aoe">Effect of the AoE.</param>
/// <param name="axeBuffRemoval">Buff removal of the orange AoE.</param>
/// <param name="time">Last time possible.</param>
private void AddAxeAoeDecoration(EffectEvent aoe, AbstractBuffEvent axeBuffRemoval, long time)
{
int duration;
if (axeBuffRemoval != null)
{
duration = (int)(axeBuffRemoval.Time - aoe.Time);
}
else
{
duration = (int)(time - aoe.Time);
}
int start = (int)aoe.Time;
int effectEnd = start + duration;
EnvironmentDecorations.Add(new CircleDecoration(true, 0, 180, (start, effectEnd), "rgba(255, 0, 0, 0.2)", new PositionConnector(aoe.Position)));
EnvironmentDecorations.Add(new CircleDecoration(false, 0, 180, (start, effectEnd), "rgba(255, 0, 0, 0.2)", new PositionConnector(aoe.Position), 10));
}
}
}
5 changes: 5 additions & 0 deletions GW2EIEvtcParser/ParserHelpers/EffectGUIDs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ public static class EffectGUIDs
public const string KickGroundEffect = "47FE87414A88484AB05A84E1440F5FDD";
public const string AoeIndicator130Radius = "8DDED161CE26964FA5952D821AD852F7";
public const string MistBomb = "03FB41386DD2A54FA093795DF2870B7A";
// Silent Surf Fractal
public const string FrighteningSpeedRedAoE = "96E8C6EA0D2FAF4C8F62B5C6CA4B611C";
public const string AxeGroundAoE = "234949DB5ECD52409F6EDD601BBC0C19";
public const string AxeGroundAoE2 = "CE91D2D4CD6C4141B3977FA70FFE05BB";
public const string HarrowshotAoE = "3AE17719B3D7374BAC4899DA0A3E7DF9";
// Vale Guardian
public const string ValeGuardianDistributedMagic = "43FD739499BB6040BBF9EEF37781B2CE";
public const string ValeGuardianMagicSpike = "55364633145D264A934935C3F026B19F";
Expand Down
7 changes: 6 additions & 1 deletion GW2EIEvtcParser/ParserHelpers/SkillIDs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3416,16 +3416,19 @@ public static class SkillIDs
public const long DualOrbitFireAndWater = 69184;
public const long FlareSilentSurf = 69189;
public const long FrighteningSpeedWindup = 69194;
public const long RendingStormAxeTargetBuff1 = 69195;
public const long HarrowshotDeath = 69199;
public const long KanxaiBreakbarCast = 69205;
public const long Phantasmagoria = 69206;
public const long RendingStormAxeTargetBuff2 = 69208;
public const long DualOrbitWaterAndAir = 69211;
public const long BleedingEdge = 69214;
public const long AchievementEligibilityTheFearlessFew = 69222;
public const long AspectedVolleyLethargy = 69224;
public const long DeterminedKanaxai = 69236;
public const long DualOrbitAirAndEarth = 69246;
public const long DissectingDance = 69251;
public const long POV_KanaxaiAxeAoeBuff = 69261;
public const long DreadDefiance = 69263;
public const long HeatTheSoulBuff = 69267;
public const long DeterminedToDestroy = 69275;
Expand All @@ -3440,13 +3443,15 @@ public static class SkillIDs
public const long DualOrbitFireAndAir = 69341;
public const long POV_DreadVisageBuff = 69343;
public const long DissectingDance2 = 69345;
public const long KanaxaiFallDownBuff = 69350; // applied when falling off the platform?
public const long KanaxaiSpreadOrangeAoEBuff = 69346;
public const long SomethingKanaxaiBuff = 69350;
public const long HarrowshotExposure = 69353;
public const long ScouringBlade = 69354;
public const long FrighteningSpeed = 69356;
public const long KanaxaiSomethingBuff = 69363;
public const long GatheringShadows = 69365;
public const long BleedingEdge2 = 69371;
public const long POV_KanaxaiOffPlatformDeathBuff = 69391;
public const long HarrowshotFear = 69398;
public const long HarrowshotTorment = 69406;
public const long RendingStorm = 69410;
Expand Down

0 comments on commit d096c1d

Please sign in to comment.