bazar_alea/client/player/Attributes/HealthAttribute.gd

18 lines
359 B
GDScript3
Raw Normal View History

2023-11-14 21:41:08 +00:00
extends GameAttribute
class_name HealthAttribute
@export_category("Visual Bar")
@export var health_bar : ProgressBar
2023-11-19 19:41:38 +00:00
func set_attribute(_prev_v, current_v):
2023-11-14 21:41:08 +00:00
if !attributes_manager:
return
if current_v <= 0.0: # and not dead
pass #death
2023-11-19 19:41:38 +00:00
func _process(_delta):
2023-11-14 21:41:08 +00:00
if health_bar:
health_bar.max_value = maximum_value
health_bar.value = current_value