game: add player stats and modifiers

This commit is contained in:
2025-08-19 14:23:12 +02:00
parent c95d4341a1
commit 0f0b537921
10 changed files with 91 additions and 51 deletions

View File

@@ -34,12 +34,13 @@ func _physics_process(delta: float) -> void:
deal_damage()
func take_damage(value: float):
func take_damage(value: float, is_crit: bool = false):
if god_mode:
return
health -= value
var dm = preload("res://scenes/damage_numbers.tscn").instantiate()
dm.damage_taken = value
dm.critical_damage = is_crit
add_child(dm)
if health <= 0:
die()