package org.project.entity.enemies;

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

public class Dragon extends Enemy{
    public Dragon() {
        int baseDamage = 2;
        int hp = 500;
        int mp = 1000;
        Weapon weapon1 = new DragonBreath();
        super(hp, mp, weapon1, baseDamage);
    }

    @Override
    public void takeDamage(int damage) {
        super.takeDamage(damage);
        if(!isAlive)
            getKilled();
    }

    @Override
    public void getKilled() {
        isAlive = false;
    }

    @Override
    public void attack(Entity target) {
        target.takeDamage((weapon.getDamage() + getBaseDamage()));
        System.out.println("\u001B[31mDragon breathes a raging fire!\u001B[0m");
        System.out.printf("\u001B[31mYou took %d damage.\u001B[0m\n", weapon.getDamage() + getBaseDamage());
    }

    @Override
    public void heal(int health) {
        if (getHP() + health > getMaxHP())
            setHP(getMaxHP());
        else
            setHP(getHP()+ health);
    }

    @Override
    public void fillMana(int mana) {
        if (getMP() + mana > getMaxMP())
            setMP(getMaxMP());
        else
            setMP(getMP()+ mana);
    }

    @Override
    public int getMaxHP() {
        return 500;
    }

    @Override
    public int getMaxMP() {
        return 1000;
    }
}
