diff options
author | nokoe <nokoe@mailbox.org> | 2024-06-25 00:14:48 +0200 |
---|---|---|
committer | nokoe <nokoe@mailbox.org> | 2024-06-25 00:15:24 +0200 |
commit | cf11d11099b8ddc03dc0c26f590193d35ba1bafd (patch) | |
tree | be36250dd56e7a064d09335379de9770101fd484 /client | |
parent | a0572f92fddb1ddc1f4d62f22f8ecfb1f623bf21 (diff) | |
download | hurrycurry-cf11d11099b8ddc03dc0c26f590193d35ba1bafd.tar hurrycurry-cf11d11099b8ddc03dc0c26f590193d35ba1bafd.tar.bz2 hurrycurry-cf11d11099b8ddc03dc0c26f590193d35ba1bafd.tar.zst |
more recipes, add tile factory
Diffstat (limited to 'client')
-rw-r--r-- | client/map/item_factory.gd | 14 | ||||
-rw-r--r-- | client/map/items/bread_slice.res | bin | 0 -> 5169 bytes | |||
-rw-r--r-- | client/map/items/bread_slice.tscn | 9 | ||||
-rw-r--r-- | client/map/items/burned_pot.gd | 23 | ||||
-rw-r--r-- | client/map/items/leek-pot.gd | 24 | ||||
-rw-r--r-- | client/map/items/leek.gd | 25 | ||||
-rw-r--r-- | client/map/items/leek.res | bin | 0 -> 11769 bytes | |||
-rw-r--r-- | client/map/items/leek.tscn | 10 | ||||
-rw-r--r-- | client/map/items/leek_tomato_juice_pot.gd | 24 | ||||
-rw-r--r-- | client/map/items/pot_fill.gd | 27 | ||||
-rw-r--r-- | client/map/items/pot_fill.res | bin | 0 -> 704 bytes | |||
-rw-r--r-- | client/map/items/pot_fill.tscn | 12 | ||||
-rw-r--r-- | client/map/items/slice.gd | 21 | ||||
-rw-r--r-- | client/map/items/tomato_juice_pot.gd | 21 | ||||
-rw-r--r-- | client/map/items/tomato_soup_pot.gd | 21 | ||||
-rw-r--r-- | client/map/map.gd | 46 | ||||
-rw-r--r-- | client/map/tile_factory.gd | 57 | ||||
-rw-r--r-- | client/map/tiles/crate.res | bin | 0 -> 4840 bytes | |||
-rw-r--r-- | client/map/tiles/crate.tscn | 10 | ||||
-rw-r--r-- | client/map/tiles/leek_crate.gd | 21 | ||||
-rw-r--r-- | client/map/tiles/leek_crate.tscn | 18 |
21 files changed, 342 insertions, 41 deletions
diff --git a/client/map/item_factory.gd b/client/map/item_factory.gd index b5357b66..863a079d 100644 --- a/client/map/item_factory.gd +++ b/client/map/item_factory.gd @@ -52,5 +52,19 @@ static func produce(name: String, owned_by: Node3D) -> Item: return Bread.new(owned_by) "dough-foodprocessor": return DoughFoodProcessor.new(owned_by) + "bread-slice": + return BreadSlice.new(owned_by) + "burned-pot": + return BurnedPot.new(owned_by) + "tomato-juice-pot": + return TomatoJuicePot.new(owned_by) + "leek": + return Leek.new(owned_by) + "leek-pot": + return LeekPot.new(owned_by) + "leek-tomato-juice-pot": + return LeekTomatoJuicePot.new(owned_by) + "tomato-soup-pot": + return TomatoSoupPot.new(owned_by) var t: return GenericItem.new(owned_by, t) diff --git a/client/map/items/bread_slice.res b/client/map/items/bread_slice.res Binary files differnew file mode 100644 index 00000000..f78b75ae --- /dev/null +++ b/client/map/items/bread_slice.res diff --git a/client/map/items/bread_slice.tscn b/client/map/items/bread_slice.tscn new file mode 100644 index 00000000..3a435e17 --- /dev/null +++ b/client/map/items/bread_slice.tscn @@ -0,0 +1,9 @@ +[gd_scene load_steps=2 format=3 uid="uid://ccajf36datccs"] + +[ext_resource type="ArrayMesh" uid="uid://cwftutpb2lxca" path="res://map/items/bread_slice.res" id="1_yv77k"] + +[node name="BreadSlice" type="Node3D"] + +[node name="Mesh" type="MeshInstance3D" parent="."] +mesh = ExtResource("1_yv77k") +skeleton = NodePath("") diff --git a/client/map/items/burned_pot.gd b/client/map/items/burned_pot.gd new file mode 100644 index 00000000..dc749259 --- /dev/null +++ b/client/map/items/burned_pot.gd @@ -0,0 +1,23 @@ +# 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 BurnedPot +extends PotFill + +func _init(owned_by_: Node3D): + super(owned_by_) + steam.emitting = true + steam.color = Color(0., 0., 0.) + set_color(Color(.1, .1, .1)) diff --git a/client/map/items/leek-pot.gd b/client/map/items/leek-pot.gd new file mode 100644 index 00000000..3b16d3cf --- /dev/null +++ b/client/map/items/leek-pot.gd @@ -0,0 +1,24 @@ +# 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 LeekPot +extends Pot + +func _init(owned_by_: Node3D): + super(owned_by_) + var leek: Node3D = load("res://map/items/leek.tscn").instantiate() + leek.rotation_degrees = Vector3(14.5, 0, -25) + leek.position.x = .03 + base.add_child(leek) diff --git a/client/map/items/leek.gd b/client/map/items/leek.gd new file mode 100644 index 00000000..fd74bd68 --- /dev/null +++ b/client/map/items/leek.gd @@ -0,0 +1,25 @@ +# 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 Leek +extends Item + +func _init(owned_by_: Node3D): + super(owned_by_) + var leek: Node3D = load("res://map/items/leek.tscn").instantiate() + leek.rotation_degrees = Vector3(90, 0, 0) + leek.position.z = -.25 + leek.position.y = .1 + base.add_child(leek) diff --git a/client/map/items/leek.res b/client/map/items/leek.res Binary files differnew file mode 100644 index 00000000..4bf31849 --- /dev/null +++ b/client/map/items/leek.res diff --git a/client/map/items/leek.tscn b/client/map/items/leek.tscn new file mode 100644 index 00000000..1bd5a01b --- /dev/null +++ b/client/map/items/leek.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=3 uid="uid://cmpwfkdnrm6e6"] + +[ext_resource type="ArrayMesh" uid="uid://cix4ji823kitw" path="res://map/items/leek.res" id="1_sum7m"] + +[node name="Leek" type="Node3D"] + +[node name="leek" type="MeshInstance3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 0.75, 0, 0, 0, 1, 0, 0, 0) +mesh = ExtResource("1_sum7m") +skeleton = NodePath("") diff --git a/client/map/items/leek_tomato_juice_pot.gd b/client/map/items/leek_tomato_juice_pot.gd new file mode 100644 index 00000000..fc6cb465 --- /dev/null +++ b/client/map/items/leek_tomato_juice_pot.gd @@ -0,0 +1,24 @@ +# 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 LeekTomatoJuicePot +extends TomatoJuicePot + +func _init(owned_by_: Node3D): + super(owned_by_) + var leek: Node3D = load("res://map/items/leek.tscn").instantiate() + leek.rotation_degrees = Vector3(14.5, 0, -25) + leek.position.x = .03 + base.add_child(leek) diff --git a/client/map/items/pot_fill.gd b/client/map/items/pot_fill.gd new file mode 100644 index 00000000..bd262c63 --- /dev/null +++ b/client/map/items/pot_fill.gd @@ -0,0 +1,27 @@ +# 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 PotFill +extends Pot + +var fill: MeshInstance3D = load("res://map/items/pot_fill.tscn").instantiate() + +func _init(owned_by_: Node3D): + super(owned_by_) + add_child(fill) + +func set_color(c: Color): + var mat: BaseMaterial3D = fill.get_active_material(0) + mat.albedo_color = c diff --git a/client/map/items/pot_fill.res b/client/map/items/pot_fill.res Binary files differnew file mode 100644 index 00000000..06c8590c --- /dev/null +++ b/client/map/items/pot_fill.res diff --git a/client/map/items/pot_fill.tscn b/client/map/items/pot_fill.tscn new file mode 100644 index 00000000..2b3a1eda --- /dev/null +++ b/client/map/items/pot_fill.tscn @@ -0,0 +1,12 @@ +[gd_scene load_steps=3 format=3 uid="uid://cwo8o5a6f5p4i"] + +[ext_resource type="ArrayMesh" uid="uid://bduftri3viodq" path="res://map/items/pot_fill.res" id="1_5suf6"] + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_djkvw"] +resource_local_to_scene = true + +[node name="PotFill" type="MeshInstance3D"] +transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0) +mesh = ExtResource("1_5suf6") +skeleton = NodePath("") +surface_material_override/0 = SubResource("StandardMaterial3D_djkvw") diff --git a/client/map/items/slice.gd b/client/map/items/slice.gd new file mode 100644 index 00000000..0449689a --- /dev/null +++ b/client/map/items/slice.gd @@ -0,0 +1,21 @@ +# 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 BreadSlice +extends Item + +func _init(owned_by_: Node3D): + super(owned_by_) + base.add_child(load("res://map/items/bread_slice.tscn").instantiate()) diff --git a/client/map/items/tomato_juice_pot.gd b/client/map/items/tomato_juice_pot.gd new file mode 100644 index 00000000..a27eeb1a --- /dev/null +++ b/client/map/items/tomato_juice_pot.gd @@ -0,0 +1,21 @@ +# 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 TomatoJuicePot +extends PotFill + +func _init(owned_by_: Node3D): + super(owned_by_) + set_color(Color(1., 0., 0.)) diff --git a/client/map/items/tomato_soup_pot.gd b/client/map/items/tomato_soup_pot.gd new file mode 100644 index 00000000..1194fae3 --- /dev/null +++ b/client/map/items/tomato_soup_pot.gd @@ -0,0 +1,21 @@ +# 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 TomatoSoupPot +extends PotFill + +func _init(owned_by_: Node3D): + super(owned_by_) + set_color(Color(1., .3, .2)) diff --git a/client/map/map.gd b/client/map/map.gd index a26da0fd..14e7698a 100644 --- a/client/map/map.gd +++ b/client/map/map.gd @@ -2,67 +2,31 @@ # Copyright 2024 nokoe # Copyright 2024 tpart # Copyright 2024 metamuffin -# +# # 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 Map extends Node3D var tile_by_pos: Dictionary = {} func update(pos, tile_name, neighbors): - var instance: Floor var node_name = str(pos) if has_node(node_name): queue_free_rename(get_node(node_name)) - match tile_name: - "trash": - instance = Trash.new(node_name, neighbors) - "tomato-crate": - instance = TomatoCrate.new(node_name, neighbors) - "cuttingboard": - instance = CuttingBoard.new(node_name, neighbors) - "counter": - instance = CounterBase.new(node_name, neighbors) - "flour-crate": - instance = FlourCounter.new(node_name, neighbors) - "oven": - instance = Oven.new(node_name, neighbors) - "raw-steak-crate": - instance = RawSteakCrate.new(node_name, neighbors) - "stove": - instance = Stove.new(node_name, neighbors) - "sink": - instance = Sink.new(node_name, neighbors) - "dirty-plate-crate": - instance = CounterBase.new(node_name, neighbors) - "wall": - instance = Wall.new(node_name, neighbors) - "chair": - instance = Chair.new(node_name, neighbors) - "table": - instance = Table.new(node_name, neighbors) - "floor": - instance = Floor.new(node_name, neighbors) - "window": - instance = WallWindow.new(node_name, neighbors) - "door": - instance = Door.new(node_name, neighbors) - var t: - push_warning("tile tile %s unknown" % t) - instance = GenericTile.new(node_name, neighbors, t) + var instance: Floor = TileFactory.produce(tile_name, node_name, neighbors) instance.position = Vector3(pos[0], 0, pos[1]) tile_by_pos[str(Vector2i(pos[0], pos[1]))] = instance diff --git a/client/map/tile_factory.gd b/client/map/tile_factory.gd new file mode 100644 index 00000000..bbd6e52f --- /dev/null +++ b/client/map/tile_factory.gd @@ -0,0 +1,57 @@ +# 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 TileFactory +extends Object + +static func produce(tile_name: String, node_name: String, neighbors: Array) -> Floor: + match tile_name: + "trash": + return Trash.new(node_name, neighbors) + "tomato-crate": + return TomatoCrate.new(node_name, neighbors) + "cuttingboard": + return CuttingBoard.new(node_name, neighbors) + "counter": + return CounterBase.new(node_name, neighbors) + "flour-crate": + return FlourCounter.new(node_name, neighbors) + "oven": + return Oven.new(node_name, neighbors) + "raw-steak-crate": + return RawSteakCrate.new(node_name, neighbors) + "stove": + return Stove.new(node_name, neighbors) + "sink": + return Sink.new(node_name, neighbors) + "dirty-plate-crate": + return CounterBase.new(node_name, neighbors) + "wall": + return Wall.new(node_name, neighbors) + "chair": + return Chair.new(node_name, neighbors) + "table": + return Table.new(node_name, neighbors) + "floor": + return Floor.new(node_name, neighbors) + "window": + return WallWindow.new(node_name, neighbors) + "door": + return Door.new(node_name, neighbors) + "leek-crate": + return LeekCrate.new(node_name, neighbors) + var t: + push_warning("tile tile %s unknown" % t) + return GenericTile.new(node_name, neighbors, t) diff --git a/client/map/tiles/crate.res b/client/map/tiles/crate.res Binary files differnew file mode 100644 index 00000000..1d1183c5 --- /dev/null +++ b/client/map/tiles/crate.res diff --git a/client/map/tiles/crate.tscn b/client/map/tiles/crate.tscn new file mode 100644 index 00000000..55da257b --- /dev/null +++ b/client/map/tiles/crate.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=3 uid="uid://xdui0oya4lpb"] + +[ext_resource type="ArrayMesh" uid="uid://btn7oh1v2k40p" path="res://map/tiles/crate.res" id="1_qu7f0"] + +[node name="Crate" type="Node3D"] + +[node name="Mesh" type="MeshInstance3D" parent="."] +transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0) +mesh = ExtResource("1_qu7f0") +skeleton = NodePath("") diff --git a/client/map/tiles/leek_crate.gd b/client/map/tiles/leek_crate.gd new file mode 100644 index 00000000..f2a76416 --- /dev/null +++ b/client/map/tiles/leek_crate.gd @@ -0,0 +1,21 @@ +# 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 LeekCrate +extends Crate + +func _init(rename: String, neighbors: Array): + super(rename, neighbors) + base.add_child(load("res://map/tiles/leek_crate.tscn").instantiate()) diff --git a/client/map/tiles/leek_crate.tscn b/client/map/tiles/leek_crate.tscn new file mode 100644 index 00000000..ae1c27ea --- /dev/null +++ b/client/map/tiles/leek_crate.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=3 format=3 uid="uid://bkrly2qyttgwh"] + +[ext_resource type="PackedScene" uid="uid://xdui0oya4lpb" path="res://map/tiles/crate.tscn" id="1_l8q4i"] +[ext_resource type="PackedScene" uid="uid://cmpwfkdnrm6e6" path="res://map/items/leek.tscn" id="2_n2ove"] + +[node name="LeekCrate" instance=ExtResource("1_l8q4i")] + +[node name="Leek" parent="." index="1" instance=ExtResource("2_n2ove")] +transform = Transform3D(0.931041, -0.363595, -0.0310037, 0.362361, 0.91115, 0.196215, -0.0430938, -0.193919, 0.980071, -0.136853, 0.0640022, -0.204823) + +[node name="Leek2" parent="." index="2" instance=ExtResource("2_n2ove")] +transform = Transform3D(0.998583, -0.046823, 0.0361874, 0.0216211, 1.10258, 0.394088, -0.0486266, -0.471297, 0.91836, 0.103182, 0.0457853, -0.223387) + +[node name="Leek3" parent="." index="3" instance=ExtResource("2_n2ove")] +transform = Transform3D(0.931041, -0.363595, -0.0310037, 0.355324, 0.922644, -0.149908, 0.0831111, 0.128554, 0.988214, -0.136853, 0.0939193, 0.253195) + +[node name="Leek4" parent="." index="4" instance=ExtResource("2_n2ove")] +transform = Transform3D(0.846401, 0.566373, 0.246663, -0.36055, 1.01849, -0.386833, -0.39193, 0.286178, 0.888548, 0.0709044, 0.0457853, 0.191268) |