package com.pesets.game.skills;

import java.util.Random;

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

public class SkillInstantKill extends Skill {
	
	private Random rand = new Random();

	@Override
	public void cast(Player player, Enemy target) {
		if (rand.nextFloat() < 0.01f * getLevel())
		{
			ResourceManager.getInstance().playSound("sword.mp3");
			target.skillHit(player, (int) (target.getHP() + 2), 0, 0);
		}
	}

	@Override
	public String getName() {
		return "Instant kill";
	}

	@Override
	public ActEvent getEvent() {
		return ActEvent.Attack;
	}

	@Override
	public int getIcon() {
		return 11;
	}

	@Override
	public float getMaxColdown() {
		return 0;
	}
	
	@Override
	public String getDescription() {
		return "(1 * level)% chance to kill the enemy an instant";
	}

}
