From 6bf8dc8683a4b6db10d70e39cdc71e9eba9686bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=A8=E8=90=BD=E5=9F=BA=E5=9B=B4=E8=99=BE?= <3161880837@qq.com> Date: Thu, 20 Nov 2025 22:18:17 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=88=98=E6=96=97=E7=B3=BB=E7=BB=9F):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=AE=AD=E7=9F=A2=E5=91=BD=E4=B8=AD=E6=95=88?= =?UTF-8?q?=E6=9E=9C=E5=B9=B6=E8=B0=83=E6=95=B4=E5=BC=93=E7=AE=AD=E4=BC=A4?= =?UTF-8?q?=E5=AE=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为箭矢添加命中时的血液粒子效果和音效 - 将弓箭的基础伤害从3降低到2 - 更新弓箭描述文本以反映伤害调整 --- components/Abstracts/BulletBase.tscn | 10 ++-- components/Bullets/Arrow.tscn | 52 ++++++++++--------- components/Characters/Cat.tscn | 11 +++- components/Effects/ShootBlood.tscn | 49 +++++++++++++++++ components/Weapons/Bow.tscn | 4 +- resources/sounds/effect/arrowshot.mp3 | Bin 0 -> 3043 bytes resources/sounds/effect/arrowshot.mp3.import | 19 +++++++ scripts/Contents/Bullets/Arrow.gd | 3 ++ 8 files changed, 115 insertions(+), 33 deletions(-) create mode 100644 components/Effects/ShootBlood.tscn create mode 100644 resources/sounds/effect/arrowshot.mp3 create mode 100644 resources/sounds/effect/arrowshot.mp3.import diff --git a/components/Abstracts/BulletBase.tscn b/components/Abstracts/BulletBase.tscn index d8ce8ef..2a9beb8 100644 --- a/components/Abstracts/BulletBase.tscn +++ b/components/Abstracts/BulletBase.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=8 format=3 uid="uid://crtdkysmnkith"] -[ext_resource type="Script" path="res://scripts/Statemachine/BulletBase.gd" id="1_pklpq"] +[ext_resource type="Script" uid="uid://dp7c02tob106n" path="res://scripts/Statemachine/BulletBase.gd" id="1_pklpq"] [sub_resource type="SpriteFrames" id="SpriteFrames_vypy3"] @@ -31,9 +31,9 @@ resource_name = "spawn" [sub_resource type="AnimationLibrary" id="AnimationLibrary_dxweq"] _data = { -"destroy": SubResource("Animation_oinqg"), -"loop": SubResource("Animation_ynxlt"), -"spawn": SubResource("Animation_kmogx") +&"destroy": SubResource("Animation_oinqg"), +&"loop": SubResource("Animation_ynxlt"), +&"spawn": SubResource("Animation_kmogx") } [sub_resource type="CircleShape2D" id="CircleShape2D_ecl7m"] @@ -48,7 +48,7 @@ sprite_frames = SubResource("SpriteFrames_vypy3") [node name="animator" type="AnimationPlayer" parent="texture"] unique_name_in_owner = true libraries = { -"": SubResource("AnimationLibrary_dxweq") +&"": SubResource("AnimationLibrary_dxweq") } [node name="hitbox" type="CollisionShape2D" parent="."] diff --git a/components/Bullets/Arrow.tscn b/components/Bullets/Arrow.tscn index 7effd8c..40e7924 100644 --- a/components/Bullets/Arrow.tscn +++ b/components/Bullets/Arrow.tscn @@ -4,6 +4,31 @@ [ext_resource type="Texture2D" uid="uid://dadbn306owsy3" path="res://resources/bullets/arrow/arrow.png" id="2_b2ohg"] [ext_resource type="Script" uid="uid://u5x40y0cvqq2" path="res://scripts/Contents/Bullets/Arrow.gd" id="2_qddg0"] +[sub_resource type="Animation" id="Animation_qddg0"] +length = 0.001 +tracks/0/type = "bezier" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("static:position:x") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"handle_modes": PackedInt32Array(0), +"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0), +"times": PackedFloat32Array(0) +} +tracks/1/type = "bezier" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("%hitbox:position:x") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"handle_modes": PackedInt32Array(0), +"points": PackedFloat32Array(8, -0.25, 0, 0.25, 0), +"times": PackedFloat32Array(0) +} + [sub_resource type="Animation" id="Animation_oinqg"] resource_name = "destroy" length = 0.5 @@ -51,31 +76,6 @@ tracks/1/keys = { "times": PackedFloat32Array(0, 1) } -[sub_resource type="Animation" id="Animation_qddg0"] -length = 0.001 -tracks/0/type = "bezier" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("static:position:x") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"handle_modes": PackedInt32Array(0), -"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0), -"times": PackedFloat32Array(0) -} -tracks/1/type = "bezier" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("%hitbox:position:x") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"handle_modes": PackedInt32Array(0), -"points": PackedFloat32Array(8, -0.25, 0, 0.25, 0), -"times": PackedFloat32Array(0) -} - [sub_resource type="AnimationLibrary" id="AnimationLibrary_qddg0"] _data = { &"RESET": SubResource("Animation_qddg0"), @@ -166,3 +166,5 @@ process_material = SubResource("ParticleProcessMaterial_qddg0") [node name="hitbox" parent="." index="1"] position = Vector2(8, 0) shape = SubResource("RectangleShape2D_qddg0") + +[node name="hit" type="AudioStreamPlayer2D" parent="." index="2"] diff --git a/components/Characters/Cat.tscn b/components/Characters/Cat.tscn index 19a6779..e6e1918 100644 --- a/components/Characters/Cat.tscn +++ b/components/Characters/Cat.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=10 format=3 uid="uid://bfkg40awgniv"] +[gd_scene load_steps=11 format=3 uid="uid://bfkg40awgniv"] [ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_hw4g4"] [ext_resource type="Texture2D" uid="uid://cs6se8dighfgj" path="res://resources/characters/cat/cat.png" id="2_q30ge"] @@ -20,6 +20,14 @@ animations = [{ "speed": 5.0 }] +[sub_resource type="SpriteFrames" id="SpriteFrames_hmu5t"] +animations = [{ +"frames": [], +"loop": true, +"name": &"idle", +"speed": 5.0 +}] + [sub_resource type="RectangleShape2D" id="RectangleShape2D_uo67a"] size = Vector2(81, 62) @@ -50,6 +58,7 @@ texture = ExtResource("2_q30ge") [node name="staticAnimation" parent="texture" index="1"] scale = Vector2(1, 1.289) +sprite_frames = SubResource("SpriteFrames_hmu5t") animation = &"idle" [node name="hitbox" parent="texture/hurtbox" index="0"] diff --git a/components/Effects/ShootBlood.tscn b/components/Effects/ShootBlood.tscn new file mode 100644 index 0000000..f20a363 --- /dev/null +++ b/components/Effects/ShootBlood.tscn @@ -0,0 +1,49 @@ +[gd_scene load_steps=10 format=3 uid="uid://mtenc2b01vau"] + +[ext_resource type="PackedScene" uid="uid://bcvuuy2m0pke0" path="res://components/Abstracts/EffectBase.tscn" id="1_yjqwo"] +[ext_resource type="AudioStream" uid="uid://23ttwefh4ej2" path="res://resources/sounds/effect/arrowshot.mp3" id="2_joko4"] + +[sub_resource type="Curve" id="Curve_yjqwo"] +_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_joko4"] +curve = SubResource("Curve_yjqwo") + +[sub_resource type="Gradient" id="Gradient_yjqwo"] +colors = PackedColorArray(0.4321134, 0.4321134, 0.4321134, 1, 1, 1, 1, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_joko4"] +gradient = SubResource("Gradient_yjqwo") + +[sub_resource type="Curve" id="Curve_er1y0"] +_data = [Vector2(0.8, 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_uam1u"] +curve = SubResource("Curve_er1y0") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_yjqwo"] +particle_flag_disable_z = true +spread = 20.0 +initial_velocity_max = 200.0 +gravity = Vector3(0, 0, 0) +damping_max = 100.00001 +scale_min = 2.0 +scale_max = 5.0 +scale_curve = SubResource("CurveTexture_uam1u") +color = Color(1, 0, 0, 1) +color_initial_ramp = SubResource("GradientTexture1D_joko4") +alpha_curve = SubResource("CurveTexture_joko4") + +[node name="ShootBlood" instance=ExtResource("1_yjqwo")] +spawnSound = "spawn" + +[node name="spawn" parent="sounds" index="0"] +stream = ExtResource("2_joko4") +volume_db = 10.0 + +[node name="particles" parent="." index="1"] +visible = false +amount = 50 +process_material = SubResource("ParticleProcessMaterial_yjqwo") diff --git a/components/Weapons/Bow.tscn b/components/Weapons/Bow.tscn index 8df47e6..e30d339 100644 --- a/components/Weapons/Bow.tscn +++ b/components/Weapons/Bow.tscn @@ -11,7 +11,7 @@ displayName = "鸡毛弓" quality = 2 costBeachball = 50 store = { -"atk": 3, +"atk": 2, "count": 1, "self": 1.0 } @@ -42,4 +42,4 @@ displayName = "鸡毛弓" quality = 2 [node name="description" parent="container" index="2"] -text = "[center]消耗[color=cyan]1[/color]点生命值,发射[color=cyan]1[/color]支[b]鸡毛箭[/b],每支造成当前飞行速度的[color=cyan]300%[/color]伤害。[/center]" +text = "[center]消耗[color=cyan]1[/color]点生命值,发射[color=cyan]1[/color]支[b]鸡毛箭[/b],每支造成当前飞行速度的[color=cyan]200%[/color]伤害。[/center]" diff --git a/resources/sounds/effect/arrowshot.mp3 b/resources/sounds/effect/arrowshot.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..1700ce4a35cb3729e28df8554aa7a0f64533314e GIT binary patch literal 3043 zcmdUxXH-+!7Jx4$7zm+*5Sk$HXn`aIMNkZcC?)hzEhv(RG!a7)qo8z#K>;a>ICO@l zC`B1TLsN`25kWvenn9v~f^^L!570I1t+&>==KXo!k9*G9YiFJF-F^4HF*DKO2H5x# za8_8>2nGNyJDiaX&JG}$*s&x0tOyE$Lcoy-I7$Z~I6FJDqLQpA`IIlwEr3WO1`z#D z5CPp?dgxt9U4US3k7H#BvNG_;gGjo1T4#`SHC~>n4*+6_M zqKO;R|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+(oVbig+| z^7T{WO9WV~aCgT$ajV2Vm1|~&{jzAEFAItVPJs@#=!Dn5?cB#Z*qYj>tvlV7Ee_@t zM?r;+o1IcYm$LKPpUYW(8~AF`pC%bX<{Is{pZ>xvM z`*@7KQltIa%qyO?&0gfW-(?=K8n zK$=Q2xrlf*M2y57G7r?|Rp*L9$cEHLDhgV%g_ts<3#)nnH4dNvgUQJS! z9TScg6Uf+QN8EOhS`rR3T8*>e{FLlcEU+wHBRwS*&%>1#!5u^OASa?+WQgm~Daaxx zM(#D*=CJBLEI6hu(-ws~D=NSIgr`@P`Wns2CpD$NLoEBbF%oi}-%E*4H6xqcg1hFT z&3wzp;d)i!nVuVe$mJ_n??!z(*rfOYO2?2Q-+>#y8>qreL~^i9+JM3kmVH#e#wJuWo{E2pXK*2fm=fnBH-18Df~LjSBcf2xuHn*2Z5m@UNm+sly; Syk+^YD?|l=zwYw?wfYk)y9oIJ literal 0 HcmV?d00001 diff --git a/resources/sounds/effect/arrowshot.mp3.import b/resources/sounds/effect/arrowshot.mp3.import new file mode 100644 index 0000000..2744b07 --- /dev/null +++ b/resources/sounds/effect/arrowshot.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://23ttwefh4ej2" +path="res://.godot/imported/arrowshot.mp3-6575c1022246344dab0e0ccd11d5e542.mp3str" + +[deps] + +source_file="res://resources/sounds/effect/arrowshot.mp3" +dest_files=["res://.godot/imported/arrowshot.mp3-6575c1022246344dab0e0ccd11d5e542.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/scripts/Contents/Bullets/Arrow.gd b/scripts/Contents/Bullets/Arrow.gd index 5264d90..b4fab87 100644 --- a/scripts/Contents/Bullets/Arrow.gd +++ b/scripts/Contents/Bullets/Arrow.gd @@ -22,3 +22,6 @@ func ai(): PresetBulletAI.forward(self, rotation) if speed < 1: tryDestroy() +func succeedToHit(_dmg: float, _entity: EntityBase): + var effect = EffectController.create(ComponentManager.getEffect("ShootBlood"), position) + effect.shot()