Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Mineshaft click to gfs ascension rope #1542

Merged
merged 7 commits into from
Apr 25, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,13 @@ public class MiningNotificationsConfig {
@ConfigOption(name = "Cold Threshold", desc = "Change when the Cold notification gets triggered.")
@ConfigEditorSlider(minValue = 1, maxValue = 100, minStep = 1)
public Property<Integer> coldThreshold = Property.of(50);

@Expose
@ConfigOption(
name = "Get Ascension Rope",
desc = "Click on a chat message to get an Ascension Rope when you're at 90 Cold and in the §bMineshaft§7. " +
"§cOnly works if you have an Ascension Rope in your sacks."
)
@ConfigEditorBoolean
public boolean getAscensionRope = true;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package at.hannibal2.skyhanni.features.mining

import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.api.GetFromSackAPI.getFromChatMessageSackItems
import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.data.MiningAPI.getCold
import at.hannibal2.skyhanni.data.MiningAPI.inColdIsland
import at.hannibal2.skyhanni.data.MiningAPI.lastColdReset
Expand All @@ -10,6 +12,10 @@ import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.utils.ConditionalUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
import at.hannibal2.skyhanni.utils.LorenzUtils.runDelayed
import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
import at.hannibal2.skyhanni.utils.PrimitiveItemStack.Companion.makePrimitiveStack
import at.hannibal2.skyhanni.utils.SoundUtils
import at.hannibal2.skyhanni.utils.StringUtils.matches
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
Expand All @@ -19,6 +25,8 @@ import kotlin.time.Duration.Companion.seconds

object MiningNotifications {

private val ASCENSION_ROPE = "ASCENSION_ROPE".asInternalName().makePrimitiveStack(1)

enum class MiningNotificationList(val str: String, val notification: String) {
MINESHAFT_SPAWN("§bGlacite Mineshaft", "§bMineshaft"),
SCRAP("§9Suspicious Scrap", "§9Suspicious Scrap"),
Expand Down Expand Up @@ -46,6 +54,10 @@ object MiningNotifications {
"goblin.diamondspawn",
"§6A §r§bDiamond Goblin §r§6has spawned!"
)
private val frostbitePattern by patternGroup.pattern(
"cold.frostbite",
"§9§lBRRR! §r§bYou're freezing! All you can think about is getting out of here to a warm campfire\\.\\.\\."
)

private val config get() = SkyHanniMod.feature.mining.notifications

Expand All @@ -61,6 +73,13 @@ object MiningNotifications {
scrapDrop.matches(message) -> sendNotification(MiningNotificationList.SCRAP)
goldenGoblinSpawn.matches(message) -> sendNotification(MiningNotificationList.GOLDEN_GOBLIN)
diamondGoblinSpawn.matches(message) -> sendNotification(MiningNotificationList.DIAMOND_GOBLIN)
frostbitePattern.matches(message) -> {
if (IslandType.MINESHAFT.isInIsland() && config.getAscensionRope) {
runDelayed(0.5.seconds) {
getFromChatMessageSackItems(ASCENSION_ROPE)
}
}
}
}
}

Expand Down
Loading