mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 11:34:05 +09:00
sound effects for tile placing and breaking
This commit is contained in:
@@ -147,6 +147,7 @@ object AxeCore {
|
||||
// drop the item under cursor
|
||||
PickaxeCore.dropItem(BlockCodex[tileBroken].drop, x, y) // todo use log item if applicable
|
||||
PickaxeCore.makeDust(tile, x, y, 9)
|
||||
PickaxeCore.makeNoise(actor, tile)
|
||||
}
|
||||
// tile not busted
|
||||
if (Math.random() < actionInterval) {
|
||||
|
||||
@@ -70,6 +70,7 @@ object BlockBase {
|
||||
false
|
||||
)
|
||||
}
|
||||
PickaxeCore.makeNoise(actor, itemID)
|
||||
|
||||
1L
|
||||
}
|
||||
|
||||
@@ -105,6 +105,7 @@ object PickaxeCore {
|
||||
dropItem(drop, x, y)
|
||||
}
|
||||
makeDust(tile, x, y, 9)
|
||||
makeNoise(actor, tile)
|
||||
}
|
||||
}
|
||||
// tile not busted
|
||||
@@ -166,6 +167,12 @@ object PickaxeCore {
|
||||
}
|
||||
}
|
||||
|
||||
fun makeNoise(actor: ActorWithBody, tile: ItemID) {
|
||||
Terrarum.audioCodex.getRandomFootstep(BlockCodex[tile].material)?.let {
|
||||
actor.startAudio(it, 2.0)
|
||||
}
|
||||
}
|
||||
|
||||
fun endPrimaryUse(actor: ActorWithBody, item: GameItem?): Boolean {
|
||||
item?.using = false
|
||||
// reset action timer to zero
|
||||
|
||||
@@ -104,6 +104,7 @@ object SledgehammerCore {
|
||||
PickaxeCore.dropItem("wall@$drop", x, y)
|
||||
}
|
||||
PickaxeCore.makeDust(wall, x, y, 9, WALL_OVERLAY_COLOUR)
|
||||
PickaxeCore.makeNoise(actor, wall)
|
||||
}
|
||||
}
|
||||
// tile not busted
|
||||
|
||||
Reference in New Issue
Block a user