mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-21 07:54:05 +09:00
fix: axe not cutting large trees well
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"id";"drop";"spawn";"name";"shdr";"shdg";"shdb";"shduv";"str";"dsty";"mate";"solid";"wall";"grav";"dlfn";"fv";"fr";"lumr";"lumg";"lumb";"lumuv";"colour";"vscs";"refl";"tags"
|
||||
"0";"0";"0";"BLOCK_AIR";"0.0312";"0.0312";"0.0312";"0.0312";"1";"1";"AIIR";"0";"1";"N/A";"0";"0";"4";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"INCONSEQUENTIAL,AIR,NORANDTILE"
|
||||
"1";"0";"0";"BLOCK_UPDATE";"0.0312";"0.0312";"0.0312";"0.0312";"1";"1";"AIIR";"0";"1";"N/A";"0";"0";"4";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"INTERNAL,NORANDTILE"
|
||||
"0";"N/A";"N/A";"BLOCK_AIR";"0.0312";"0.0312";"0.0312";"0.0312";"1";"1";"AIIR";"0";"1";"N/A";"0";"0";"4";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"INCONSEQUENTIAL,AIR,NORANDTILE"
|
||||
"1";"N/A";"N/A";"BLOCK_UPDATE";"0.0312";"0.0312";"0.0312";"0.0312";"1";"1";"AIIR";"0";"1";"N/A";"0";"0";"4";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"INTERNAL,NORANDTILE"
|
||||
|
||||
# rocks
|
||||
"16";"17";"17";"BLOCK_STONE";"0.1252";"0.1252";"0.1252";"0.1252";"48";"2400";"ROCK";"1";"1";"N/A";"0";"4";"16";"0.0000";"0.0000";"0.0000";"0.0000";"N/A";"N/A";"0.0";"ROCK,NATURAL,OREBEARING"
|
||||
|
||||
|
@@ -628,6 +628,7 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
||||
//uiVitalPrimary,
|
||||
//uiVitalSecondary,
|
||||
//uiVitalItem,
|
||||
noticelet,
|
||||
|
||||
uiBlur,
|
||||
|
||||
@@ -638,6 +639,7 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
||||
getWearableDeviceUI,
|
||||
UIScreenZoom(),
|
||||
uiAutosaveNotifier,
|
||||
|
||||
uiInventoryPlayer,
|
||||
getUIFixture,
|
||||
uiTooltip,
|
||||
@@ -656,7 +658,6 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
||||
}
|
||||
|
||||
// these need to appear on top of any others
|
||||
uiContainer.add(noticelet)
|
||||
uiContainer.add(notifier)
|
||||
|
||||
App.setDebugTime("Ingame.UpdateCounter", 0)
|
||||
|
||||
@@ -104,15 +104,47 @@ object AxeCore {
|
||||
).let { tileBroken ->
|
||||
// tile busted
|
||||
if (tileBroken != null) {
|
||||
var upCtr = 1
|
||||
var upCtr = 0
|
||||
var thisLeaf: ItemID? = null
|
||||
val tileThereL = INGAME.world.getTileFromTerrain(x-1, y - upCtr)
|
||||
val tileThereR = INGAME.world.getTileFromTerrain(x+1, y - upCtr)
|
||||
val propThereL = BlockCodex[tileThereL]
|
||||
val propThereR = BlockCodex[tileThereR]
|
||||
val treeTrunkXoff = if (propThereL.hasAllTag(listOf("TREELARGE", "TREETRUNK"))) -1
|
||||
else if (propThereR.hasAllTag(listOf("TREELARGE", "TREETRUNK"))) 1
|
||||
else 0
|
||||
|
||||
if (treeTrunkXoff != 0) {
|
||||
val tileThere = INGAME.world.getTileFromTerrain(x + treeTrunkXoff, y - upCtr)
|
||||
val propThere = BlockCodex[tileThere]
|
||||
|
||||
INGAME.world.setTileTerrain(x + treeTrunkXoff, y - upCtr, Block.AIR, false)
|
||||
PickaxeCore.dropItem(propThere.drop, x + treeTrunkXoff, y - upCtr)
|
||||
PickaxeCore.makeDust(tile, x + treeTrunkXoff, y - upCtr, 2 + Math.random().roundToInt())
|
||||
}
|
||||
|
||||
upCtr = 1
|
||||
while (true) {
|
||||
val tileHere = INGAME.world.getTileFromTerrain(x, y - upCtr)
|
||||
val propHere = BlockCodex[tileHere]
|
||||
|
||||
if (propHere.hasTag("TREETRUNK")) {
|
||||
if (propHere.hasAllTag(listOf("TREELARGE", "TREETRUNK"))) {
|
||||
INGAME.world.setTileTerrain(x, y - upCtr, Block.AIR, false)
|
||||
PickaxeCore.dropItem(propHere.drop, x, y - upCtr) // todo use log item if applicable
|
||||
PickaxeCore.dropItem(propHere.drop, x, y - upCtr)
|
||||
PickaxeCore.makeDust(tile, x, y - upCtr, 2 + Math.random().roundToInt())
|
||||
|
||||
if (treeTrunkXoff != 0) {
|
||||
val tileThere = INGAME.world.getTileFromTerrain(x + treeTrunkXoff, y - upCtr)
|
||||
val propThere = BlockCodex[tileThere]
|
||||
|
||||
INGAME.world.setTileTerrain(x + treeTrunkXoff, y - upCtr, Block.AIR, false)
|
||||
PickaxeCore.dropItem(propThere.drop, x + treeTrunkXoff, y - upCtr)
|
||||
PickaxeCore.makeDust(tile, x + treeTrunkXoff, y - upCtr, 2 + Math.random().roundToInt())
|
||||
}
|
||||
}
|
||||
else if (propHere.hasTag("TREETRUNK")) {
|
||||
INGAME.world.setTileTerrain(x, y - upCtr, Block.AIR, false)
|
||||
PickaxeCore.dropItem(propHere.drop, x, y - upCtr)
|
||||
PickaxeCore.makeDust(tile, x, y - upCtr, 2 + Math.random().roundToInt())
|
||||
}
|
||||
else if (propHere.hasTag("LEAVES")) {
|
||||
|
||||
@@ -428,7 +428,7 @@ internal object BlocksDrawer {
|
||||
|
||||
// hide tiles with super low lights, kinda like Minecraft's Orebfuscator
|
||||
val lightAtXY = LightmapRenderer.getLight(x, y) ?: Cvec(0)
|
||||
if (lightAtXY.fastLum() <= 4f / 255f) {
|
||||
if (lightAtXY.fastLum() <= 1.5f / 255f) {
|
||||
tileNumber = 2 // black solid
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user