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

@@ -52,6 +52,38 @@ public class Hitsplat
* Taking damage by others (red). * Taking damage by others (red).
*/ */
DAMAGE_OTHER, DAMAGE_OTHER,
/**
* Taking damage by me (cyan).
*/
DAMAGE_ME_CYAN,
/**
* Taking damage by others (cyan).
*/
DAMAGE_OTHER_CYAN,
/**
* Taking damage by me (orange).
*/
DAMAGE_ME_ORANGE,
/**
* Taking damage by others (orange).
*/
DAMAGE_OTHER_ORANGE,
/**
* Taking damage by me (yellow).
*/
DAMAGE_ME_YELLOW,
/**
* Taking damage by others (yellow).
*/
DAMAGE_OTHER_YELLOW,
/**
* Taking damage by me (white).
*/
DAMAGE_ME_WHITE,
/**
* Taking damage by others (white/black).
*/
DAMAGE_OTHER_WHITE,
/** /**
* Damage from poison (green). * Damage from poison (green).
*/ */
@@ -88,6 +120,14 @@ public class Hitsplat
case 4: return DISEASE; case 4: return DISEASE;
case 5: return VENOM; case 5: return VENOM;
case 6: return HEAL; case 6: return HEAL;
case 18: return DAMAGE_ME_CYAN;
case 19: return DAMAGE_OTHER_CYAN;
case 20: return DAMAGE_ME_ORANGE;
case 21: return DAMAGE_OTHER_ORANGE;
case 22: return DAMAGE_ME_YELLOW;
case 23: return DAMAGE_OTHER_YELLOW;
case 24: return DAMAGE_ME_WHITE;
case 25: return DAMAGE_OTHER_WHITE;
} }
return null; return null;
} }
@@ -117,4 +157,36 @@ public class Hitsplat
this.amount = amount; this.amount = amount;
this.disappearsOnGameCycle = disappearsOnGameCycle; this.disappearsOnGameCycle = disappearsOnGameCycle;
} }
public boolean isMine()
{
switch (this.getHitsplatType())
{
case BLOCK_ME:
case DAMAGE_ME:
case DAMAGE_ME_CYAN:
case DAMAGE_ME_YELLOW:
case DAMAGE_ME_ORANGE:
case DAMAGE_ME_WHITE:
return true;
default:
return false;
}
}
public boolean isOthers()
{
switch (this.getHitsplatType())
{
case BLOCK_OTHER:
case DAMAGE_OTHER:
case DAMAGE_OTHER_CYAN:
case DAMAGE_OTHER_YELLOW:
case DAMAGE_OTHER_ORANGE:
case DAMAGE_OTHER_WHITE:
return true;
default:
return false;
}
}
} }

View File

@@ -163,9 +163,8 @@ public class DpsCounterPlugin extends Plugin
Hitsplat hitsplat = hitsplatApplied.getHitsplat(); Hitsplat hitsplat = hitsplatApplied.getHitsplat();
switch (hitsplat.getHitsplatType()) if (hitsplat.isMine())
{ {
case DAMAGE_ME:
int hit = hitsplat.getAmount(); int hit = hitsplat.getAmount();
// Update local member // Update local member
PartyMember localMember = partyService.getLocalMember(); PartyMember localMember = partyService.getLocalMember();
@@ -182,8 +181,9 @@ public class DpsCounterPlugin extends Plugin
wsClient.send(specialCounterUpdate); wsClient.send(specialCounterUpdate);
} }
// apply to total // apply to total
break; }
case DAMAGE_OTHER: else if (hitsplat.isOthers())
{
final int npcId = ((NPC) actor).getId(); final int npcId = ((NPC) actor).getId();
boolean isBoss = BOSSES.contains(npcId); boolean isBoss = BOSSES.contains(npcId);
if (actor != player.getInteracting() && !isBoss) if (actor != player.getInteracting() && !isBoss)
@@ -192,8 +192,9 @@ public class DpsCounterPlugin extends Plugin
return; return;
} }
// apply to total // apply to total
break; }
default: else
{
return; return;
} }

View File

@@ -168,7 +168,7 @@ public class SpecialCounterPlugin extends Plugin
Hitsplat hitsplat = hitsplatApplied.getHitsplat(); Hitsplat hitsplat = hitsplatApplied.getHitsplat();
Hitsplat.HitsplatType hitsplatType = hitsplat.getHitsplatType(); Hitsplat.HitsplatType hitsplatType = hitsplat.getHitsplatType();
// Ignore all hitsplats other than mine // 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; return;
} }