hitsplats: add missing multihitsplat varients

This commit is contained in:
Trevor
2020-04-11 18:57:27 -04:00
committed by Adam
parent 03511a4e00
commit 188a9414ff
3 changed files with 103 additions and 30 deletions

View File

@@ -163,38 +163,39 @@ public class DpsCounterPlugin extends Plugin
Hitsplat hitsplat = hitsplatApplied.getHitsplat();
switch (hitsplat.getHitsplatType())
if (hitsplat.isMine())
{
case DAMAGE_ME:
int hit = hitsplat.getAmount();
// Update local member
PartyMember localMember = partyService.getLocalMember();
// If not in a party, user local player name
final String name = localMember == null ? player.getName() : localMember.getName();
DpsMember dpsMember = members.computeIfAbsent(name, DpsMember::new);
dpsMember.addDamage(hit);
int hit = hitsplat.getAmount();
// Update local member
PartyMember localMember = partyService.getLocalMember();
// If not in a party, user local player name
final String name = localMember == null ? player.getName() : localMember.getName();
DpsMember dpsMember = members.computeIfAbsent(name, DpsMember::new);
dpsMember.addDamage(hit);
// broadcast damage
if (localMember != null)
{
final DpsUpdate specialCounterUpdate = new DpsUpdate(hit);
specialCounterUpdate.setMemberId(localMember.getMemberId());
wsClient.send(specialCounterUpdate);
}
// apply to total
break;
case DAMAGE_OTHER:
final int npcId = ((NPC) actor).getId();
boolean isBoss = BOSSES.contains(npcId);
if (actor != player.getInteracting() && !isBoss)
{
// only track damage to npcs we are attacking, or is a nearby common boss
return;
}
// apply to total
break;
default:
// broadcast damage
if (localMember != null)
{
final DpsUpdate specialCounterUpdate = new DpsUpdate(hit);
specialCounterUpdate.setMemberId(localMember.getMemberId());
wsClient.send(specialCounterUpdate);
}
// apply to total
}
else if (hitsplat.isOthers())
{
final int npcId = ((NPC) actor).getId();
boolean isBoss = BOSSES.contains(npcId);
if (actor != player.getInteracting() && !isBoss)
{
// only track damage to npcs we are attacking, or is a nearby common boss
return;
}
// apply to total
}
else
{
return;
}
unpause();

View File

@@ -168,7 +168,7 @@ public class SpecialCounterPlugin extends Plugin
Hitsplat hitsplat = hitsplatApplied.getHitsplat();
Hitsplat.HitsplatType hitsplatType = hitsplat.getHitsplatType();
// Ignore all hitsplats other than mine
if ((hitsplatType != Hitsplat.HitsplatType.DAMAGE_ME && hitsplatType != Hitsplat.HitsplatType.BLOCK_ME) || target == client.getLocalPlayer())
if (!hitsplat.isMine() || target == client.getLocalPlayer())
{
return;
}