diff options
-rw-r--r-- | client/map/items/cut.tscn | 22 | ||||
-rw-r--r-- | client/map/items/pot.gd | 15 | ||||
-rw-r--r-- | client/map/items/steam.tscn | 26 | ||||
-rw-r--r-- | client/map/items/tomato.gd | 12 | ||||
-rw-r--r-- | client/map/tiles/cutting_board.gd | 3 |
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.) |