aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortpart <tpart120@proton.me>2024-08-19 17:53:17 +0200
committertpart <tpart120@proton.me>2024-08-19 17:53:21 +0200
commit2916d8af9b6458dd97fe313c7775f4780ee6c82d (patch)
treeeeed9b7be99c010151fb68b71e42c844b96eeeb5
parent947ea54a0dfe0093f658c371dc1a8aef3df61b61 (diff)
downloadhurrycurry-2916d8af9b6458dd97fe313c7775f4780ee6c82d.tar
hurrycurry-2916d8af9b6458dd97fe313c7775f4780ee6c82d.tar.bz2
hurrycurry-2916d8af9b6458dd97fe313c7775f4780ee6c82d.tar.zst
Add glass fill item & Implement water glass
-rw-r--r--client/map/item_factory.gd1
-rw-r--r--client/map/items/glass_fill.gd27
-rw-r--r--client/map/items/glass_fill.resbin0 -> 7769 bytes
-rw-r--r--client/map/items/glass_fill.tscn8
-rw-r--r--client/map/items/glass_items.gd6
5 files changed, 42 insertions, 0 deletions
diff --git a/client/map/item_factory.gd b/client/map/item_factory.gd
index 7c92e2b8..876ffb29 100644
--- a/client/map/item_factory.gd
+++ b/client/map/item_factory.gd
@@ -74,6 +74,7 @@ static func produce(name: String, owned_by: Node3D) -> Item:
"tomato-juice-foodprocessor": return FoodProcessorItems.TomatoJuiceF.new(owned_by)
"glass": return Glass.new(owned_by)
+ "water-glass": return GlassItems.WaterG.new(owned_by)
"plate": return Plate.new(owned_by)
"bread-slice-plate": return PlateItems.BreadSliceP.new(owned_by)
diff --git a/client/map/items/glass_fill.gd b/client/map/items/glass_fill.gd
new file mode 100644
index 00000000..8b1e18f0
--- /dev/null
+++ b/client/map/items/glass_fill.gd
@@ -0,0 +1,27 @@
+# Hurry Curry! - 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 GlassFill
+extends Glass
+
+var fill: MeshInstance3D = load("res://map/items/glass_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/glass_fill.res b/client/map/items/glass_fill.res
new file mode 100644
index 00000000..bb29e341
--- /dev/null
+++ b/client/map/items/glass_fill.res
Binary files differ
diff --git a/client/map/items/glass_fill.tscn b/client/map/items/glass_fill.tscn
new file mode 100644
index 00000000..1a26d5ee
--- /dev/null
+++ b/client/map/items/glass_fill.tscn
@@ -0,0 +1,8 @@
+[gd_scene load_steps=2 format=3 uid="uid://dvdwxct8qu2fm"]
+
+[ext_resource type="ArrayMesh" uid="uid://byebq6oifi2jk" path="res://map/items/glass_fill.res" id="1_apxu2"]
+
+[node name="GlassFill" type="MeshInstance3D"]
+transform = Transform3D(0.125, 0, 0, 0, 0.125, 0, 0, 0, 0.125, 0, 0.125, 0)
+mesh = ExtResource("1_apxu2")
+skeleton = NodePath("")
diff --git a/client/map/items/glass_items.gd b/client/map/items/glass_items.gd
new file mode 100644
index 00000000..29d87c7a
--- /dev/null
+++ b/client/map/items/glass_items.gd
@@ -0,0 +1,6 @@
+class_name GlassItems
+
+class WaterG extends GlassFill:
+ func _init(owned_by_: Node3D):
+ super(owned_by_)
+ set_color(Color(.5, .6, .8))