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/SevenSoul.gd
T
fallingshrimp 949b957696 feat(Bullets): 修改SevenSoul子弹生成逻辑,增加子弹数量
将原本生成一个WhiteSoul子弹改为生成两个,均匀分布在360度范围内
2025-09-26 22:19:02 +08:00

36 lines
1.0 KiB
GDScript

extends BulletBase
var colors = [
"#2BEAFF",
"#FCA500",
"#0042FF",
"#D346D0",
"#0C9B0B",
"#FDEB0F"
]
var index = 0
var spawnedChild = false
@onready var heart = $"%heart"
@onready var effect: GPUParticles2D = $"%effect"
func spawn():
modulate = Color(colors[index % colors.size()])
effect.emitting = true
func ai():
rotation_degrees = 360.0 / colors.size() * index + timeLived() / 20000.0 * 360 - index / 6.0 * 360.0
heart.global_rotation_degrees = 0
PresetBulletAI.lockLauncher(self, launcher, true)
func applyDot():
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()))
await TickTool.millseconds(100)
return true