package org.project.abilities;

import org.project.entity.Entity;

public abstract class SpecialAbility {

    public enum AbilityTarget {
        SELF,
        TARGET
    }

    protected String name;
    protected int manaCost;
    protected int duration;
    private final AbilityTarget target;

    public SpecialAbility(String name,int manaCost, int duration, AbilityTarget target) {

        this.name = name;
        this.manaCost = manaCost;
        this.duration = duration;
        this.target = target;
    }

    public AbilityTarget getTarget() {
        return target;
    }

    public String getName() {
        return name;
    }

    public int getManaCost() {return manaCost;}

    public int getDuration() {
        return duration;
    }

    public void reduceDuration() {duration--;}

    public void onApply(Entity target) {System.out.println(target.getName() + " activated " + name);}

    public abstract void onTick(Entity target);

    public void onExpire(Entity target) {}

}

