thermal tags for buckets and fluids

This commit is contained in:
minjaesong
2024-09-14 21:15:46 +09:00
parent 35bec7bc26
commit dfac9ed9a8
4 changed files with 21 additions and 12 deletions

View File

@@ -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<String>()
}

View File

@@ -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