Skip to content
Open
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
13 changes: 13 additions & 0 deletions src/main/java/com/attacktimer/AttackTimerMetronomeConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,19 @@ default int heightTickOffset()
return 0;
}

@ConfigItem(
position = 9,
keyName = "flinchingMode",
name = "Flinching Mode",
description = "Enables flinching mode for the tick number",
section = TickNumberSettings
)
@Range(min = -50, max = 50)
default boolean flinchingMode()
{
return false;
}

@ConfigSection(
name = "Attack Bar",
description = "Change the colors and number of colors to cycle through",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ private void setAttackDelay()
AnimationData curAnimation = AnimationData.fromId(client.getLocalPlayer().getAnimation());
PoweredStaves stave = PoweredStaves.getPoweredStaves(weaponId, curAnimation);
boolean matchesSpellbook = matchesSpellbook(curAnimation);
attackDelayHoldoffTicks = getWeaponSpeed(weaponId, stave, curAnimation, matchesSpellbook);
attackDelayHoldoffTicks = config.flinchingMode() ? 10 : getWeaponSpeed(weaponId, stave, curAnimation, matchesSpellbook);
Copy link
Contributor

@Lexer747 Lexer747 Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flinching isn't always 10 ticks. The wiki seems to agree https://oldschool.runescape.wiki/w/Flinching that it can vary, maybe this should be configurable (N tick choice) or just smarter and implement what the wiki describes.

E.g. this wouldn't work for the scarab mage example the wiki gives, but being able to set it too 15 ticks would be a proper delay for that NPC.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, could we have a checkbox to enable flinching mode and a field to enter the number of ticks we want the timer to be?

}

// matchesSpellbook tries two methods, matching the animation the spell book based on the enum of
Expand Down