package com.pesets.game.skills;

import com.pesets.game.Enemy;
import com.pesets.game.Player;

public abstract class Skill {
	public static final int EffectSlow = 0;
	public static final int EffectArmorReduction = 1;
	public static final int EffectStun = 2;
	
	public static enum ActEvent {
		Cast,
		Timer,
		Attack
	}
	protected float coldown = 0;
	private int level = 0;
	
	
	public float getCd()
	{
		return coldown;
	}
	
	public void resetCd() {
		coldown = 0;
	}
	
	public boolean canBeCasted(Player player, Enemy target)
	{
		return coldown <= 0;
	}
	public abstract void cast(Player player, Enemy target);
	public abstract String getName();
	public abstract String getDescription();
	public abstract ActEvent getEvent();
	public abstract int getIcon();
	public abstract float getMaxColdown();
	
	public void setColdown()
	{
		coldown = getMaxColdown();
	}
	
	public int getLevel()
	{
		return level;
	}
	
	public void setLevel(int level)
	{
		this.level = level;
	}
	
	public boolean isPassive() {
		return getEvent().equals(ActEvent.Cast) == false;
	}
	
	public void update(float dt)
	{
		coldown -= dt;
		if (coldown < 0)
			coldown = 0;
	}

}
