package org.project.item.armors;

import org.project.Colors;
import org.project.entity.Entity;
import org.project.entity.players.Wizard;

public class WizardArmor extends Armor{
    //Reflects enemy attacks back to itself.
    //you get mana bonus

    private int bonusPercent;
    private int reflectPercent;

    public WizardArmor() {
        super(10, 75);
        this.bonusPercent = 15;
        this.reflectPercent = 20;
    }


    public int getBonusPercent() {
        return bonusPercent;
    }

    public void setBonusPercent(int bonusPercent) {
        this.bonusPercent = bonusPercent;
    }

    public int getReflectPercent() {
        return reflectPercent;
    }

    public void setReflectPercent(int reflectPercent) {
        this.reflectPercent = reflectPercent;
    }

    public int getBonus(Wizard w)
   {
       return (bonusPercent*w.getMaxMP()) / 100;
   }

   public void reflect(Entity attacker, int damage)
   {

       System.out.printf( Colors.ORANGE + "%d" + Colors.RESET + " of damage reflected.\n", (reflectPercent*damage) / 100);
       attacker.takeDamage((reflectPercent*damage) / 100);
       super.reduceDurability(12);
   }
}
