package org.project.entity.enemies;

public class Dragon extends Enemy
{

    public Dragon()
    {
        super("Dragon", 200, 100);
    }

    @Override
    public void attack(Entity target)
    {
        int damage = 40;
        System.out.println(name + " breathes fire for " + damage + " damage ignoring defense!");

        if (target instanceof Player)
        {
            Player p = (Player) target;
            p.setHP(p.getHP() - damage);
            if (p.getHP() < 0)
                p.setHP(0);
            System.out.println(target.getName() + " takes " + damage + " damage!");
        }
        else
        {
            target.takeDamage(damage);
        }
    }
}