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

feat(子弹系统): 添加子弹追踪功能

在EntityBase.gd中添加BULLET_TRACE字段,并在BulletBase.gd中实现追踪逻辑。FieldStore.gd中新增BULLET_TRACE枚举及相关配置,支持百分比类型的追踪强度设置
This commit is contained in:
2025-09-06 10:51:40 +08:00
parent 978eed4b0c
commit 86e14b3bfe
3 changed files with 16 additions and 2 deletions
+9
View File
@@ -59,6 +59,15 @@ func _physics_process(_delta: float) -> void:
if destroying: return
if is_instance_valid(launcher) and (launcher.isPlayer() or is_instance_valid(launcher.currentFocusedBoss)):
launcher.position -= Vector2.from_angle(rotation) * recoil
PresetAIs.trace(
self,
EntityTool.findClosetEntity(position, get_tree(),
!launcher.isPlayer(),
launcher.isPlayer(),
[launcher]
).position,
launcher.fields.get(FieldStore.Entity.BULLET_TRACE) / 10
)
ai()
else:
tryDestroy()