package org.project.entity.players;

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

public class Wizard extends Player{

    public Wizard(String name, int hp, int maxHP, int mp, int maxMP, Weapon weapon, Armor armor) {
        super(name, hp, maxHP, mp, maxMP, weapon, armor);
    }


    @Override
    public void attack(Entity target) { //heavy attack

        Weapon weapon = super.getWeapon();

        if(reduceMana(weapon.getManaCost())){ //checking if the player has enough Mana

            target.takeDamage(weapon.getDamage()); //causing damage
            heal(20); //replenishing HP
            System.out.println(getName() + " (Wizard \uD83E\uDDD9\u200D♂\uFE0F) cast a devastating spell");
        }
        else{
            System.out.println(getName() + " (Wizard \uD83E\uDDD9\u200D♂\uFE0F) dose not have enough Mana\n" +
                    "Choose another action...");
        }
    }
}
