1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-08 04:37:13 +08:00

feat(角色): 添加狗角色音效和攻击冷却随机化

添加狗角色的受伤音效文件并配置导入设置
修改狗的攻击冷却时间为3000-5000毫秒随机值
调整狗角色的受伤音效播放几率为30%
为狗角色添加碰撞检测形状
This commit is contained in:
2025-11-16 14:42:48 +08:00
parent 9e77b720d6
commit b7638fa9b6
9 changed files with 96 additions and 3 deletions
+20 -1
View File
@@ -1,8 +1,9 @@
[gd_scene load_steps=6 format=3 uid="uid://bb363wvwvs7m4"]
[gd_scene load_steps=9 format=3 uid="uid://bb363wvwvs7m4"]
[ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_cbgnh"]
[ext_resource type="Texture2D" uid="uid://cew1kecisufy4" path="res://resources/characters/dog/hsq.png" id="2_oospf"]
[ext_resource type="Script" uid="uid://soehdxfbpmc0" path="res://scripts/Contents/Characters/Dog.gd" id="2_pb36u"]
[ext_resource type="AudioStream" uid="uid://cgnqvldnkxjtr" path="res://resources/sounds/effect/doghurt2.wav" id="3_tn3v8"]
[sub_resource type="SpriteFrames" id="SpriteFrames_pb36u"]
animations = [{
@@ -28,9 +29,19 @@ animations = [{
"speed": 5.0
}]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_e644g"]
size = Vector2(118, 64)
[sub_resource type="CircleShape2D" id="CircleShape2D_s2gll"]
radius = 27.018513
[node name="Dog" instance=ExtResource("1_cbgnh")]
script = ExtResource("2_pb36u")
displayName = "哈士奇"
hurtAudioRate = 0.3
[node name="hurt" parent="sounds" index="3"]
stream = ExtResource("3_tn3v8")
[node name="texture" parent="." index="3"]
sprite_frames = SubResource("SpriteFrames_pb36u")
@@ -41,6 +52,14 @@ scale = Vector2(0.35093215, 0.35093215)
sprite_frames = SubResource("SpriteFrames_tn3v8")
animation = &"idle"
[node name="hitbox" parent="texture/hurtbox" index="0"]
position = Vector2(-14, -22)
shape = SubResource("RectangleShape2D_e644g")
[node name="hitbox2" type="CollisionShape2D" parent="texture/hurtbox" index="1"]
position = Vector2(46, -51)
shape = SubResource("CircleShape2D_s2gll")
[node name="normal" type="Node2D" parent="texture/weapons" index="0"]
position = Vector2(53, -35)