1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-29 07:21:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Bullets/BossAttack/Bear/LightGun.gd
T
fallingshrimp 8d841b2f7b feat(角色): 更新熊角色资源与攻击逻辑
添加新的熊角色贴图和遮罩资源
实现新的攻击类型7并调整现有攻击逻辑
优化动画和碰撞体设置
移除旧的SVG资源文件
2025-09-14 13:02:00 +08:00

33 lines
1.2 KiB
GDScript

extends BulletBase
@export var allColor: GradientTexture1D = null
@export var length: float = 1000
@onready var track: ShaderStage = $"%track"
@onready var sword: Sprite2D = $"%sword"
@onready var points: GPUParticles2D = $"%points"
var myColor: Color
func register():
speed = 1
damage = 5
penerate = 1
func spawn():
myColor = allColor.gradient.sample(randf())
track.material = track.material.duplicate()
points.process_material = points.process_material.duplicate()
setColor(myColor)
track.size.x = length
TickTool.modifyAnimationKey(animator, "spawn", "sword:position:x", Animation.TrackType.TYPE_BEZIER, 2.5, length / -2)
TickTool.modifyAnimationKey(animator, "spawn", "sword:position:x", Animation.TrackType.TYPE_BEZIER, 3, length / 2)
TickTool.modifyAnimationKey(animator, "spawn", "%hitbox:position:x", Animation.TrackType.TYPE_BEZIER, 2.5, length / -2)
TickTool.modifyAnimationKey(animator, "spawn", "%hitbox:position:x", Animation.TrackType.TYPE_BEZIER, 3, length / 2)
await TickTool.millseconds(2500)
points.emitting = true
func setColor(color: Color):
var result = Color(color)
result.a = 0
track.material.set_shader_parameter("color", result)
sword.modulate = color
points.process_material.color = color