Renamed damage instance

This commit is contained in:
Eduard Urbach 2024-02-13 23:49:58 +01:00
parent d87d4c9e3f
commit 60783f7166
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0
3 changed files with 5 additions and 6 deletions

View File

@ -18,11 +18,11 @@ func restore():
value = max_value
value_changed.emit()
func take_damage(attack: DamageInstance):
func take_damage(hit: Hit):
if !is_alive:
return
value = clampf(value - attack.damage, 0, max_value)
value = clampf(value - hit.damage, 0, max_value)
value_changed.emit()
if value < DEATH_THRESHOLD:

View File

@ -1,7 +1,6 @@
class_name DamageInstance
class_name Hit
var damage: float
func _init(_damage: float):
damage = _damage

View File

@ -4,4 +4,4 @@ func on_body_entered(body: Node3D):
var health := body.get_node_or_null("Health") as HealthComponent
if health:
health.take_damage(DamageInstance.new(100))
health.take_damage(Hit.new(100))