1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Bullets/Parrier.gd
T
fallingshrimp 88a9fd5fff feat(子弹): 添加招架子弹的招架率参数
为招架子弹添加可配置的招架率参数,允许控制子弹成功招架的概率
修改招架特效生成位置,使其在招架时更明显
调整测试波次数据以便于开发测试
2026-03-17 06:49:46 +08:00

13 lines
395 B
GDScript

extends BulletBase
class_name ParrierBullet
@export var parryRate: float = 1
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() * 100)
eff.modulate = bullet.modulate
eff.shot()
bullet.tryDestroy()