package org.project.entity.players;

import org.project.entity.Entity;
import org.project.item.weapons.Weapon;
import org.project.utils.ConsoleColors;

public class Knight extends Player {
    private boolean stunEnemy = false;

    public Knight(String name, Weapon weapon) {
        super(name, 120, 60, 18, weapon);
    }

    @Override
    public void specialAbility(Entity target) {
        if (mp < 20) {
            System.out.println(ConsoleColors.RED + "Not enough Mana!" + ConsoleColors.RESET);
            return;
        }
        mp -= 20;
        int totalDamage = damage * 3;
        if (weapon != null) {
            totalDamage += weapon.getDamage();
        }
        System.out.println(ConsoleColors.YELLOW_BOLD + "⚔ Shield Bash!" + ConsoleColors.RESET);
        target.receiveAttack(totalDamage, false);
        stunEnemy = true;
    }

    public boolean shouldStunEnemy() {
        return stunEnemy;
    }

    public void resetStun() {
        stunEnemy = false;
    }
}