package org.project.entity.enemies;

import org.project.entity.Entity;
import org.project.entity.players.Player;
import org.project.util.ConsoleColors;

/**
 * Dragon 🐉 — the final boss. Enormous HP and damage. Its fiery breath is "true
 * damage": it bypasses armor and the player's defend stance entirely by calling
 * the overloaded {@link Player#takeDamage(int, boolean)} with {@code true}.
 *
 * Even though it is the boss, it still extends {@link Enemy} so it reuses all
 * the common combat plumbing — exactly what the assignment asks for.
 */
public class Dragon extends Enemy {

    public Dragon() {
        super("Dragon", 160, 26, 120, 100, null, 0);
    }

    @Override
    public void attack(Entity target) {
        System.out.println(ConsoleColors.red("🐉🔥 The Dragon unleashes a torrent of fire that bypasses all defenses!"));
        if (target instanceof Player player) {
            player.takeDamage(damage, true); // true = ignore armor and shields
        } else {
            target.takeDamage(damage);
        }
    }
}
