diff options
author | nokoe <nokoe@mailbox.org> | 2024-06-24 02:00:24 +0200 |
---|---|---|
committer | nokoe <nokoe@mailbox.org> | 2024-06-24 02:01:09 +0200 |
commit | 372bc4897f81fabb919ab79bce6d6d7aa00fad78 (patch) | |
tree | b094c5dbad652850e287413fd1101a4c180063a0 /client | |
parent | 4c51bd75579b148ba94f5a87aa8bd8ff19569705 (diff) | |
download | hurrycurry-372bc4897f81fabb919ab79bce6d6d7aa00fad78.tar hurrycurry-372bc4897f81fabb919ab79bce6d6d7aa00fad78.tar.bz2 hurrycurry-372bc4897f81fabb919ab79bce6d6d7aa00fad78.tar.zst |
add some items
Diffstat (limited to 'client')
27 files changed, 265 insertions, 3 deletions
diff --git a/client/map/item_factory.gd b/client/map/item_factory.gd index 3dbb7018..fba1e006 100644 --- a/client/map/item_factory.gd +++ b/client/map/item_factory.gd @@ -20,5 +20,21 @@ static func produce(idx: int, owned_by: Node3D) -> Item: match Multiplayer.item_names[idx]: "plate": return Plate.new(owned_by) + "dirty-plate": + return DirtyPlate.new(owned_by) + "tomato": + return Tomato.new(owned_by) + "raw-steak": + return RawSteak.new(owned_by) + "sliced-tomato": + return SlicedTomato.new(owned_by) + "pot": + return Pot.new(owned_by) + "raw-steak-pot": + return RawSteakPot.new(owned_by) + "steak-pot": + return SteakPot.new(owned_by) + "steak-plate": + return SteakPlate.new(owned_by) var t: return GenericItem.new(owned_by, t) diff --git a/client/map/items/dirt.res b/client/map/items/dirt.res Binary files differnew file mode 100644 index 00000000..3043f8d8 --- /dev/null +++ b/client/map/items/dirt.res diff --git a/client/map/items/dirt.tscn b/client/map/items/dirt.tscn new file mode 100644 index 00000000..18956b3d --- /dev/null +++ b/client/map/items/dirt.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=3 uid="uid://cluraed43qoeb"] + +[ext_resource type="ArrayMesh" uid="uid://dla7bxb6byk48" path="res://map/items/dirt.res" id="1_xmsre"] + +[node name="Dirt" type="Node3D"] + +[node name="Mesh" type="MeshInstance3D" parent="."] +transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, -0.015, 0) +mesh = ExtResource("1_xmsre") +skeleton = NodePath("") diff --git a/client/map/items/dirty_plate.gd b/client/map/items/dirty_plate.gd new file mode 100644 index 00000000..ace34452 --- /dev/null +++ b/client/map/items/dirty_plate.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 DirtyPlate +extends Plate + +func _init(owned_by_: Node3D): + super(owned_by_) + base.add_child(load("res://map/items/dirt.tscn").instantiate()) diff --git a/client/map/items/generic_item.gd b/client/map/items/generic_item.gd index 70e9b354..be9d5a0a 100644 --- a/client/map/items/generic_item.gd +++ b/client/map/items/generic_item.gd @@ -31,4 +31,4 @@ func _init(owned_by_: Node3D, t: String): mat.billboard_mode = mat.BILLBOARD_ENABLED mat.shading_mode = BaseMaterial3D.SHADING_MODE_UNSHADED text.material = mat - add_child(mesh) + base.add_child(mesh) diff --git a/client/map/items/item.gd b/client/map/items/item.gd index f817e72d..cb0cf0b7 100644 --- a/client/map/items/item.gd +++ b/client/map/items/item.gd @@ -17,13 +17,16 @@ class_name Item extends Node3D var owned_by: Node3D +var base: Node3D = Node3D.new() var progress_instance: ProgressBar3D = preload("res://map/progress.tscn").instantiate() func _init(owned_by_: Node3D): progress_instance.position.y = 2. - add_child(progress_instance) progress_instance.visible = false + add_child(progress_instance) + base.position = base_position() + add_child(base) owned_by = owned_by_ func _ready(): @@ -38,3 +41,6 @@ func progress(p: float, warn: bool): func finish(_warn: bool): progress_instance.visible = false + +static func base_position() -> Vector3: + return Vector3(0., 0., 0.) diff --git a/client/map/items/plate.gd b/client/map/items/plate.gd index 8ebea099..91faf0b1 100644 --- a/client/map/items/plate.gd +++ b/client/map/items/plate.gd @@ -18,4 +18,7 @@ extends Item func _init(owned_by_: Node3D): super(owned_by_) - add_child(load("res://map/items/plate.tscn").instantiate()) + base.add_child(load("res://map/items/plate.tscn").instantiate()) + +static func base_position() -> Vector3: + return Vector3(0., 0.015, 0.) diff --git a/client/map/items/plate.res b/client/map/items/plate.res Binary files differindex 25e6e832..b57844c3 100644 --- a/client/map/items/plate.res +++ b/client/map/items/plate.res diff --git a/client/map/items/pot.gd b/client/map/items/pot.gd new file mode 100644 index 00000000..fa5b038d --- /dev/null +++ b/client/map/items/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 Pot +extends Item + +func _init(owned_by_: Node3D): + super(owned_by_) + base.add_child(load("res://map/items/pot.tscn").instantiate()) + +static func base_position() -> Vector3: + return Vector3(0., 0.015, 0.) diff --git a/client/map/items/pot.res b/client/map/items/pot.res Binary files differnew file mode 100644 index 00000000..df67fed3 --- /dev/null +++ b/client/map/items/pot.res diff --git a/client/map/items/pot.tscn b/client/map/items/pot.tscn new file mode 100644 index 00000000..f823cae2 --- /dev/null +++ b/client/map/items/pot.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=3 uid="uid://df0hhdcyubyid"] + +[ext_resource type="ArrayMesh" uid="uid://dm14h4sasn2bm" path="res://map/items/pot.res" id="1_41enh"] + +[node name="Pot" 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_41enh") +skeleton = NodePath("") diff --git a/client/map/items/raw_steak.gd b/client/map/items/raw_steak.gd new file mode 100644 index 00000000..328e4e92 --- /dev/null +++ b/client/map/items/raw_steak.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 RawSteak +extends Item + +func _init(owned_by_: Node3D): + super(owned_by_) + base.add_child(load("res://map/items/raw_steak.tscn").instantiate()) diff --git a/client/map/items/raw_steak.res b/client/map/items/raw_steak.res Binary files differnew file mode 100644 index 00000000..f94e895c --- /dev/null +++ b/client/map/items/raw_steak.res diff --git a/client/map/items/raw_steak.tscn b/client/map/items/raw_steak.tscn new file mode 100644 index 00000000..f8b282fb --- /dev/null +++ b/client/map/items/raw_steak.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=3 uid="uid://burjwm1m1ukbh"] + +[ext_resource type="ArrayMesh" uid="uid://tuorjx63f0ij" path="res://map/items/raw_steak.res" id="1_dw8a3"] + +[node name="RawSteak" 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_dw8a3") +skeleton = NodePath("") diff --git a/client/map/items/raw_steak_pot.gd b/client/map/items/raw_steak_pot.gd new file mode 100644 index 00000000..992554ea --- /dev/null +++ b/client/map/items/raw_steak_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 RawSteakPot +extends Pot + +func _init(owned_by_: Node3D): + super(owned_by_) + base.add_child(load("res://map/items/raw_steak.tscn").instantiate()) diff --git a/client/map/items/sliced_tomato.gd b/client/map/items/sliced_tomato.gd new file mode 100644 index 00000000..af5e53e2 --- /dev/null +++ b/client/map/items/sliced_tomato.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 SlicedTomato +extends Item + +func _init(owned_by_: Node3D): + super(owned_by_) + base.add_child(load("res://map/items/sliced_tomato.tscn").instantiate()) diff --git a/client/map/items/sliced_tomato.res b/client/map/items/sliced_tomato.res Binary files differnew file mode 100644 index 00000000..3594e6f9 --- /dev/null +++ b/client/map/items/sliced_tomato.res diff --git a/client/map/items/sliced_tomato.tscn b/client/map/items/sliced_tomato.tscn new file mode 100644 index 00000000..28ba45f4 --- /dev/null +++ b/client/map/items/sliced_tomato.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=3 uid="uid://8u4yp0323kiw"] + +[ext_resource type="ArrayMesh" uid="uid://cwjqxolxw0ttl" path="res://map/items/sliced_tomato.res" id="1_6yvlk"] + +[node name="SlicedTomato" 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_6yvlk") +skeleton = NodePath("") diff --git a/client/map/items/steak.res b/client/map/items/steak.res Binary files differnew file mode 100644 index 00000000..68aaa171 --- /dev/null +++ b/client/map/items/steak.res diff --git a/client/map/items/steak.tscn b/client/map/items/steak.tscn new file mode 100644 index 00000000..5ec962f4 --- /dev/null +++ b/client/map/items/steak.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=3 uid="uid://c70af18pms3gw"] + +[ext_resource type="ArrayMesh" uid="uid://kfod37qy5sx" path="res://map/items/steak.res" id="1_iei2f"] + +[node name="Steak" 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_iei2f") +skeleton = NodePath("") diff --git a/client/map/items/steak_plate.gd b/client/map/items/steak_plate.gd new file mode 100644 index 00000000..454400ee --- /dev/null +++ b/client/map/items/steak_plate.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 SteakPlate +extends Plate + +func _init(owned_by_: Node3D): + super(owned_by_) + base.add_child(load("res://map/items/steak.tscn").instantiate()) diff --git a/client/map/items/steak_pot.gd b/client/map/items/steak_pot.gd new file mode 100644 index 00000000..fd755e62 --- /dev/null +++ b/client/map/items/steak_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 SteakPot +extends Pot + +func _init(owned_by_: Node3D): + super(owned_by_) + base.add_child(load("res://map/items/steak.tscn").instantiate()) diff --git a/client/map/items/tomato.gd b/client/map/items/tomato.gd new file mode 100644 index 00000000..989e4a54 --- /dev/null +++ b/client/map/items/tomato.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 Tomato +extends Item + +func _init(owned_by_: Node3D): + super(owned_by_) + base.add_child(load("res://map/items/tomato.tscn").instantiate()) diff --git a/client/map/items/tomato.res b/client/map/items/tomato.res Binary files differnew file mode 100644 index 00000000..aafc8738 --- /dev/null +++ b/client/map/items/tomato.res diff --git a/client/map/items/tomato.tscn b/client/map/items/tomato.tscn new file mode 100644 index 00000000..4589cca5 --- /dev/null +++ b/client/map/items/tomato.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=3 uid="uid://cvgmmrm8xqg4t"] + +[ext_resource type="ArrayMesh" uid="uid://bh5t6gqdxv1t8" path="res://map/items/tomato.res" id="1_8xuup"] + +[node name="Tomato" 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_8xuup") +skeleton = NodePath("") diff --git a/client/map/progress.gd b/client/map/progress.gd index 4d6494f6..61a0c7dd 100644 --- a/client/map/progress.gd +++ b/client/map/progress.gd @@ -16,6 +16,9 @@ class_name ProgressBar3D extends MeshInstance3D +func _ready(): + self.get_active_material(0).duplicate(true) + func set_progress(progress: float, bad: bool): var mat: ShaderMaterial = self.get_active_material(0) mat.set_shader_parameter("progress", progress) diff --git a/client/map/tiles/stove.gd b/client/map/tiles/stove.gd index 216129fb..e17ced36 100644 --- a/client/map/tiles/stove.gd +++ b/client/map/tiles/stove.gd @@ -19,3 +19,6 @@ extends Counter func _init(rename: String, neighbors: Array): super(rename, neighbors) base.add_child(load("res://map/tiles/stove.tscn").instantiate()) + +static func interact_target() -> Vector3: + return Vector3(0., 0.625, 0.) |