function init(hero) {

    hero.setName("Black Lantern");

    hero.setTier(8);



    hero.setChestplate("Death Ring");

    

    hero.addPowers("ahhp:death");

    hero.addAttribute("PUNCH_DAMAGE", 9.0, 0);

    hero.addAttribute("JUMP_HEIGHT", 1.0, 0);

    hero.addAttribute("FALL_RESISTANCE", 50.0, 1);

    hero.addAttribute("SPRINT_SPEED", 1.25, 1);

    hero.addAttribute("IMPACT_DAMAGE", 0.3, 1);

    

    hero.addKeyBind("AIM", "key.aim", 1);

    hero.addKeyBind("LANTERN_HAMMER", "Light Construct", 2);

    hero.addKeyBind("SHIELD", "Light Forcefield", 3);

    hero.addKeyBind("TELEKINESIS", "Light Grab", 4);

    hero.addKeyBind("LANTERN_TRANSFORM", "Suit Manifestation", 5);

    

    hero.setModifierEnabled(isModifierEnabled);

    hero.addAttributeProfile("INACTIVE", inactiveProfile);

    hero.addAttributeProfile("LANTERNHAMMER", lanternhammerProfile);

    hero.addAttributeProfile("SHIELD", shieldProfile);

    hero.setAttributeProfile(getAttributeProfile);

    hero.setTierOverride(getTierOverride);

    hero.setKeyBindEnabled(isKeyBindEnabled);

    hero.setHasProperty(hasProperty);

    hero.supplyFunction("canAim", canAim);



    hero.addSoundEvent("AIM_START", "ahhp:lantern_blast");

    

}



function hasProperty(entity, property) {

    switch (property) {

    case "BREATHE_SPACE":

        return entity.getData("ahhp:dyn/lantern");

    case "MASK_TOGGLE":

        return entity.getData("ahhp:dyn/lantern");

    default:

        return false;

    }

}



function canAim(entity) {

    return entity.getHeldItem().isEmpty() && !entity.getData("ahhp:dyn/lanternhammer");

}



function getTierOverride(entity) {

    return entity.getData("ahhp:dyn/lantern") ? 8 : 0;

}



function inactiveProfile(profile) {
}



function lanternhammerProfile(profile) {

    profile.addAttribute("PUNCH_DAMAGE", 11.0, 0);

    profile.addAttribute("JUMP_HEIGHT", 1.0, 0);

    profile.addAttribute("FALL_RESISTANCE", 8.5, 0);

    profile.addAttribute("SPRINT_SPEED", 0.25, 1);

    profile.addAttribute("IMPACT_DAMAGE", 0.5, 1);

}



function shieldProfile(profile) {

    profile.inheritDefaults();

    profile.addAttribute("SPRINT_SPEED", -1.5, 1);

    profile.addAttribute("JUMP_HEIGHT", -10.0, 1);

}



function getAttributeProfile(entity) {

    if (entity.getData("fiskheroes:shield_blocking")) {

        return "SHIELD";

    }

    if (entity.getData("ahhp:dyn/lanternhammer")) {

        return "LANTERNHAMMER";

    }

    return entity.getData("ahhp:dyn/lantern") ? null : "INACTIVE";

}



function isModifierEnabled(entity, modifier) {

    if (modifier.name() != "fiskheroes:transformation" && modifier.name() != "fiskheroes:cooldown" && (!entity.getData("ahhp:dyn/lantern") || modifier.name() == "fiskheroes:controlled_flight" && entity.getData("ahhp:dyn/lantern_timer") < 1)) {

        return false;

    }

    switch (modifier.name()) {

    case "fiskheroes:energy_bolt":

        return entity.getData("fiskheroes:aimed_timer") >= 1;

    case "ahhp:dyn/lanternhammer":

        return entity.getData("ahhp:dyn/lantern") && !entity.getData("fiskheroes:aiming") && !entity.getData("fiskheroes:shield") && entity.getData("fiskheroes:flight_boost_timer") == 0;

    case "fiskheroes:shield":

        return !entity.getData("fiskheroes:aiming") && !entity.getData("ahhp:dyn/lanternhammer") && entity.getData("fiskheroes:flight_boost_timer") == 0;

    case "fiskheroes:regeneration":

        return !entity.getData("ahhp:dyn/lanternhammer");

    case "fiskheroes:telekinesis":

        return entity.getData("ahhp:dyn/lantern") && !entity.getData("fiskheroes:aiming") && !entity.getData("fiskheroes:shield") && entity.getData("fiskheroes:flight_boost_timer") == 0;

    default:

        return true;

    }

}



function isKeyBindEnabled(entity, keyBind) {

    switch (keyBind) {

        case "LANTERN_HAMMER":

            return (entity.getData("ahhp:dyn/lantern")) && (entity.getData("fiskheroes:flight_boost_timer") == 0) && (!entity.getData("fiskheroes:telekinesis")) && (!entity.getData("fiskheroes:shield")) && !entity.getData("fiskheroes:aiming");

        case "SHIELD":

            return (entity.getData("ahhp:dyn/lantern")) && (!entity.getData("ahhp:dyn/lanternhammer")) && (entity.getData("fiskheroes:flight_boost_timer") == 0) && !entity.getData("fiskheroes:aiming") && (!entity.getData("fiskheroes:telekinesis"));

        case "TELEKINESIS":

            return (entity.getData("ahhp:dyn/lantern")) && (!entity.getData("fiskheroes:shield")) && (!entity.getData("ahhp:dyn/lanternhammer")) && (entity.getData("fiskheroes:flight_boost_timer") == 0) && !entity.getData("fiskheroes:aiming");

        case "AIM":

            return (entity.getData("ahhp:dyn/lantern")) && (!entity.getData("fiskheroes:shield")) && (!entity.getData("ahhp:dyn/lanternhammer")) && (entity.getData("fiskheroes:flight_boost_timer") == 0) && (!entity.getData("fiskheroes:telekinesis"));

        default:

            return true;

    }

}