package org.project.item.armors;

import org.project.entity.players.Player;
import org.project.item.armors.Armor;

public class AssassinArmor extends Armor {

    private int HPPercentDamageReduction;

    public AssassinArmor() {
        super(15);
        this.HPPercentDamageReduction = 40;
    }


    private boolean isLowHP(Player player) {
        return (player.getHP() * 100 / player.getMaxHP()) < HPPercentDamageReduction;
    }

    public int reduceDamage(int damage, Player player) {
        if (isLowHP(player)) {
            return damage / 2;
        }
        return damage;
    }

}