package org.project.entity.enemies;

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

public class Dragon extends Enemy{

    private static int maxHP = 220;
    private int hp = maxHP;

    public static final String RESET = "\u001B[0m";
    public static final String GREEN_TEXT = "\u001B[32m";

    public Dragon(){
        Weapon DragonWeapon = new Flame();
        super(maxHP, DragonWeapon);
    }

    @Override
    public void attack(Entity target) {
        System.out.printf("\t%s attacks!\n", getName());
        target.takeDamage(28);
    }

    @Override
    public void specialAbility(Entity target) {
        System.out.printf("\t%s breathes fire! \uD83D\uDD25\n", getName());
        target.takeDamage(weapon.getDamage());
    }

    public int getMaxHP() {
        return maxHP;
    }

    @Override
    public String getName(){
        return " \uD83D\uDC09 Dragon";
    }

    @Override
    public boolean isAlive() {
        if(hp <= 0){
            System.out.printf(GREEN_TEXT + "\t=============== Victory! ===============\n" + RESET, getName());
            alive = false;
        }
        return alive;
    }

}