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/BossAttack/Bear/LightGun.gd
T
fallingshrimp 46ea2fc775 feat(子弹系统): 重构伤害计算并添加音效
将子弹的伤害属性从`damage`重命名为`baseDamage`,并引入`damageMultipliers`数组支持多段伤害
为火山武器添加三段攻击音效并调整伤害倍率
更新相关武器和子弹脚本以适配新的伤害系统
2025-11-22 08:42:51 +08:00

34 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
baseDamage = 1
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.y = 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):
color.v *= 2
var result = Color(color)
result.a = 0
track.material.set_shader_parameter("laser_color", result)
sword.modulate = color
points.process_material.color = color