game: add player stats and modifiers
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user