package org.project.entity.players;

import org.project.entity.enemies.Enemy;
import org.project.utilities.Colors;

public class Knight extends Player
{

    public Knight(String name)
    {
        super(name, 120, 70, 18);
    }

    @Override
    public String getClassName()
    {
        return "Knight";
    }

    @Override
    public void lightAttack(Enemy enemy)
    {
        System.out.println("⚔️ Knight used Light Attack!");
        enemy.takeDamage(damage);
    }

    @Override
    public void heavyAttack(Enemy enemy)
    {
        if (mana < 10) return;

        mana -= 10;

        System.out.println("⚔️ Knight used Heavy Attack!");
        enemy.takeDamage(damage + 10);
    }

    @Override
    public void defend()
    {
        if (mana < 8) return;

        mana -= 8;
        defending = true;

        System.out.println("🛡️ Knight is defending!");
    }

    @Override
    public void heal()
    {
        if (mana < 12) return;

        mana -= 12;

        health += 20;

        if (health > maxHealth)
            health = maxHealth;

        System.out.println(Colors.GREEN + "Knight healed!" + Colors.RESET);
    }

    @Override
    public void specialAbility(Enemy enemy)
    {
        if (mana < 18) return;

        mana -= 18;

        enemy.takeDamage(damage + 20);
        enemy.setStunned(true);

        System.out.println(Colors.PURPLE + "⚔️ SHIELD BASH! Enemy stunned!" + Colors.RESET);
    }
}
