class_name DeployedUnitStats extends Resource

@export var unit_stats: UnitStats
@export var current_hp: int
@export var current_sp: int
@export var current_fs: int

# Passthrough accessors. Future buff/debuff layers can override these
# without mutating the underlying UnitStats template.
var max_hp: int:
	get: return unit_stats.max_hp
var max_sp: int:
	get: return unit_stats.max_sp
var max_fs: int:
	get: return unit_stats.max_fs
var phys_atk: int:
	get: return unit_stats.phys_atk
var phys_def: int:
	get: return unit_stats.phys_def
var magic_atk: int:
	get: return unit_stats.magic_atk
var magic_def: int:
	get: return unit_stats.magic_def
var hit: int:
	get: return unit_stats.hit
var atk_range: int:
	get: return unit_stats.atk_range
var spd: int:
	get: return unit_stats.spd
var eva: int:
	get: return unit_stats.eva
var lck: int:
	get: return unit_stats.lck
var mov: int:
	get: return unit_stats.mov
var level: int:
	get: return unit_stats.level

static func from_unit_stats(source: UnitStats) -> DeployedUnitStats:
	var stats := DeployedUnitStats.new()
	stats.unit_stats = source
	stats.current_hp = source.max_hp
	stats.current_sp = source.max_sp
	stats.current_fs = source.max_fs
	return stats
