package org.project.entity.enemies;

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

public class Goblin extends Enemy{
    public Goblin() {
        super(80,100,new Sword());
        setDefendRate(.5);
    }

    @Override
    public void attack(Entity target) {
        setAttackMultiplier(1.8);
        super.attack(target);
        setAttackMultiplier(1);
    }

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

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