Raise-Your-Wand/Scripts/animationBase.gd
nc5432 847a41eaad Animations and bug fixes
- Converted the rock throw animation to the new system
- Converted the fireball animation to the new system (needs to be inverted still)
- Spell variable now get set to null after use or they get interrupted
- Made some code more readable
2024-05-13 22:38:17 -04:00

21 lines
470 B
GDScript

class_name AnimationBase extends Node2D
signal animationFinished(spell: Spell)
@export var inverted: bool = false
@export var index: int = -1
@export var finalIndex: int = 0
@export var spell: Spell
var attackName: String = "attackSegment"
var inverseName: String = "attackInverse"
var targetProg: float
var finalProg: float
func castFailed() -> void:
pass
func setProgress(target: float, final: float = finalProg) -> void:
targetProg = target
finalProg = final