summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data
diff options
context:
space:
mode:
authorThunderblade73 <85900443+Thunderblade73@users.noreply.github.com>2024-08-31 22:31:55 +0200
committerGitHub <noreply@github.com>2024-08-31 22:31:55 +0200
commit79d891d5a3e1bffd31491a921757ccf7ab66b5fe (patch)
treef6fd36060dd3764ecf81295f77a0aecf68e82364 /src/main/java/at/hannibal2/skyhanni/data
parentc834fbbb6a535b0c0c27d02c893433e687332268 (diff)
downloadskyhanni-79d891d5a3e1bffd31491a921757ccf7ab66b5fe.tar.gz
skyhanni-79d891d5a3e1bffd31491a921757ccf7ab66b5fe.tar.bz2
skyhanni-79d891d5a3e1bffd31491a921757ccf7ab66b5fe.zip
Feature: Bits on Cookie (#2265)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt40
1 files changed, 21 insertions, 19 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt
index 72928fd25..e9e58fa46 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt
@@ -60,7 +60,7 @@ object BitsAPI {
// Scoreboard patterns
val bitsScoreboardPattern by bitsDataGroup.pattern(
"scoreboard",
- "^Bits: §b(?<amount>[\\d,.]+).*$"
+ "^Bits: §b(?<amount>[\\d,.]+).*$",
)
// Chat patterns
@@ -68,17 +68,17 @@ object BitsAPI {
private val bitsFromFameRankUpChatPattern by bitsChatGroup.pattern(
"rankup.bits",
- "§eYou gained §3(?<amount>.*) Bits Available §ecompounded from all your §epreviously eaten §6cookies§e! Click here to open §6cookie menu§e!"
+ "§eYou gained §3(?<amount>.*) Bits Available §ecompounded from all your §epreviously eaten §6cookies§e! Click here to open §6cookie menu§e!",
)
private val fameRankUpPattern by bitsChatGroup.pattern(
"rankup.rank",
- "[§\\w\\s]+FAME RANK UP (?:§.)+(?<rank>.*)"
+ "[§\\w\\s]+FAME RANK UP (?:§.)+(?<rank>.*)",
)
private val boosterCookieAte by bitsChatGroup.pattern(
"boostercookieate",
- "§eYou consumed a §6Booster Cookie§e!.*"
+ "§eYou consumed a §6Booster Cookie§e!.*",
)
// GUI patterns
@@ -86,12 +86,12 @@ object BitsAPI {
private val bitsAvailableMenuPattern by bitsGuiGroup.pattern(
"availablemenu",
- "§7Bits Available: §b(?<toClaim>[\\d,]+)(§3.+)?"
+ "§7Bits Available: §b(?<toClaim>[\\d,]+)(§3.+)?",
)
private val fameRankSbMenuPattern by bitsGuiGroup.pattern(
"sbmenufamerank",
- "§7Your rank: §e(?<rank>.*)"
+ "§7Your rank: §e(?<rank>.*)",
)
/**
@@ -99,47 +99,47 @@ object BitsAPI {
*/
private val cookieDurationPattern by bitsGuiGroup.pattern(
"cookieduration",
- "\\s*§7Duration: §a(?<time>.*)"
+ "\\s*§7Duration: §a(?<time>.*)",
)
private val noCookieActiveSBMenuPattern by bitsGuiGroup.pattern(
"sbmenunocookieactive",
- " §7Status: §cNot active!"
+ " §7Status: §cNot active!",
)
private val noCookieActiveCookieMenuPattern by bitsGuiGroup.pattern(
"cookiemenucookieactive",
- "(§7§cYou do not currently have a|§cBooster Cookie active!)"
+ "(§7§cYou do not currently have a|§cBooster Cookie active!)",
)
private val fameRankCommunityShopPattern by bitsGuiGroup.pattern(
"communityshopfamerank",
- "§7Fame Rank: §e(?<rank>.*)"
+ "§7Fame Rank: §e(?<rank>.*)",
)
private val bitsGuiNamePattern by bitsGuiGroup.pattern(
"mainmenuname",
- "^SkyBlock Menu$"
+ "^SkyBlock Menu$",
)
private val cookieGuiStackPattern by bitsGuiGroup.pattern(
"mainmenustack",
- "^§6Booster Cookie$"
+ "^§6Booster Cookie$",
)
private val bitsStackPattern by bitsGuiGroup.pattern(
"bitsstack",
- "§bBits"
+ "§bBits",
)
private val fameRankGuiNamePattern by bitsGuiGroup.pattern(
"famerankmenuname",
- "^(Community Shop|Booster Cookie)$"
+ "^(Community Shop|Booster Cookie)$",
)
private val fameRankGuiStackPattern by bitsGuiGroup.pattern(
"famerankmenustack",
- "^(§aCommunity Shop|§eFame Rank)$"
+ "^(§aCommunity Shop|§eFame Rank)$",
)
@SubscribeEvent
@@ -187,14 +187,14 @@ object BitsAPI {
"FameRank $rank not found",
"Rank" to rank,
"Message" to message,
- "FameRanks" to FameRanks.fameRanks
+ "FameRanks" to FameRanks.fameRanks,
)
return
}
boosterCookieAte.matchMatcher(message) {
- bitsAvailable += (defaultCookieBits * (currentFameRank?.bitsMultiplier ?: return)).toInt()
+ bitsAvailable += bitsPerCookie()
val cookieTime = cookieBuffTime
cookieBuffTime = if (cookieTime == null) SimpleTimeMark.now() + 4.days else cookieTime + 4.days
sendBitsAvailableGainedEvent()
@@ -203,6 +203,8 @@ object BitsAPI {
}
}
+ fun bitsPerCookie(): Int = (defaultCookieBits * (currentFameRank?.bitsMultiplier ?: 1.0)).toInt()
+
@SubscribeEvent
fun onInventoryOpen(event: InventoryFullyOpenedEvent) {
if (!isEnabled()) return
@@ -258,7 +260,7 @@ object BitsAPI {
"FameRank $rank not found",
"Rank" to rank,
"Lore" to fameRankStack.getLore(),
- "FameRanks" to FameRanks.fameRanks
+ "FameRanks" to FameRanks.fameRanks,
)
continue@line
@@ -273,7 +275,7 @@ object BitsAPI {
"FameRank $rank not found",
"Rank" to rank,
"Lore" to fameRankStack.getLore(),
- "FameRanks" to FameRanks.fameRanks
+ "FameRanks" to FameRanks.fameRanks,
)
continue@line