mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-02 17:31:55 +08:00
97ac580347
添加乾坤剑的追踪和攻击逻辑,包括命中目标后的效果 调整格挡子弹的伤害值和生成气的逻辑 优化子弹动画和碰撞箱设置 为乾坤剑添加基础伤害和穿透属性
26 lines
793 B
GDScript
26 lines
793 B
GDScript
extends BulletBase
|
|
class_name ParryBallBullet
|
|
|
|
var cycler: CycleTimer
|
|
|
|
func spawn():
|
|
cycler = launcher.getOrCreateCycleTimer("parry")
|
|
cycler.host(self )
|
|
launcher.sprintMultiplier += 1
|
|
func destroy(_beacuseMap: bool):
|
|
launcher.sprintMultiplier -= 1
|
|
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.getTrackingAnchor()) # 生成的乾坤剑面向敌人
|