mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
refactor(追踪系统): 统一使用getTrackingAnchor方法获取追踪目标位置
修改多个子弹脚本和EntityBase,使用统一的getTrackingAnchor方法获取追踪目标位置 在BulletBase中增加目标有效性检查 调整Wave配置和Rooster武器顺序
This commit is contained in:
@@ -59,15 +59,16 @@ 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
|
||||
)
|
||||
var targetEntity = EntityTool.findClosetEntity(position, get_tree(),
|
||||
!launcher.isPlayer(),
|
||||
launcher.isPlayer(),
|
||||
[launcher] )
|
||||
if is_instance_valid(targetEntity):
|
||||
PresetAIs.trace(
|
||||
self,
|
||||
targetEntity.getTrackingAnchor(),
|
||||
launcher.fields.get(FieldStore.Entity.BULLET_TRACE) / 10
|
||||
)
|
||||
ai()
|
||||
else:
|
||||
tryDestroy()
|
||||
@@ -113,7 +114,8 @@ func tryRefract():
|
||||
var value = launcher.fields.get(FieldStore.Entity.BULLET_REFRACTION)
|
||||
var entity = EntityTool.findClosetEntity(position, get_tree(), !launcher.isPlayer(), launcher.isPlayer())
|
||||
for i in range(MathTool.shrimpRate(value)):
|
||||
refract(entity, i, value, value - floor(value))
|
||||
if is_instance_valid(entity):
|
||||
refract(entity, i, value, value - floor(value))
|
||||
|
||||
# 抽象方法
|
||||
func ai():
|
||||
|
||||
Reference in New Issue
Block a user