package org.project.entity.enemies;

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

import javax.xml.transform.stax.StAXResult;

public class Vampire extends Enemy{
    private int addadHP;

    public Vampire(int hp, Weapon weapon) {
        if (weapon.getDamage() % 3 == 0){ this.addadHP = weapon.getDamage() / 3; }
        else if (weapon.getDamage() % 3 == 1){ this.addadHP = (weapon.getDamage() - 1) / 3; }
        else { this.addadHP = (weapon.getDamage() - 2) / 3; }
        super(hp, weapon, 25, 14);
    }

    //attacks the player and increases HP as much as a portion (almost 1/3) of the damage it deals
    @Override
    public void attack(Entity target) {
        //checks if the player has stunned them
        if (!isStunned()) {
            target.takeDamage(getWeapon().getDamage());
            addHP(addadHP);
        }
    }
}
