Better status effects

This commit is contained in:
2025-03-02 02:50:05 +01:00
parent 9054777a05
commit a562079d71
17 changed files with 192 additions and 102 deletions

View File

@@ -0,0 +1,22 @@
class_name EffectInflictorComponent
extends Node
@export var damage: DamageComponent
func _ready() -> void:
if not damage:
printerr("No damage component assigned!")
return
damage.effect_inflicted.connect(on_effect_inflicted)
func on_effect_inflicted(target: Node2D, effect: StatusEffectDataResource) -> void:
var status_effect_component: StatusEffectComponent = target.get_node_or_null("StatusEffectComponent")
if not status_effect_component:
return
status_effect_component.apply_effect(effect)