package org.project.entity.players;

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


public class Knight extends Player {

    public Knight(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

        if(reduceMana(getWeapon().getManaCost())) { //checking if the player has enough Mana
            target.takeDamage(getWeapon().getDamage()); //causing damage

            if (target instanceof Enemy) {
                Enemy enemy = (Enemy) target;
                enemy.setStunned(true); //stun the enemy
            }

            System.out.println(getName() + " (Knight ⚔️) performed a shield bash that stunned the enemy.");
        }
        else{
            System.out.println(getName() + " (Knight ⚔️) dose not have enough Mana\n" +
                    "Choose another action...");
        }
    }
}