mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
46ea2fc775
将子弹的伤害属性从`damage`重命名为`baseDamage`,并引入`damageMultipliers`数组支持多段伤害 为火山武器添加三段攻击音效并调整伤害倍率 更新相关武器和子弹脚本以适配新的伤害系统
34 lines
1.2 KiB
GDScript
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
|