From 45ee87e64e4cd8a1888db642ce344689477ee25e Mon Sep 17 00:00:00 2001 From: randy Date: Thu, 27 Mar 2025 19:30:06 -0600 Subject: [PATCH] Blast Furnace improvements Shoving coke no longer requires intense clicking, the player will keep shoveling until the stove is full. Adding ore that requires coal to the conveyor belt will take the needed coal from the gold satchel, if carried. --- .../minigame/blastfurnace/BlastFurnace.kt | 26 ++++++++++++++++++- .../blastfurnace/BlastFurnaceListeners.kt | 9 +++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/Server/src/main/content/minigame/blastfurnace/BlastFurnace.kt b/Server/src/main/content/minigame/blastfurnace/BlastFurnace.kt index 5bbdedef1..7c8386596 100644 --- a/Server/src/main/content/minigame/blastfurnace/BlastFurnace.kt +++ b/Server/src/main/content/minigame/blastfurnace/BlastFurnace.kt @@ -166,8 +166,32 @@ class BlastFurnace : MapArea, PersistPlayer, TickListener { maxAmt = maxAmt.coerceAtMost(amount).coerceAtLeast(0) if (maxAmt == 0) continue - if (removeItem(p, Item(oreId, maxAmt))) + if (removeItem(p, Item(oreId, maxAmt))) { + sendMessage(p, "You place ${maxAmt} ${Item(oreId).getName()} on the conveyor belt.") + addCoalSecondary(p, oreId, maxAmt) //The belt renders the most recent ore, so add the coal first addOreToBelt(p, oreId, maxAmt) + } + } + } + + //Snowscape feature: coal stored in the gold satchel is automatically added to the belt with ores that require coal. + fun addCoalSecondary (p: Player, oreId: Int, amount: Int) { + if (!inEquipmentOrInventory(p, Items.GOLD_SATCHEL_10881)) return + + var coalAmount = 0 + when(oreId) { + Items.IRON_ORE_440 -> coalAmount = amount + Items.MITHRIL_ORE_447 -> coalAmount = amount * 2 + Items.ADAMANTITE_ORE_449 -> coalAmount = amount * 3 + Items.RUNITE_ORE_451 -> coalAmount = amount * 4 + else -> return + } + + coalAmount = coalAmount.coerceAtMost(getOreContainer(p).getAvailableSpace(Items.COAL_453) - getAmountOnBelt(p, Items.COAL_453)) + + if (coalAmount > 0 && p.goldSatchel.remove(Item(Items.COAL_453, coalAmount))){ + addOreToBelt(p, Items.COAL_453, coalAmount) + sendMessage(p, "You take ${coalAmount} Coal from your gold satchel and place it on the belt.") } } diff --git a/Server/src/main/content/minigame/blastfurnace/BlastFurnaceListeners.kt b/Server/src/main/content/minigame/blastfurnace/BlastFurnaceListeners.kt index deaaae199..627f57d77 100644 --- a/Server/src/main/content/minigame/blastfurnace/BlastFurnaceListeners.kt +++ b/Server/src/main/content/minigame/blastfurnace/BlastFurnaceListeners.kt @@ -6,6 +6,7 @@ import core.game.dialogue.DialogueFile import core.game.dialogue.Topic import core.game.interaction.IntType import core.game.interaction.InteractionListener +import core.game.interaction.InteractionListeners import core.game.node.entity.skill.Skills import core.game.system.task.Pulse import core.game.world.map.Location @@ -128,6 +129,10 @@ class BlastFurnaceListeners : InteractionListener { lockInteractions(player,1) animate(player, 2441) } + queueScript(player, 0) { + val node = getScenery(1948,4963,0) + InteractionListeners.run(node!!.getId(), SCENERY, "refuel", player, node) + } } else { sendMessage(player, "You need a spade to do this!") } @@ -163,6 +168,10 @@ class BlastFurnaceListeners : InteractionListener { } } }) + queueScript(player, 0) { + val node = getScenery(1950,4964,0) + InteractionListeners.run(node!!.getId(), SCENERY, "collect", player, node) + } } else { sendMessage(player,"You need some coke to do that!") }