mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
new wire property: branching
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
"id";"drop";"name";"renderclass";"accept";"inputcount";"inputtype";"outputtype";"javaclass";"inventoryimg"
|
||||
"8192";"8192";"WIRE_RED";"signal";"digital_bit";"3";"N/A";"N/A";"net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire";"basegame.items16,1,9"
|
||||
"8193";"8193";"WIRE_GREEN";"signal";"digital_bit";"3";"N/A";"N/A";"net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire";"basegame.items16,1,10"
|
||||
"8194";"8194";"WIRE_BLUE";"signal";"digital_bit";"3";"N/A";"N/A";"net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire";"basegame.items16,1,11"
|
||||
#"8195";"8195";"WIRE_BUNDLE";"signal";"digital_3bits";"3";"N/A";"N/A";"net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire";"basegame.items16,1,2"
|
||||
"id";"drop";"name";"renderclass";"accept";"inputcount";"inputtype";"outputtype";"javaclass";"inventoryimg";"branching"
|
||||
"8192";"8192";"WIRE_RED";"signal";"digital_bit";"3";"N/A";"N/A";"net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire";"basegame.items16,1,9";"1"
|
||||
"8193";"8193";"WIRE_GREEN";"signal";"digital_bit";"3";"N/A";"N/A";"net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire";"basegame.items16,1,10";"1"
|
||||
"8194";"8194";"WIRE_BLUE";"signal";"digital_bit";"3";"N/A";"N/A";"net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire";"basegame.items16,1,11";"1"
|
||||
#"8195";"8195";"WIRE_BUNDLE";"signal";"digital_3bits";"3";"N/A";"N/A";"net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire";"basegame.items16,1,2";"1"
|
||||
|
||||
|
||||
# accept: which wiretype (defined elsewhere) the wires acceps. Use comma to separate multiple. N/A for electronic components (aka "not wires")
|
||||
# inputcount: how many sides are input (outputcount is deduced from the inputcount). N/A for wires
|
||||
# inputtype: which wiretype it accepts. N/A for wires
|
||||
# outputtype: which wiretype it emits. N/A for wires
|
||||
# branching: if this wire can have branches. Something like a thicknet can't have branches
|
||||
#
|
||||
# comments
|
||||
# "digital_3bits" must come right after three wires it bundles
|
||||
# what's the point of WIRE_BUNDLE when you can overlap as many wires as you want? -- Torvald, 2021-08-09
|
||||
# what's the point of WIRE_BUNDLE when you can overlap as many wires as you want? -- Torvald, 2021-08-09
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 5 and column 2.
|
@@ -56,15 +56,15 @@ object BlockCodex {
|
||||
AppLoader.printmsg(this, "Building block properties table")
|
||||
|
||||
records.forEach {
|
||||
/*if (intVal(it, "id") == -1) {
|
||||
/*if (it.intVal("id") == -1) {
|
||||
setProp(nullProp, it)
|
||||
}
|
||||
else {
|
||||
setProp(blockProps[intVal(it, "id")], it)
|
||||
setProp(blockProps[it.intVal("id")], it)
|
||||
}*/
|
||||
|
||||
setProp(module, intVal(it, "id"), it)
|
||||
val tileId = "$module:${intVal(it, "id")}"
|
||||
setProp(module, it.intVal("id"), it)
|
||||
val tileId = "$module:${it.intVal("id")}"
|
||||
|
||||
// register tiles with dynamic light
|
||||
if ((blockProps[tileId]?.dynamicLuminosityFunction ?: 0) != 0) {
|
||||
@@ -157,36 +157,36 @@ object BlockCodex {
|
||||
|
||||
prop.id = "$modname:$key"
|
||||
prop.numericID = key
|
||||
prop.drop = "$modname:${intVal(record, "drop")}"
|
||||
prop.drop = "$modname:${record.intVal("drop")}"
|
||||
|
||||
prop.shadeColR = floatVal(record, "shdr")
|
||||
prop.shadeColG = floatVal(record, "shdg")
|
||||
prop.shadeColB = floatVal(record, "shdb")
|
||||
prop.shadeColA = floatVal(record, "shduv")
|
||||
prop.shadeColR = record.floatVal("shdr")
|
||||
prop.shadeColG = record.floatVal("shdg")
|
||||
prop.shadeColB = record.floatVal("shdb")
|
||||
prop.shadeColA = record.floatVal("shduv")
|
||||
prop.opacity = Cvec(prop.shadeColR, prop.shadeColG, prop.shadeColB, prop.shadeColA)
|
||||
|
||||
prop.strength = intVal(record, "str")
|
||||
prop.density = intVal(record, "dsty")
|
||||
prop.strength = record.intVal("str")
|
||||
prop.density = record.intVal("dsty")
|
||||
|
||||
prop.baseLumColR = floatVal(record, "lumr")
|
||||
prop.baseLumColG = floatVal(record, "lumg")
|
||||
prop.baseLumColB = floatVal(record, "lumb")
|
||||
prop.baseLumColA = floatVal(record, "lumuv")
|
||||
prop.baseLumColR = record.floatVal("lumr")
|
||||
prop.baseLumColG = record.floatVal("lumg")
|
||||
prop.baseLumColB = record.floatVal("lumb")
|
||||
prop.baseLumColA = record.floatVal("lumuv")
|
||||
prop.baseLumCol.set(prop.baseLumColR, prop.baseLumColG, prop.baseLumColB, prop.baseLumColA)
|
||||
|
||||
prop.friction = intVal(record, "fr")
|
||||
prop.viscosity = intVal(record, "vscs")
|
||||
prop.colour = str16ToInt(record, "colour")
|
||||
prop.friction = record.intVal("fr")
|
||||
prop.viscosity = record.intVal("vscs")
|
||||
prop.colour = record.str16ToInt("colour")
|
||||
|
||||
//prop.isFluid = boolVal(record, "fluid")
|
||||
prop.isSolid = boolVal(record, "solid")
|
||||
//prop.isClear = boolVal(record, "clear")
|
||||
prop.isPlatform = boolVal(record, "plat")
|
||||
prop.isWallable = boolVal(record, "wall")
|
||||
prop.maxSupport = intVal(record, "grav")
|
||||
prop.isVertFriction = boolVal(record, "fv")
|
||||
//prop.isFluid = record.boolVal("fluid")
|
||||
prop.isSolid = record.boolVal("solid")
|
||||
//prop.isClear = record.boolVal("clear")
|
||||
prop.isPlatform = record.boolVal("plat")
|
||||
prop.isWallable = record.boolVal("wall")
|
||||
prop.maxSupport = record.intVal("grav")
|
||||
prop.isVertFriction = record.boolVal("fv")
|
||||
|
||||
prop.dynamicLuminosityFunction = intVal(record, "dlfn")
|
||||
prop.dynamicLuminosityFunction = record.intVal("dlfn")
|
||||
|
||||
blockProps[prop.id] = prop
|
||||
|
||||
@@ -194,10 +194,10 @@ object BlockCodex {
|
||||
}
|
||||
}
|
||||
|
||||
fun str16ToInt(rec: CSVRecord, s: String): Int {
|
||||
fun CSVRecord.str16ToInt(s: String): Int {
|
||||
var ret = 0
|
||||
try {
|
||||
ret = rec.get(s).toLong(16).toInt()
|
||||
ret = this.get(s).toLong(16).toInt()
|
||||
}
|
||||
catch (e: NumberFormatException) {
|
||||
}
|
||||
@@ -209,10 +209,10 @@ fun str16ToInt(rec: CSVRecord, s: String): Int {
|
||||
return ret
|
||||
}
|
||||
|
||||
fun intVal(rec: CSVRecord, s: String): Int {
|
||||
fun CSVRecord.intVal(s: String): Int {
|
||||
var ret = -1
|
||||
try {
|
||||
ret = rec.get(s).toInt()
|
||||
ret = this.get(s).toInt()
|
||||
}
|
||||
catch (e: NumberFormatException) {
|
||||
}
|
||||
@@ -224,10 +224,10 @@ fun intVal(rec: CSVRecord, s: String): Int {
|
||||
return ret
|
||||
}
|
||||
|
||||
fun floatVal(rec: CSVRecord, s: String): Float {
|
||||
fun CSVRecord.floatVal(s: String): Float {
|
||||
var ret = -1f
|
||||
try {
|
||||
ret = rec.get(s).toFloat()
|
||||
ret = this.get(s).toFloat()
|
||||
}
|
||||
catch (e: NumberFormatException) {
|
||||
}
|
||||
@@ -239,4 +239,4 @@ fun floatVal(rec: CSVRecord, s: String): Float {
|
||||
return ret
|
||||
}
|
||||
|
||||
fun boolVal(rec: CSVRecord, s: String) = intVal(rec, s) != 0
|
||||
fun CSVRecord.boolVal(s: String) = this.intVal(s) != 0
|
||||
@@ -35,7 +35,7 @@ object WireCodex {
|
||||
|
||||
|
||||
records.forEach {
|
||||
WireCodex.setProp(module, intVal(it, "id"), it)
|
||||
WireCodex.setProp(module, it.intVal("id"), it)
|
||||
}
|
||||
|
||||
AppLoader.printmsg(this, "Registering wire textures into the resource pool")
|
||||
@@ -107,9 +107,10 @@ object WireCodex {
|
||||
prop.numericID = key
|
||||
prop.renderClass = record.get("renderclass")
|
||||
prop.accepts = record.get("accept")
|
||||
prop.inputCount = intVal(record, "inputcount")
|
||||
prop.inputCount = record.intVal("inputcount")
|
||||
prop.inputType = record.get("inputtype") ?: prop.accepts
|
||||
prop.outputType = record.get("outputtype") ?: prop.accepts
|
||||
prop.canBranch = record.boolVal("branching")
|
||||
|
||||
WireCodex.wireProps[prop.id] = prop
|
||||
|
||||
|
||||
@@ -17,4 +17,6 @@ class WireProp {
|
||||
var inputType: String = ""
|
||||
var outputType: String = ""
|
||||
|
||||
var canBranch: Boolean = true
|
||||
|
||||
}
|
||||
@@ -39,11 +39,11 @@ object MaterialCodex {
|
||||
|
||||
records.forEach {
|
||||
val prop = Material()
|
||||
prop.strength = intVal(it, "tens")
|
||||
prop.density = intVal(it, "dsty")
|
||||
prop.forceMod = intVal(it, "fmod")
|
||||
prop.enduranceMod = floatVal(it, "endurance")
|
||||
prop.thermalConductivity = floatVal(it, "tcond")
|
||||
prop.strength = it.intVal("tens")
|
||||
prop.density = it.intVal("dsty")
|
||||
prop.forceMod = it.intVal("fmod")
|
||||
prop.enduranceMod = it.floatVal("endurance")
|
||||
prop.thermalConductivity = it.floatVal("tcond")
|
||||
prop.identifier = it.get("idst").toUpperCase()
|
||||
|
||||
materialProps[prop.identifier] = prop
|
||||
|
||||
Reference in New Issue
Block a user