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 mp, Weapon weapon, Armor armor) {
        super(name,hp,mp,weapon,armor);
        setDefendRate(.6);
    }

    @Override
    public void lightAttack(Entity target) {
        attack(target, 1);
    }

    @Override
    public void heavyAttack(Entity target) {
        if (getMP() >= 5) {
            attack(target, 1.6);
            setMP(getMP() - 5);
        }
        else {
            System.out.println("Not enough MP");
        }
    }

    @Override
    public void defend() {
        if (getMP() >= 4) {
            super.defend();
            setMP(getMP() - 4);
        }
        else {
            System.out.println("Not enough MP");
        }
    }

    @Override
    public void specialAbility(Entity target) {
        if (getMP() >= 20) {
            attack(target, 2);
            setMP(getMP() - 20);
            setHP(getHP() + 10);
        }
        else {
            System.out.println("Not enough MP");
        }
    }

    @Override
    public void heal(int health) {
        if (getMP() >= 5) {
            super.heal(health);
            setMP(getMP() - 5);
        }
        else  {
            System.out.println("Not enough MP");
        }
    }
}
