diff options
-rw-r--r-- | client/map/tiles/sink.gd | 11 | ||||
-rw-r--r-- | client/map/tiles/sink.tscn | 8 | ||||
-rw-r--r-- | client/map/tiles/sink_bubbles.gd | 10 | ||||
-rw-r--r-- | client/map/tiles/sink_bubbles.tscn | 56 |
4 files changed, 85 insertions, 0 deletions
diff --git a/client/map/tiles/sink.gd b/client/map/tiles/sink.gd index d1f4b5f2..f6213eb5 100644 --- a/client/map/tiles/sink.gd +++ b/client/map/tiles/sink.gd @@ -16,8 +16,11 @@ class_name Sink extends Counter +var bubbles: SinkBubbles = preload("res://map/tiles/sink_bubbles.tscn").instantiate() + func _init(rename: String, neighbors: Array): super(rename, neighbors) + base.add_child(bubbles) match kind: CounterKind.STRAIGHT: base.add_child(load("res://map/tiles/sink.tscn").instantiate()) @@ -25,3 +28,11 @@ func _init(rename: String, neighbors: Array): base.add_child(load("res://map/tiles/sink_backsplash.tscn").instantiate()) _: base.add_child(load("res://map/tiles/sink.tscn").instantiate()) + +func progress(p: float, warn: bool): + super(p, warn) + bubbles.start() + +func finish(warn: bool): + super(warn) + bubbles.stop() diff --git a/client/map/tiles/sink.tscn b/client/map/tiles/sink.tscn index 887a6a86..7a42e011 100644 --- a/client/map/tiles/sink.tscn +++ b/client/map/tiles/sink.tscn @@ -8,3 +8,11 @@ transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0) mesh = ExtResource("1_w6v3o") skeleton = NodePath("") + +[node name="SinkBubbles" type="Node3D" parent="."] + +[node name="Stream" type="CPUParticles3D" parent="SinkBubbles"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.75, -0.05) + +[node name="Bubbles" type="CPUParticles3D" parent="SinkBubbles"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) diff --git a/client/map/tiles/sink_bubbles.gd b/client/map/tiles/sink_bubbles.gd new file mode 100644 index 00000000..2dbafca8 --- /dev/null +++ b/client/map/tiles/sink_bubbles.gd @@ -0,0 +1,10 @@ +class_name SinkBubbles +extends Node3D + +func start(): + $Stream.emitting = true + $Bubbles.emitting = true + +func stop(): + $Stream.emitting = false + $Bubbles.emitting = false diff --git a/client/map/tiles/sink_bubbles.tscn b/client/map/tiles/sink_bubbles.tscn new file mode 100644 index 00000000..6e4487fa --- /dev/null +++ b/client/map/tiles/sink_bubbles.tscn @@ -0,0 +1,56 @@ +[gd_scene load_steps=8 format=3 uid="uid://ckxtlgx7hg368"] + +[ext_resource type="Script" path="res://map/tiles/sink_bubbles.gd" id="1_xt81f"] + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_b8p5f"] +vertex_color_use_as_albedo = true + +[sub_resource type="SphereMesh" id="SphereMesh_1r04j"] +material = SubResource("StandardMaterial3D_b8p5f") +radius = 0.025 +height = 0.05 + +[sub_resource type="Gradient" id="Gradient_p7a7b"] +offsets = PackedFloat32Array(0, 0.753333) +colors = PackedColorArray(0.119726, 0.715743, 1, 1, 1, 1, 1, 1) + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_588v1"] +vertex_color_use_as_albedo = true + +[sub_resource type="SphereMesh" id="SphereMesh_3wrov"] +material = SubResource("StandardMaterial3D_588v1") +radius = 0.05 +height = 0.1 + +[sub_resource type="Curve" id="Curve_wu4je"] +_data = [Vector2(0.264045, 0), 0.0, 0.0, 0, 0, Vector2(0.460674, 1), 0.0, 0.0, 0, 0, Vector2(0.949438, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] +point_count = 4 + +[node name="SinkBubbles" type="Node3D"] +script = ExtResource("1_xt81f") + +[node name="Stream" type="CPUParticles3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.75, -0.05) +emitting = false +amount = 10 +lifetime = 0.2 +mesh = SubResource("SphereMesh_1r04j") +direction = Vector3(0, -1, 0) +spread = 10.0 +initial_velocity_min = 0.1 +initial_velocity_max = 0.3 +color_ramp = SubResource("Gradient_p7a7b") + +[node name="Bubbles" type="CPUParticles3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.55, 0) +emitting = false +amount = 30 +mesh = SubResource("SphereMesh_3wrov") +direction = Vector3(0, 1, 0) +spread = 90.0 +gravity = Vector3(0, -0.2, 0) +initial_velocity_min = 0.1 +initial_velocity_max = 0.3 +scale_amount_min = 0.0 +scale_amount_max = 1.5 +scale_amount_curve = SubResource("Curve_wu4je") |