Skip to content

Commit

Permalink
added changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Xupie committed Jul 7, 2024
1 parent 0c0414e commit e48def8
Showing 1 changed file with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ object ArmorStackDisplay {
"combat.armorstack.actionbar",
" (?:§6|§6§l)(?<stack>\\d+[ᝐ⁑|҉Ѫ⚶])"
)
/**

Check failure on line 38 in src/main/java/at/hannibal2/skyhanni/features/combat/ArmorStackDisplay.kt

View workflow job for this annotation

GitHub Actions / Check Style

[ktlint] reported by reviewdog 🐶 Declarations and declarations with comments should have an empty space between. Raw Output: src/main/java/at/hannibal2/skyhanni/features/combat/ArmorStackDisplay.kt:38:5: error: Declarations and declarations with comments should have an empty space between. (standard:spacing-between-declarations-with-comments)
* REGEX-TEST: §7Health: §a+205, §7Defense: §a+55, §7Intelligence: §a+125, §7Combat Wisdom: §a+0.75, §8[§8⚔§8] §8[§8⚔§8], , §bArachno Resistance II, §7Grants §a+3❈ Defense §7against §aspiders§7., §bVeteran I, §7Grants §3+0.75☯ Combat Wisdom§7., , §6Tiered Bonus: Arcane Vision (2/4), §7Gives you the ability to see the runic, §7affinity of enemies., §7, §7Using the proper §bRune §7when casting spells, §7from §bRunic Items §7grants 1 stack of §6Arcane, §6Vision Ѫ§7., §7, §7Each §6Arcane Vision Ѫ §7stack grants you §c+2%, §c§7damage on your §bRunic Spells§7., §7, §7At §c10 §7stacks, the spells also explode on hit., §7, §7Lose 1 stack after §c4s §7of not gaining a stack., , §7§8This item can be reforged!, §6§lLEGENDARY LEGGINGS
*/
private val armorStackTierBonus by RepoPattern.pattern(
"combat.armorstack.armor",
"§6Tiered Bonus: (?<type>\\S+) \\((?<amount>\\d)\\/4\\)"
"§6Tiered Bonus: (?<type>.*) \\((?<amount>\\d)\\/4\\)"
)

@SubscribeEvent
Expand All @@ -51,27 +54,26 @@ object ArmorStackDisplay {

@SubscribeEvent
fun onSecond(event: SecondPassedEvent) {
if (config.showTimer) {
InventoryUtils.getArmor().forEach { armor ->
armorStackTierBonus.findMatcher(armor?.getLore().toString()) {
group("amount")
}?.let { result ->
armorMaxTime = when (result) {
"2" -> 4000.milliseconds
"3" -> 7000.milliseconds
"4" -> 10000.milliseconds
else -> ZERO
}
return
if (!isEnabled() || !config.showTimer) return
InventoryUtils.getArmor().forEach { armor ->
armorStackTierBonus.findMatcher(armor?.getLore().toString()) {
group("amount")
}?.let { result ->
armorMaxTime = when (result) {
"2" -> 4000.milliseconds
"3" -> 7000.milliseconds
"4" -> 10000.milliseconds
else -> ZERO
}
return
}
}
}

@SubscribeEvent
fun onActionBarValueUpdate(event: ActionBarValueUpdateEvent) {
if (event.updated != ActionBarStatsData.ARMOR_STACK) return
displayTimer = SimpleTimeMark.now().plus(armorMaxTime)
if (!isEnabled() || event.updated != ActionBarStatsData.ARMOR_STACK) return
displayTimer = SimpleTimeMark.now() + armorMaxTime
}

@SubscribeEvent
Expand Down

0 comments on commit e48def8

Please sign in to comment.