using Godot;
using Newlon.Components;
using System;

namespace Newlon.Systems.Effects;

public partial class SlownessEffect : Effect
{
    [Export] public Color ColorOverride;
    [Export] public float Multiplier;

    public override void Enter(Node target)
    {
        if (target is Entity entity)
        {
            entity.LocalTimescale *= Multiplier;
            entity.Modulate = ColorOverride;
        }
    }

    public override void Exit(Node target)
    {
        if (target is Entity entity)
        {
            entity.LocalTimescale /= Multiplier;
            entity.Modulate = Colors.White;
        }
    }

    public override void Process(Node target)
    {
        
    }
}
