Skip to content
Merged

Fixes #146

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion runelite-plugin.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
displayName=AttackTimer
author=ngraves95,Lexer747
build=standard
version=1.2.1
version=1.2.2
description=A plugin to countdown until your next attack
tags=pvm,timer,attack,combat,weapon
plugins=com.attacktimer.AttackTimerMetronomePlugin
Original file line number Diff line number Diff line change
Expand Up @@ -659,10 +659,11 @@ private StringBuilder getState()
public void onRender()
{
int delta = 0;
delta = VariableSpeed.SHADOW_CRASH.onRender(client, attackDelayHoldoffTicks, isUsingMagic);
delta = VariableSpeed.SHADOW_CRASH.onRender(client, attackDelayHoldoffTicks, isUsingMagic, config.debugLogs());

if (delta != 0)
{
logStateTrace("onRender");
attackDelayHoldoffTicks += delta;
// if a change in attack delay would cause the delay to be less than 0 we hide the display
if (attackDelayHoldoffTicks < 0)
Expand Down
16 changes: 13 additions & 3 deletions src/main/java/com/attacktimer/VariableSpeed/ShadowCrash.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.Client;
import net.runelite.api.GraphicsObject;
import net.runelite.api.Player;
import net.runelite.api.WorldView;
import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldPoint;

@Slf4j
public class ShadowCrash
{
private static final int FIREBALL_ID = 3262;
Expand Down Expand Up @@ -87,7 +89,7 @@ public class ShadowCrash
//
// This function will adjust the attackDelayHoldoffTicks if the player successfully dodges the shadowcrash
// in the sweet spot.
public int onRender(final Client client, final int attackDelayHoldoffTicks, final boolean isUsingMagic)
public int onRender(final Client client, final int attackDelayHoldoffTicks, final boolean isUsingMagic, final boolean debugLogs)
{
// if mark of darkness isn't active then no speed up can be gained.
if (!yama.inYamaRegion || yama.phase() != YamaPhase.P3 || !mod.isActive())
Expand All @@ -100,12 +102,20 @@ public int onRender(final Client client, final int attackDelayHoldoffTicks, fina
// improved by a tick.
consumed = tickCount.get();
// theres a bug/feature in the yama mechanic, if you are using a mage weapon then the speed up
// doesn't apply if the global cooldown is 2 or less. It might also affect range but no-one uses
// doesn't apply if the global cooldown is 1 or less. It might also affect range but no-one uses
// that at yama so IDC. Another reason to prefer melee P3.
if (attackDelayHoldoffTicks <= 2 && isUsingMagic)
if (attackDelayHoldoffTicks <= 1 && isUsingMagic)
{
if (debugLogs)
{
log.debug("shadowCrash success, but magic and low CD");
}
return 0;
}
if (debugLogs)
{
log.debug("shadowCrash success");
}
return -1;
}
return 0;
Expand Down
Loading