aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornokoe <nokoe@mailbox.org>2024-06-24 17:25:38 +0200
committernokoe <nokoe@mailbox.org>2024-06-24 17:27:05 +0200
commit971c795b02f6a8f9702fe39e489f8ee5d0ae14a7 (patch)
treedb4fa27f87994ee1472e226105a0f145c3b56f3e
parent75293243bd7d1141714ecbe5a874fa356a6320b3 (diff)
downloadhurrycurry-971c795b02f6a8f9702fe39e489f8ee5d0ae14a7.tar
hurrycurry-971c795b02f6a8f9702fe39e489f8ee5d0ae14a7.tar.bz2
hurrycurry-971c795b02f6a8f9702fe39e489f8ee5d0ae14a7.tar.zst
add interaction effects
-rw-r--r--client/map/items/cut.tscn22
-rw-r--r--client/map/items/pot.gd15
-rw-r--r--client/map/items/steam.tscn26
-rw-r--r--client/map/items/tomato.gd12
-rw-r--r--client/map/tiles/cutting_board.gd3
5 files changed, 78 insertions, 0 deletions
diff --git a/client/map/items/cut.tscn b/client/map/items/cut.tscn
new file mode 100644
index 00000000..0a15a2c8
--- /dev/null
+++ b/client/map/items/cut.tscn
@@ -0,0 +1,22 @@
+[gd_scene load_steps=3 format=3 uid="uid://bbjair4iw1841"]
+
+[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_iypba"]
+vertex_color_use_as_albedo = true
+
+[sub_resource type="SphereMesh" id="SphereMesh_0blsq"]
+material = SubResource("StandardMaterial3D_iypba")
+radius = 0.05
+height = 0.1
+
+[node name="Cut" type="CPUParticles3D"]
+emitting = false
+amount = 25
+lifetime = 0.3
+explosiveness = 1.0
+lifetime_randomness = 0.5
+mesh = SubResource("SphereMesh_0blsq")
+direction = Vector3(0, 1, 0)
+spread = 90.0
+initial_velocity_min = 1.0
+initial_velocity_max = 3.0
+scale_amount_min = 0.4
diff --git a/client/map/items/pot.gd b/client/map/items/pot.gd
index fa5b038d..ac865329 100644
--- a/client/map/items/pot.gd
+++ b/client/map/items/pot.gd
@@ -16,9 +16,24 @@
class_name Pot
extends Item
+var steam: CPUParticles3D = load("res://map/items/steam.tscn").instantiate()
+
func _init(owned_by_: Node3D):
super(owned_by_)
base.add_child(load("res://map/items/pot.tscn").instantiate())
+ base.add_child(steam)
+
+func progress(p: float, warn: bool):
+ super(p, warn)
+ steam.emitting = true
+ if warn:
+ steam.color = Color(.2, .2, .2)
+ else:
+ steam.color = Color(1., 1., 1.)
+
+func finish(warn: bool):
+ super(warn)
+ steam.emitting = false
static func base_position() -> Vector3:
return Vector3(0., 0.015, 0.)
diff --git a/client/map/items/steam.tscn b/client/map/items/steam.tscn
new file mode 100644
index 00000000..4a112278
--- /dev/null
+++ b/client/map/items/steam.tscn
@@ -0,0 +1,26 @@
+[gd_scene load_steps=4 format=3 uid="uid://g1wsqgb56o1o"]
+
+[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_e1q7j"]
+vertex_color_use_as_albedo = true
+
+[sub_resource type="SphereMesh" id="SphereMesh_mk24m"]
+material = SubResource("StandardMaterial3D_e1q7j")
+radius = 0.1
+height = 0.2
+
+[sub_resource type="Curve" id="Curve_s1bty"]
+_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0.10989), 0.0, 0.0, 0, 0]
+point_count = 2
+
+[node name="Steam" type="CPUParticles3D"]
+emitting = false
+amount = 25
+lifetime = 2.0
+mesh = SubResource("SphereMesh_mk24m")
+direction = Vector3(0, 1, 0)
+spread = 30.0
+gravity = Vector3(0, -0.1, 0)
+initial_velocity_min = 0.2
+initial_velocity_max = 0.5
+scale_amount_min = 0.4
+scale_amount_curve = SubResource("Curve_s1bty")
diff --git a/client/map/items/tomato.gd b/client/map/items/tomato.gd
index 989e4a54..43e2e64d 100644
--- a/client/map/items/tomato.gd
+++ b/client/map/items/tomato.gd
@@ -16,6 +16,18 @@
class_name Tomato
extends Item
+var cut: CPUParticles3D = load("res://map/items/cut.tscn").instantiate()
+
func _init(owned_by_: Node3D):
super(owned_by_)
base.add_child(load("res://map/items/tomato.tscn").instantiate())
+ base.add_child(cut)
+ cut.color = Color(1., 0., 0.)
+
+func progress(p: float, warn: bool):
+ super(p, warn)
+ cut.emitting = true
+
+func finish(warn: bool):
+ super(warn)
+ cut.emitting = false
diff --git a/client/map/tiles/cutting_board.gd b/client/map/tiles/cutting_board.gd
index cadfccfa..280235e8 100644
--- a/client/map/tiles/cutting_board.gd
+++ b/client/map/tiles/cutting_board.gd
@@ -19,3 +19,6 @@ extends CounterBase
func _init(rename: String, neighbors: Array):
super(rename, neighbors)
base.add_child(load("res://map/tiles/cutting_board.tscn").instantiate())
+
+static func interact_target() -> Vector3:
+ return Vector3(0., 0.575, 0.)