class_name IceFieldAbility extends Ability

@export var field_radius: float = 150.0
@export var damage_per_second: float = 5.0
@export var slow_amount: float = 0.5

var field_instance: Node2D

func _init():
    cooldown = 10.0
    effect_duration = 6.0

func _start_ability():
    field_instance = preload("scenes/ice_field.tscn").instantiate()
    field_instance.global_position = global_position
    field_instance.radius = field_radius
    field_instance.damage = damage_per_second
    field_instance.slow = slow_amount
    get_tree().root.add_child(field_instance)
    
func _end_ability():
    if is_instance_valid(field_instance):
        field_instance.queue_free()