1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-02 17:31:55 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Bullets/ParryBall.gd
T
fallingshrimp 97ac580347 feat(子弹系统): 完善乾坤剑和格挡子弹的逻辑
添加乾坤剑的追踪和攻击逻辑,包括命中目标后的效果
调整格挡子弹的伤害值和生成气的逻辑
优化子弹动画和碰撞箱设置
为乾坤剑添加基础伤害和穿透属性
2026-03-19 22:58:50 +08:00

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()) # 生成的乾坤剑面向敌人