Refactored unit
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user