package org.project.entity.enemies;

import org.project.entity.Entity;


public abstract class Enemy implements Entity {

    protected int hp;
    protected int mp;
    protected int maxHp;
    protected int maxMp;

    public Enemy(int hp, int mp) {
        this.hp = hp;
        this.mp = mp;
        this.maxHp = hp;
        this.maxMp = mp;

    }

    @Override
    public void takeDamage(int damage) {
        hp -= damage;
        if (hp < 0) hp = 0;
    }

    @Override
    public void LightAttack(Entity target, int damage) {
        target.takeDamage(damage);
    }

    @Override
    public void HeavyAttack(Entity target, int damage) {
        target.takeDamage(damage);
    }

    public abstract void SpecialAbility(Entity target);

    @Override
    public void heal(int health) {
        hp += health;
    }

    @Override
    public void fillMana(int mana) {
        mp += mana;
    }

    @Override
    public String defend() {
        return "enemy defends";
    }

    @Override
    public boolean isAlive() {
        return hp > 0;
    }

    public int getHp() {
        return hp;
    }

    public int getMp() {
        return mp;
    }

    @Override
    public int getMaxHP() {
        return maxHp;
    }


    @Override
    public int getMaxMP() {
        return maxMp;
    }


}
