package org.project.item.armors;

import java.util.Random;

public class AssassineArmor extends Armor{

    private int dodgeChance;




    public AssassineArmor() {
        super(12, 100);
        this.dodgeChance = 10;
    }

    @Override
    public int getDefense(int damage) {
        if(new Random().nextInt(100) < dodgeChance)
        {
            System.out.println("Assassin dodged the Hit!");
            super.reduceDurability(20);
            return damage;
        }
        else {
            return super.getDefense(damage);
        }
    }

    public int getDodgeChance() {
        return dodgeChance;
    }

    public void setDodgeChance(int dodgeChance) {
        this.dodgeChance = dodgeChance;
    }
}


