mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 11:04:05 +09:00
fourth purple wire because four-colour theorem
This commit is contained in:
@@ -16,6 +16,12 @@
|
|||||||
[1, 1, "$SIGNALWIRE"] /* 1 other signal wire */
|
[1, 1, "$SIGNALWIRE"] /* 1 other signal wire */
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"wire@basegame:8195": { /* signal wire purple */
|
||||||
|
"workbench": "",
|
||||||
|
"ingredients": [
|
||||||
|
[1, 1, "$SIGNALWIRE"] /* 1 other signal wire */
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
"wire@basegame:8192": { /* signal wire red */
|
"wire@basegame:8192": { /* signal wire red */
|
||||||
"workbench": "wirerollingmill",
|
"workbench": "wirerollingmill",
|
||||||
@@ -34,6 +40,12 @@
|
|||||||
[10, 1, "item@basegame:112"] /* 1 copper */
|
[10, 1, "item@basegame:112"] /* 1 copper */
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"wire@basegame:8195": { /* signal wire purble */
|
||||||
|
"workbench": "wirerollingmill",
|
||||||
|
"ingredients": [
|
||||||
|
[10, 1, "item@basegame:112"] /* 1 copper */
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
"item@basegame:50": { /* soldering wire */
|
"item@basegame:50": { /* soldering wire */
|
||||||
"workbench": "wirerollingmill",
|
"workbench": "wirerollingmill",
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
9
assets/mods/basegame/wires/decayconsts.csv
Normal file
9
assets/mods/basegame/wires/decayconsts.csv
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
wireItemID;const
|
||||||
|
wire@basegame:8192;0.995
|
||||||
|
wire@basegame:8193;0.995
|
||||||
|
wire@basegame:8194;0.995
|
||||||
|
wire@basegame:8195;0.995
|
||||||
|
wire@basegame:8196;0.999
|
||||||
|
wire@basegame:8197;0.999
|
||||||
|
wire@basegame:8198;0.999
|
||||||
|
|
||||||
|
Binary file not shown.
@@ -2,10 +2,10 @@ id;drop;name;renderclass;accept;inputcount;inputtype;outputtype;javaclass;invent
|
|||||||
8192;8192;WIRE_RED;signal;digital_bit;3;N/A;N/A;net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire;basegame.items,0,4;1;"SIGNALWIRE"
|
8192;8192;WIRE_RED;signal;digital_bit;3;N/A;N/A;net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire;basegame.items,0,4;1;"SIGNALWIRE"
|
||||||
8193;8193;WIRE_GREEN;signal;digital_bit;3;N/A;N/A;net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire;basegame.items,1,4;1;"SIGNALWIRE"
|
8193;8193;WIRE_GREEN;signal;digital_bit;3;N/A;N/A;net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire;basegame.items,1,4;1;"SIGNALWIRE"
|
||||||
8194;8194;WIRE_BLUE;signal;digital_bit;3;N/A;N/A;net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire;basegame.items,2,4;1;"SIGNALWIRE"
|
8194;8194;WIRE_BLUE;signal;digital_bit;3;N/A;N/A;net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire;basegame.items,2,4;1;"SIGNALWIRE"
|
||||||
#8195;8195;WIRE_BUNDLE;signal;digital_3bits;3;N/A;N/A;net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire;basegame.items,0,0;1;"SIGNALWIRE"
|
8195;8195;WIRE_PURPLE;signal;digital_bit;3;N/A;N/A;net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire;basegame.items,3,4;1;"SIGNALWIRE"
|
||||||
8196;8196;WIRE_POWER_LOW;power;power_low;3;N/A;N/A;net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire;basegame.items,3,4;1;"POWERWIRE_LOW"
|
8196;8196;WIRE_POWER_LOW;power;power_low;3;N/A;N/A;net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire;basegame.items,4,4;1;"POWERWIRE_LOW"
|
||||||
8197;8197;WIRE_POWER_HIGH;power;power_high;3;N/A;N/A;net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire;basegame.items,4,4;1;"POWERWIRE_HIGH"
|
8197;8197;WIRE_POWER_HIGH;power;power_high;3;N/A;N/A;net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire;basegame.items,5,4;1;"POWERWIRE_HIGH"
|
||||||
8198;8198;WIRE_ETHERNET;network;10base2;3;N/A;N/A;net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire;basegame.items,5,4;1;"ETHERNETWIRE"
|
8198;8198;WIRE_ETHERNET;network;10base2;3;N/A;N/A;net.torvald.terrarum.modulebasegame.gameitems.WirePieceSignalWire;basegame.items,6,4;1;"ETHERNETWIRE"
|
||||||
|
|
||||||
|
|
||||||
# accept: which wiretype (defined elsewhere) the wires acceps. Use comma to separate multiple. N/A for electronic components (aka not wires)
|
# accept: which wiretype (defined elsewhere) the wires acceps. Use comma to separate multiple. N/A for electronic components (aka not wires)
|
||||||
|
|||||||
|
@@ -19,6 +19,7 @@ import org.dyn4j.geometry.Vector2
|
|||||||
import java.lang.Math.pow
|
import java.lang.Math.pow
|
||||||
import kotlin.math.cosh
|
import kotlin.math.cosh
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
|
import kotlin.math.pow
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -519,7 +520,7 @@ object WorldSimulator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun calculateDecay(signal: Vector2, dist: Int, wire: ItemID, signalType: WireEmissionType): Vector2 {
|
private fun calculateDecay(signal: Vector2, dist: Int, wire: ItemID, signalType: WireEmissionType): Vector2 {
|
||||||
return signal * pow(0.99, dist.toDouble())
|
return signal * 0.995.pow(dist.toDouble())
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun traverseWireGraph(world: GameWorld, wire: ItemID, startingPoint: WireGraphCursor, signal: Vector2, signalType: WireEmissionType) {
|
private fun traverseWireGraph(world: GameWorld, wire: ItemID, startingPoint: WireGraphCursor, signal: Vector2, signalType: WireEmissionType) {
|
||||||
|
|||||||
@@ -49,9 +49,9 @@ open class Electric : FixtureBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val ELECTRIC_THRESHOLD_HIGH = 0.9
|
const val ELECTRIC_THRESHOLD_HIGH = 0.6666666666666666
|
||||||
const val ELECTRIC_THRESHOLD_LOW = 0.1
|
const val ELECTRIC_THRESHOLD_LOW = 0.3333333333333333
|
||||||
const val ELECTRIC_THRESHOLD_EDGE_DELTA = 0.7
|
const val ELECTRIC_THRESHOLD_EDGE_DELTA = 0.33333333333333337
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getWireEmitterAt(blockBoxIndex: BlockBoxIndex) = this.wireEmitterTypes[blockBoxIndex]
|
fun getWireEmitterAt(blockBoxIndex: BlockBoxIndex) = this.wireEmitterTypes[blockBoxIndex]
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user