From 8eab23147e7eaea693d518850de8be2ae06f97f3 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Thu, 16 Aug 2018 15:17:56 -0700 Subject: [PATCH] timers plugin: Add fall/winter DMM teleblock timers Beginning in Autumn 2018, teleblock timers will be half that of the normal game mode: 150 seconds for a full teleblock, and 75 seconds if the target had Protect from Magic active. Ref: https://services.runescape.com/m=news/deadman-autumn-finals-and-winter-season?oldschool=1 --- .../client/plugins/timers/GameTimer.java | 2 + .../client/plugins/timers/TimersPlugin.java | 54 ++++++------------- 2 files changed, 19 insertions(+), 37 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timers/GameTimer.java b/runelite-client/src/main/java/net/runelite/client/plugins/timers/GameTimer.java index 8aa92d0429..9cdb4c30d0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timers/GameTimer.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timers/GameTimer.java @@ -46,6 +46,8 @@ enum GameTimer MAGICIMBUE(SpriteID.SPELL_MAGIC_IMBUE, GameTimerImageType.SPRITE, "Magic imbue", 12, ChronoUnit.SECONDS), FULLTB(SpriteID.SPELL_TELE_BLOCK, GameTimerImageType.SPRITE, "Full Teleblock", 5, ChronoUnit.MINUTES), HALFTB(SpriteID.SPELL_TELE_BLOCK, GameTimerImageType.SPRITE, "Half Teleblock", 150, ChronoUnit.SECONDS), + DMM_FULLTB(SpriteID.SPELL_TELE_BLOCK, GameTimerImageType.SPRITE, "Deadman Mode Full Teleblock", 150, ChronoUnit.SECONDS), + DMM_HALFTB(SpriteID.SPELL_TELE_BLOCK, GameTimerImageType.SPRITE, "Deadman Mode Half Teleblock", 75, ChronoUnit.SECONDS), ANTIVENOMPLUS(ItemID.ANTIVENOM4_12913, GameTimerImageType.ITEM, "Anti-venom+", 3, ChronoUnit.MINUTES), SUPERANTIFIRE(ItemID.SUPER_ANTIFIRE_POTION4, GameTimerImageType.ITEM, "Super antifire", 3, ChronoUnit.MINUTES), ANTIDOTEPLUSPLUS(ItemID.ANTIDOTE4_5952, GameTimerImageType.ITEM, "Antidote++", 12, ChronoUnit.MINUTES), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java index 983ac427f7..539e6a3219 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java @@ -58,42 +58,7 @@ import net.runelite.client.game.ItemManager; 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; -import static net.runelite.client.plugins.timers.GameTimer.ANTIPOISON; -import static net.runelite.client.plugins.timers.GameTimer.ANTIVENOM; -import static net.runelite.client.plugins.timers.GameTimer.ANTIVENOMPLUS; -import static net.runelite.client.plugins.timers.GameTimer.BIND; -import static net.runelite.client.plugins.timers.GameTimer.CANNON; -import static net.runelite.client.plugins.timers.GameTimer.CHARGE; -import static net.runelite.client.plugins.timers.GameTimer.ENTANGLE; -import static net.runelite.client.plugins.timers.GameTimer.EXANTIFIRE; -import static net.runelite.client.plugins.timers.GameTimer.EXSUPERANTIFIRE; -import static net.runelite.client.plugins.timers.GameTimer.FULLTB; -import static net.runelite.client.plugins.timers.GameTimer.GOD_WARS_ALTAR; -import static net.runelite.client.plugins.timers.GameTimer.HALFBIND; -import static net.runelite.client.plugins.timers.GameTimer.HALFENTANGLE; -import static net.runelite.client.plugins.timers.GameTimer.HALFSNARE; -import static net.runelite.client.plugins.timers.GameTimer.HALFTB; -import static net.runelite.client.plugins.timers.GameTimer.ICEBARRAGE; -import static net.runelite.client.plugins.timers.GameTimer.ICEBLITZ; -import static net.runelite.client.plugins.timers.GameTimer.ICEBURST; -import static net.runelite.client.plugins.timers.GameTimer.ICERUSH; -import static net.runelite.client.plugins.timers.GameTimer.IMBUEDHEART; -import static net.runelite.client.plugins.timers.GameTimer.MAGICIMBUE; -import static net.runelite.client.plugins.timers.GameTimer.OVERLOAD; -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.SANFEW; -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.SUPERANTIFIRE; -import static net.runelite.client.plugins.timers.GameTimer.SUPERANTIPOISON; -import static net.runelite.client.plugins.timers.GameTimer.VENGEANCE; -import static net.runelite.client.plugins.timers.GameTimer.VENGEANCEOTHER; +import static net.runelite.client.plugins.timers.GameTimer.*; import net.runelite.client.ui.overlay.infobox.InfoBoxManager; @PluginDescriptor( @@ -111,6 +76,7 @@ public class TimersPlugin extends Plugin private static final String CANNON_REPAIR_MESSAGE = "You repair your cannon, restoring it to working order."; private static final String CHARGE_EXPIRED_MESSAGE = "Your magical charge fades away."; private static final String CHARGE_MESSAGE = "You feel charged with magic power."; + private static final String DEADMAN_HALF_TELEBLOCK_MESSAGE = "A teleblock spell has been cast on you. It will expire in 1 minute, 15 seconds."; private static final String EXTENDED_ANTIFIRE_DRINK_MESSAGE = "You drink some of your extended antifire potion."; private static final String EXTENDED_SUPER_ANTIFIRE_DRINK_MESSAGE = "You drink some of your extended super antifire potion."; private static final String FROZEN_MESSAGE = "You have been frozen!"; @@ -272,6 +238,8 @@ public class TimersPlugin extends Plugin { removeGameTimer(FULLTB); removeGameTimer(HALFTB); + removeGameTimer(DMM_FULLTB); + removeGameTimer(DMM_HALFTB); } if (!config.showFreezes()) @@ -440,7 +408,19 @@ public class TimersPlugin extends Plugin if (config.showTeleblock() && event.getMessage().equals(HALF_TELEBLOCK_MESSAGE)) { - createGameTimer(HALFTB); + if (client.getWorldType().contains(WorldType.DEADMAN)) + { + createGameTimer(DMM_FULLTB); + } + else + { + createGameTimer(HALFTB); + } + } + + if (config.showTeleblock() && event.getMessage().equals(DEADMAN_HALF_TELEBLOCK_MESSAGE)) + { + createGameTimer(DMM_HALFTB); } if (config.showSuperAntiFire() && event.getMessage().contains(SUPER_ANTIFIRE_DRINK_MESSAGE))