package org.project.entity.players;

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

public class Assassin extends Player
{
    public Assassin(String name)
    {
        super(name, 100, 120, 16);
    }

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

    @Override
    public void lightAttack(Enemy enemy)
    {

        int dmg = damage;

        if (criticalNext)
        {
            dmg *= 2;
            criticalNext = false;

            System.out.println(Colors.RED + "CRITICAL HIT!" + Colors.RESET);
        }

        enemy.takeDamage(dmg);
    }

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

        mana -= 10;

        enemy.takeDamage(damage + 14);
    }

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

        mana -= 8;
        defending = true;

        System.out.println("🗡️ Assassin prepares to evade!");
    }

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

        mana -= 12;

        health += 18;

        if (health > maxHealth)
            health = maxHealth;

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

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

        mana -= 20;

        invisible = true;
        criticalNext = true;

        System.out.println(Colors.PURPLE + "👻 Assassin became invisible!" + Colors.RESET);
    }
}
