1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-07-02 08:12:12 +08:00

feat(战斗系统): 添加新武器"树"及其配套子弹和特效

实现新的近战武器"树",包含以下内容:
- 添加武器Tree.gd脚本及场景资源
- 新增Parrier子弹类型,支持子弹碰撞检测和反弹效果
- 添加武器攻击音效和子弹命中特效
- 修改BulletBase.gd以支持子弹间碰撞逻辑
- 更新角色预设装备新武器
This commit is contained in:
2026-03-16 23:35:22 +08:00
parent ff9273ca29
commit 5cb1e27a08
33 changed files with 680 additions and 8 deletions
+120
View File
@@ -0,0 +1,120 @@
[gd_scene load_steps=9 format=3 uid="uid://brt2q316hrswe"]
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_57y3f"]
[ext_resource type="Script" uid="uid://bi7nde2rs0w4m" path="res://scripts/Contents/Bullets/Parrier.gd" id="2_li4th"]
[ext_resource type="Texture2D" uid="uid://cajy8iya7achn" path="res://resources/bullets/parrier/造型2.png" id="3_ksxds"]
[sub_resource type="SpriteFrames" id="SpriteFrames_hu1af"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("3_ksxds")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="Animation" id="Animation_ksxds"]
resource_name = "spawn"
step = 0.1
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:scale:x")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(0, 2, 2),
"points": PackedFloat32Array(0.4, -0.25, 0, 0, 0, 0.5, -0.1, 0, 0.8, 0, 0, 0, 0, 0, 0),
"times": PackedFloat32Array(0, 0.2, 1)
}
tracks/1/type = "bezier"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:scale:y")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"handle_modes": PackedInt32Array(2, 2, 2),
"points": PackedFloat32Array(0.4, 0, 0, 0, 0, 0.5, -0.1, 0, 0.8, 0, 0, 0, 0, 0, 0),
"times": PackedFloat32Array(0, 0.2, 1)
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath(".:modulate")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.2, 0.5, 1),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
[sub_resource type="Animation" id="Animation_hu1af"]
length = 0.001
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:scale: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(".:scale:y")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0)
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath(".:modulate")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_k4ctn"]
_data = {
&"RESET": SubResource("Animation_hu1af"),
&"spawn": SubResource("Animation_ksxds")
}
[sub_resource type="RectangleShape2D" id="RectangleShape2D_57y3f"]
size = Vector2(26, 102)
[node name="Parrier" instance=ExtResource("1_57y3f")]
script = ExtResource("2_li4th")
speed = 5.0
baseDamage = 0.0
penerate = 1.0
autoSpawnAnimation = true
freeAfterSpawn = true
[node name="texture" parent="." index="0"]
scale = Vector2(1e-05, 1e-05)
sprite_frames = SubResource("SpriteFrames_hu1af")
[node name="animator" parent="texture" index="0"]
libraries = {
&"": SubResource("AnimationLibrary_k4ctn")
}
[node name="hitbox" parent="." index="1"]
shape = SubResource("RectangleShape2D_57y3f")
+11 -3
View File
@@ -1,8 +1,9 @@
[gd_scene load_steps=20 format=3 uid="uid://dky8574uqc18r"]
[gd_scene load_steps=21 format=3 uid="uid://dky8574uqc18r"]
[ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_e5pl8"]
[ext_resource type="Script" uid="uid://cthtupc6dtbav" path="res://scripts/Contents/Characters/Rooster.gd" id="2_oqdqd"]
[ext_resource type="PackedScene" uid="uid://c65tbxm3tclw0" path="res://components/Weapons/Hetun.tscn" id="3_da2ca"]
[ext_resource type="PackedScene" uid="uid://cx7nogfnv7s8t" path="res://components/Weapons/Tree.tscn" id="3_0omr3"]
[ext_resource type="PackedScene" uid="uid://c0n3igy4hucrg" path="res://components/Weapons/PurpleCrystal.tscn" id="4_0omr3"]
[ext_resource type="AudioStream" uid="uid://cdrevrq7n6yqa" path="res://resources/sounds/effect/Boing.mp3" id="4_66s6c"]
[ext_resource type="AudioStream" uid="uid://benyec5bqni0b" path="res://resources/sounds/effect/Chomp.wav" id="4_k0yme"]
[ext_resource type="AudioStream" uid="uid://dmxh3bpk8vyy5" path="res://resources/sounds/effect/Coin.mp3" id="5_xnbhq"]
@@ -101,9 +102,16 @@ process_material = SubResource("ParticleProcessMaterial_joj4g")
[node name="weaponStore" parent="." index="2"]
process_mode = 4
[node name="Hetun" parent="weaponStore" index="0" instance=ExtResource("3_da2ca")]
[node name="PurpleCrystal" parent="weaponStore" index="0" instance=ExtResource("4_0omr3")]
offset_left = 30.0
offset_top = 20.0
offset_right = 359.0
offset_bottom = 370.0
debugRebuild = false
[node name="Tree" parent="weaponStore" index="1" instance=ExtResource("3_0omr3")]
offset_bottom = 350.0
[node name="sprint" parent="sounds" index="0"]
stream = ExtResource("4_66s6c")
+86
View File
@@ -0,0 +1,86 @@
[gd_scene load_steps=14 format=3 uid="uid://bwbhxnuhmkwww"]
[ext_resource type="PackedScene" uid="uid://bcvuuy2m0pke0" path="res://components/Abstracts/EffectBase.tscn" id="1_vc7s4"]
[ext_resource type="Texture2D" uid="uid://bdvyebq7sepqf" path="res://resources/effects/parry/ParrySparkAccurate0.png" id="2_kic6n"]
[ext_resource type="AudioStream" uid="uid://caxopva6lrlm3" path="res://resources/sounds/effect/swordhit.ogg" id="2_l0pl0"]
[ext_resource type="Texture2D" uid="uid://bsq0s07h5u6fp" path="res://resources/effects/parry/ParrySparkAccurate1.png" id="3_l0pl0"]
[ext_resource type="Texture2D" uid="uid://myolsnuud6jk" path="res://resources/effects/parry/ParrySparkAccurate2.png" id="4_buxs5"]
[ext_resource type="Texture2D" uid="uid://cu72mlaga1ge4" path="res://resources/effects/parry/ParrySparkAccurate3.png" id="5_471em"]
[ext_resource type="Texture2D" uid="uid://25kjjcrbbm70" path="res://resources/effects/parry/ParrySparkAccurate4.png" id="6_tu1jt"]
[ext_resource type="Texture2D" uid="uid://2jjv833hjn0o" path="res://resources/effects/parry/ParrySparkAccurate5.png" id="7_f5km5"]
[ext_resource type="Texture2D" uid="uid://cvommbyvqfp1p" path="res://resources/effects/parry/ParrySparkAccurate6.png" id="8_molrd"]
[ext_resource type="Texture2D" uid="uid://rv10oe25rb6c" path="res://resources/effects/parry/ParrySparkAccurate.png" id="9_76bi2"]
[sub_resource type="Animation" id="Animation_kic6n"]
resource_name = "spawn"
step = 0.1
tracks/0/type = "method"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("%stage/../texture")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [&"default", 1.0, false],
"method": &"play"
}]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_l0pl0"]
_data = {
&"spawn": SubResource("Animation_kic6n")
}
[sub_resource type="SpriteFrames" id="SpriteFrames_qcypm"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("2_kic6n")
}, {
"duration": 1.0,
"texture": ExtResource("3_l0pl0")
}, {
"duration": 1.0,
"texture": ExtResource("4_buxs5")
}, {
"duration": 1.0,
"texture": ExtResource("5_471em")
}, {
"duration": 1.0,
"texture": ExtResource("6_tu1jt")
}, {
"duration": 1.0,
"texture": ExtResource("7_f5km5")
}, {
"duration": 1.0,
"texture": ExtResource("8_molrd")
}, {
"duration": 1.0,
"texture": ExtResource("9_76bi2")
}],
"loop": false,
"name": &"default",
"speed": 10.0
}]
[node name="Parry" instance=ExtResource("1_vc7s4")]
spawnSound = "spawn"
spawnAnimation = "spawn"
[node name="spawn" parent="sounds" index="0"]
stream = ExtResource("2_l0pl0")
[node name="animator" parent="stage" index="0"]
libraries = {
&"": SubResource("AnimationLibrary_l0pl0")
}
[node name="texture" type="AnimatedSprite2D" parent="." index="3"]
modulate = Color(0.5922946, 1, 0.5, 1)
scale = Vector2(0.5, 0.5)
sprite_frames = SubResource("SpriteFrames_qcypm")
frame = 7
frame_progress = 1.0
+8
View File
@@ -0,0 +1,8 @@
[gd_scene load_steps=3 format=3 uid="uid://cx7nogfnv7s8t"]
[ext_resource type="PackedScene" uid="uid://ckq2cq6m23hq3" path="res://components/Abstracts/WeaponCardBase.tscn" id="1_0lbwr"]
[ext_resource type="Script" uid="uid://bqdyhwcd4jwmj" path="res://scripts/Contents/Weapons/Tree.gd" id="2_jsuc8"]
[node name="Tree" instance=ExtResource("1_0lbwr")]
script = ExtResource("2_jsuc8")
cooldown = 500.0