extends Node


var max_health = 50
var health = max_health


func get_health():
	return health
	
func take_damage(amount):
	health -= amount
	get_tree().call_group("player","reset_regen")
	if health <= 0:
		get_tree().call_group("player","die")
		get_tree().call_group("deathmenu","show_menu")
		
func heal(amount):
	health += amount
	if health > max_health:
		health = max_health
