package org.project.entity.enemies;

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

public class Boss extends Enemy {

    public Boss(String name, int maxHP, int maxMP, int damage, Weapon weapon, int xpReward) {
        super(name, maxHP, maxMP, damage, weapon, xpReward);
    }

    @Override
    public void attack(Entity target) {
        if (stunned) {
            System.out.println(name + " is stunned and cannot attack!");
            return;
        }

        int totalDamage = damage;
        if (weapon != null) {
            totalDamage += weapon.getDamage();
        }

        // Boss deals extra damage and ignores defense on heavy attacks
        if (Math.random() < 0.3) {
            totalDamage *= 1.5;
            System.out.println("💢 " + name + " uses a powerful heavy attack!");
            target.receiveAttack((int)totalDamage, true);
        } else {
            System.out.println("⚔️ " + name + " attacks!");
            target.receiveAttack(totalDamage, false);
        }
    }
}