diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/map/item_factory.gd | 6 | ||||
-rw-r--r-- | client/map/items/food_processor.gd | 36 | ||||
-rw-r--r-- | client/map/items/food_processor.res | bin | 0 -> 23961 bytes | |||
-rw-r--r-- | client/map/items/food_processor.tscn | 10 | ||||
-rw-r--r-- | client/map/items/food_processor_content.gd | 27 | ||||
-rw-r--r-- | client/map/items/food_processor_content.res | bin | 0 -> 3141 bytes | |||
-rw-r--r-- | client/map/items/food_processor_content.tscn | 8 | ||||
-rw-r--r-- | client/map/items/processing.tscn | 26 | ||||
-rw-r--r-- | client/map/items/tomat_food_processor.gd | 22 | ||||
-rw-r--r-- | client/map/items/tomato_juice_food_processor.gd | 21 |
10 files changed, 156 insertions, 0 deletions
diff --git a/client/map/item_factory.gd b/client/map/item_factory.gd index fb27a5e0..1fa21b27 100644 --- a/client/map/item_factory.gd +++ b/client/map/item_factory.gd @@ -36,5 +36,11 @@ static func produce(name: String, owned_by: Node3D) -> Item: return SteakPot.new(owned_by) "steak-plate": return SteakPlate.new(owned_by) + "foodprocessor": + return FoodProcessor.new(owned_by) + "tomato-foodprocessor": + return TomatoFoodProcessor.new(owned_by) + "tomato-juice-foodprocessor": + return TomatoJuiceFoodProcessor.new(owned_by) var t: return GenericItem.new(owned_by, t) diff --git a/client/map/items/food_processor.gd b/client/map/items/food_processor.gd new file mode 100644 index 00000000..1be3d591 --- /dev/null +++ b/client/map/items/food_processor.gd @@ -0,0 +1,36 @@ +# 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 FoodProcessor +extends Item + +var processing: CPUParticles3D = load("res://map/items/processing.tscn").instantiate() + +func _init(owned_by_: Node3D): + super(owned_by_) + add_child(load("res://map/items/food_processor.tscn").instantiate()) + add_child(processing) + +func progress(p: float, warn: bool): + super(p, warn) + processing.emitting = true + processing.rotation.y += p * TAU + +func finish(warn: bool): + super(warn) + processing.emitting = false + +static func base_position() -> Vector3: + return Vector3(0., 0.4, 0.) diff --git a/client/map/items/food_processor.res b/client/map/items/food_processor.res Binary files differnew file mode 100644 index 00000000..8c0e26de --- /dev/null +++ b/client/map/items/food_processor.res diff --git a/client/map/items/food_processor.tscn b/client/map/items/food_processor.tscn new file mode 100644 index 00000000..bb95d580 --- /dev/null +++ b/client/map/items/food_processor.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=3 uid="uid://daxjpvycs85ec"] + +[ext_resource type="ArrayMesh" uid="uid://bpjl5dlst6yg" path="res://map/items/food_processor.res" id="1_65ilg"] + +[node name="FoodProcessor" type="Node3D"] + +[node name="FoodProcessor" type="MeshInstance3D" parent="."] +transform = Transform3D(0.15, 0, 0, 0, 0.15, 0, 0, 0, 0.15, 0, 0.3, 0) +mesh = ExtResource("1_65ilg") +skeleton = NodePath("") diff --git a/client/map/items/food_processor_content.gd b/client/map/items/food_processor_content.gd new file mode 100644 index 00000000..ee8edc1c --- /dev/null +++ b/client/map/items/food_processor_content.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 FoodProcessorContent +extends FoodProcessor + +var content: MeshInstance3D = load("res://map/items/food_processor_content.tscn").instantiate() + +func _init(owned_by_: Node3D): + super(owned_by_) + add_child(content) + +func set_color(c: Color): + var mat: BaseMaterial3D = content.get_active_material(0) + mat.albedo_color = c diff --git a/client/map/items/food_processor_content.res b/client/map/items/food_processor_content.res Binary files differnew file mode 100644 index 00000000..7511cc75 --- /dev/null +++ b/client/map/items/food_processor_content.res diff --git a/client/map/items/food_processor_content.tscn b/client/map/items/food_processor_content.tscn new file mode 100644 index 00000000..1ae6dba4 --- /dev/null +++ b/client/map/items/food_processor_content.tscn @@ -0,0 +1,8 @@ +[gd_scene load_steps=2 format=3 uid="uid://di5nq2vgvostp"] + +[ext_resource type="ArrayMesh" uid="uid://vkd0ty7khthl" path="res://map/items/food_processor_content.res" id="1_pyn0j"] + +[node name="FoodProcessorContent" type="MeshInstance3D"] +transform = Transform3D(0.15, 0, 0, 0, 0.15, 0, 0, 0, 0.15, 0, 0.3, 0) +mesh = ExtResource("1_pyn0j") +skeleton = NodePath("") diff --git a/client/map/items/processing.tscn b/client/map/items/processing.tscn new file mode 100644 index 00000000..4904eb04 --- /dev/null +++ b/client/map/items/processing.tscn @@ -0,0 +1,26 @@ +[gd_scene load_steps=3 format=3 uid="uid://sk5i14bxi0qr"] + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_tqrr3"] +vertex_color_use_as_albedo = true + +[sub_resource type="SphereMesh" id="SphereMesh_baneh"] +material = SubResource("StandardMaterial3D_tqrr3") +radius = 0.1 +height = 0.2 + +[node name="Processing" type="CPUParticles3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, 0) +emitting = false +amount = 15 +local_coords = true +mesh = SubResource("SphereMesh_baneh") +emission_shape = 6 +emission_ring_axis = Vector3(0, 1, 0) +emission_ring_height = 0.2 +emission_ring_radius = 0.05 +emission_ring_inner_radius = 0.0 +direction = Vector3(0, 1, 0) +spread = 180.0 +gravity = Vector3(0, 0, 0) +scale_amount_min = 0.75 +scale_amount_max = 1.1 diff --git a/client/map/items/tomat_food_processor.gd b/client/map/items/tomat_food_processor.gd new file mode 100644 index 00000000..4003e246 --- /dev/null +++ b/client/map/items/tomat_food_processor.gd @@ -0,0 +1,22 @@ +# 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 TomatoFoodProcessor +extends FoodProcessor + +func _init(owned_by_: Node3D): + super(owned_by_) + processing.color = Color(1., 0., 0.) + base.add_child(load("res://map/items/tomato.tscn").instantiate()) diff --git a/client/map/items/tomato_juice_food_processor.gd b/client/map/items/tomato_juice_food_processor.gd new file mode 100644 index 00000000..d1fe9c7c --- /dev/null +++ b/client/map/items/tomato_juice_food_processor.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 TomatoJuiceFoodProcessor +extends FoodProcessorContent + +func _init(owned_by_: Node3D): + super(owned_by_) + set_color(Color(1., 0., 0.)) |