
- Implemented more animations - Added spell HUD - Fixed interrupted spell cooldowns - Fixed getting stunned when all damage is blocked - Added export presets
17 lines
482 B
GDScript
17 lines
482 B
GDScript
class_name HudController extends Control
|
|
|
|
@onready var data: Data = $/root/Root/Data
|
|
@export var slots: Array[SpellSlot]
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
for i in range(data.spellbook.spells.size()):
|
|
if (data.spellbook.spells == null): break
|
|
slots[i].setSpell(data.spellbook.spells[i])
|
|
|
|
func spellCast(spell: Spell, cooldown: float):
|
|
for slot: SpellSlot in slots:
|
|
if slot.spell == spell:
|
|
slot.spellCast(cooldown)
|
|
return
|