mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 03:24:06 +09:00
particles when blocks are being mined
This commit is contained in:
@@ -79,13 +79,16 @@ object PickaxeCore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// filter passed, do the job
|
// filter passed, do the job
|
||||||
val swingDmgToFrameDmg = delta.toDouble() / actorvalue.getAsDouble(AVKey.ACTION_INTERVAL)!!
|
val actionInterval = actorvalue.getAsDouble(AVKey.ACTION_INTERVAL)!!
|
||||||
|
val swingDmgToFrameDmg = delta.toDouble() / actionInterval
|
||||||
val (oreOnTile, _) = INGAME.world.getTileFromOre(x, y)
|
val (oreOnTile, _) = INGAME.world.getTileFromOre(x, y)
|
||||||
|
|
||||||
INGAME.world.inflictTerrainDamage(
|
INGAME.world.inflictTerrainDamage(
|
||||||
x, y,
|
x, y,
|
||||||
Calculate.pickaxePower(actor, item?.material) * swingDmgToFrameDmg
|
Calculate.pickaxePower(actor, item?.material) * swingDmgToFrameDmg
|
||||||
)?.let { tileBroken ->
|
).let { tileBroken ->
|
||||||
|
// tile busted
|
||||||
|
if (tileBroken != null) {
|
||||||
if (Math.random() < dropProbability) {
|
if (Math.random() < dropProbability) {
|
||||||
val drop = if (oreOnTile != Block.AIR)
|
val drop = if (oreOnTile != Block.AIR)
|
||||||
OreCodex[oreOnTile].item
|
OreCodex[oreOnTile].item
|
||||||
@@ -98,6 +101,11 @@ object PickaxeCore {
|
|||||||
makeDust(tile, x, y, 9)
|
makeDust(tile, x, y, 9)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// tile not busted
|
||||||
|
if (Math.random() < actionInterval) {
|
||||||
|
makeDust(tile, x, y, 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
usageStatus = usageStatus or true
|
usageStatus = usageStatus or true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,12 +88,15 @@ object SledgehammerCore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// filter passed, do the job
|
// filter passed, do the job
|
||||||
val swingDmgToFrameDmg = delta.toDouble() / actorvalue.getAsDouble(AVKey.ACTION_INTERVAL)!!
|
val actionInterval = actorvalue.getAsDouble(AVKey.ACTION_INTERVAL)!!
|
||||||
|
val swingDmgToFrameDmg = delta.toDouble() / actionInterval
|
||||||
|
|
||||||
INGAME.world.inflictWallDamage(
|
INGAME.world.inflictWallDamage(
|
||||||
x, y,
|
x, y,
|
||||||
Calculate.pickaxePower(actor, item?.material) * swingDmgToFrameDmg
|
Calculate.pickaxePower(actor, item?.material) * swingDmgToFrameDmg
|
||||||
)?.let { tileBroken ->
|
).let { tileBroken ->
|
||||||
|
// tile busted
|
||||||
|
if (tileBroken != null) {
|
||||||
if (Math.random() < dropProbability) {
|
if (Math.random() < dropProbability) {
|
||||||
val drop = BlockCodex[tileBroken].drop
|
val drop = BlockCodex[tileBroken].drop
|
||||||
if (drop.isNotBlank()) {
|
if (drop.isNotBlank()) {
|
||||||
@@ -102,6 +105,11 @@ object SledgehammerCore {
|
|||||||
PickaxeCore.makeDust(wall, x, y, 9, App.tileMaker.wallOverlayColour)
|
PickaxeCore.makeDust(wall, x, y, 9, App.tileMaker.wallOverlayColour)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// tile not busted
|
||||||
|
if (Math.random() < actionInterval) {
|
||||||
|
PickaxeCore.makeDust(wall, x, y, 1, App.tileMaker.wallOverlayColour)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
usageStatus = usageStatus or true
|
usageStatus = usageStatus or true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user