diff --git a/client/player/health/HealthComponent.gd b/client/player/health/HealthComponent.gd index a95b689..b95e574 100644 --- a/client/player/health/HealthComponent.gd +++ b/client/player/health/HealthComponent.gd @@ -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: diff --git a/client/player/health/DamageInstance.gd b/client/player/health/Hit.gd similarity index 51% rename from client/player/health/DamageInstance.gd rename to client/player/health/Hit.gd index 258606c..cf4176f 100644 --- a/client/player/health/DamageInstance.gd +++ b/client/player/health/Hit.gd @@ -1,7 +1,6 @@ -class_name DamageInstance +class_name Hit var damage: float func _init(_damage: float): - damage = _damage - + damage = _damage \ No newline at end of file diff --git a/client/skill/MeleeArea.gd b/client/skill/MeleeArea.gd index d52e5d5..0bd1604 100644 --- a/client/skill/MeleeArea.gd +++ b/client/skill/MeleeArea.gd @@ -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)) \ No newline at end of file + health.take_damage(Hit.new(100)) \ No newline at end of file