package org.project.entity.enemies;

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

public class Vampire extends Enemy {

    public Vampire(Weapon weapon) {
        super("Vampire", 180, 20, weapon, 0.3);
        this.xpReward = 120;
        this.coinReward = 40;
    }

    @Override
    public void lightAttack(Entity target) {
        super.lightAttack(target);
        fillHealth(5);
    }

    @Override
    public void heavyAttack(Entity target) {
        super.heavyAttack(target);
        int lifeStolen = weapon.getDamage() / 4;
        fillHealth(lifeStolen);
    }

    @Override
    public int choice() {
        double roll = Math.random();


        if (this.getStamina() >= this.weapon.getStaminaCost()) {
            if (roll < 0.33) {return 1;}
            else if (roll < 0.67) {return 2;}
            else {return 3;}
        } else {
            return 1;
        }
    }
}

