forked from 2009Scape/Server
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.
This commit is contained in:
parent
4799069ebd
commit
45ee87e64e
2 changed files with 34 additions and 1 deletions
|
|
@ -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.")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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!")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue