Add Skull Timer (#32)
This commit is contained in:
@@ -78,7 +78,8 @@ enum GameTimer
|
||||
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, true),
|
||||
HOME_TELEPORT(SpriteID.SPELL_LUMBRIDGE_HOME_TELEPORT, GameTimerImageType.SPRITE, "Home Teleport", 30, ChronoUnit.MINUTES),
|
||||
MINIGAME_TELEPORT(SpriteID.TAB_QUESTS_RED_MINIGAMES, GameTimerImageType.SPRITE, "Minigame Teleport", 20, ChronoUnit.MINUTES);
|
||||
MINIGAME_TELEPORT(SpriteID.TAB_QUESTS_RED_MINIGAMES, GameTimerImageType.SPRITE, "Minigame Teleport", 20, ChronoUnit.MINUTES),
|
||||
SKULL(SpriteID.PLAYER_KILLER_SKULL_523, GameTimerImageType.SPRITE, "Skull", 20, ChronoUnit.MINUTES);
|
||||
|
||||
@Getter
|
||||
private final Duration duration;
|
||||
|
||||
@@ -43,6 +43,7 @@ import net.runelite.api.NPC;
|
||||
import net.runelite.api.NpcID;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.Prayer;
|
||||
import net.runelite.api.SkullIcon;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.WorldType;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
@@ -120,6 +121,7 @@ public class TimersPlugin extends Plugin
|
||||
private int lastAnimation;
|
||||
private boolean loggedInRace;
|
||||
private boolean widgetHiddenChangedOnPvpWorld;
|
||||
private boolean skulledLastTick = false;
|
||||
|
||||
@Inject
|
||||
private ItemManager itemManager;
|
||||
@@ -608,6 +610,21 @@ public class TimersPlugin extends Plugin
|
||||
Player player = client.getLocalPlayer();
|
||||
WorldPoint currentWorldPoint = player.getWorldLocation();
|
||||
|
||||
final boolean isSkulled = player.getSkullIcon() != null && player.getSkullIcon() != SkullIcon.SKULL_FIGHT_PIT;
|
||||
|
||||
if (isSkulled != skulledLastTick)
|
||||
{
|
||||
skulledLastTick = isSkulled;
|
||||
if (isSkulled)
|
||||
{
|
||||
createGameTimer(SKULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
removeGameTimer(SKULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (freezeTimer != null)
|
||||
{
|
||||
// assume movement means unfrozen
|
||||
|
||||
Reference in New Issue
Block a user