package org.project.entity.enemies;

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

public abstract class Enemy implements Entity {
    Weapon weapon;
    protected int hp;
    private boolean defending = false;
    protected boolean lifeStealing = false;
    private boolean stunned = false;

    public Enemy(int hp, Weapon weapon) {
        this.hp = hp;
        this.weapon = weapon;
    }

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

    public void attack(Entity target) {
        target.takeDamage(weapon.getDamage());
    }

    public abstract void SpecialAbility(Entity target);

    @Override
    public void defend() {
        defending = true;
    }


    public int getHp() {
        return hp;
    }

    public Weapon getWeapon() {
        return weapon;
    }

    public boolean isDefending() {
        return defending;
    }

    public boolean isLifeStealing() {
        return lifeStealing;
    }

    public boolean isStunned() {
        return stunned;
    }
}
