mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
327afcc721
实现小鸡的冲刺攻击能力,包括: 1. 新增ChickSprint子弹类型及场景 2. 为EntityBase添加拖尾粒子效果 3. 添加攻击蓄力特效和音效 4. 调整小鸡的攻击冷却时间和冲刺倍率 5. 优化TickTool工具类添加until方法 6. 修改世界背景z-index避免遮挡 调整战斗平衡性: 1. 降低默认冲刺倍率 2. 修改测试波次配置 3. 增加新的攻击方式选项
32 lines
842 B
GDScript
32 lines
842 B
GDScript
extends Node2D
|
|
class_name EffectController
|
|
|
|
@export var oneShot: bool = true
|
|
@export var spawnSound: String = ""
|
|
|
|
@onready var particles: GPUParticles2D = $"%particles"
|
|
@onready var sounds = $"%sounds"
|
|
|
|
func _ready():
|
|
particles.emitting = false
|
|
particles.one_shot = oneShot
|
|
var sound = sounds.get_node_or_null(spawnSound)
|
|
if sound and sound.stream:
|
|
sound.play()
|
|
func shot():
|
|
var cloned = particles.duplicate() as GPUParticles2D
|
|
cloned.emitting = true
|
|
add_child(cloned)
|
|
if oneShot:
|
|
await cloned.finished
|
|
cloned.queue_free()
|
|
|
|
static func create(scene: PackedScene, spawnPosition: Vector2, parent: Node2D = null) -> EffectController:
|
|
var cloned = scene.instantiate() as EffectController
|
|
cloned.global_position = spawnPosition
|
|
if parent:
|
|
parent.add_child(cloned)
|
|
else:
|
|
WorldManager.rootNode.add_child(cloned)
|
|
return cloned
|