aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjani270 <69345714+jani270@users.noreply.github.com>2023-10-15 16:00:43 +0200
committerGitHub <noreply@github.com>2023-10-15 16:00:43 +0200
commit218fc4352fd1c0af67d52a3264632f0617179aa8 (patch)
treebedaa5d698a2aae62412355215514c16ffda0ad6
parent347f1b4d913dc9d7c40ef88e09efc885557a110b (diff)
downloadskyhanni-218fc4352fd1c0af67d52a3264632f0617179aa8.tar.gz
skyhanni-218fc4352fd1c0af67d52a3264632f0617179aa8.tar.bz2
skyhanni-218fc4352fd1c0af67d52a3264632f0617179aa8.zip
Added Enrichment to Estimated Item Value (#566)
Added Enrichment to Estimated Item Value. #566
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt14
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt2
2 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt
index dcc2574d9..277c84735 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt
@@ -50,6 +50,7 @@ import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getPowerScroll
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getReforgeName
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getRune
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getSilexCount
+import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getEnrichment
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getTransmissionTunerCount
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.hasArtOfPeace
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.hasArtOfWar
@@ -203,6 +204,7 @@ object EstimatedItemValue {
totalPrice += addWoodSingularity(stack, list)
totalPrice += addJalapenoBook(stack, list)
totalPrice += addStatsBook(stack, list)
+ totalPrice += addEnrichment(stack, list)
// counted
totalPrice += addMasterStars(stack, list)
@@ -567,6 +569,18 @@ object EstimatedItemValue {
return price
}
+ private fun addEnrichment(stack: ItemStack, list: MutableList<String>): Double {
+
+ val enrichmentName = stack.getEnrichment() ?: return 0.0
+ val internalName = "TALISMAN_ENRICHMENT_$enrichmentName".asInternalName()
+
+
+ val price = internalName.getPrice()
+ val name = internalName.getItemName()
+ list.add("§7Enrichment: $name §7(§6" + NumberUtil.format(price) + "§7)")
+ return price
+ }
+
private fun addRune(stack: ItemStack, list: MutableList<String>): Double {
val internalName = stack.getRune() ?: return 0.0
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
index 4cc248ba3..d5a957160 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
@@ -109,6 +109,8 @@ object SkyBlockItemModifierUtils {
fun ItemStack.getPowerScroll() = getAttributeString("power_ability_scroll")?.asInternalName()
+ fun ItemStack.getEnrichment() = getAttributeString("talisman_enrichment")
+
fun ItemStack.getHelmetSkin() = getAttributeString("skin")?.asInternalName()
fun ItemStack.getArmorDye() = getAttributeString("dye_item")?.asInternalName()