1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00

feat(子弹系统): 完善乾坤剑和格挡子弹的逻辑

添加乾坤剑的追踪和攻击逻辑,包括命中目标后的效果
调整格挡子弹的伤害值和生成气的逻辑
优化子弹动画和碰撞箱设置
为乾坤剑添加基础伤害和穿透属性
This commit is contained in:
2026-03-19 22:58:50 +08:00
parent cc4b91797d
commit 97ac580347
6 changed files with 82 additions and 62 deletions
+7 -5
View File
@@ -3,17 +3,19 @@ class_name ParrierBullet
@export var parryRate: float = 1
func hitBullet(bullet: BulletBase):
if BulletTool.canDamage(bullet, launcher):
func hitBullet(bullet: BulletBase): # 当前子弹与其他子弹相撞
if BulletTool.canDamage(bullet, launcher): # 其他子弹可以使当前子弹的发射者受伤吗?
if MathTool.rate(parryRate):
var eff = EffectController.create(ComponentManager.getEffect("Parry"), position + (bullet.position - position).normalized() * 150)
# 生成格挡特效
var eff = EffectController.create(ComponentManager.getEffect("Parry"), position + (bullet.position - position).normalized() * 150) # 从子弹位置,面向其他子弹的方向前进150
eff.modulate = bullet.modulate.blend(bullet.texture.modulate)
eff.shot()
# 摧毁其他子弹
bullet.tryDestroy()
var cycler = launcher.getOrCreateCycleTimer("parry", 2000, 100)
if len(cycler.bullets) < 5:
if len(cycler.bullets) < 5: # 玩家最多只能拥有5点气
for b in BulletBase.generate(
ComponentManager.getBullet("ParryBall"),
ComponentManager.getBullet("ParryBall"), # 生成气的子弹
launcher,
position,
0