class_name QuestorSprite extends QuestSprite


var data : Adventurer = null

func _ready() -> void:
	if data:		
		life = data.life
		max_life = data.max_life
		energy = data.energy
		max_energy = data.max_energy
		level = data.level
		exp = data.exp
		stats = StatBlock.copy(data.stats)
		gold = data.gold

func set_animation(anim_name : String) -> void:
	anim_player.play(anim_name)

func setup(adv : Adventurer) -> void:
	data = adv
	life = data.life
	max_life = data.max_life
	energy = data.energy
	max_energy = data.max_energy
	level = data.level
	exp = data.exp
	stats = StatBlock.copy(data.stats)
	gold = data.gold
	adv.quest_sprite = self

func check_levelup() -> void:
	data.gain_exp(exp)
