aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-12-19 20:18:39 +0100
committerLinnea Gräf <nea@nea.moe>2024-12-19 20:18:39 +0100
commiteda44cb8743c709c15a7ed03381d05e43728e647 (patch)
tree557a3bd4f096584158b46921f4826208396b4baa /src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt
parenta046b198645811fe1b7db129942505c379aabb03 (diff)
downloadLocalTransactionLedger-eda44cb8743c709c15a7ed03381d05e43728e647.tar.gz
LocalTransactionLedger-eda44cb8743c709c15a7ed03381d05e43728e647.tar.bz2
LocalTransactionLedger-eda44cb8743c709c15a7ed03381d05e43728e647.zip
feat: Add corpse loot detection
Diffstat (limited to 'src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt')
-rw-r--r--src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt24
1 files changed, 1 insertions, 23 deletions
diff --git a/src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt b/src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt
index 2ee581c..f457ae4 100644
--- a/src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt
+++ b/src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt
@@ -59,29 +59,7 @@ class VisitorDetection {
private fun parseGardenLoreLine(rewardLine: String): Pair<ItemId, Double>? {
val f = rewardLine.unformattedString().trim()
- return parseSpecialReward(f)
- ?: idProvider.findStackableItemByName(f, true)
- }
-
- private val specialRewardRegex = "\\+(?<amount>${SHORT_NUMBER_PATTERN})x? (?<what>.*)".toPattern()
-
- private fun parseSpecialReward(specialLine: String): Pair<ItemId, Double>? {
- specialRewardRegex.useMatcher(specialLine) {
- val id = when (group("what")) {
- "Copper" -> ItemId.COPPER
- "Bits" -> ItemId.BITS
- "Garden Experience" -> ItemId.GARDEN
- "Farming XP" -> ItemId.FARMING
- "Gold Essence" -> ItemId.GOLD_ESSENCE
- "Gemstone Powder" -> ItemId.GEMSTONE_POWDER
- "Mithril Powder" -> ItemId.MITHRIL_POWDER
- "Pelts" -> ItemId.PELT
- "Fine Flour" -> ItemId.FINE_FLOUR
- else -> ItemId.NIL
- }
- return Pair(id, parseShortNumber(group("amount")))
- }
- return null
+ return idProvider.findStackableItemByName(f, true)
}