1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00

feat(音效/特效): 添加角色死亡音效和血液特效

添加多个音效文件并实现角色死亡时的血液粒子效果
调整冲刺逻辑和数值,修复激光子弹的显示位置
为不同攻击类型添加对应音效,增强游戏表现力
This commit is contained in:
2025-08-29 14:29:07 +08:00
parent 72b83b909a
commit bd8a7d5d2c
14 changed files with 221 additions and 11 deletions
+50 -1
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=27 format=3 uid="uid://cvogxi7mktumf"]
[gd_scene load_steps=36 format=3 uid="uid://cvogxi7mktumf"]
[ext_resource type="Script" path="res://scripts/Statemachine/EntityBase.gd" id="1_mvol6"]
[ext_resource type="Texture2D" uid="uid://dwwpkn4q07ja2" path="res://icon.svg" id="2_7lpu0"]
@@ -212,6 +212,47 @@ color_ramp = SubResource("GradientTexture1D_j8vyx")
color_initial_ramp = SubResource("GradientTexture1D_j74g5")
alpha_curve = SubResource("CurveTexture_r5gvu")
[sub_resource type="Curve" id="Curve_bdwpn"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_vvfxd"]
curve = SubResource("Curve_bdwpn")
[sub_resource type="Curve" id="Curve_kwqoa"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_065by"]
curve = SubResource("Curve_kwqoa")
[sub_resource type="Gradient" id="Gradient_futl5"]
colors = PackedColorArray(1, 0, 0, 1, 0.394531, 0, 0, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_4n0se"]
gradient = SubResource("Gradient_futl5")
[sub_resource type="Gradient" id="Gradient_qttew"]
colors = PackedColorArray(1, 1, 1, 1, 0.597656, 0.597656, 0.597656, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_joqdg"]
gradient = SubResource("Gradient_qttew")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_f3xas"]
particle_flag_disable_z = true
angle_min = 1.07288e-05
angle_max = 360.0
angle_curve = SubResource("CurveTexture_065by")
direction = Vector3(-1, 0, 0)
spread = 180.0
initial_velocity_max = 150.0
gravity = Vector3(0, 200, 0)
scale_min = 3.0
scale_max = 8.0
color_ramp = SubResource("GradientTexture1D_joqdg")
color_initial_ramp = SubResource("GradientTexture1D_4n0se")
alpha_curve = SubResource("CurveTexture_vvfxd")
[sub_resource type="CircleShape2D" id="CircleShape2D_34h7q"]
[node name="EntityBase" type="CharacterBody2D"]
@@ -274,6 +315,14 @@ z_index = -1
amount = 300
process_material = SubResource("ParticleProcessMaterial_kndb2")
[node name="deadParticle" type="GPUParticles2D" parent="texture"]
unique_name_in_owner = true
emitting = false
amount = 100
process_material = SubResource("ParticleProcessMaterial_f3xas")
one_shot = true
explosiveness = 1.0
[node name="statebar" parent="." instance=ExtResource("2_uje1g")]
unique_name_in_owner = true
position = Vector2(0, -100)
+5 -5
View File
@@ -208,10 +208,10 @@ metadata/_edit_vertical_guides_ = [705.0]
[node name="rect" parent="texture" index="0"]
material = SubResource("ShaderMaterial_x6ivr")
offset_left = 204.0
offset_top = 25.0
offset_right = 254.0
offset_bottom = 525.0
offset_left = 188.0
offset_top = 0.0
offset_right = 238.0
offset_bottom = 500.0
[node name="particles" parent="texture/rect" index="0"]
position = Vector2(25, 250)
@@ -221,7 +221,7 @@ lifetime = 0.1
visibility_rect = Rect2(-50, -250, 100, 500)
[node name="launcher" parent="texture/rect" index="1"]
position = Vector2(25, -21)
position = Vector2(25, -13.9999)
scale = Vector2(0.525, 0.525)
[node name="animator" parent="texture" index="1"]
+13 -1
View File
@@ -1,12 +1,15 @@
[gd_scene load_steps=9 format=3 uid="uid://b0ncrvm8u4pox"]
[gd_scene load_steps=12 format=3 uid="uid://b0ncrvm8u4pox"]
[ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_goqmy"]
[ext_resource type="Script" path="res://scripts/Contents/Characters/Chick.gd" id="2_r6bub"]
[ext_resource type="Texture2D" uid="uid://7pkplcqqxvnp" path="res://resources/characters/chick/chick-a.svg" id="2_syddq"]
[ext_resource type="Texture2D" uid="uid://dj5dvqb8gsedr" path="res://resources/characters/chick/chick-b.svg" id="3_064jv"]
[ext_resource type="AudioStream" uid="uid://b7pxuov1id0ho" path="res://resources/sounds/effect/Pew.mp3" id="3_ik1xf"]
[ext_resource type="AudioStream" uid="uid://bgo8p1l77xrbe" path="res://resources/sounds/effect/Magic Spell.wav" id="4_2qabh"]
[ext_resource type="AudioStream" uid="uid://b10u6iir6uvqn" path="res://resources/sounds/effect/BigLaser.wav" id="4_mrsne"]
[ext_resource type="AudioStream" uid="uid://cee6rxv2uqynh" path="res://resources/sounds/effect/Flame.ogg" id="5_vcsbb"]
[ext_resource type="PackedScene" uid="uid://dny25qkcvtaa2" path="res://components/Effects/FirePot.tscn" id="6_kvx3n"]
[ext_resource type="AudioStream" uid="uid://dn6bijr513wyp" path="res://resources/sounds/effect/Drum Boing.wav" id="7_qjhwc"]
[sub_resource type="SpriteFrames" id="SpriteFrames_xji3d"]
animations = [{
@@ -41,10 +44,19 @@ appleCount = Vector2i(2, 4)
[node name="hurt" parent="sounds" index="3"]
stream = ExtResource("3_ik1xf")
[node name="attack0" parent="sounds" index="5"]
stream = ExtResource("4_2qabh")
[node name="attack1" type="AudioStreamPlayer2D" parent="sounds" index="6"]
stream = ExtResource("4_mrsne")
volume_db = -10.0
[node name="attack2" type="AudioStreamPlayer2D" parent="sounds" index="7"]
stream = ExtResource("5_vcsbb")
[node name="attack3" type="AudioStreamPlayer2D" parent="sounds" index="8"]
stream = ExtResource("7_qjhwc")
[node name="texture" parent="." index="1"]
position = Vector2(0, -37)
sprite_frames = SubResource("SpriteFrames_xji3d")
+57
View File
@@ -0,0 +1,57 @@
[gd_scene load_steps=12 format=3 uid="uid://b3hoapgh61w3e"]
[ext_resource type="PackedScene" uid="uid://bcvuuy2m0pke0" path="res://components/Abstracts/EffectBase.tscn" id="1_neao1"]
[ext_resource type="AudioStream" uid="uid://bjtxl0ec0dfw5" path="res://resources/sounds/effect/Squish Pop.wav" id="2_sjht3"]
[sub_resource type="Curve" id="Curve_w5fhr"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_py1or"]
curve = SubResource("Curve_w5fhr")
[sub_resource type="Curve" id="Curve_ux33m"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_kt65p"]
curve = SubResource("Curve_ux33m")
[sub_resource type="Gradient" id="Gradient_ydyr0"]
colors = PackedColorArray(1, 0, 0, 1, 0.394531, 0, 0, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_8qmb3"]
gradient = SubResource("Gradient_ydyr0")
[sub_resource type="Gradient" id="Gradient_4t65b"]
colors = PackedColorArray(1, 1, 1, 1, 0.597656, 0.597656, 0.597656, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_ltuue"]
gradient = SubResource("Gradient_4t65b")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_g7bcr"]
particle_flag_disable_z = true
emission_shape = 1
emission_sphere_radius = 10.0
angle_min = 1.07288e-05
angle_max = 360.0
angle_curve = SubResource("CurveTexture_kt65p")
direction = Vector3(-1, 0, 0)
spread = 180.0
initial_velocity_max = 200.0
gravity = Vector3(0, 200, 0)
scale_min = 5.0
scale_max = 10.0
color_ramp = SubResource("GradientTexture1D_ltuue")
color_initial_ramp = SubResource("GradientTexture1D_8qmb3")
alpha_curve = SubResource("CurveTexture_py1or")
[node name="DeadBlood" instance=ExtResource("1_neao1")]
spawnSound = "spawn"
[node name="spawn" parent="sounds" index="0"]
stream = ExtResource("2_sjht3")
[node name="particles" parent="." index="1"]
amount = 100
process_material = SubResource("ParticleProcessMaterial_g7bcr")
Binary file not shown.
@@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://dn6bijr513wyp"
path="res://.godot/imported/Drum Boing.wav-f090a9e9e01992567c3fb709b5b41857.sample"
[deps]
source_file="res://resources/sounds/effect/Drum Boing.wav"
dest_files=["res://.godot/imported/Drum Boing.wav-f090a9e9e01992567c3fb709b5b41857.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0
Binary file not shown.
+19
View File
@@ -0,0 +1,19 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://cee6rxv2uqynh"
path="res://.godot/imported/Flame.ogg-03a5b18aeebb75d3cec38a59046a469e.oggvorbisstr"
[deps]
source_file="res://resources/sounds/effect/Flame.ogg"
dest_files=["res://.godot/imported/Flame.ogg-03a5b18aeebb75d3cec38a59046a469e.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
Binary file not shown.
@@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://bgo8p1l77xrbe"
path="res://.godot/imported/Magic Spell.wav-5293554c522fa39b42ee6fbe9a20cc35.sample"
[deps]
source_file="res://resources/sounds/effect/Magic Spell.wav"
dest_files=["res://.godot/imported/Magic Spell.wav-5293554c522fa39b42ee6fbe9a20cc35.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0
Binary file not shown.
@@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://bjtxl0ec0dfw5"
path="res://.godot/imported/Squish Pop.wav-f3096dbf743894be425e11fe0e37111d.sample"
[deps]
source_file="res://resources/sounds/effect/Squish Pop.wav"
dest_files=["res://.godot/imported/Squish Pop.wav-f3096dbf743894be425e11fe0e37111d.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0
+1 -3
View File
@@ -40,10 +40,8 @@ func attack(type):
firepot.shot()
BulletBase.generate(preload("res://components/Bullets/FireScan.tscn"), self, weaponPos, target)
elif type == 3:
trailing = true
BulletBase.generate(preload("res://components/Bullets/ChickSprint.tscn"), self, position, 0)
await trySprint()
trailing = false
trySprint()
return true
func sprint():
move((currentFocusedBoss.position - position).normalized() * sprintMultiplier, true)
+4 -1
View File
@@ -55,7 +55,7 @@ var inventoryMax = {
@export var defaultCooldownUnit: float = 100
@export var isBoss: bool = false
@export var displayName: String = "未知实体"
@export var sprintMultiplier: float = 3
@export var sprintMultiplier: float = 5
@export var drops: Array[ItemStore.ItemType] = []
@export var dropCounts: Array[Vector2] = []
@export var appleCount: Vector2i = Vector2(0, 2) # 死亡后掉落的苹果数量
@@ -203,10 +203,12 @@ func tryAttack(type: int, needChargeUp: bool = false):
attack(type)
return state
func trySprint():
trailing = true
playSound("sprint")
sprint()
sprinting = true
await TickTool.until(func(): return !sprinting)
trailing = false
func tryDie(by: BulletBase):
for drop in range(min(len(drops), len(dropCounts))):
var item = drops[drop]
@@ -220,6 +222,7 @@ func tryDie(by: BulletBase):
) or isBoss:
for i in randi_range(appleCount.x, appleCount.y):
ItemDropped.generate(ItemStore.ItemType.APPLE, 1, position + MathTool.randv2_range(GameRule.itemDroppedSpawnOffset))
EffectController.create(preload("res://components/Effects/DeadBlood.tscn"), texture.global_position).shot()
await die()
if isPlayer() and UIState.player == self:
UIState.setPanel("GameOver")