diff options
Diffstat (limited to 'client/player/particles')
-rw-r--r-- | client/player/particles/angry/angry.webp | bin | 0 -> 5022 bytes | |||
-rw-r--r-- | client/player/particles/angry/angry.webp.import | 36 | ||||
-rw-r--r-- | client/player/particles/effect.gd | 45 | ||||
-rw-r--r-- | client/player/particles/effect.tscn | 36 | ||||
-rw-r--r-- | client/player/particles/satisfied/star.webp | bin | 0 -> 5818 bytes | |||
-rw-r--r-- | client/player/particles/satisfied/star.webp.import | 36 | ||||
-rw-r--r-- | client/player/particles/satisfied/stars.tscn | 37 |
7 files changed, 190 insertions, 0 deletions
diff --git a/client/player/particles/angry/angry.webp b/client/player/particles/angry/angry.webp Binary files differnew file mode 100644 index 00000000..866ba92c --- /dev/null +++ b/client/player/particles/angry/angry.webp diff --git a/client/player/particles/angry/angry.webp.import b/client/player/particles/angry/angry.webp.import new file mode 100644 index 00000000..3deee645 --- /dev/null +++ b/client/player/particles/angry/angry.webp.import @@ -0,0 +1,36 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://unjbxplj845n" +path.s3tc="res://.godot/imported/angry.webp-f649f66bf6a009b3b61480c4e451c61b.s3tc.ctex" +path.etc2="res://.godot/imported/angry.webp-f649f66bf6a009b3b61480c4e451c61b.etc2.ctex" +metadata={ +"imported_formats": ["s3tc_bptc", "etc2_astc"], +"vram_texture": true +} + +[deps] + +source_file="res://player/particles/angry/angry.webp" +dest_files=["res://.godot/imported/angry.webp-f649f66bf6a009b3b61480c4e451c61b.s3tc.ctex", "res://.godot/imported/angry.webp-f649f66bf6a009b3b61480c4e451c61b.etc2.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/client/player/particles/effect.gd b/client/player/particles/effect.gd new file mode 100644 index 00000000..00c95441 --- /dev/null +++ b/client/player/particles/effect.gd @@ -0,0 +1,45 @@ +# Hurry Curry! - a game about cooking +# Copyright 2024 tpart +# Copyright 2024 nokoe +# +# 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/>. +# +class_name Effect +extends Node3D + +@onready var success = $Success +@onready var failure = $Failure +@onready var angry_grunt: PlayRandom = $AngryGrunt +@onready var stars = $Stars +@onready var angry = $Angry + + +func set_effect(e: String): + clear_effect() + match e: + "satisfied": + stars.emitting = true + success.play() + "angry": + angry.emitting = true + angry_grunt.play_random() + failure.play() + _: + push_warning("effect %s unknown" % e) + +func clear_effect(): + stars.emitting = false + success.stop() + angry.emitting = false + angry_grunt.stop_all() + failure.stop() diff --git a/client/player/particles/effect.tscn b/client/player/particles/effect.tscn new file mode 100644 index 00000000..13423874 --- /dev/null +++ b/client/player/particles/effect.tscn @@ -0,0 +1,36 @@ +[gd_scene load_steps=9 format=3 uid="uid://dn2ne30t81ame"] + +[ext_resource type="Script" 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="AudioStream" uid="uid://camy77x26mmpv" path="res://menu/sounds/success.ogg" id="3_favyn"] +[ext_resource type="AudioStream" uid="uid://cv4isy6po6pqd" path="res://menu/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" 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"] + +[node name="Effect" type="Node3D"] +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="Success" type="AudioStreamPlayer" parent="."] +stream = ExtResource("3_favyn") + +[node name="Failure" type="AudioStreamPlayer" parent="."] +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 + +[node name="Angry1" type="AudioStreamPlayer3D" parent="AngryGrunt"] +stream = ExtResource("6_ou7uy") + +[node name="Angry2" type="AudioStreamPlayer3D" parent="AngryGrunt"] +stream = ExtResource("7_r21iy") diff --git a/client/player/particles/satisfied/star.webp b/client/player/particles/satisfied/star.webp Binary files differnew file mode 100644 index 00000000..c1d2e8ff --- /dev/null +++ b/client/player/particles/satisfied/star.webp diff --git a/client/player/particles/satisfied/star.webp.import b/client/player/particles/satisfied/star.webp.import new file mode 100644 index 00000000..11d15c58 --- /dev/null +++ b/client/player/particles/satisfied/star.webp.import @@ -0,0 +1,36 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b10goh4dsa3b0" +path.s3tc="res://.godot/imported/star.webp-4edd9a951e46ba686b105839f622c981.s3tc.ctex" +path.etc2="res://.godot/imported/star.webp-4edd9a951e46ba686b105839f622c981.etc2.ctex" +metadata={ +"imported_formats": ["s3tc_bptc", "etc2_astc"], +"vram_texture": true +} + +[deps] + +source_file="res://player/particles/satisfied/star.webp" +dest_files=["res://.godot/imported/star.webp-4edd9a951e46ba686b105839f622c981.s3tc.ctex", "res://.godot/imported/star.webp-4edd9a951e46ba686b105839f622c981.etc2.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/client/player/particles/satisfied/stars.tscn b/client/player/particles/satisfied/stars.tscn new file mode 100644 index 00000000..2bfaaec0 --- /dev/null +++ b/client/player/particles/satisfied/stars.tscn @@ -0,0 +1,37 @@ +[gd_scene load_steps=6 format=3 uid="uid://yaed1vnhd0aa"] + +[ext_resource type="Texture2D" uid="uid://b10goh4dsa3b0" path="res://player/particles/satisfied/star.webp" id="1_v8q3r"] + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_d8uy0"] +transparency = 1 +shading_mode = 0 +vertex_color_use_as_albedo = true +albedo_texture = ExtResource("1_v8q3r") +billboard_mode = 2 +billboard_keep_scale = true + +[sub_resource type="QuadMesh" id="QuadMesh_d0lru"] +material = SubResource("StandardMaterial3D_d8uy0") + +[sub_resource type="Curve" id="Curve_0rju1"] +_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.51927, 1), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="Gradient" id="Gradient_lmymu"] +offsets = PackedFloat32Array(0, 0.711828, 1) +colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0) + +[node name="Stars" type="CPUParticles3D"] +emitting = false +amount = 5 +lifetime = 2.0 +one_shot = true +explosiveness = 1.0 +mesh = SubResource("QuadMesh_d0lru") +direction = Vector3(0, 1, 0) +spread = 30.0 +gravity = Vector3(0, 0, 0) +initial_velocity_min = 1.0 +initial_velocity_max = 1.5 +scale_amount_curve = SubResource("Curve_0rju1") +color_ramp = SubResource("Gradient_lmymu") |