diff options
Diffstat (limited to 'client/scripts/tiles')
-rw-r--r-- | client/scripts/tiles/chair.gd | 28 | ||||
-rw-r--r-- | client/scripts/tiles/counter.gd | 81 | ||||
-rw-r--r-- | client/scripts/tiles/counter_base.gd | 27 | ||||
-rw-r--r-- | client/scripts/tiles/crate.gd | 23 | ||||
-rw-r--r-- | client/scripts/tiles/cutting_board.gd | 21 | ||||
-rw-r--r-- | client/scripts/tiles/door.gd | 27 | ||||
-rw-r--r-- | client/scripts/tiles/floor.gd | 85 | ||||
-rw-r--r-- | client/scripts/tiles/flour_counter.gd | 26 | ||||
-rw-r--r-- | client/scripts/tiles/full_tile.gd | 49 | ||||
-rw-r--r-- | client/scripts/tiles/generic_tile.gd | 33 | ||||
-rw-r--r-- | client/scripts/tiles/oven.gd | 21 | ||||
-rw-r--r-- | client/scripts/tiles/raw_steak_crate.gd | 21 | ||||
-rw-r--r-- | client/scripts/tiles/sink.gd | 27 | ||||
-rw-r--r-- | client/scripts/tiles/stove.gd | 21 | ||||
-rw-r--r-- | client/scripts/tiles/table.gd | 21 | ||||
-rw-r--r-- | client/scripts/tiles/tomato_crate.gd | 21 | ||||
-rw-r--r-- | client/scripts/tiles/trash.gd | 21 | ||||
-rw-r--r-- | client/scripts/tiles/wall.gd | 29 | ||||
-rw-r--r-- | client/scripts/tiles/wall_tile.gd | 74 | ||||
-rw-r--r-- | client/scripts/tiles/window.gd | 29 |
20 files changed, 0 insertions, 685 deletions
diff --git a/client/scripts/tiles/chair.gd b/client/scripts/tiles/chair.gd deleted file mode 100644 index 34735fda..00000000 --- a/client/scripts/tiles/chair.gd +++ /dev/null @@ -1,28 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 nokoe -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -class_name Chair -extends Floor - -func _init(rename: String, neighbors: Array): - super(rename, neighbors) - var chair = load("res://models/prefabs/map/chair_A.tscn").instantiate() - var facing = 0; - for i in range(4): - if tile_name(neighbors[i]) == "table": - facing = i - break - base.add_child(chair) - turn_facing(facing) diff --git a/client/scripts/tiles/counter.gd b/client/scripts/tiles/counter.gd deleted file mode 100644 index c3032e4f..00000000 --- a/client/scripts/tiles/counter.gd +++ /dev/null @@ -1,81 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 nokoe -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -class_name Counter -extends FullTile - -var counters = [ - "counter", - "pan", - "sink", - "oven", -] - -enum CounterKind { - OUTER_CORNER, - STRAIGHT, - STRAIGHT_BACKSPLASH -} - -var kind: CounterKind = CounterKind.STRAIGHT - -static func interact_target() -> Vector3: - return Vector3(0, 0.5, 0) - -func _init(rename: String, neighbors: Array): - super(rename, neighbors) - var facing = 0 - var edges = neighbors.duplicate() - for i in range(4): - var i_name = tile_name(edges[i]) - if Counter.is_counter(i_name): - edges[i] = "counter" - else: - edges[i] = tile_name(edges[i]) - - var series: int = 0 - var last_series: int = 0 - var adj: Array = [] - - for i in range(4): - if edges[i] == "floor": - last_series += 1 - adj.append(i) - if last_series > series: - series = last_series - else: - last_series = 0 - - var count = 4 - adj.size() - - # we can neither find out whether it is an inner corner nor an outer corner - # backsplash - if series == 1&&count == 3: - facing = adj[0] % 4 - - if edges[(adj[0] + 2) % 4] == "wall": - kind = CounterKind.STRAIGHT_BACKSPLASH - else: - kind = CounterKind.STRAIGHT - elif series == 2&&count == 2: - facing = (adj[0] + 1) % 4 - kind = CounterKind.OUTER_CORNER - - turn_facing(facing) - -static func is_counter(tile_name_t) -> bool: - if tile_name_t == null: - return false - return tile_name_t.ends_with("crate")||counters.has(tile_name_t) diff --git a/client/scripts/tiles/counter_base.gd b/client/scripts/tiles/counter_base.gd deleted file mode 100644 index ebeebb3b..00000000 --- a/client/scripts/tiles/counter_base.gd +++ /dev/null @@ -1,27 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 nokoe -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -class_name CounterBase -extends Counter - -func _init(rename: String, neighbors: Array): - super(rename, neighbors) - match kind: - CounterKind.OUTER_CORNER: - base.add_child(load("res://models/prefabs/map/kitchencounter_outercorner.tscn").instantiate()) - CounterKind.STRAIGHT: - 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()) diff --git a/client/scripts/tiles/crate.gd b/client/scripts/tiles/crate.gd deleted file mode 100644 index 21fae60b..00000000 --- a/client/scripts/tiles/crate.gd +++ /dev/null @@ -1,23 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 nokoe -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -class_name Crate -extends Counter - -static func interact_target() -> Vector3: - return Vector3(0, 0.25, 0) - -func _init(rename: String, neighbors: Array): - super(rename, neighbors) diff --git a/client/scripts/tiles/cutting_board.gd b/client/scripts/tiles/cutting_board.gd deleted file mode 100644 index 944a7a9f..00000000 --- a/client/scripts/tiles/cutting_board.gd +++ /dev/null @@ -1,21 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 nokoe -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -class_name CuttingBoard -extends CounterBase - -func _init(rename: String, neighbors: Array): - super(rename, neighbors) - base.add_child(load("res://models/prefabs/map/cuttingboard.tscn").instantiate()) diff --git a/client/scripts/tiles/door.gd b/client/scripts/tiles/door.gd deleted file mode 100644 index cfba08b7..00000000 --- a/client/scripts/tiles/door.gd +++ /dev/null @@ -1,27 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 nokoe -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -class_name Door -extends Floor - -func _init(rename: String, neighbors: Array): - super(rename, neighbors) - - var facing = 0 - for i in range(4): - if tile_name(neighbors[i]) == "door": - facing = i % 4 - base.add_child(load("res://models/prefabs/map/door.tscn").instantiate()) - turn_facing(facing) diff --git a/client/scripts/tiles/floor.gd b/client/scripts/tiles/floor.gd deleted file mode 100644 index fec68cbd..00000000 --- a/client/scripts/tiles/floor.gd +++ /dev/null @@ -1,85 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 nokoe -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -class_name Floor -extends Node3D - -var base = Node3D.new() -var item: Item = null -var item_base: Node3D - -enum Facing { - NEG_Y = 0, - NEG_X = 1, - Y = 2, - X = 3, -} - -func _init(rename: String, _neighbors: Array): - var floor_tile = load("res://models/prefabs/map/floor_kitchen_small.tscn").instantiate() - floor_tile.position += Vector3(0.5, 0, 0.5) - add_child(floor_tile) - base.name = "Base" - base.position += Vector3(0.5, 0, 0.5) - add_child(base) - self.name = rename - var item_base_ = Node3D.new() - # this method is supposed to be overriden - @warning_ignore("static_called_on_instance") - item_base_.position = interact_target() - item_base_.name = "ItemBase" - base.add_child(item_base_) - item_base = item_base_ - -func turn_facing(facing: Facing): - base.rotate_y(facing * 0.5 * PI + PI) - -func tile_name(idx): - if idx == null: - return null - return Multiplayer.tile_names[idx] - - -# defines where items go when interacting -static func interact_target() -> Vector3: - return Vector3(0, 0, 0) - -# actions when interacting, e.g. animations -func interact(): - pass - -func progress(p: float, warn: bool): - if item != null: - item.progress(p, warn) - -func finish(warn: bool): - if item != null: - item.finish(warn) - -func put_item(i: Item): - if item != null: - push_error("already holding an item") - set_item(i) - -func set_item(i: Item): - if item != null: - item.queue_free() - item = i - i.owned_by = item_base - -func take_item() -> Item: - var i = item - item = null - return i diff --git a/client/scripts/tiles/flour_counter.gd b/client/scripts/tiles/flour_counter.gd deleted file mode 100644 index 4bf2b1f3..00000000 --- a/client/scripts/tiles/flour_counter.gd +++ /dev/null @@ -1,26 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 nokoe -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -class_name FlourCounter -extends CounterBase - -func _init(rename: String, neighbors: Array): - super(rename, neighbors) - var bag = load("res://models/prefabs/map/bag.tscn").instantiate() - # this is supposed to be overridden - @warning_ignore("static_called_on_instance") - bag.position = interact_target() - bag.rotation_degrees.y = 45 - base.add_child(bag) diff --git a/client/scripts/tiles/full_tile.gd b/client/scripts/tiles/full_tile.gd deleted file mode 100644 index 2da54237..00000000 --- a/client/scripts/tiles/full_tile.gd +++ /dev/null @@ -1,49 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 nokoe -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -class_name FullTile -extends Floor - -var static_body = StaticBody3D.new() -var item: Node3D = null - -func _init(rename: String, neighbors: Array): - super(rename, neighbors) - var shape = CollisionShape3D.new() - var box = BoxShape3D.new() - shape.position.y += .5 - shape.shape = box - shape.name = "Box" - static_body.add_child(shape) - static_body.name = "Body" - base.add_child(static_body) - -# defines where items go when interacting -static func interact_target() -> Vector3: - return Vector3(0, 0, 0) - -# actions when interacting, e.g. animations -func interact(): - pass - -func put_item(i: Node3D): - if item != null: - push_error("already holding an item") - item = i - -func take_item() -> Node3D: - var i = item - item = null - return i diff --git a/client/scripts/tiles/generic_tile.gd b/client/scripts/tiles/generic_tile.gd deleted file mode 100644 index f7d1b4a7..00000000 --- a/client/scripts/tiles/generic_tile.gd +++ /dev/null @@ -1,33 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 nokoe -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -class_name GenericTile -extends Floor - -func _init(rename: String, neighbors: Array, kind: String): - super(rename, neighbors) - var mesh = MeshInstance3D.new() - var text = TextMesh.new() - var mat = StandardMaterial3D.new() - text.text = kind - text.font = SystemFont.new() - text.depth = 0 - mesh.mesh = text - mesh.position.y = 1 - mesh.scale = Vector3(3, 3, 3) - mat.billboard_mode = mat.BILLBOARD_ENABLED - mat.shading_mode = BaseMaterial3D.SHADING_MODE_UNSHADED - text.material = mat - item_base.add_child(mesh) diff --git a/client/scripts/tiles/oven.gd b/client/scripts/tiles/oven.gd deleted file mode 100644 index 88da3adb..00000000 --- a/client/scripts/tiles/oven.gd +++ /dev/null @@ -1,21 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 nokoe -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -class_name Oven -extends Counter - -func _init(rename: String, neighbors: Array): - super(rename, neighbors) - base.add_child(load("res://models/prefabs/map/oven.tscn").instantiate()) diff --git a/client/scripts/tiles/raw_steak_crate.gd b/client/scripts/tiles/raw_steak_crate.gd deleted file mode 100644 index 8ff93d6b..00000000 --- a/client/scripts/tiles/raw_steak_crate.gd +++ /dev/null @@ -1,21 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 nokoe -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -class_name RawSteakCrate -extends Crate - -func _init(rename: String, neighbors: Array): - super(rename, neighbors) - base.add_child(load("res://models/prefabs/map/crate_steak.tscn").instantiate()) diff --git a/client/scripts/tiles/sink.gd b/client/scripts/tiles/sink.gd deleted file mode 100644 index e4eaff60..00000000 --- a/client/scripts/tiles/sink.gd +++ /dev/null @@ -1,27 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 nokoe -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -class_name Sink -extends Counter - -func _init(rename: String, neighbors: Array): - super(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/tiles/stove.gd b/client/scripts/tiles/stove.gd deleted file mode 100644 index 93fad5a3..00000000 --- a/client/scripts/tiles/stove.gd +++ /dev/null @@ -1,21 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 nokoe -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -class_name Stove -extends Counter - -func _init(rename: String, neighbors: Array): - super(rename, neighbors) - base.add_child(load("res://models/prefabs/map/stove_single.tscn").instantiate()) diff --git a/client/scripts/tiles/table.gd b/client/scripts/tiles/table.gd deleted file mode 100644 index 533223a4..00000000 --- a/client/scripts/tiles/table.gd +++ /dev/null @@ -1,21 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 nokoe -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -class_name Table -extends FullTile - -func _init(rename: String, neighbors: Array): - super(rename, neighbors) - base.add_child(load("res://models/prefabs/map/table_round_A_small.tscn").instantiate()) diff --git a/client/scripts/tiles/tomato_crate.gd b/client/scripts/tiles/tomato_crate.gd deleted file mode 100644 index 078d0ba2..00000000 --- a/client/scripts/tiles/tomato_crate.gd +++ /dev/null @@ -1,21 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 nokoe -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -class_name TomatoCrate -extends Crate - -func _init(rename: String, neighbors: Array): - super(rename, neighbors) - base.add_child(load("res://models/prefabs/map/crate_tomatoes.tscn").instantiate()) diff --git a/client/scripts/tiles/trash.gd b/client/scripts/tiles/trash.gd deleted file mode 100644 index fed1a502..00000000 --- a/client/scripts/tiles/trash.gd +++ /dev/null @@ -1,21 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 nokoe -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -class_name Trash -extends Crate - -func _init(rename: String, neighbors: Array): - super(rename, neighbors) - base.add_child(load("res://models/prefabs/map/crate_trash.tscn").instantiate()) diff --git a/client/scripts/tiles/wall.gd b/client/scripts/tiles/wall.gd deleted file mode 100644 index 0201d4d6..00000000 --- a/client/scripts/tiles/wall.gd +++ /dev/null @@ -1,29 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 nokoe -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -class_name Wall -extends WallTile - -func _init(rename: String, neighbors: Array): - super(rename, neighbors) - match kind: - WallKind.STRAIGHT: - base.add_child(load("res://models/prefabs/map/wall_straight.tscn").instantiate()) - WallKind.OUTER_CORNER: - base.add_child(load("res://models/prefabs/map/wall_corner.tscn").instantiate()) - WallKind.T: - base.add_child(load("res://models/prefabs/map/wall_t.tscn").instantiate()) - WallKind.CROSS: - base.add_child(load("res://models/prefabs/map/wall_cross.tscn").instantiate()) diff --git a/client/scripts/tiles/wall_tile.gd b/client/scripts/tiles/wall_tile.gd deleted file mode 100644 index 7c9d4305..00000000 --- a/client/scripts/tiles/wall_tile.gd +++ /dev/null @@ -1,74 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 nokoe -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -class_name WallTile -extends FullTile - -const WALLS: Array = [ - "wall", - "window", - "door" -] - -enum WallKind { - STRAIGHT, - OUTER_CORNER, - T, - CROSS, -} - -var kind: WallKind = WallKind.STRAIGHT -var facing: int = 0 - -func _init(rename: String, neighbors: Array): - super(rename, neighbors) - - var edges = neighbors.duplicate() - - var series: int = 0 - var last_series: int = 0 - var adj: Array = [] - - for i in range(4): - var i_name = tile_name(edges[i]) - if is_wall(i_name): - edges[i] = "wall" - else: - edges[i] = tile_name(edges[i]) - - for i in range(4): - if edges[i] != "wall": - last_series += 1 - adj.append(i) - if last_series > series: - series = last_series - else: - last_series = 0 - - var count = 4 - adj.size() - - if series == 1&&count == 2: - facing = adj[0] - kind = WallKind.STRAIGHT - elif series == 2&&count == 2: - facing = adj[0] - kind = WallKind.OUTER_CORNER - elif series == 1&&count == 3: - facing = adj[0] - kind = WallKind.T - elif series == 0&&count == 4: - facing = adj[0] - kind = WallKind.CROSS - turn_facing(facing) diff --git a/client/scripts/tiles/window.gd b/client/scripts/tiles/window.gd deleted file mode 100644 index b2926080..00000000 --- a/client/scripts/tiles/window.gd +++ /dev/null @@ -1,29 +0,0 @@ -# Undercooked - a game about cooking -# Copyright 2024 nokoe -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, version 3 of the License only. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. -# -class_name WallWindow -extends WallTile - -static func interact_target() -> Vector3: - return Vector3(0, 0.625, 0) - -func _init(rename: String, neighbors: Array): - super(rename, neighbors) - match kind: - WallKind.STRAIGHT: - base.add_child(load("res://models/prefabs/map/window.tscn").instantiate()) - WallKind.OUTER_CORNER: - push_warning("There is no corner window!") - base.add_child(load("res://models/prefabs/map/window.tscn").instantiate()) |