mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
6e0d0ad89b
为EntityBase添加getCycleTimer方法以直接获取计时器 修改CycleTimer的forceFilter方法以检查子弹是否正在销毁 更新InfinitySword的hitBullet逻辑以处理内部伤害子弹
29 lines
931 B
GDScript
29 lines
931 B
GDScript
extends BulletBase
|
|
class_name InfinitySwordBullet
|
|
|
|
var implused: Array[EntityBase] = []
|
|
var rate2: float = 0
|
|
|
|
func spawn():
|
|
CameraManager.shake(2000, 100)
|
|
func ai():
|
|
PresetBulletAI.forward(self , rotation)
|
|
func succeedToHit(_dmg: float, entity: EntityBase):
|
|
if implused.has(entity): return
|
|
else:
|
|
implused.append(entity)
|
|
entity.impluse(Vector2.from_angle(rotation) * 1500)
|
|
var eff = EffectController.create(ComponentManager.getEffect("ShootBlood"), entity.position)
|
|
eff.particles.hide()
|
|
eff.shot()
|
|
func hitBullet(bullet: BulletBase):
|
|
if !is_instance_valid(launcher): return
|
|
if BulletTool.canDamage(bullet, launcher):
|
|
baseDamage *= rate2 ** bullet.getDamage()
|
|
var cycler = launcher.getCycleTimer("internalDamages")
|
|
if cycler is CycleTimer:
|
|
if len(cycler.bullets) > 0:
|
|
InternalDamageBullet.generateBall(launcher, bullet.launcher, sqrt(baseDamage))
|
|
cycler.bullets[0].tryDestroy()
|
|
cycler.forceFilter()
|