1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-27 22:41:56 +08:00

feat(子弹): 为扫帚炮添加追踪开关并调整相关参数

- 在BroomGun中添加canTrace导出变量控制追踪功能
- 调整Broom子弹的碰撞体大小和位置
- 修改EnergyBlock中Broom子弹的速度倍率从2改为3
- 在BroomGun动画中添加canTrace状态控制
This commit is contained in:
2026-05-01 12:50:27 +08:00
parent 6d51795c54
commit c3e5e81a61
4 changed files with 38 additions and 7 deletions
+7 -4
View File
@@ -276,7 +276,7 @@ scale_curve = SubResource("CurveTexture_87bq4")
alpha_curve = SubResource("CurveTexture_p0bgf")
[sub_resource type="RectangleShape2D" id="RectangleShape2D_keubc"]
size = Vector2(252, 39.99996)
size = Vector2(150, 40)
[node name="Broom" unique_id=5571707 instance=ExtResource("1_t7cj0")]
script = ExtResource("2_p0bgf")
@@ -302,13 +302,16 @@ preprocess = 2.0
local_coords = true
process_material = SubResource("ParticleProcessMaterial_87bq4")
[node name="anchor" type="Node2D" parent="texture/broom" index="1" unique_id=614094225]
position = Vector2(-53.598587, 1.325489)
[node name="hitbox" parent="." index="1" unique_id=175349408 node_paths=PackedStringArray("target")]
position = Vector2(200, 1.907981e-05)
rotation = -3.1415925
position = Vector2(225, -117)
rotation = 2.6673002
shape = SubResource("RectangleShape2D_keubc")
disabled = true
script = ExtResource("4_87bq4")
target = NodePath("../texture/broom")
target = NodePath("../texture/broom/anchor")
enablePosition = true
enableRotation = true
enableScale = true
+25
View File
@@ -56,6 +56,18 @@ tracks/3/keys = {
"update": 1,
"values": [true]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("%texture/..:canTrace")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="Animation" id="Animation_uv0o1"]
resource_name = "destroy"
@@ -169,6 +181,18 @@ tracks/6/keys = {
"update": 1,
"values": [true, false, true]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("%texture/..:canTrace")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [true, false]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_jn776"]
_data = {
@@ -198,6 +222,7 @@ size = Vector2(1968, 44)
[node name="BroomGun" unique_id=5571707 instance=ExtResource("1_7ykg5")]
script = ExtResource("2_jn776")
canTrace = true
displayName = "扫帚炮"
baseDamage = 5.0
motionType = 2
+4 -1
View File
@@ -1,7 +1,10 @@
extends BulletBase
class_name BroomGun
@export var canTrace: bool = true
func shake():
CameraManager.shake(2000, 200)
func ai():
PresetBulletAI.trace(self , launcher.currentFocusedPosition, 0.05)
if canTrace:
PresetBulletAI.trace(self , launcher.currentFocusedPosition, 0.05)
+2 -2
View File
@@ -45,11 +45,11 @@ func attack(type: int):
elif type == 3:
for bullet in BulletBase.generate(ComponentManager.getBullet("Broom"), self , getTrackingAnchor(), 0):
if bullet is BroomBullet:
fields[FieldStore.Entity.MOVEMENT_SPEED] *= 2
fields[FieldStore.Entity.MOVEMENT_SPEED] *= 3
await TickTool.frame()
bullet.animator.play("rotate")
await bullet.destroied
fields[FieldStore.Entity.MOVEMENT_SPEED] /= 2
fields[FieldStore.Entity.MOVEMENT_SPEED] /= 3
elif type == 4:
BulletBase.generate(ComponentManager.getBullet("BroomBoomerang"), self , position, position.angle_to_point(currentFocusedPosition))
elif type == 5: