mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-07-01 07:42:30 +08:00
refactor(Bullets): 移除SevenSoul子弹的spawnedChild变量及相关逻辑
简化子弹生成逻辑,移除不再需要的状态变量和循环生成子子弹的代码
This commit is contained in:
@@ -9,7 +9,6 @@ var colors = [
|
|||||||
"#FDEB0F"
|
"#FDEB0F"
|
||||||
]
|
]
|
||||||
var index = 0
|
var index = 0
|
||||||
var spawnedChild = false
|
|
||||||
|
|
||||||
@onready var heart = $"%heart"
|
@onready var heart = $"%heart"
|
||||||
@onready var effect: GPUParticles2D = $"%effect"
|
@onready var effect: GPUParticles2D = $"%effect"
|
||||||
@@ -24,12 +23,6 @@ func ai():
|
|||||||
PresetBulletAI.lockLauncher(self, launcher, true)
|
PresetBulletAI.lockLauncher(self, launcher, true)
|
||||||
func applyDot():
|
func applyDot():
|
||||||
if timeLived() > 20000 * ((6.0 - index) / 6.0):
|
if timeLived() > 20000 * ((6.0 - index) / 6.0):
|
||||||
if !spawnedChild:
|
|
||||||
spawnedChild = true
|
|
||||||
var count = 7
|
|
||||||
for i in count:
|
|
||||||
BulletBase.generate(ComponentManager.getBullet("WhiteSoul"), launcher, heart.global_position, rotation + deg_to_rad(360.0 / count * i))
|
|
||||||
await TickTool.millseconds(50)
|
|
||||||
BulletBase.generate(ComponentManager.getBullet("SoulBall"), launcher, heart.global_position, heart.global_position.angle_to_point(get_global_mouse_position()))
|
BulletBase.generate(ComponentManager.getBullet("SoulBall"), launcher, heart.global_position, heart.global_position.angle_to_point(get_global_mouse_position()))
|
||||||
await TickTool.millseconds(100)
|
await TickTool.millseconds(100)
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user