package org.project.entity.enemies;

import org.project.entity.Entity;
import org.project.item.weapons.Weapon;

public class Goblin extends Enemy{
    public Goblin(int hp, int mp, Weapon weapon) {
        super(hp,mp,weapon);
        setDefendRate(.5);
    }

    @Override
    public void attack(Entity target, double multiplier) {
        if (getMP() > 5) {
            super.attack(target,2);
            setMP(getMP() - 5);
        }
        else {
            System.out.println("Not enough MP");
        }
    }

    @Override
    public void defend() {
        if (getMP() >= 5) {
            super.defend();
            setMP(getMP() - 5);
        }
        else {
            System.out.println("Not enough MP");
        }
    }

    @Override
    public void heal(int health) {
        if (getMP() >= 6) {
            super.heal(health);
            setMP(getMP() - 6);
        }
        else  {
            System.out.println("Not enough MP");
        }
    }
}
