This commit is contained in:
Rendo 2026-06-29 00:20:57 +05:00
commit 49b09b9bb8
9 changed files with 77 additions and 12 deletions

18
scenes/bubbles.gd Normal file
View file

@ -0,0 +1,18 @@
extends GPUParticles3D
@export var inventory: Inventory
@export var particles: GPUParticles3D
var tween: Tween
func _on_inventory_reacted_with_gasses(gasses: Array[RuntimeSubstanceData]) -> void:
if tween:
tween.kill()
tween = create_tween()
particles.emitting = true
tween.tween_interval(2.)
tween.tween_callback(func():
particles.emitting = false
for gas in gasses:
inventory.extract_substance(gas.substance.get_formula(),gas.amount)
)

1
scenes/bubbles.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://8jd32taaq5yy

View file

@ -7,7 +7,9 @@
[ext_resource type="Script" uid="uid://bl0ojhc0thk1p" path="res://src/interactible/interactible.gd" id="4_dbm1u"]
[ext_resource type="Texture2D" uid="uid://cw3jw8qbvj3fv" path="res://assets/textures/solid.png" id="4_h7awq"]
[ext_resource type="Script" uid="uid://duirfi4j26g2i" path="res://src/interactible/flask_interaction.gd" id="5_pmegg"]
[ext_resource type="Texture2D" uid="uid://bkuxwtxum1r4x" path="res://assets/textures/bubble.png" id="6_rqua0"]
[ext_resource type="Script" uid="uid://82ettbegollp" path="res://src/inventory.gd" id="7_h7awq"]
[ext_resource type="Script" uid="uid://8jd32taaq5yy" path="res://scenes/bubbles.gd" id="7_wadb5"]
[ext_resource type="Script" uid="uid://mqch4ruivbg8" path="res://src/position_resetter.gd" id="9_kkw7a"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_vcwhe"]
@ -74,6 +76,24 @@ bottom_radius = 0.772
radial_segments = 16
rings = 0
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_u7u8q"]
emission_shape_scale = Vector3(0.755, 0.93, 0.755)
emission_shape = 1
emission_sphere_radius = 1.0
gravity = Vector3(0, 1, 0)
collision_mode = 1
collision_friction = 0.0
collision_bounce = 0.0
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_t5c10"]
transparency = 1
albedo_texture = ExtResource("6_rqua0")
billboard_mode = 1
[sub_resource type="QuadMesh" id="QuadMesh_iuc1c"]
material = SubResource("StandardMaterial3D_t5c10")
size = Vector2(0.05, 0.05)
[node name="Flask" type="Area3D" unique_id=516093165 node_paths=PackedStringArray("interactible") groups=["flask"]]
collision_layer = 5
script = ExtResource("1_0xufn")
@ -89,12 +109,13 @@ transform = Transform3D(0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, 0.1, 0)
mesh = SubResource("ArrayMesh_nvewc")
skeleton = NodePath("")
[node name="FillLiquid" type="MeshInstance3D" parent="Flash" unique_id=439339804]
[node name="FillLiquid" type="MeshInstance3D" parent="Flash" unique_id=439339804 node_paths=PackedStringArray("particle_collision")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.8061247, 0)
material_override = SubResource("ShaderMaterial_ailwx")
mesh = SubResource("CylinderMesh_h7awq")
skeleton = NodePath("")
script = ExtResource("3_0xufn")
particle_collision = NodePath("../GPUParticlesCollisionBox3D")
[node name="FillSolid" type="MeshInstance3D" parent="Flash" unique_id=390551675]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8061155, 0)
@ -105,6 +126,18 @@ skeleton = NodePath("")
script = ExtResource("3_0xufn")
display_type = 1
[node name="GPUParticlesCollisionBox3D" type="GPUParticlesCollisionBox3D" parent="Flash" unique_id=330053589]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5932534, 0)
size = Vector3(2.7734375, 1.1738281, 3.2333984)
[node name="GPUParticles3D" type="GPUParticles3D" parent="Flash" unique_id=2054685714]
emitting = false
lifetime = 3.0
local_coords = true
process_material = SubResource("ParticleProcessMaterial_u7u8q")
draw_pass_1 = SubResource("QuadMesh_iuc1c")
script = ExtResource("7_wadb5")
[node name="Inventory" type="Node" parent="." unique_id=1748297338]
unique_name_in_owner = true
script = ExtResource("7_h7awq")
@ -147,5 +180,6 @@ script = ExtResource("9_kkw7a")
[connection signal="drag_started" from="." to="PositionResetter" method="_on_flask_drag_started"]
[connection signal="inventory_changed" from="Inventory" to="Flash/FillLiquid" method="update_material_unfiltered"]
[connection signal="inventory_changed" from="Inventory" to="Flash/FillSolid" method="update_material_unfiltered"]
[connection signal="reacted_with_gasses" from="Inventory" to="Flash/GPUParticles3D" method="_on_inventory_reacted_with_gasses"]
[connection signal="interacted" from="Interactible" to="Interactible/Interaction" method="_on_interactible_interacted"]
[connection signal="value_changed" from="Interactible/HBoxContainer/HSlider" to="Interactible/Interaction" method="_on_h_slider_value_changed"]