diff --git a/.~lock.Работы по химии TODO.docx# b/.~lock.Работы по химии TODO.docx# index 1d8047d..083cc6b 100644 --- a/.~lock.Работы по химии TODO.docx# +++ b/.~lock.Работы по химии TODO.docx# @@ -1 +1 @@ -,rendo,kompikrendo,29.06.2026 00:21,file:///home/rendo/.config/libreoffice/4; \ No newline at end of file +,rendo,kompikrendo,29.05.2026 16:54,file:///home/rendo/.config/libreoffice/4; \ No newline at end of file diff --git a/assets/meshes/Drip_Cylinder.res b/assets/meshes/Drip_Cylinder.res deleted file mode 100644 index e651f8f..0000000 Binary files a/assets/meshes/Drip_Cylinder.res and /dev/null differ diff --git a/assets/meshes/Drip_Cylinder_001.res b/assets/meshes/Drip_Cylinder_001.res deleted file mode 100644 index 176806e..0000000 Binary files a/assets/meshes/Drip_Cylinder_001.res and /dev/null differ diff --git a/assets/meshes/Drip_Cylinder_004.res b/assets/meshes/Drip_Cylinder_004.res deleted file mode 100644 index 4ab9655..0000000 Binary files a/assets/meshes/Drip_Cylinder_004.res and /dev/null differ diff --git a/assets/models/Drip.glb.import b/assets/models/Drip.glb.import index 561c7cf..e6a5589 100644 --- a/assets/models/Drip.glb.import +++ b/assets/models/Drip.glb.import @@ -16,8 +16,6 @@ dest_files=["res://.godot/imported/Drip.glb-91c932019939c0c57a2bbeb7aa92f14a.scn nodes/root_type="" nodes/root_name="" nodes/root_script=null -mesh_library/use_node_names_as_mesh_names=false -array_mesh/deduplicate_surfaces=true nodes/apply_root_scale=true nodes/root_scale=1.0 nodes/import_as_skeleton_bones=false @@ -46,37 +44,7 @@ _subresources={ "use_external/fallback_path": "res://assets/materials/mat_glass.tres", "use_external/path": "uid://64m17act0kwu" } -}, -"meshes": { -"Drip_Cylinder": { -"generate/lightmap_uv": 0, -"generate/lods": 0, -"generate/shadow_meshes": 0, -"lods/normal_merge_angle": 20.0, -"save_to_file/enabled": true, -"save_to_file/fallback_path": "res://assets/meshes/Drip_Cylinder.res", -"save_to_file/path": "uid://bca7m12sa3g48" -}, -"Drip_Cylinder_001": { -"generate/lightmap_uv": 0, -"generate/lods": 0, -"generate/shadow_meshes": 0, -"lods/normal_merge_angle": 20.0, -"save_to_file/enabled": true, -"save_to_file/fallback_path": "res://assets/meshes/Drip_Cylinder_001.res", -"save_to_file/path": "uid://dv7q66xtqi55t" -}, -"Drip_Cylinder_004": { -"generate/lightmap_uv": 0, -"generate/lods": 0, -"generate/shadow_meshes": 0, -"lods/normal_merge_angle": 20.0, -"save_to_file/enabled": true, -"save_to_file/fallback_path": "res://assets/meshes/Drip_Cylinder_004.res", -"save_to_file/path": "uid://dwg7r8hor517p" -} } } gltf/naming_version=2 gltf/embedded_image_handling=1 -gltf/texture_map_mode=1 diff --git a/assets/reactions/hcl_p_naoh.tres b/assets/reactions/hcl_p_naoh.tres index 84a1f46..8f785d7 100644 --- a/assets/reactions/hcl_p_naoh.tres +++ b/assets/reactions/hcl_p_naoh.tres @@ -1,4 +1,4 @@ -[gd_resource type="Resource" script_class="Reaction" format=3 uid="uid://17oljvqj8f33"] +[gd_resource type="Resource" script_class="Reaction" load_steps=11 format=3 uid="uid://17oljvqj8f33"] [ext_resource type="Script" uid="uid://bb8o8l6u6fiai" path="res://src/resources/reaction_substance.gd" id="1_bffrj"] [ext_resource type="Resource" uid="uid://30ym4xb0uu3y" path="res://assets/substances/NaOH.tres" id="2_1nb8s"] diff --git a/assets/reagents/Phenolphtalein.tres b/assets/reagents/Phenolphtalein.tres index f9e3730..fdea53b 100644 --- a/assets/reagents/Phenolphtalein.tres +++ b/assets/reagents/Phenolphtalein.tres @@ -1,11 +1,9 @@ -[gd_resource type="Resource" script_class="Reagent" format=3 uid="uid://dia0grmva8062"] +[gd_resource type="Resource" script_class="Reagent" load_steps=3 format=3 uid="uid://dia0grmva8062"] [ext_resource type="Script" uid="uid://bditqax8ibmxw" path="res://src/resources/reagent.gd" id="1_v8ev6"] [ext_resource type="Resource" uid="uid://brih4gryc1acx" path="res://assets/substances/Phenolphtalein.tres" id="2_ikqma"] -[ext_resource type="PackedScene" uid="uid://t432slq7xiyg" path="res://scenes/substance_jar_alt.tscn" id="2_ta4t0"] [resource] script = ExtResource("1_v8ev6") substance = ExtResource("2_ikqma") -storage = ExtResource("2_ta4t0") metadata/_custom_type_script = "uid://b8q5buwgvppyh" diff --git a/assets/textures/bubble.png.import b/assets/textures/bubble.png.import index 46d3ca3..07769dc 100644 --- a/assets/textures/bubble.png.import +++ b/assets/textures/bubble.png.import @@ -3,20 +3,19 @@ importer="texture" type="CompressedTexture2D" uid="uid://bkuxwtxum1r4x" -path.s3tc="res://.godot/imported/bubble.png-a4e9df5e78917cd4475ee7b84b1534f0.s3tc.ctex" +path="res://.godot/imported/bubble.png-a4e9df5e78917cd4475ee7b84b1534f0.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], -"vram_texture": true +"vram_texture": false } [deps] source_file="res://assets/textures/bubble.png" -dest_files=["res://.godot/imported/bubble.png-a4e9df5e78917cd4475ee7b84b1534f0.s3tc.ctex"] +dest_files=["res://.godot/imported/bubble.png-a4e9df5e78917cd4475ee7b84b1534f0.ctex"] [params] -compress/mode=2 +compress/mode=0 compress/high_quality=false compress/lossy_quality=0.7 compress/uastc_level=0 @@ -24,7 +23,7 @@ compress/rdo_quality_loss=0.0 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=true +mipmaps/generate=false mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -38,4 +37,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=0 +detect_3d/compress_to=1 diff --git a/project.godot b/project.godot index fcca46e..78618d2 100644 --- a/project.godot +++ b/project.godot @@ -16,7 +16,7 @@ compatibility/default_parent_skeleton_in_mesh_instance_3d=true config/name="lab-electrolyte" run/main_scene="uid://c2ciwyjf7au6l" -config/features=PackedStringArray("4.7", "Mobile") +config/features=PackedStringArray("4.6", "Mobile") config/icon="res://icon.svg" [autoload] diff --git a/scenes/bubbles.gd b/scenes/bubbles.gd deleted file mode 100644 index 227b91f..0000000 --- a/scenes/bubbles.gd +++ /dev/null @@ -1,18 +0,0 @@ -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) - ) diff --git a/scenes/bubbles.gd.uid b/scenes/bubbles.gd.uid deleted file mode 100644 index 1e475bc..0000000 --- a/scenes/bubbles.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://8jd32taaq5yy diff --git a/scenes/flask.tscn b/scenes/flask.tscn index d04cc86..19c3a85 100644 --- a/scenes/flask.tscn +++ b/scenes/flask.tscn @@ -7,9 +7,7 @@ [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"] @@ -76,24 +74,6 @@ 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") @@ -109,13 +89,12 @@ 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_paths=PackedStringArray("particle_collision")] +[node name="FillLiquid" type="MeshInstance3D" parent="Flash" unique_id=439339804] 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) @@ -126,18 +105,6 @@ 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") @@ -180,6 +147,5 @@ 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"] diff --git a/scenes/substance_jar_alt.tscn b/scenes/substance_jar_alt.tscn deleted file mode 100644 index fd6bc18..0000000 --- a/scenes/substance_jar_alt.tscn +++ /dev/null @@ -1,65 +0,0 @@ -[gd_scene format=3 uid="uid://t432slq7xiyg"] - -[ext_resource type="Script" uid="uid://bjnv2g1ni0525" path="res://src/drag/draggable_object.gd" id="1_ojiag"] -[ext_resource type="ArrayMesh" uid="uid://b5bxc1qinl3gw" path="res://assets/meshes/Drip_Cylinder.res" id="2_ojiag"] -[ext_resource type="ArrayMesh" uid="uid://5aw6ifbhbmu4" path="res://assets/meshes/Drip_Cylinder_001.res" id="3_kbrga"] -[ext_resource type="Script" uid="uid://c8epd7gguvyop" path="res://src/substance_holder.gd" id="4_bxvcb"] -[ext_resource type="Script" uid="uid://bl0ojhc0thk1p" path="res://src/interactible/interactible.gd" id="5_mhyp3"] -[ext_resource type="Script" uid="uid://bhnptwotw5bs8" path="res://src/interactible/substance_jar_interaction.gd" id="6_p0fvg"] - -[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_pcpcb"] -resource_local_to_scene = true -transparency = 1 - -[sub_resource type="CylinderShape3D" id="CylinderShape3D_kfk5m"] -height = 0.6569824 -radius = 0.32421875 - -[node name="SubstanceJar" type="Area3D" unique_id=904812958 node_paths=PackedStringArray("interactible")] -collision_layer = 5 -script = ExtResource("1_ojiag") -interactible = NodePath("Interaction") -mask = PackedStringArray("flask") - -[node name="Jar" type="MeshInstance3D" parent="." unique_id=985146813] -transform = Transform3D(0.14479385, 0.13796644, 0, -0.13796644, 0.14479385, 0, 0, 0, 0.2, 0.022179853, 0.41104287, 0) -mesh = ExtResource("2_ojiag") - -[node name="JarFill" type="MeshInstance3D" parent="." unique_id=1364277535] -transform = Transform3D(0.14479385, 0.13796644, 0, -0.13796644, 0.14479385, 0, 0, 0, 0.2, 0.050798316, 0.33528638, 0) -material_override = SubResource("StandardMaterial3D_pcpcb") -mesh = ExtResource("3_kbrga") - -[node name="DragArea" type="CollisionShape3D" parent="." unique_id=960002167] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.3272705, 0) -shape = SubResource("CylinderShape3D_kfk5m") - -[node name="SubstanceData" type="Node" parent="." unique_id=1379108671] -script = ExtResource("4_bxvcb") - -[node name="Interaction" type="ConfirmationDialog" parent="." unique_id=1225848265] -title = "Добавить вещество?" -ok_button_text = "Добавить" -cancel_button_text = "Не добавлять" -script = ExtResource("5_mhyp3") - -[node name="HBoxContainer" type="HBoxContainer" parent="Interaction" unique_id=1504866588] -offset_right = 40.0 -offset_bottom = 40.0 - -[node name="ProgressBar" type="HSlider" parent="Interaction/HBoxContainer" unique_id=1037338095] -layout_mode = 2 -size_flags_horizontal = 3 -allow_greater = true - -[node name="SpinBox" type="SpinBox" parent="Interaction/HBoxContainer" unique_id=194740698] -layout_mode = 2 -allow_greater = true -suffix = "мл." - -[node name="Interaction" type="Node" parent="Interaction" unique_id=729724369] -script = ExtResource("6_p0fvg") - -[connection signal="interacted" from="Interaction" to="Interaction/Interaction" method="_on_interaction_interacted"] -[connection signal="value_changed" from="Interaction/HBoxContainer/ProgressBar" to="Interaction/Interaction" method="_on_progress_bar_value_changed"] -[connection signal="value_changed" from="Interaction/HBoxContainer/SpinBox" to="Interaction/Interaction" method="_on_spin_box_value_changed"] diff --git a/src/inventory.gd b/src/inventory.gd index 5a95666..897c283 100644 --- a/src/inventory.gd +++ b/src/inventory.gd @@ -23,7 +23,6 @@ var total_amount: float: return result signal inventory_changed(substances: Array[RuntimeSubstanceData], capacity: float) -signal reacted_with_gasses(gasses: Array[RuntimeSubstanceData]) signal temperature_changed(to: float) func _ready() -> void: @@ -180,23 +179,15 @@ func check_for_reactions() -> void: add_substance_no_callback(data) check_for_reactions() recalculate_temperature() - - var gasses = find_gases() - if gasses != []: - reacted_with_gasses.emit(gasses) - update_solutions() inventory_changed.emit(inventory.values(),capacity) GuiSignalBus.push("Произошла реакция") if len(find_odor()) > 0: GuiSignalBus.push("Появился запах") -func find_gases() -> Array[RuntimeSubstanceData]: - var gasses: Array[RuntimeSubstanceData] = [] - for key in inventory: - if inventory[key].substance.boiling_point < mean_temperature: - gasses.append(inventory[key]) - return gasses +#func find_gases() -> Array[RuntimeSubstanceData]: +# for key in inventory: +# if inventory[key].substance in [preload("H")] func find_odor() -> Array[RuntimeSubstanceData]: var result = [] diff --git a/src/substance_display.gd b/src/substance_display.gd index a9f3b60..51805bc 100644 --- a/src/substance_display.gd +++ b/src/substance_display.gd @@ -11,7 +11,6 @@ enum DisplayType{ var tween = create_tween() material_override.set_shader_parameter("wave_intensity",1.) tween.tween_property(material_override,"shader_parameter/wave_intensity",0.0,2.0) -@export var particle_collision: GPUParticlesCollisionBox3D func update_fluid_material(substances: Array[RuntimeSubstanceData],capacity: float) -> void: var mat: ShaderMaterial = material_override @@ -54,7 +53,6 @@ func update_fluid_material(substances: Array[RuntimeSubstanceData],capacity: flo mat.set_shader_parameter("albedo_color", color / total_color) mat.set_shader_parameter("fill",total_weight/capacity) - particle_collision.position.y = + particle_collision.size.y/2 + position.y - 4 + 8 * total_weight/capacity func update_solid_material(substances: Array[RuntimeSubstanceData]) -> void: var mat: StandardMaterial3D = material_override diff --git a/Работы по химии TODO.docx b/Работы по химии TODO.docx index dab894c..d22917c 100644 Binary files a/Работы по химии TODO.docx and b/Работы по химии TODO.docx differ