From b344b3b1613166d8b07aad49ad026fb0f9cd36ef Mon Sep 17 00:00:00 2001 From: minjaesong Date: Wed, 25 Sep 2024 19:43:22 +0900 Subject: [PATCH] no quartz on igneous rocks --- assets/mods/basegame/blocks/blocks.csv | 10 +++++----- assets/mods/basegame/locales/en/blocks.json | 9 +++++++-- assets/mods/basegame/ores/worldgen.csv | 8 ++++---- .../terrarum/modulebasegame/WorldSimulator.kt | 14 ++++++++------ .../terrarum/modulebasegame/console/ExportMap.kt | 1 + 5 files changed, 25 insertions(+), 17 deletions(-) diff --git a/assets/mods/basegame/blocks/blocks.csv b/assets/mods/basegame/blocks/blocks.csv index f3deb4101..4c1121a1b 100644 --- a/assets/mods/basegame/blocks/blocks.csv +++ b/assets/mods/basegame/blocks/blocks.csv @@ -7,12 +7,12 @@ "17";"16";"16";"BLOCK_STONE_QUARRIED";"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";"0.0";"ROCK,NATURAL,OREBEARING" "18";"18";"18";"BLOCK_STONE_TILE_WHITE";"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";"0.18";"STONE" "19";"19";"19";"BLOCK_STONE_BRICKS";"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";"0.0";"STONE" -"20";"20";"20";"BLOCK_STONE_GABBRO";"0.1252";"0.1252";"0.1252";"0.1252";"80";"2400";"ROCK";"1";"1";"N/A";"0";"4";"16";"0.0000";"0.0000";"0.0000";"0.0000";"0.0";"ROCK,NATURAL,DEEPROCK,OREBEARING,OLDNAME¤0.4.4¤STONE_DEEP" +"20";"20";"20";"BLOCK_STONE_DEEP";"0.1252";"0.1252";"0.1252";"0.1252";"80";"2400";"ROCK";"1";"1";"N/A";"0";"4";"16";"0.0000";"0.0000";"0.0000";"0.0000";"0.0";"ROCK,NATURAL,DEEPROCK,OREBEARING" "21";"21";"21";"BLOCK_STONE_MARBLE";"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";"0.1";"ROCK,NATURAL,FLUXSTONE" -"22";"22";"22";"BLOCK_STONE_ORTHOCLASE";"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";"0.0";"ROCK,NATURAL,OREBEARING" -"23";"23";"23";"BLOCK_STONE_PLAGIOCLASE";"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";"0.0";"ROCK,NATURAL,OREBEARING" -"24";"24";"24";"BLOCK_STONE_MICROCLINE";"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";"0.0";"ROCK,NATURAL,OREBEARING" -"25";"25";"25";"BLOCK_STONE_BASALT";"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";"0.0";"ROCK,NATURAL,OREBEARING" +"22";"22";"22";"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";"0.0";"ROCK,NATURAL,OREBEARING" +"23";"23";"23";"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";"0.0";"ROCK,NATURAL,OREBEARING" +"24";"24";"24";"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";"0.0";"ROCK,NATURAL,OREBEARING" +"25";"25";"25";"BLOCK_STONE_BASALT";"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";"0.0";"ROCK,NATURAL,OREBEARING,BASALT" "26";"26";"26";"BLOCK_STONE_SLATE";"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";"0.0";"ROCK,NATURAL,OREBEARING" "27";"27";"27";"BLOCK_STONE_LIMESTONE";"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";"0.0";"ROCK,NATURAL,OREBEARING,FLUXSTONE" diff --git a/assets/mods/basegame/locales/en/blocks.json b/assets/mods/basegame/locales/en/blocks.json index 113a922fb..4e37b612b 100644 --- a/assets/mods/basegame/locales/en/blocks.json +++ b/assets/mods/basegame/locales/en/blocks.json @@ -5,11 +5,16 @@ "BLOCK_AIR": "Air", "BLOCK_STONE": "Stone", - "BLOCK_STONE_QUARRIED": "Quarried Stone", - "BLOCK_STONE_TILE_WHITE": "Stone Tile", + "BLOCK_STONE_BASALT": "Basalt", "BLOCK_STONE_BRICKS": "Stone Bricks", "BLOCK_STONE_DEEP": "Deepstone", + "BLOCK_STONE_LIMESTONE": "Limestone", "BLOCK_STONE_MARBLE": "Marble", + "BLOCK_STONE_QUARRIED": "Quarried Stone", + "BLOCK_STONE_SLATE": "Slate", + "BLOCK_STONE_TILE_WHITE": "White Stone Tile", + "BLOCK_STONE_TILE_BLACK": "Black Stone Tile", + "BLOCK_BRICKS": "Bricks", /* always plural */ "BLOCK_DIRT": "Dirt", diff --git a/assets/mods/basegame/ores/worldgen.csv b/assets/mods/basegame/ores/worldgen.csv index 586fe21e1..39a489baf 100644 --- a/assets/mods/basegame/ores/worldgen.csv +++ b/assets/mods/basegame/ores/worldgen.csv @@ -9,10 +9,10 @@ "8";"0.017";"0.020";"0.511";"1.0";"a16x16";"lead (galena)";"" "9";"0.008";"0.200";"0.480";"1.0";"a16x16";"uranium (pitchblende)";"FLUXSTONE" -"256";"0.010";"-0.366";"0.528";"2.4";"a16x8";"rocksalt";"DEEPROCK" -"257";"0.007";"0.100";"0.494";"1.0";"a16x8";"amethyst";"" -"258";"0.019";"0.015";"0.509";"1.0";"a16x8";"quartz";"" -"259";"0.010";"-0.166";"0.517";"1.4";"a16x8";"nitre";"DEEPROCK" +"256";"0.010";"-0.366";"0.528";"2.4";"a16x8";"rocksalt";"DEEPROCK,BASALT" +"257";"0.007";"0.100";"0.494";"1.0";"a16x8";"amethyst";"DEEPROCK,BASALT" +"258";"0.019";"0.015";"0.509";"1.0";"a16x8";"quartz";"DEEPROCK,BASALT" +"259";"0.010";"-0.166";"0.517";"1.4";"a16x8";"nitre";"DEEPROCK,BASALT" ################################################################################ diff --git a/src/net/torvald/terrarum/modulebasegame/WorldSimulator.kt b/src/net/torvald/terrarum/modulebasegame/WorldSimulator.kt index dd8b67114..aa4ccc38c 100644 --- a/src/net/torvald/terrarum/modulebasegame/WorldSimulator.kt +++ b/src/net/torvald/terrarum/modulebasegame/WorldSimulator.kt @@ -47,7 +47,7 @@ object WorldSimulator { private val fluidNewTypeMap = Array(DOUBLE_RADIUS) { Array(DOUBLE_RADIUS) { Fluid.NULL } } const val FLUID_MAX_MASS = 1f // The normal, un-pressurized mass of a full water cell - const val FLUID_MAX_COMP = 0.02f // How much excess water a cell can store, compared to the cell above it. A tile of fluid can contain more than MaxMass water. + const val FLUID_MAX_COMP = 0.01f // How much excess water a cell can store, compared to the cell above it. A tile of fluid can contain more than MaxMass water. // const val FLUID_MIN_MASS = net.torvald.terrarum.gameworld.FLUID_MIN_MASS //Ignore cells that are almost dry (smaller than epsilon of float16) const val minFlow = 1f / 512f @@ -204,12 +204,17 @@ object WorldSimulator { fluidmapToWorld() } + fun isSolid(worldX: Int, worldY: Int): Boolean { + val tile = world.getTileFromTerrain(worldX, worldY) + return BlockCodex[tile].isSolid + } + fun isFlowable(type: ItemID, worldX: Int, worldY: Int): Boolean { val fluid = world.getFluid(worldX, worldY) val tile = world.getTileFromTerrain(worldX, worldY) // true if target's type is the same as mine, or it's NULL (air) - return ((fluid.type == type || fluid.type == Fluid.NULL) && !BlockCodex[tile].isSolid) + return (((fluid.type == type && fluid.amount < FLUID_MAX_MASS + FLUID_MAX_COMP) || fluid.type == Fluid.NULL) && !BlockCodex[tile].isSolid) } /** @@ -350,10 +355,7 @@ object WorldSimulator { val maxSpeed = 1f / FluidCodex[remainingType].viscosity.sqr() // check solidity - if (!isFlowable(remainingType, worldX, worldY)) continue - // check if the fluid is a same kind - //if (!isFlowable(type, worldX, worldY))) continue - + if (isSolid(worldX, worldY)) continue // Custom push-only flow var flow = 0f diff --git a/src/net/torvald/terrarum/modulebasegame/console/ExportMap.kt b/src/net/torvald/terrarum/modulebasegame/console/ExportMap.kt index d047b85bf..5130595f8 100644 --- a/src/net/torvald/terrarum/modulebasegame/console/ExportMap.kt +++ b/src/net/torvald/terrarum/modulebasegame/console/ExportMap.kt @@ -34,6 +34,7 @@ internal object ExportMap : ConsoleCommand { "ores@basegame:6" to Cvec(0xffcc00ff.toInt()), "ores@basegame:7" to Cvec(0xd5d9f9ff.toInt()), "ores@basegame:8" to Cvec(0xff9300ff.toInt()), + "ores@basegame:9" to Cvec(0x88ff00ff.toInt()), "ores@basegame:256" to Cvec(0xff00ffff.toInt()), "ores@basegame:257" to Cvec(0xee77ffff.toInt()), "ores@basegame:258" to Cvec(0xffffffff.toInt()),