package org.project.entity.enemies;

import org.project.entity.players.Player;

public class Goblin extends Enemy {

    private final static EnemyStats stats = new EnemyStats(60, 12, 20);
    private final double critChance;
    private final double critMultiplier;

    public Goblin() {
        super(stats);
        critChance = 0.25;
        critMultiplier = 1.8;
    }

    @Override
    public void attack(Player target) {

        if(Math.random()<critChance && !isStunned()) {
            target.takeDamage((int) (stats.damage * critMultiplier));
            if(!target.isDefending()) System.out.println("The goblin landed a critical hit!");
        }
        else
            super.attack(target);

    }

    @Override
    public String getType() {
        return "Goblin";
    }
}
