mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
88a9fd5fff
为招架子弹添加可配置的招架率参数,允许控制子弹成功招架的概率 修改招架特效生成位置,使其在招架时更明显 调整测试波次数据以便于开发测试
13 lines
395 B
GDScript
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()
|