diff --git a/assets/mods/basegame/fluid/fluids.csv b/assets/mods/basegame/fluid/fluids.csv index 74e978137..63abb72d3 100644 --- a/assets/mods/basegame/fluid/fluids.csv +++ b/assets/mods/basegame/fluid/fluids.csv @@ -1,4 +1,10 @@ -"id";"name";"shdr";"shdg";"shdb";"shduv";"str";"dsty";"mate";"lumr";"lumg";"lumb";"lumuv";"colour";"vscs";"refl";"tags" -"1";"BLOCK_WATER";"0.1016";"0.0744";"0.0508";"0.0826";"100";"1000";"WATR";"0.0000";"0.0000";"0.0000";"0.0000";"005599A6";"5";"0.0";"NATURAL" -"2";"BLOCK_LAVA";"0.1252";"0.1252";"0.1252";"0.1252";"100";"2600";"ROCK"; "0.7664";"0.2032";"0.0000";"0.0000";"FF4600E6";"16";"0.0";"NATURAL,MOLTEN" -"3";"BLOCK_CRUDE_OIL";"0.1252";"0.1252";"0.1252";"0.1252";"100";"750";"COIL"; "0.0000";"0.0000";"0.0000";"0.0000";"1D0A06F8";"10";"0.0";"NATURAL" +"id";"name";"shdr";"shdg";"shdb";"shduv";"str";"dsty";"mate";"lumr";"lumg";"lumb";"lumuv";"colour";"vscs";"refl";"tags";"therm" +"1";"BLOCK_WATER";"0.1016";"0.0744";"0.0508";"0.0826";"100";"1000";"WATR";"0.0000";"0.0000";"0.0000";"0.0000";"005599A6";"5";"0.0";"NATURAL";0 +"2";"BLOCK_LAVA";"0.1252";"0.1252";"0.1252";"0.1252";"100";"2600";"ROCK"; "0.7664";"0.2032";"0.0000";"0.0000";"FF4600E6";"16";"0.0";"NATURAL,MOLTEN";2 +"3";"BLOCK_CRUDE_OIL";"0.1252";"0.1252";"0.1252";"0.1252";"100";"750";"COIL"; "0.0000";"0.0000";"0.0000";"0.0000";"1D0A06F8";"10";"0.0";"NATURAL";1 + +## therm +# -1: cryogenic (-100C) +# 0: room temperature (-10C..10C; e.g. water) +# 1: hot (100C; e.g. steam, crude oil) +# 2: molten (1000C; e.g. lava) diff --git a/assets/mods/basegame/items/itemid.csv b/assets/mods/basegame/items/itemid.csv index 3f03d9fb9..22baff848 100644 --- a/assets/mods/basegame/items/itemid.csv +++ b/assets/mods/basegame/items/itemid.csv @@ -155,7 +155,7 @@ id;classname;tags # preferably autogenerated # FLUIDSTORAGE: required tag for buckets/canisters # OPENSTORAGE: cannot hold gas. Canisters need LIDDEDSTORAGE/SEALEDSTORAGE -# FLUIDROOMTEMP: cannot hold cryogenic/hot fluids (e.g. lava, steam) +# NOEXTREMETHERM: cannot hold cryogenic/molten fluids (can only hold fluid with therm 0 or 1) # 100000h..1000FFh : container type 0 x Fluid type 0..255 # 100100h..1001FFh : container type 1 x Fluid type 0..255 # 100200h..1002FFh : container type 2 x Fluid type 0..255 @@ -164,10 +164,10 @@ id;classname;tags # 100500h..1005FFh : container type 5 x Fluid type 0..255 # ... # 10FF00h..10FFFFh : container type 255 x Fluid type 0..255 -1048576;net.torvald.terrarum.modulebasegame.gameitems.ItemBucketWooden00;FLUIDSTORAGE,OPENSTORAGE,FLUIDROOMTEMP,FLUIDSTORAGEEMPTY -1048577;net.torvald.terrarum.modulebasegame.gameitems.ItemBucketWooden01;FLUIDSTORAGE,OPENSTORAGE,FLUIDROOMTEMP -#1048578;net.torvald.terrarum.modulebasegame.gameitems.ItemBucketWooden02;FLUIDSTORAGE,OPENSTORAGE,FLUIDROOMTEMP -1048579;net.torvald.terrarum.modulebasegame.gameitems.ItemBucketWooden03;FLUIDSTORAGE,OPENSTORAGE,FLUIDROOMTEMP +1048576;net.torvald.terrarum.modulebasegame.gameitems.ItemBucketWooden00;FLUIDSTORAGE,OPENSTORAGE,NOEXTREMETHERM,FLUIDSTORAGEEMPTY +1048577;net.torvald.terrarum.modulebasegame.gameitems.ItemBucketWooden01;FLUIDSTORAGE,OPENSTORAGE,NOEXTREMETHERM +#1048578;net.torvald.terrarum.modulebasegame.gameitems.ItemBucketWooden02;FLUIDSTORAGE,OPENSTORAGE,NOEXTREMETHERM +1048579;net.torvald.terrarum.modulebasegame.gameitems.ItemBucketWooden03;FLUIDSTORAGE,OPENSTORAGE,NOEXTREMETHERM 1048832;net.torvald.terrarum.modulebasegame.gameitems.ItemBucketIron00;FLUIDSTORAGE,OPENSTORAGE,FLUIDSTORAGEEMPTY 1048833;net.torvald.terrarum.modulebasegame.gameitems.ItemBucketIron01;FLUIDSTORAGE,OPENSTORAGE diff --git a/src/net/torvald/terrarum/blockproperties/FluidCodex.kt b/src/net/torvald/terrarum/blockproperties/FluidCodex.kt index c513da291..f224b59b6 100644 --- a/src/net/torvald/terrarum/blockproperties/FluidCodex.kt +++ b/src/net/torvald/terrarum/blockproperties/FluidCodex.kt @@ -86,6 +86,8 @@ class FluidCodex { prop.material = record.get("mate") + prop.therm = record.intVal("therm") + fluidProps[prop.id] = prop printdbg(this, "Setting fluid prop ${prop.id} ->>\t${prop.nameKey}") @@ -126,6 +128,8 @@ class FluidProp { var reflectance = 0f // the exact colour of the reflected light depends on the texture + var therm = 0 + @Transient var tags = HashSet() } \ No newline at end of file diff --git a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemFluidStorage.kt b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemFluidStorage.kt index 60cfe2c64..7cb3e1980 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameitems/ItemFluidStorage.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameitems/ItemFluidStorage.kt @@ -1,8 +1,6 @@ package net.torvald.terrarum.modulebasegame.gameitems -import net.torvald.terrarum.BlockCodex -import net.torvald.terrarum.CommonResourcePool -import net.torvald.terrarum.INGAME +import net.torvald.terrarum.* import net.torvald.terrarum.blockproperties.Fluid import net.torvald.terrarum.gameactors.ActorWithBody import net.torvald.terrarum.gameitems.GameItem @@ -54,6 +52,7 @@ open class ItemFluidStoragePrototype(originalID: ItemID, sheetX: Int, sheetY: In // empty bucket -> filled bucket if (fluid == null) { + if (ItemCodex[originalID]!!.hasTag("NOEXTREMETHERM") && FluidCodex[fluidAtWorld.type].therm !in 0..1) return@mouseInInteractableRange -1L if (fluidAtWorld.amount < 1f - FLUID_MIN_MASS) return@mouseInInteractableRange -1L // TODO respect the FLUIDROOMTEMP tag