aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortpart <tpart120@proton.me>2024-08-17 17:08:44 +0200
committertpart <tpart120@proton.me>2024-08-17 17:09:37 +0200
commitd9820c71252f94ea2c0197d673c4c30abe73c0f4 (patch)
treea9a8648289e2be3c334da416a06b8fcd9eecc675
parent49f5bd102b000391915b49485eb51156c5ef6b59 (diff)
downloadhurrycurry-d9820c71252f94ea2c0197d673c4c30abe73c0f4.tar
hurrycurry-d9820c71252f94ea2c0197d673c4c30abe73c0f4.tar.bz2
hurrycurry-d9820c71252f94ea2c0197d673c4c30abe73c0f4.tar.zst
Add freezer model & implement tile
-rw-r--r--client/map/tile_factory.gd2
-rw-r--r--client/map/tiles/freezer.gd31
-rw-r--r--client/map/tiles/freezer.tscn75
-rw-r--r--client/map/tiles/freezer_base.resbin0 -> 8305 bytes
-rw-r--r--client/map/tiles/freezer_door.resbin0 -> 9112 bytes
-rw-r--r--client/map/tiles/freezer_model.gd20
6 files changed, 128 insertions, 0 deletions
diff --git a/client/map/tile_factory.gd b/client/map/tile_factory.gd
index bd0a71ca..9f157b78 100644
--- a/client/map/tile_factory.gd
+++ b/client/map/tile_factory.gd
@@ -90,6 +90,8 @@ static func produce(tile_name: String, node_name: String, neighbors: Array) -> T
return StrawberryCrate.new(node_name, neighbors)
"coconut-crate":
return CoconutCrate.new(node_name, neighbors)
+ "freezer":
+ return Freezer.new(node_name, neighbors)
var t:
push_warning("tile %s unknown" % t)
return GenericTile.new(node_name, neighbors, t)
diff --git a/client/map/tiles/freezer.gd b/client/map/tiles/freezer.gd
new file mode 100644
index 00000000..bca8d607
--- /dev/null
+++ b/client/map/tiles/freezer.gd
@@ -0,0 +1,31 @@
+# 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 Freezer
+extends Counter
+
+var freezer: FreezerModel = load("res://map/tiles/freezer.tscn").instantiate()
+
+func _init(rename: String, neighbors: Array):
+ super(rename, neighbors)
+ base.add_child(freezer)
+
+func put_item(i: Item):
+ freezer.open()
+ super(i)
+
+func take_item() -> Item:
+ freezer.open()
+ return super()
diff --git a/client/map/tiles/freezer.tscn b/client/map/tiles/freezer.tscn
new file mode 100644
index 00000000..1da75fad
--- /dev/null
+++ b/client/map/tiles/freezer.tscn
@@ -0,0 +1,75 @@
+[gd_scene load_steps=7 format=3 uid="uid://ch753p32b3jl8"]
+
+[ext_resource type="Script" path="res://map/tiles/freezer_model.gd" id="1_kso20"]
+[ext_resource type="ArrayMesh" uid="uid://cbdalq2gofyu8" path="res://map/tiles/freezer_base.res" id="2_akcb5"]
+[ext_resource type="ArrayMesh" uid="uid://yknstw5duuot" path="res://map/tiles/freezer_door.res" id="3_0pgw0"]
+
+[sub_resource type="Animation" id="Animation_33bww"]
+length = 0.001
+tracks/0/type = "value"
+tracks/0/imported = false
+tracks/0/enabled = true
+tracks/0/path = NodePath("FreezerBase/FreezerDoor:rotation")
+tracks/0/interp = 1
+tracks/0/loop_wrap = true
+tracks/0/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 0,
+"values": [Vector3(0, 0, 0)]
+}
+
+[sub_resource type="Animation" id="Animation_axsnk"]
+resource_name = "open"
+length = 0.4
+tracks/0/type = "value"
+tracks/0/imported = false
+tracks/0/enabled = true
+tracks/0/path = NodePath("FreezerBase/FreezerDoor:rotation")
+tracks/0/interp = 2
+tracks/0/loop_wrap = true
+tracks/0/keys = {
+"times": PackedFloat32Array(0, 0.1, 0.2, 0.4),
+"transitions": PackedFloat32Array(1, 1, 1, 1),
+"update": 0,
+"values": [Vector3(0, 0, 0), Vector3(0, 1.39626, 0), Vector3(0, 1.39626, 0), Vector3(0, 0, 0)]
+}
+
+[sub_resource type="AnimationLibrary" id="AnimationLibrary_usga0"]
+_data = {
+"RESET": SubResource("Animation_33bww"),
+"open": SubResource("Animation_axsnk")
+}
+
+[node name="Freezer" type="Node3D"]
+script = ExtResource("1_kso20")
+
+[node name="FreezerBase" type="MeshInstance3D" parent="."]
+transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
+mesh = ExtResource("2_akcb5")
+skeleton = NodePath("")
+
+[node name="FreezerDoor" type="MeshInstance3D" parent="FreezerBase"]
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.850006, 1.25, 0.5)
+mesh = ExtResource("3_0pgw0")
+skeleton = NodePath("")
+
+[node name="OmniLight3D" type="OmniLight3D" parent="."]
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.25, 0)
+light_color = Color(0.566816, 0.801037, 0.838352, 1)
+shadow_enabled = true
+
+[node name="OmniLight3D2" type="OmniLight3D" parent="."]
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, 0)
+light_color = Color(0.566816, 0.801037, 0.838352, 1)
+shadow_enabled = true
+
+[node name="OmniLight3D3" type="OmniLight3D" parent="."]
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.9, 0)
+light_color = Color(0.566816, 0.801037, 0.838352, 1)
+shadow_enabled = true
+
+[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
+libraries = {
+"": SubResource("AnimationLibrary_usga0")
+}
diff --git a/client/map/tiles/freezer_base.res b/client/map/tiles/freezer_base.res
new file mode 100644
index 00000000..dded8a8b
--- /dev/null
+++ b/client/map/tiles/freezer_base.res
Binary files differ
diff --git a/client/map/tiles/freezer_door.res b/client/map/tiles/freezer_door.res
new file mode 100644
index 00000000..9efb17a3
--- /dev/null
+++ b/client/map/tiles/freezer_door.res
Binary files differ
diff --git a/client/map/tiles/freezer_model.gd b/client/map/tiles/freezer_model.gd
new file mode 100644
index 00000000..558de97d
--- /dev/null
+++ b/client/map/tiles/freezer_model.gd
@@ -0,0 +1,20 @@
+# Hurry Curry! - a game about cooking
+# Copyright 2024 tpart
+#
+# 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 FreezerModel
+extends Node3D
+
+func open():
+ $AnimationPlayer.play("open")