diff --git a/scripts/entities/base_enemy.gd b/scripts/entities/base_enemy.gd index ce51afc..bdb8180 100644 --- a/scripts/entities/base_enemy.gd +++ b/scripts/entities/base_enemy.gd @@ -256,11 +256,11 @@ func _handle_attack(action: Dictionary) -> void: ## Damage API -func apply_damage(damage: int) -> void: +func apply_damage(damage: int, attacker: Entity = null) -> void: ## Apply damage through EntityLifecycle via AutoloadHelper var lifecycle: _EntityLifecycle = AutoloadHelper.entity_lifecycle() if lifecycle: - lifecycle.apply_damage(null, entity, damage) + lifecycle.apply_damage(attacker, entity, damage) else: entity.apply_damage(damage) diff --git a/scripts/entities/keeper.gd b/scripts/entities/keeper.gd index e9ecd12..33c6479 100644 --- a/scripts/entities/keeper.gd +++ b/scripts/entities/keeper.gd @@ -59,12 +59,12 @@ func trigger_damage_effect() -> void: ## Apply damage to the Keeper entity and trigger recoil on the apparition. ## Delegates to EntityLifecycle for canonical state transitions. -func apply_damage(damage: int) -> void: +func apply_damage(damage: int, attacker: Entity = null) -> void: if entity == null: return var lifecycle: _EntityLifecycle = AutoloadHelper.entity_lifecycle() if lifecycle: - lifecycle.apply_damage(null, entity, damage) + lifecycle.apply_damage(attacker, entity, damage) else: entity.apply_damage(damage)