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

feat(子弹系统): 新增BREATH运动类型并更新相关子弹配置

- 在BulletBase.gd枚举中添加BREATH运动类型
- 为多种子弹场景文件添加motionType属性配置
- 在Parrier.gd中实现BREATH类型的碰撞处理逻辑
- 更新多个子弹场景文件的格式和唯一ID
This commit is contained in:
2026-04-30 06:45:48 +08:00
parent 64f11d75b2
commit 6afc97ba10
10 changed files with 63 additions and 56 deletions
+5 -4
View File
@@ -1,14 +1,15 @@
[gd_scene load_steps=4 format=3 uid="uid://dse2033lnmr7h"] [gd_scene format=3 uid="uid://dse2033lnmr7h"]
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_qcnih"] [ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_qcnih"]
[ext_resource type="Script" path="res://scripts/Contents/Bullets/ChickSprint.gd" id="2_87hcl"] [ext_resource type="Script" uid="uid://c2cw6tei72cv7" path="res://scripts/Contents/Bullets/ChickSprint.gd" id="2_87hcl"]
[sub_resource type="CircleShape2D" id="CircleShape2D_rirs4"] [sub_resource type="CircleShape2D" id="CircleShape2D_rirs4"]
radius = 63.1269 radius = 63.1269
[node name="BearSprint" instance=ExtResource("1_qcnih")] [node name="BearSprint" unique_id=1809692167 instance=ExtResource("1_qcnih")]
script = ExtResource("2_87hcl") script = ExtResource("2_87hcl")
displayName = "猛冲" displayName = "猛冲"
motionType = 4
[node name="hitbox" parent="." index="1"] [node name="hitbox" parent="." index="1" unique_id=175349408]
shape = SubResource("CircleShape2D_rirs4") shape = SubResource("CircleShape2D_rirs4")
+5 -4
View File
@@ -6,13 +6,13 @@
[ext_resource type="Shader" uid="uid://dfd73rom161o4" path="res://shaders/FilledRing.gdshader" id="5_txsro"] [ext_resource type="Shader" uid="uid://dfd73rom161o4" path="res://shaders/FilledRing.gdshader" id="5_txsro"]
[ext_resource type="Script" uid="uid://cgb01lelfg73p" path="res://scripts/Statemachine/ShaderStage.gd" id="6_6g0ep"] [ext_resource type="Script" uid="uid://cgb01lelfg73p" path="res://scripts/Statemachine/ShaderStage.gd" id="6_6g0ep"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_1mqkh"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_of0mu"]
shader = ExtResource("5_txsro") shader = ExtResource("5_txsro")
shader_parameter/inner = 1.0 shader_parameter/inner = 1.0
shader_parameter/outer = 1.0 shader_parameter/outer = 1.0
shader_parameter/alpha = 1.0 shader_parameter/alpha = 1.0
[sub_resource type="ShaderMaterial" id="ShaderMaterial_5xjim"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_txsro"]
shader = ExtResource("5_txsro") shader = ExtResource("5_txsro")
shader_parameter/inner = 0.98 shader_parameter/inner = 0.98
shader_parameter/outer = 1.0 shader_parameter/outer = 1.0
@@ -84,17 +84,18 @@ script = ExtResource("2_165xl")
displayName = "蹦蹦炸弹" displayName = "蹦蹦炸弹"
speed = 4.0 speed = 4.0
baseDamage = 30.0 baseDamage = 30.0
motionType = 3
lifeTime = 10000.0 lifeTime = 10000.0
autoLoopAnimation = true autoLoopAnimation = true
[node name="warnbg" type="Node2D" parent="." index="0" unique_id=122409585] [node name="warnbg" type="Node2D" parent="." index="0" unique_id=122409585]
material = SubResource("ShaderMaterial_1mqkh") material = SubResource("ShaderMaterial_of0mu")
script = ExtResource("6_6g0ep") script = ExtResource("6_6g0ep")
size = Vector2(250, 125) size = Vector2(250, 125)
color = Color(0, 0, 0, 0.2) color = Color(0, 0, 0, 0.2)
[node name="warn" type="Node2D" parent="." index="1" unique_id=804964529] [node name="warn" type="Node2D" parent="." index="1" unique_id=804964529]
material = SubResource("ShaderMaterial_5xjim") material = SubResource("ShaderMaterial_txsro")
script = ExtResource("6_6g0ep") script = ExtResource("6_6g0ep")
size = Vector2(250, 125) size = Vector2(250, 125)
color = Color(1, 0, 0, 1) color = Color(1, 0, 0, 1)
+1
View File
@@ -150,6 +150,7 @@ _data = {
[node name="BigLaser" unique_id=1993936080 instance=ExtResource("1_ukbip")] [node name="BigLaser" unique_id=1993936080 instance=ExtResource("1_ukbip")]
displayName = "湮灭射线" displayName = "湮灭射线"
motionType = 2
knockback = 10.0 knockback = 10.0
recoil = 4.0 recoil = 4.0
+1
View File
@@ -140,6 +140,7 @@ size = Vector2(734, 56)
script = ExtResource("2_3x2nv") script = ExtResource("2_3x2nv")
speed = -10.0 speed = -10.0
baseDamage = 0.0 baseDamage = 0.0
motionType = 3
penerate = 1.0 penerate = 1.0
lifeTime = 1000.0 lifeTime = 1000.0
autoSpawnAnimation = true autoSpawnAnimation = true
+1
View File
@@ -105,6 +105,7 @@ radius = 76.105194
[node name="Cement" unique_id=5571707 instance=ExtResource("1_aqfa8")] [node name="Cement" unique_id=5571707 instance=ExtResource("1_aqfa8")]
script = ExtResource("2_4j0u0") script = ExtResource("2_4j0u0")
baseDamage = 0.0 baseDamage = 0.0
motionType = 3
penerate = 1.0 penerate = 1.0
autoSpawnAnimation = true autoSpawnAnimation = true
freeAfterSpawn = true freeAfterSpawn = true
+8 -10
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=17 format=3 uid="uid://bvri0nv1jrigf"] [gd_scene format=3 uid="uid://bvri0nv1jrigf"]
[ext_resource type="PackedScene" uid="uid://8gjjfju6p3fh" path="res://components/Bullets/LaserSummoner.tscn" id="1_eb54j"] [ext_resource type="PackedScene" uid="uid://8gjjfju6p3fh" path="res://components/Bullets/LaserSummoner.tscn" id="1_eb54j"]
[ext_resource type="Script" uid="uid://nygobyigq5sp" path="res://scripts/Contents/Bullets/ChickLaser.gd" id="2_7g0f0"] [ext_resource type="Script" uid="uid://nygobyigq5sp" path="res://scripts/Contents/Bullets/ChickLaser.gd" id="2_7g0f0"]
@@ -204,13 +204,13 @@ _data = {
radius = 20.0 radius = 20.0
height = 500.0 height = 500.0
[node name="ChickLaser" instance=ExtResource("1_eb54j")] [node name="ChickLaser" unique_id=1419234842 instance=ExtResource("1_eb54j")]
script = ExtResource("2_7g0f0") script = ExtResource("2_7g0f0")
displayName = "冷冻激光" displayName = "冷冻激光"
penerate = 1.0 motionType = 2
metadata/_edit_vertical_guides_ = [688.0, 189.0] metadata/_edit_vertical_guides_ = [688.0, 189.0]
[node name="rect" parent="texture" index="0"] [node name="rect" parent="texture" parent_id_path=PackedInt32Array(162977358) index="0"]
material = SubResource("ShaderMaterial_x6ivr") material = SubResource("ShaderMaterial_x6ivr")
offset_left = 188.0 offset_left = 188.0
offset_right = 238.0 offset_right = 238.0
@@ -228,15 +228,13 @@ position = Vector2(25, -13.9999)
scale = Vector2(0.525, 0.525) scale = Vector2(0.525, 0.525)
color = Color(0, 0.701961, 1, 1) color = Color(0, 0.701961, 1, 1)
[node name="animator" parent="texture" index="1"] [node name="animator" parent="texture" parent_id_path=PackedInt32Array(162977358) index="1" unique_id=1114087117]
libraries = { libraries/ = SubResource("AnimationLibrary_7qqtc")
&"": SubResource("AnimationLibrary_7qqtc")
}
[node name="circle" parent="texture" index="2"] [node name="circle" parent="texture" parent_id_path=PackedInt32Array(162977358) index="2"]
texture = ExtResource("4_cws6l") texture = ExtResource("4_cws6l")
[node name="hitbox" parent="." index="1"] [node name="hitbox" parent="." index="1" unique_id=175349408]
visible = true visible = true
position = Vector2(438, 0) position = Vector2(438, 0)
shape = SubResource("CapsuleShape2D_sg52j") shape = SubResource("CapsuleShape2D_sg52j")
+5 -4
View File
@@ -1,14 +1,15 @@
[gd_scene load_steps=4 format=3 uid="uid://dpww053pxchsb"] [gd_scene format=3 uid="uid://dpww053pxchsb"]
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_hvhrf"] [ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_hvhrf"]
[ext_resource type="Script" path="res://scripts/Contents/Bullets/ChickSprint.gd" id="2_fecvj"] [ext_resource type="Script" uid="uid://c2cw6tei72cv7" path="res://scripts/Contents/Bullets/ChickSprint.gd" id="2_fecvj"]
[sub_resource type="CircleShape2D" id="CircleShape2D_rirs4"] [sub_resource type="CircleShape2D" id="CircleShape2D_rirs4"]
radius = 63.1269 radius = 63.1269
[node name="ChickSprint" instance=ExtResource("1_hvhrf")] [node name="ChickSprint" unique_id=1294951436 instance=ExtResource("1_hvhrf")]
script = ExtResource("2_fecvj") script = ExtResource("2_fecvj")
displayName = "猛冲" displayName = "猛冲"
motionType = 4
[node name="hitbox" parent="." index="1"] [node name="hitbox" parent="." index="1" unique_id=175349408]
shape = SubResource("CircleShape2D_rirs4") shape = SubResource("CircleShape2D_rirs4")
+33 -34
View File
@@ -1,8 +1,34 @@
[gd_scene load_steps=7 format=3 uid="uid://db2cbgyyjpydp"] [gd_scene format=3 uid="uid://db2cbgyyjpydp"]
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_cqre5"] [ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_cqre5"]
[ext_resource type="PackedScene" uid="uid://dny25qkcvtaa2" path="res://components/Effects/FirePot.tscn" id="3_ybjor"] [ext_resource type="PackedScene" uid="uid://dny25qkcvtaa2" path="res://components/Effects/FirePot.tscn" id="3_ybjor"]
[sub_resource type="Animation" id="Animation_ikuic"]
length = 0.001
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("%hitbox: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 = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("%texture/..:damage")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [10.0]
}
[sub_resource type="Animation" id="Animation_ybjor"] [sub_resource type="Animation" id="Animation_ybjor"]
resource_name = "spawn" resource_name = "spawn"
step = 0.05 step = 0.05
@@ -44,32 +70,6 @@ tracks/2/keys = {
"values": [15.0, 0.0] "values": [15.0, 0.0]
} }
[sub_resource type="Animation" id="Animation_ikuic"]
length = 0.001
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("%hitbox: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 = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("%texture/..:damage")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [10.0]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_ikuic"] [sub_resource type="AnimationLibrary" id="AnimationLibrary_ikuic"]
_data = { _data = {
&"RESET": SubResource("Animation_ikuic"), &"RESET": SubResource("Animation_ikuic"),
@@ -79,19 +79,18 @@ _data = {
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4qcsn"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_4qcsn"]
size = Vector2(10, 100) size = Vector2(10, 100)
[node name="FireScan" instance=ExtResource("1_cqre5")] [node name="FireScan" unique_id=1266932369 instance=ExtResource("1_cqre5")]
displayName = "雪葬" displayName = "雪葬"
motionType = 2
penerate = 1.0 penerate = 1.0
autoSpawnAnimation = true autoSpawnAnimation = true
freeAfterSpawn = true freeAfterSpawn = true
metadata/_edit_vertical_guides_ = [488.0] metadata/_edit_vertical_guides_ = [488.0]
[node name="animator" parent="texture" index="0"] [node name="animator" parent="texture" parent_id_path=PackedInt32Array(162977358) index="0" unique_id=1114087117]
libraries = { libraries/ = SubResource("AnimationLibrary_ikuic")
&"": SubResource("AnimationLibrary_ikuic")
}
[node name="hitbox" parent="." index="1"] [node name="hitbox" parent="." index="1" unique_id=175349408]
shape = SubResource("RectangleShape2D_4qcsn") shape = SubResource("RectangleShape2D_4qcsn")
[node name="firePot" parent="." index="2" instance=ExtResource("3_ybjor")] [node name="firePot" parent="." index="2" unique_id=897032100 instance=ExtResource("3_ybjor")]
+3
View File
@@ -57,6 +57,9 @@ func hitBullet(bullet: BulletBase): # 当前子弹与其他子弹相撞
elif bullet.motionType == BulletBase.MotionType.SPRINT: elif bullet.motionType == BulletBase.MotionType.SPRINT:
bullet.tryDestroy() bullet.tryDestroy()
bullet.launcher.velocity *= -0.1 bullet.launcher.velocity *= -0.1
elif bullet.motionType == BulletBase.MotionType.BREATH:
bullet.hitbox.disable = true
bullet.launcher.impluse(Vector2.from_angle(bullet.rotation) * -500)
elif bullet.motionType == BulletBase.MotionType.SUMMON || bullet.motionType == BulletBase.MotionType.MAGIC: elif bullet.motionType == BulletBase.MotionType.SUMMON || bullet.motionType == BulletBase.MotionType.MAGIC:
launcher.storeEnergy(sqrt(bullet.baseDamage)) launcher.storeEnergy(sqrt(bullet.baseDamage))
var cycler = launcher.getOrCreateCycleTimer("parry", 2000, 100) var cycler = launcher.getOrCreateCycleTimer("parry", 2000, 100)
+1
View File
@@ -7,6 +7,7 @@ enum MotionType {
MAGIC, # 魔法 MAGIC, # 魔法
SUMMON, # 召唤 SUMMON, # 召唤
SPRINT, # 冲撞 SPRINT, # 冲撞
BREATH, # 吐息
} }
@export var displayName: String = "未知子弹" @export var displayName: String = "未知子弹"