diff options
author | Linnea Gräf <nea@nea.moe> | 2024-12-19 20:18:39 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-12-19 20:18:39 +0100 |
commit | eda44cb8743c709c15a7ed03381d05e43728e647 (patch) | |
tree | 557a3bd4f096584158b46921f4826208396b4baa /src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt | |
parent | a046b198645811fe1b7db129942505c379aabb03 (diff) | |
download | LocalTransactionLedger-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.kt | 24 |
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) } |