28 lines
652 B
GDScript3
Raw Normal View History

extends AnimationBase
@onready var texture: TextureRect = $TextureRect
@onready var animationPlayer: AnimationPlayer = $AnimationPlayer
var failIndex: int = 0
var animQueue: Queue = Queue.new()
2024-05-03 19:45:30 -04:00
# Called when the node enters the scene tree for the first time.
func _ready():
if inverted:
attackName = inverseName
2024-05-03 19:45:30 -04:00
func castFailed() -> void:
queue_free()
func setProgress(target: float, final: float = finalProg) -> void:
targetProg = target
finalProg = final
if (index > -1):
animationPlayer.queue(attackName + str(index))
index += 1
func animFinished(s: String):
if (index == finalIndex):
animationFinished.emit(spell)
queue_free()