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 SkillCrit extends Skill {
	private Random rand = new Random();
	
	@Override
	public void cast(Player player, Enemy target) {
		if (rand.nextFloat() < 0.03f * getLevel())
		{
			target.hit(player);
			ResourceManager.getInstance().playSound("sword.mp3");
		}
	}

	@Override
	public String getName() {
		return "Critical Strike";
	}

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

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

	@Override
	public float getMaxColdown() {
		return 0;
	}
	
	@Override
	public String getDescription() {
		return "(3 * level)% chance to deal double damage on attack";
	}

}
