package org.project.entity.enemies;


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

public class Skeleton extends Enemy{

    public Skeleton(int hp, int mp, Weapon weapon) {
        super(hp,mp,weapon);
        setDefendRate(.3);
    }

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

    @Override
    public void defend() {
        if (getMP() >= 3) {
            super.defend();
            setMP(getMP() - 3);
        }
        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");
        }
    }

    @Override
    public void takeDamage(int damage) {
        super.takeDamage(damage);
        if (getHP() <= 0) {
            setHP(getMaxHP() / 2);
        }
    }


}
