Skip to content

Commit

Permalink
timers: add liquid adrenaline timer
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam- committed Aug 29, 2022
1 parent d461604 commit 8ef1f3a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
8 changes: 8 additions & 0 deletions runelite-api/src/main/java/net/runelite/api/Varbits.java
Original file line number Diff line number Diff line change
Expand Up @@ -683,4 +683,12 @@ public final class Varbits
* Set to 32 upon crushing salts.
*/
public static final int BUFF_STAT_BOOST = 14344;

/**
* If the player has liquid adrenaline buff active
* <p>
* 0 = inactive
* 1 = active
*/
public static final int LIQUID_ADERNALINE_ACTIVE = 14361;
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ enum GameTimer
CORRUPTION_COOLDOWN(SpriteID.SPELL_GREATER_CORRUPTION_DISABLED, GameTimerImageType.SPRITE, "Corruption cooldown", 30, ChronoUnit.SECONDS),
PICKPOCKET_STUN(SpriteID.SKILL_THIEVING, GameTimerImageType.SPRITE, "Stunned", true),
SMELLING_SALTS(ItemID.SMELLING_SALTS_2, GameTimerImageType.ITEM, "Smelling salts", true),
LIQUID_ADRENALINE(ItemID.LIQUID_ADRENALINE_2, GameTimerImageType.ITEM, "Liquid adrenaline", 30, ChronoUnit.SECONDS, true),
;

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ default boolean showOverload()
return true;
}

@ConfigItem(
keyName = "showLiquidAdrenaline",
name = "Liquid adrenaline timer",
description = "Configures whether liquid adrenaline timer is displayed"
)
default boolean showLiquidAdrenaline()
{
return true;
}

@ConfigItem(
keyName = "showPrayerEnhance",
name = "Prayer enhance timer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,18 @@ else if (buffTimer == null)
buffTimer.updateDuration(duration);
}
}

if (event.getVarbitId() == Varbits.LIQUID_ADERNALINE_ACTIVE && config.showLiquidAdrenaline())
{
if (event.getValue() == 1)
{
createGameTimer(LIQUID_ADRENALINE);
}
else
{
removeGameTimer(LIQUID_ADRENALINE);
}
}
}

@Subscribe
Expand Down Expand Up @@ -483,6 +495,11 @@ public void onConfigChanged(ConfigChanged event)
{
createTzhaarTimer();
}

if (!config.showLiquidAdrenaline())
{
removeGameTimer(LIQUID_ADRENALINE);
}
}

@Subscribe
Expand Down

0 comments on commit 8ef1f3a

Please sign in to comment.