From c53846874ed5720747cc3321225d4d3b01d84b02 Mon Sep 17 00:00:00 2001 From: Danial Date: Mon, 8 Sep 2025 17:58:53 +1200 Subject: [PATCH] Add flinching mode --- .../com/attacktimer/AttackTimerMetronomeConfig.java | 13 +++++++++++++ .../com/attacktimer/AttackTimerMetronomePlugin.java | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/attacktimer/AttackTimerMetronomeConfig.java b/src/main/java/com/attacktimer/AttackTimerMetronomeConfig.java index dadc582..23aa929 100644 --- a/src/main/java/com/attacktimer/AttackTimerMetronomeConfig.java +++ b/src/main/java/com/attacktimer/AttackTimerMetronomeConfig.java @@ -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", diff --git a/src/main/java/com/attacktimer/AttackTimerMetronomePlugin.java b/src/main/java/com/attacktimer/AttackTimerMetronomePlugin.java index d30595b..2fc0f79 100644 --- a/src/main/java/com/attacktimer/AttackTimerMetronomePlugin.java +++ b/src/main/java/com/attacktimer/AttackTimerMetronomePlugin.java @@ -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); } // matchesSpellbook tries two methods, matching the animation the spell book based on the enum of