mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 15:01:53 +08:00
feat(子弹): 添加招架子弹的招架率参数
为招架子弹添加可配置的招架率参数,允许控制子弹成功招架的概率 修改招架特效生成位置,使其在招架时更明显 调整测试波次数据以便于开发测试
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
extends BulletBase
|
||||
class_name ParrierBullet
|
||||
|
||||
@export var parryRate: float = 1
|
||||
|
||||
func hitBullet(bullet: BulletBase):
|
||||
if BulletTool.canDamage(bullet, launcher):
|
||||
var eff = EffectController.create(ComponentManager.getEffect("Parry"), position)
|
||||
eff.modulate = bullet.modulate
|
||||
eff.shot()
|
||||
bullet.tryDestroy()
|
||||
tryDestroy()
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user