mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 15:01:53 +08:00
87c392d8a4
修改所有子弹追踪逻辑,统一使用launcher.currentFocusedPosition作为目标位置 在EntityBase中新增currentFocusedPosition字段,用于存储当前焦点位置 调整MTY角色的攻击距离参数,使用常量定义最小招架和攻击距离
26 lines
614 B
GDScript
26 lines
614 B
GDScript
extends BulletBase
|
|
class_name Bow
|
|
|
|
var count: int = 0
|
|
var atk: float = 0
|
|
var waitTime: float = 2000
|
|
|
|
func spawn():
|
|
var startAngle = rotation - deg_to_rad(count * 10.0 / 2)
|
|
for c in count:
|
|
for i in BulletBase.generate(
|
|
ComponentManager.getBullet("Arrow"),
|
|
launcher,
|
|
position,
|
|
startAngle
|
|
):
|
|
var bullet: Arrow = i
|
|
bullet.atk = atk
|
|
bullet.waitTime = waitTime
|
|
bullet.offsetRotation = deg_to_rad(c * 10.0)
|
|
await TickTool.millseconds(waitTime)
|
|
tryDestroy()
|
|
func ai():
|
|
PresetBulletAI.lockLauncher(self , launcher, true)
|
|
rotation = position.angle_to_point(launcher.currentFocusedPosition)
|