extends Control

@onready var level_label: Label = %LevelLabel
@onready var strength_label: Label = %StrengthScore
@onready var agility_label: Label = %AgilityScore
@onready var speed_label: Label = %SpeedScore
@onready var endurance_label: Label = %EnduranceScore
@onready var attack_damage_value: Label = %AttackDamageValue

@export var player: Player

func _ready() -> void:
	update_stats()

func update_stats() -> void:
	level_label.text = "Level %d" % player.stats.level
	strength_label.text = str(player.stats.strength.score)
	agility_label.text = str(player.stats.agility.score)
	speed_label.text = str(player.stats.speed.score)
	endurance_label.text = str(player.stats.endurance.score)

func update_gear_stats() -> void:
	attack_damage_value.text = str(get_weapon_damage_value())

func get_weapon_damage_value() -> int:
	var damage = 10
	damage += player.stats.strength.get_modifier()
	return damage
