Skip to content

Commit

Permalink
spec counter: convert party hits to counter hits
Browse files Browse the repository at this point in the history
The other side just sends the raw hit now, so it has to be converted for damage/tekton when received
  • Loading branch information
Adam- committed Jun 16, 2024
1 parent 6893666 commit 029d3b6
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ public void onSpecialCounterUpdate(SpecialCounterUpdate event)
clientThread.invoke(() ->
{
NPC target = client.getCachedNPCs()[event.getNpcIndex()];
SpecialWeapon specialWeapon = event.getWeapon();
int counterHit = specialWeapon.isDamage() ? specialWeapon.computeHit(event.getHit(), target) : Math.min(event.getHit(), 1);
float defenceDrain = event.getWeapon().computeDrainPercent(event.getHit(), target);

// If not interacting with any npcs currently, add to interacting list
Expand All @@ -463,13 +465,13 @@ public void onSpecialCounterUpdate(SpecialCounterUpdate event)
{
if (config.infobox())
{
updateCounter(event.getWeapon(), name, event.getHit(), defenceDrain);
updateCounter(event.getWeapon(), name, counterHit, defenceDrain);
}
}

if (event.getHit() > 0 || defenceDrain > 0 || config.specDropMisses())
if (counterHit > 0 || defenceDrain > 0 || config.specDropMisses())
{
playerInfoDrops.add(createSpecInfoDrop(event.getWeapon(), event.getHit(), event.getPlayerId()));
playerInfoDrops.add(createSpecInfoDrop(event.getWeapon(), counterHit, event.getPlayerId()));
}
});
}
Expand Down

0 comments on commit 029d3b6

Please sign in to comment.