Add Staff of the Dead timer

Closes runelite/runelite#1728
This commit is contained in:
Jordan Atwood
2018-06-12 15:51:21 -07:00
parent 013cc54ba2
commit 6468eed0f4
5 changed files with 32 additions and 1 deletions

View File

@@ -36,6 +36,7 @@ public class GraphicID
public static final int ICE_BLITZ = 367; public static final int ICE_BLITZ = 367;
public static final int ICE_BARRAGE = 369; public static final int ICE_BARRAGE = 369;
public static final int VENGEANCE = 726; public static final int VENGEANCE = 726;
public static final int STAFF_OF_THE_DEAD = 1228;
public static final int IMBUED_HEART = 1316; public static final int IMBUED_HEART = 1316;
public static final int FLYING_FISH = 1387; public static final int FLYING_FISH = 1387;
} }

View File

@@ -70,7 +70,8 @@ public enum GameTimer
GOD_WARS_ALTAR("altar", "God wars altar", 10, ChronoUnit.MINUTES), GOD_WARS_ALTAR("altar", "God wars altar", 10, ChronoUnit.MINUTES),
ANTIPOISON("antipoison", "Antipoison", 90, ChronoUnit.SECONDS), ANTIPOISON("antipoison", "Antipoison", 90, ChronoUnit.SECONDS),
SUPERANTIPOISON("superantipoison", "Superantipoison", 346, ChronoUnit.SECONDS), SUPERANTIPOISON("superantipoison", "Superantipoison", 346, ChronoUnit.SECONDS),
CHARGE("charge", "Charge", 6, ChronoUnit.MINUTES); CHARGE("charge", "Charge", 6, ChronoUnit.MINUTES),
STAFF_OF_THE_DEAD("staffofthedead", "Staff of the Dead", GraphicID.STAFF_OF_THE_DEAD, 1, ChronoUnit.MINUTES);
@Getter @Getter
private final String imageResource; private final String imageResource;

View File

@@ -287,4 +287,15 @@ public interface TimersConfig extends Config
{ {
return true; return true;
} }
@ConfigItem(
position = 23,
keyName = "showStaffOfTheDead",
name = "Staff of the Dead timer",
description = "Configures whether staff of the dead timer is displayed"
)
default boolean showStaffOfTheDead()
{
return true;
}
} }

View File

@@ -72,6 +72,7 @@ import static net.runelite.client.plugins.timers.GameTimer.OVERLOAD_RAID;
import static net.runelite.client.plugins.timers.GameTimer.PRAYER_ENHANCE; import static net.runelite.client.plugins.timers.GameTimer.PRAYER_ENHANCE;
import static net.runelite.client.plugins.timers.GameTimer.SANFEW; import static net.runelite.client.plugins.timers.GameTimer.SANFEW;
import static net.runelite.client.plugins.timers.GameTimer.SNARE; import static net.runelite.client.plugins.timers.GameTimer.SNARE;
import static net.runelite.client.plugins.timers.GameTimer.STAFF_OF_THE_DEAD;
import static net.runelite.client.plugins.timers.GameTimer.STAMINA; import static net.runelite.client.plugins.timers.GameTimer.STAMINA;
import static net.runelite.client.plugins.timers.GameTimer.SUPERANTIFIRE; import static net.runelite.client.plugins.timers.GameTimer.SUPERANTIFIRE;
import static net.runelite.client.plugins.timers.GameTimer.SUPERANTIPOISON; import static net.runelite.client.plugins.timers.GameTimer.SUPERANTIPOISON;
@@ -84,6 +85,7 @@ import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
) )
public class TimersPlugin extends Plugin public class TimersPlugin extends Plugin
{ {
private int lastEquippedWeapVarb;
private int lastRaidVarb; private int lastRaidVarb;
@Inject @Inject
@@ -110,6 +112,12 @@ public class TimersPlugin extends Plugin
@Subscribe @Subscribe
public void onVarbitChange(VarbitChanged event) public void onVarbitChange(VarbitChanged event)
{ {
int equippedWeap = client.getVar(Varbits.EQUIPPED_WEAPON_TYPE);
if (lastEquippedWeapVarb != equippedWeap)
{
removeGameTimer(STAFF_OF_THE_DEAD);
}
int raidVarb = client.getVar(Varbits.IN_RAID); int raidVarb = client.getVar(Varbits.IN_RAID);
if (lastRaidVarb != raidVarb) if (lastRaidVarb != raidVarb)
{ {
@@ -198,6 +206,11 @@ public class TimersPlugin extends Plugin
removeGameTimer(IMBUEDHEART); removeGameTimer(IMBUEDHEART);
} }
if (!config.showStaffOfTheDead())
{
removeGameTimer(STAFF_OF_THE_DEAD);
}
if (!config.showVengeance()) if (!config.showVengeance())
{ {
removeGameTimer(VENGEANCE); removeGameTimer(VENGEANCE);
@@ -451,6 +464,11 @@ public class TimersPlugin extends Plugin
createGameTimer(VENGEANCE); createGameTimer(VENGEANCE);
} }
if (config.showStaffOfTheDead() && actor.getGraphic() == STAFF_OF_THE_DEAD.getGraphicId())
{
createGameTimer(STAFF_OF_THE_DEAD);
}
if (config.showFreezes()) if (config.showFreezes())
{ {
if (actor.getGraphic() == BIND.getGraphicId()) if (actor.getGraphic() == BIND.getGraphicId())

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB