From f258632fb52d3cf8f4c52e68a437f0fddf61605c Mon Sep 17 00:00:00 2001 From: randy Date: Sun, 24 Nov 2024 20:21:34 -0700 Subject: [PATCH] Farming produce is automatically noted if wearing an amulet of farming or amulet of nature Since the leprechaun is right there and can do the same function, this just saves the annoying clicking of harvesting and using the produce on the leprechaun over and over. Note that the other functions of the amulet of farming or amulet of nature are not implemented yet. --- .../content/global/skill/farming/CropHarvester.kt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Server/src/main/content/global/skill/farming/CropHarvester.kt b/Server/src/main/content/global/skill/farming/CropHarvester.kt index f5fda6108..43d1ee70c 100644 --- a/Server/src/main/content/global/skill/farming/CropHarvester.kt +++ b/Server/src/main/content/global/skill/farming/CropHarvester.kt @@ -82,9 +82,17 @@ class CropHarvester : OptionHandler() { sendMessage(player, "You lack the needed tool to harvest these crops.") return true } + val necklace = getItemFromEquipment(player, EquipmentSlot.NECK) + var amulet = false + if (necklace != null && (necklace.name.lowercase().contains("amulet of farming") || necklace.name.lowercase().contains("amulet of nature"))) { + amulet = true + } val sendHarvestMessages = if (fPatch.type == PatchType.FLOWER_PATCH) false else true if (sendHarvestMessages && firstHarvest) { sendMessage(player, "You begin to harvest the $patchName.") + if (amulet) { + sendMessage(player, "The leprechaun exchanges your produce for banknotes.") + } firstHarvest = false } animate(player, anim) @@ -92,7 +100,11 @@ class CropHarvester : OptionHandler() { // TODO: If a flower patch is being harvested, delay the clearing of the // patch until after the animation has played - https://youtu.be/lg4GktlVNUY?t=75 delay = 2 - addItem(player, reward.id) + if (amulet) { + addItem(player, note(reward).id) + } else { + addItem(player, reward.id) + } rewardXP(player, Skills.FARMING, plantable.harvestXP) if (patch.patch.type in livesBased) { patch.rollLivesDecrement(