mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat(子弹系统): 添加QKSword子弹及其处理逻辑
实现QKSword子弹类型,包括子弹行为、生成逻辑和命中效果 - 新增QKSwordBullet类,实现追踪目标功能 - 新增QKSwordHandler处理命中后的子弹生成 - 修改ParryBall使其命中时生成QKSword子弹 - 调整CycleTimer的子弹偏移计算 - 为BulletBase添加afterSpawn回调
This commit is contained in:
@@ -9,3 +9,14 @@ func spawn():
|
||||
func ai():
|
||||
PresetBulletAI.selfRotate(self , 5)
|
||||
hitbox.disabled = !launcher.sprinting
|
||||
func succeedToHit(_dmg: float, entity: EntityBase):
|
||||
for bullet in BulletBase.generate(
|
||||
ComponentManager.getBullet("QKSword"),
|
||||
launcher,
|
||||
entity.position,
|
||||
0
|
||||
):
|
||||
if bullet is QKSwordBullet:
|
||||
bullet.position = entity.texture.global_position + MathTool.sampleInRing(50, 200)
|
||||
bullet.tracer = entity
|
||||
bullet.look_at(entity.position)
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
extends BulletBase
|
||||
class_name QKSwordBullet
|
||||
|
||||
var tracer: EntityBase
|
||||
|
||||
func ai():
|
||||
if is_instance_valid(tracer):
|
||||
look_at(tracer.position)
|
||||
if timeLived() > 1000:
|
||||
PresetBulletAI.forward(self , rotation)
|
||||
@@ -0,0 +1 @@
|
||||
uid://chyrnrbgcudmk
|
||||
@@ -0,0 +1,14 @@
|
||||
extends BulletBase
|
||||
class_name QKSwordHandler
|
||||
|
||||
func succeedToHit(_dmg: float, entity: EntityBase):
|
||||
for bullet in BulletBase.generate(
|
||||
ComponentManager.getBullet("QKSword"),
|
||||
launcher,
|
||||
entity.position,
|
||||
0
|
||||
):
|
||||
if bullet is QKSwordBullet:
|
||||
bullet.position = entity.texture.global_position + MathTool.sampleInRing(50, 200)
|
||||
bullet.tracer = entity
|
||||
bullet.look_at(entity.position)
|
||||
@@ -0,0 +1 @@
|
||||
uid://cmph2bim5oro5
|
||||
Reference in New Issue
Block a user