Skip to content

Commit

Permalink
timers plugin: add abyssal sire stun timer
Browse files Browse the repository at this point in the history
  • Loading branch information
jfpiv authored and Adam- committed Jul 22, 2018
1 parent 899ad1c commit 8943d1d
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ enum GameTimer
ANTIPOISON(ItemID.ANTIPOISON4, GameTimerImageType.ITEM, "Antipoison", 90, ChronoUnit.SECONDS),
SUPERANTIPOISON(ItemID.SUPERANTIPOISON4, GameTimerImageType.ITEM, "Superantipoison", 346, ChronoUnit.SECONDS),
CHARGE(SpriteID.SPELL_CHARGE, GameTimerImageType.SPRITE, "Charge", 6, ChronoUnit.MINUTES),
STAFF_OF_THE_DEAD(ItemID.STAFF_OF_THE_DEAD, GameTimerImageType.ITEM, "Staff of the Dead", 1, ChronoUnit.MINUTES);
STAFF_OF_THE_DEAD(ItemID.STAFF_OF_THE_DEAD, GameTimerImageType.ITEM, "Staff of the Dead", 1, ChronoUnit.MINUTES),
ABYSSAL_SIRE_STUN(ItemID.ABYSSAL_ORPHAN, GameTimerImageType.ITEM, "Abyssal Sire Stun", 30, ChronoUnit.SECONDS);

@Getter
private final Duration duration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,4 +294,15 @@ default boolean showStaffOfTheDead()
{
return true;
}

@ConfigItem(
position = 24,
keyName = "showAbyssalSireStun",
name = "Abyssal Sire Stun Timer",
description = "Configures whether Abyssal Sire stun timer is displayed"
)
default boolean showAbyssalSireStun()
{
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import net.runelite.client.game.SpriteManager;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import static net.runelite.client.plugins.timers.GameTimer.ABYSSAL_SIRE_STUN;
import static net.runelite.client.plugins.timers.GameTimer.ANTIDOTEPLUS;
import static net.runelite.client.plugins.timers.GameTimer.ANTIDOTEPLUSPLUS;
import static net.runelite.client.plugins.timers.GameTimer.ANTIFIRE;
Expand Down Expand Up @@ -94,7 +95,7 @@
@PluginDescriptor(
name = "Timers",
description = "Show various timers in an infobox",
tags = {"combat", "items", "magic", "potions", "prayer", "overlay"}
tags = {"combat", "items", "magic", "potions", "prayer", "overlay", "abyssal", "sire"}
)
public class TimersPlugin extends Plugin
{
Expand Down Expand Up @@ -464,6 +465,32 @@ public void onAnimationChanged(AnimationChanged event)
{
Actor actor = event.getActor();

if (config.showAbyssalSireStun()
&& actor instanceof NPC)
{
int npcId = ((NPC)actor).getId();

switch (npcId)
{
// Show the countdown when the Sire enters the stunned state.
case NpcID.ABYSSAL_SIRE_5887:
createGameTimer(ABYSSAL_SIRE_STUN);
break;

// Hide the countdown if the Sire isn't in the stunned state.
// This is necessary because the Sire leaves the stunned
// state early once all all four respiratory systems are killed.
case NpcID.ABYSSAL_SIRE:
case NpcID.ABYSSAL_SIRE_5888:
case NpcID.ABYSSAL_SIRE_5889:
case NpcID.ABYSSAL_SIRE_5890:
case NpcID.ABYSSAL_SIRE_5891:
case NpcID.ABYSSAL_SIRE_5908:
removeGameTimer(ABYSSAL_SIRE_STUN);
break;
}
}

if (actor != client.getLocalPlayer())
{
return;
Expand Down Expand Up @@ -631,4 +658,4 @@ private void removeGameTimer(GameTimer timer)
{
infoBoxManager.removeIf(t -> t instanceof TimerTimer && ((TimerTimer) t).getTimer() == timer);
}
}
}

0 comments on commit 8943d1d

Please sign in to comment.