mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 02:54:04 +09:00
fix: bomb's item drop not obeying 'drop' itemproperty
This commit is contained in:
@@ -105,10 +105,7 @@ object AxeCore {
|
||||
// tile busted
|
||||
if (tileBroken != null) {
|
||||
val drop = BlockCodex[tileBroken].drop
|
||||
|
||||
if (drop.isNotBlank()) {
|
||||
PickaxeCore.dropItem(drop, x, y)
|
||||
}
|
||||
PickaxeCore.dropItem(drop, x, y)
|
||||
|
||||
PickaxeCore.makeDust(tile, x, y, 9)
|
||||
PickaxeCore.makeNoise(actor, tile)
|
||||
|
||||
@@ -95,19 +95,19 @@ object PickaxeCore {
|
||||
x, y,
|
||||
Calculate.pickaxePower(actor, item?.material) * swingDmgToFrameDmg
|
||||
).let { (tileBroken, oreBroken) ->
|
||||
|
||||
|
||||
// drop ore
|
||||
if (oreBroken != null) {
|
||||
if (Math.random() < dropProbability) {
|
||||
val drop = OreCodex[oreBroken].item
|
||||
if (drop.isNotBlank()) dropItem(drop, x, y)
|
||||
dropItem(drop, x, y)
|
||||
}
|
||||
}
|
||||
// drop tile
|
||||
else if (tileBroken != null) {
|
||||
if (Math.random() < dropProbability) {
|
||||
val drop = BlockCodex[tileBroken].drop
|
||||
if (drop.isNotBlank()) dropItem(drop, x, y)
|
||||
dropItem(drop, x, y)
|
||||
}
|
||||
|
||||
// temperary: drop random disc
|
||||
@@ -139,6 +139,7 @@ object PickaxeCore {
|
||||
}
|
||||
|
||||
fun dropItem(item: ItemID, tx: Int, ty: Int) {
|
||||
if (item.isBlank()) return
|
||||
INGAME.queueActorAddition(
|
||||
DroppedItem(
|
||||
item,
|
||||
|
||||
@@ -100,9 +100,8 @@ object SledgehammerCore {
|
||||
if (tileBroken != null) {
|
||||
if (Math.random() < dropProbability) {
|
||||
val drop = BlockCodex[tileBroken].drop
|
||||
if (drop.isNotBlank()) {
|
||||
PickaxeCore.dropItem("wall@$drop", x, y)
|
||||
}
|
||||
PickaxeCore.dropItem("wall@$drop", x, y)
|
||||
|
||||
PickaxeCore.makeDust(wall, x, y, 9, WALL_OVERLAY_COLOUR)
|
||||
PickaxeCore.makeNoise(actor, wall)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user