Refactored unit

This commit is contained in:
gamer147
2026-04-08 18:44:58 -04:00
parent c192d48bc4
commit b807e9897d
16 changed files with 239 additions and 154 deletions

View File

@@ -5,10 +5,10 @@ class_name DeployedUnitStats extends Resource
@export var current_sp: int
@export var current_fs: int
func _init() -> void:
_init_stats.call_deferred()
func _init_stats() -> void:
current_hp = unit_stats.max_hp
current_sp = unit_stats.max_sp
current_fs = unit_stats.max_fs
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