diff options
author | nokoe <nokoe@mailbox.org> | 2024-06-20 15:21:57 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-06-23 19:24:32 +0200 |
commit | 7fc559d2967dd235f72ad0fd04d5e13c31486e98 (patch) | |
tree | 5833536b051956ce049681ec04eab0d2ec8fe17a | |
parent | 43528e61419b639049799b5e5de19c727d508dbc (diff) | |
download | hurrycurry-7fc559d2967dd235f72ad0fd04d5e13c31486e98.tar hurrycurry-7fc559d2967dd235f72ad0fd04d5e13c31486e98.tar.bz2 hurrycurry-7fc559d2967dd235f72ad0fd04d5e13c31486e98.tar.zst |
add some more counter elements
-rw-r--r-- | client/scripts/map.gd | 12 | ||||
-rw-r--r-- | client/scripts/map/counter.gd | 4 | ||||
-rw-r--r-- | client/scripts/map/counter_base.gd | 1 | ||||
-rw-r--r-- | client/scripts/map/cutting_board.gd | 5 | ||||
-rw-r--r-- | client/scripts/map/oven.gd | 6 | ||||
-rw-r--r-- | client/scripts/map/sink.gd | 12 | ||||
-rw-r--r-- | client/scripts/map/stove.gd | 6 |
7 files changed, 37 insertions, 9 deletions
diff --git a/client/scripts/map.gd b/client/scripts/map.gd index 64d15723..83b61467 100644 --- a/client/scripts/map.gd +++ b/client/scripts/map.gd @@ -11,21 +11,19 @@ func update(pos, tile_name, neighbors): "tomato-crate": instance = CounterBase.new() "cuttingboard": - instance = CounterBase.new() + instance = CuttingBoard.new() "counter": instance = CounterBase.new() "flour-crate": instance = CounterBase.new() "oven": - instance = CounterBase.new() + instance = Oven.new() "raw-steak-crate": instance = CounterBase.new() - "pan": - instance = CounterBase.new() - "watercooler": - instance = CounterBase.new() + "stove": + instance = Stove.new() "sink": - instance = CounterBase.new() + instance = Sink.new() "dirty-plate-crate": instance = CounterBase.new() "wall": diff --git a/client/scripts/map/counter.gd b/client/scripts/map/counter.gd index 686369cf..d8b41804 100644 --- a/client/scripts/map/counter.gd +++ b/client/scripts/map/counter.gd @@ -14,11 +14,11 @@ enum CounterKind { STRAIGHT_BACKSPLASH } -var facing: int = 0 var kind: CounterKind = CounterKind.STRAIGHT func setup(rename: String, neighbors: Array): super.setup(rename, neighbors) + var facing = 0 var edges = neighbors.duplicate() for i in range(4): var i_name = tile_name(edges[i]) @@ -54,6 +54,8 @@ func setup(rename: String, neighbors: Array): elif series == 2&&count == 2: facing = (adj[0] + 1) % 4 kind = CounterKind.OUTER_CORNER + + turn_facing(facing) func is_counter(tile_name_t) -> bool: if tile_name_t == null: diff --git a/client/scripts/map/counter_base.gd b/client/scripts/map/counter_base.gd index 32f5cc06..c32cb070 100644 --- a/client/scripts/map/counter_base.gd +++ b/client/scripts/map/counter_base.gd @@ -10,4 +10,3 @@ func setup(rename: String, neighbors: Array): base.add_child(load("res://models/prefabs/map/kitchencounter_straight_A.tscn").instantiate()) CounterKind.STRAIGHT_BACKSPLASH: base.add_child(load("res://models/prefabs/map/kitchencounter_straight_A_backsplash.tscn").instantiate()) - turn_facing(facing) diff --git a/client/scripts/map/cutting_board.gd b/client/scripts/map/cutting_board.gd index 4be394d0..0164036b 100644 --- a/client/scripts/map/cutting_board.gd +++ b/client/scripts/map/cutting_board.gd @@ -1 +1,6 @@ +class_name CuttingBoard extends CounterBase + +func setup(rename: String, neighbors: Array): + super.setup(rename, neighbors) + base.add_child(load("res://models/prefabs/map/cuttingboard.tscn").instantiate()) diff --git a/client/scripts/map/oven.gd b/client/scripts/map/oven.gd new file mode 100644 index 00000000..2ebe7f33 --- /dev/null +++ b/client/scripts/map/oven.gd @@ -0,0 +1,6 @@ +class_name Oven +extends Counter + +func setup(rename: String, neighbors: Array): + super.setup(rename, neighbors) + base.add_child(load("res://models/prefabs/map/oven.tscn").instantiate()) diff --git a/client/scripts/map/sink.gd b/client/scripts/map/sink.gd new file mode 100644 index 00000000..2067cc33 --- /dev/null +++ b/client/scripts/map/sink.gd @@ -0,0 +1,12 @@ +class_name Sink +extends Counter + +func setup(rename: String, neighbors: Array): + super.setup(rename, neighbors) + match kind: + CounterKind.STRAIGHT: + base.add_child(load("res://models/prefabs/map/kitchencounter_sink.tscn").instantiate()) + CounterKind.STRAIGHT_BACKSPLASH: + base.add_child(load("res://models/prefabs/map/kitchencounter_sink_backsplash.tscn").instantiate()) + _: + base.add_child(load("res://models/prefabs/map/kitchencounter_sink.tscn").instantiate()) diff --git a/client/scripts/map/stove.gd b/client/scripts/map/stove.gd new file mode 100644 index 00000000..c2d75b7b --- /dev/null +++ b/client/scripts/map/stove.gd @@ -0,0 +1,6 @@ +class_name Stove +extends Counter + +func setup(rename: String, neighbors: Array): + super.setup(rename, neighbors) + base.add_child(load("res://models/prefabs/map/stove_single.tscn").instantiate()) |