diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/map/items/item.gd | 18 | ||||
-rw-r--r-- | client/player/particles/angry/angry.tscn (renamed from client/player/angry.tscn) | 0 | ||||
-rw-r--r-- | client/player/particles/checkmark/checkmark.gd | 19 | ||||
-rw-r--r-- | client/player/particles/checkmark/checkmark.gd.uid | 1 | ||||
-rw-r--r-- | client/player/particles/checkmark/checkmark.svg | 1 | ||||
-rw-r--r-- | client/player/particles/checkmark/checkmark.svg.import | 45 | ||||
-rw-r--r-- | client/player/particles/checkmark/checkmark.tscn | 44 | ||||
-rw-r--r-- | client/player/particles/effect.tscn | 8 |
8 files changed, 127 insertions, 9 deletions
diff --git a/client/map/items/item.gd b/client/map/items/item.gd index 7e858aec..4847313e 100644 --- a/client/map/items/item.gd +++ b/client/map/items/item.gd @@ -16,13 +16,14 @@ class_name Item extends Node3D +const CHECKMARK: PackedScene = preload("uid://bdbw8whs3data") + var owned_by: Node3D var base: Node3D = Node3D.new() var progress_instance: Progress3D = preload("res://map/progress/progress.tscn").instantiate() var take_sound: PlayRandom = preload("res://audio/play_random.tscn").instantiate() var put_sound: PlayRandom = preload("res://audio/play_random.tscn").instantiate() -var ding_sound := AudioStreamPlayer3D.new() var beep_sound := AudioStreamPlayer3D.new() var sound_id @@ -43,9 +44,7 @@ func _init(owned_by_: Node3D): put_sound.volume_db = -16 add_child(take_sound) add_child(put_sound) - ding_sound.stream = preload("res://map/tiles/sounds/ding.ogg") beep_sound.stream = preload("res://map/tiles/sounds/beep.ogg") - add_child(ding_sound) add_child(beep_sound) setup_sounds() @warning_ignore("static_called_on_instance") @@ -94,8 +93,17 @@ func progress(position_: float, speed: float, warn: bool): progress_speed = speed progress_warn = warn - # Always play ding sound if item is making progress while warn - if warn and speed > 0.: ding_sound.play() + if position_ == 1.0 and not warn: + # Progress gets called with position 1.0 when the task is finished + var checkmark: CPUParticles3D = CHECKMARK.instantiate() + owned_by.add_child(checkmark) + checkmark.position.y = 1 + checkmark.emitting = true + + var ding_sound := AudioStreamPlayer3D.new() + owned_by.add_child(ding_sound) + ding_sound.stream = preload("res://map/tiles/sounds/ding.ogg") + ding_sound.play() func finish(): progress_instance.visible = false diff --git a/client/player/angry.tscn b/client/player/particles/angry/angry.tscn index c8f82ab6..c8f82ab6 100644 --- a/client/player/angry.tscn +++ b/client/player/particles/angry/angry.tscn diff --git a/client/player/particles/checkmark/checkmark.gd b/client/player/particles/checkmark/checkmark.gd new file mode 100644 index 00000000..106b1cc7 --- /dev/null +++ b/client/player/particles/checkmark/checkmark.gd @@ -0,0 +1,19 @@ +# Hurry Curry! - a game about cooking +# Copyright (C) 2025 Hurry Curry! contributors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, version 3 of the License only. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# +extends CPUParticles3D + +func _on_finished() -> void: + queue_free() diff --git a/client/player/particles/checkmark/checkmark.gd.uid b/client/player/particles/checkmark/checkmark.gd.uid new file mode 100644 index 00000000..913fb945 --- /dev/null +++ b/client/player/particles/checkmark/checkmark.gd.uid @@ -0,0 +1 @@ +uid://bj1h0r3qvy6vm diff --git a/client/player/particles/checkmark/checkmark.svg b/client/player/particles/checkmark/checkmark.svg new file mode 100644 index 00000000..f8a31e29 --- /dev/null +++ b/client/player/particles/checkmark/checkmark.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="256px" viewBox="0 -960 960 960" width="256px" fill="#FFFFFF"><path d="m419-283 294-294-66-66-228 228-111-111-65 66 176 177Zm61.14 228Q392-55 314.51-88.08q-77.48-33.09-135.41-91.02-57.93-57.93-91.02-135.27Q55-391.72 55-479.86 55-569 88.08-646.49q33.09-77.48 90.86-134.97 57.77-57.48 135.19-91.01Q391.56-906 479.78-906q89.22 0 166.83 33.45 77.6 33.46 135.01 90.81t90.89 134.87Q906-569.34 906-480q0 88.28-33.53 165.75t-91.01 135.28q-57.49 57.8-134.83 90.89Q569.28-55 480.14-55Z"/></svg>
\ No newline at end of file diff --git a/client/player/particles/checkmark/checkmark.svg.import b/client/player/particles/checkmark/checkmark.svg.import new file mode 100644 index 00000000..58f42635 --- /dev/null +++ b/client/player/particles/checkmark/checkmark.svg.import @@ -0,0 +1,45 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c10wjga8ni7eq" +path.s3tc="res://.godot/imported/checkmark.svg-fa4b3748aa6561b9772a9b05d1a5b098.s3tc.ctex" +path.etc2="res://.godot/imported/checkmark.svg-fa4b3748aa6561b9772a9b05d1a5b098.etc2.ctex" +metadata={ +"imported_formats": ["s3tc_bptc", "etc2_astc"], +"vram_texture": true +} + +[deps] + +source_file="res://player/particles/checkmark/checkmark.svg" +dest_files=["res://.godot/imported/checkmark.svg-fa4b3748aa6561b9772a9b05d1a5b098.s3tc.ctex", "res://.godot/imported/checkmark.svg-fa4b3748aa6561b9772a9b05d1a5b098.etc2.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +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 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/client/player/particles/checkmark/checkmark.tscn b/client/player/particles/checkmark/checkmark.tscn new file mode 100644 index 00000000..c2fbf6b7 --- /dev/null +++ b/client/player/particles/checkmark/checkmark.tscn @@ -0,0 +1,44 @@ +[gd_scene load_steps=7 format=3 uid="uid://bdbw8whs3data"] + +[ext_resource type="Texture2D" uid="uid://c10wjga8ni7eq" path="res://player/particles/checkmark/checkmark.svg" id="1_co83x"] +[ext_resource type="Script" uid="uid://bj1h0r3qvy6vm" path="res://player/particles/checkmark/checkmark.gd" id="2_ru6ov"] + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ru6ov"] +transparency = 1 +no_depth_test = true +shading_mode = 0 +vertex_color_use_as_albedo = true +albedo_texture = ExtResource("1_co83x") +billboard_mode = 2 +billboard_keep_scale = true + +[sub_resource type="QuadMesh" id="QuadMesh_4d8iq"] +material = SubResource("StandardMaterial3D_ru6ov") + +[sub_resource type="Curve" id="Curve_co83x"] +_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.49781358, 1), 0.0, 0.0, 0, 0, Vector2(0.9931608, 1), 0.0, 0.0, 0, 0] +point_count = 3 + +[sub_resource type="Gradient" id="Gradient_gh7p3"] +offsets = PackedFloat32Array(0, 0.26672226, 0.4904026, 1) +colors = PackedColorArray(1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0) + +[node name="Checkmark" type="CPUParticles3D"] +emitting = false +amount = 1 +one_shot = true +explosiveness = 1.0 +mesh = SubResource("QuadMesh_4d8iq") +direction = Vector3(0, 1, 0) +spread = 0.0 +gravity = Vector3(0, 0, 0) +initial_velocity_min = 1.0 +initial_velocity_max = 1.0 +scale_amount_min = 0.5 +scale_amount_max = 0.5 +scale_amount_curve = SubResource("Curve_co83x") +color = Color(0, 1, 0, 1) +color_ramp = SubResource("Gradient_gh7p3") +script = ExtResource("2_ru6ov") + +[connection signal="finished" from="." to="." method="_on_finished"] diff --git a/client/player/particles/effect.tscn b/client/player/particles/effect.tscn index 9f77476d..4495ce12 100644 --- a/client/player/particles/effect.tscn +++ b/client/player/particles/effect.tscn @@ -2,9 +2,9 @@ [ext_resource type="Script" uid="uid://ecsoi03822i5" path="res://player/particles/effect.gd" id="1_aqsk6"] [ext_resource type="PackedScene" uid="uid://yaed1vnhd0aa" path="res://player/particles/satisfied/stars.tscn" id="2_shb5l"] +[ext_resource type="PackedScene" uid="uid://cvty1rwt52anq" path="res://player/particles/angry/angry.tscn" id="3_bnidm"] [ext_resource type="AudioStream" uid="uid://camy77x26mmpv" path="res://gui/resources/sounds/success.ogg" id="3_favyn"] [ext_resource type="AudioStream" uid="uid://cv4isy6po6pqd" path="res://gui/resources/sounds/failure.ogg" id="4_j38qf"] -[ext_resource type="PackedScene" uid="uid://cvty1rwt52anq" path="res://player/angry.tscn" id="4_uxxex"] [ext_resource type="Script" uid="uid://n4jwod1jfuiv" path="res://audio/play_random.gd" id="5_t2upj"] [ext_resource type="AudioStream" uid="uid://c3gatgrsb0npf" path="res://player/sounds/angry1.ogg" id="6_ou7uy"] [ext_resource type="AudioStream" uid="uid://cty282m6ckt62" path="res://player/sounds/angry2.ogg" id="7_r21iy"] @@ -15,6 +15,9 @@ script = ExtResource("1_aqsk6") [node name="Stars" parent="." instance=ExtResource("2_shb5l")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) +[node name="Angry" parent="." instance=ExtResource("3_bnidm")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) + [node name="Success" type="AudioStreamPlayer" parent="."] stream = ExtResource("3_favyn") @@ -22,9 +25,6 @@ stream = ExtResource("3_favyn") stream = ExtResource("4_j38qf") volume_db = -8.0 -[node name="Angry" parent="." instance=ExtResource("4_uxxex")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) - [node name="AngryGrunt" type="Node3D" parent="."] script = ExtResource("5_t2upj") volume_db = -8.0 |