package org.project.entity.enemies;
import org.project.entity.Entity;
import org.project.item.weapons.Weapon;
import java.util.Random;


public class Goblin extends Enemy {
    private final Random random = new Random();

    public Goblin(Weapon weapon) {
        //Lower health but higher burst damage potential
        super(50, 15, weapon);
    }

    @Override
    public void attack(Entity target) {

        int damage = weapon.getDamage();

        //Has a 35% chance to deal double damage.
        if (random.nextInt(100) < 35) {
            damage *= 2;
        }

        target.takeDamage(damage);
    }
}
