package org.project.entity.enemies;

import org.project.entity.Entity;
import org.project.item.weapons.ToothedHook;
import org.project.location.NarrativeConsole;

public class Vampire extends Enemy {
    public Vampire() {
        super("Vampire", 50, 40, new ToothedHook());
    }

    @Override
    public void attack(Entity target) {
        int damage = 12;

        target.takeDamage(damage);

        //Adding to Vampire HP
        int healAmount = damage * 30 / 100;
        int newHp = getHp() + healAmount;
        if (newHp > getMaxHP()) {
            newHp = getMaxHP();
        }
        setHp(newHp);

        NarrativeConsole.printCombat("🦇 Vampire attacks " + getName(target) + "!");
        NarrativeConsole.printDamage("💥 Dealt " + damage + " damage!");
        NarrativeConsole.printSpecial("🩸 Life steal: Vampire drains " + healAmount + " HP and regenerates!");
        NarrativeConsole.printSpecial("💚 Vampire HP: " + getHp() + "/" + getMaxHP());

        if (getHp() == getMaxHP()) {
            NarrativeConsole.printInfo("🦇 Vampire is fully satiated!");
        }
    }

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

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