function init(hero) {
    hero.setName("Amulet of Daylight");
    hero.setTier(10);
    hero.hide();

    hero.setChestplate("Merlin's");

    hero.addPowers("pkg:amulet");

    hero.addAttribute("FALL_RESISTANCE", 10, 1);
    hero.addAttribute("PUNCH_DAMAGE", 4, 0);
    hero.addAttribute("SPRINT_SPEED", 0.6, 1);

    hero.addKeyBind("DAYLIGHT", "For the Glory of Merlin, Daylight is Mine to Command!", 1);;
    hero.addKeyBind("ECLIPSE", "For the Doom of Gunmar Eclipse is Mine to Command!", 2);;
    hero.addKeyBind("BLADE", "Daylight Sword", 2);
    hero.addKeyBind("ECLIPSE_SWORD", "Eclipse Sword", 2);
    hero.addKeyBind("ECLIPSE_SHIELD", "Eclipse Shield", 3);
    hero.addKeyBind("ECLIPSE_GLAIVES", "Eclipse Glaives", 4);
    hero.addKeyBind("SHIELD", "Daylight Shield", 3);
    hero.addKeyBind("GLAIVES", "Daylight Glaives", 4);

    hero.addAttributeProfile("BLADE", bladeProfile);
    hero.setAttributeProfile(getProfile);
    hero.setDamageProfile(getProfile);
    hero.addDamageProfile("BLADE", { "types": { "BLUNT": 1.0 } });
    hero.setModifierEnabled(isModifierEnabled);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.addSoundEvent("WEAPON_EQUIP", "pkg:sword");
    hero.addSoundEvent("WEAPON_UNEQUIP", "pkg:sword");
    hero.setHasProperty(hasProperty);
    hero.addAttributeProfile("ECLIPSE", eclipseProfile);
    hero.addAttributeProfile("NOTECLIPSE", noteclipseProfile);
    hero.addAttributeProfile("DAYLIGHT", daylightProfile);
    hero.addAttributeProfile("NOTDAYLIGHT", notdaylightProfile);
    hero.setAttributeProfile(getAttributeProfile);
    hero.setTierOverride(getTierOverride);
    hero.setHasPermission(hasPermission);
    hero.addAttributeProfile("SHIELD", shieldProfile);
    hero.setAttributeProfile(getProfile);
    hero.setDamageProfile(getProfile);
    hero.addDamageProfile("SHIELD", {
        "types": {
            "BLUNT": 0.7,
            "SHARP": 0.3
        }
    });
}

function hasProperty(entity, property) {
    switch (property) {
        case "MASK_TOGGLE":
            return entity.getData("pkg:dyn/daylight") == 1;
        case "WATER_BREATHƯNG":
            return !entity.getData("fiskheroes:mask_open") && entity.getData("pkg:dyn/eclipse") && entity.getData("pkg:dyn/daylight");
        default:
            return false;
    }
}

function noteclipseProfile(profile) {
    profile.revokeAugments();
}


function eclipseProfile(profile) {
    profile.addAttribute("FALL_RESISTANCE", 20, 1);
    profile.addAttribute("PUNCH_DAMAGE", 4, 0);
    profile.addAttribute("SPRINT_SPEED", 0.6, 1);
    profile.addAttribute("REACH_DISTANCE", 2.8, 1);
    profile.addAttribute("MAX_HEALTH", 2.0, 0);
}

function getProfile(entity) {
    if (!entity.getData("pkg:dyn/daylight")) {
        return "INACTIVE";
    }
    return entity.getData("fiskheroes:blade") ? "BLADE" : null;
    if (!entity.getData("pkg:dyn/eclipse")) {
        return "INACTIVE";
    }
    return entity.getData("fiskheroes:blade") ? "BLADE" : null;
}

function shieldProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 6.5, 0);
}

function isKeyBindEnabled(entity, keyBind) {
    switch (keyBind) {
        case "ECLIPSE":
            return entity.isSneaking();
        case "ECLIPSE_SWORD":
            return entity.getData("pkg:dyn/eclipse")
        case "ECLIPSE_GLAIVES":
            return entity.getData("pkg:dyn/eclipse")
        case "ECLIPSE_SHIELD":
            return entity.getData("pkg:dyn/eclipse")
        case "SHIELD":
            return entity.getData("pkg:dyn/daylight")
        case "BLADE":
            return entity.getData("pkg:dyn/daylight")
        case "GLAIVES":
            return entity.getData("pkg:dyn/daylight")

        default:
            return true;
    }
}

function getProfile(entity) {
    return entity.getData("fiskheroes:blade") ? "DAYLIGHT" : null;
    return entity.getData("fiskheroes:blade") ? "ECLIPSE" : null;
}

function isModifierEnabled(entity, modifier) {
    return modifier.name() != "fiskheroes:water_breathing" || !entity.getData("fiskheroes:mask_open");
    if (modifier.name() != "fiskheroes:transformation" && modifier.name() != "fiskheroes:cooldown" && (!entity.getData("pkg:dyn/daylight") && entity.getData("pkg:dyn/daylight_timer") < 1)) {
        return false;
    }
    if (modifier.name() != "fiskheroes:transformation" && modifier.name() != "fiskheroes:cooldown" && (!entity.getData("pkg:dyn/eclipse") && entity.getData("pkg:dyn/eclipse_timer") < 1)) {
        return false;
    }
    switch (modifier.name()) {
        case "fiskheroes:regeneration":
            return entity.getData("pkg:dyn/daylight") && entity.getData("pkg:dyn/eclipse");;
        case "fiskheroes:blade":
            return (entity.getData("fiskheroes:shield") && entity.getData("fiskheroes:blade")).getData("pkg:dyn/daylight") && entity.getData("pkg:dyn/eclipse");;
        case "fiskheroes:shield":
            return (entity.getData("fiskheroes:shield") && entity.getData("fiskheroes:blade")).getData("pkg:dyn/daylight") && entity.getData("pkg:dyn/eclipse");
        case "fiskheroes:arrow_catching":
            return entity.getData("pkg:dyn/eclipse");
        default:
            return true;
    }
}

function notdaylightProfile(profile) {
    profile.revokeAugments();
}

function daylightProfile(profile) {
    profile.addAttribute("FALL_RESISTANCE", 15, 1);
    profile.addAttribute("PUNCH_DAMAGE", 4, 0);
    profile.addAttribute("SPRINT_SPEED", 0.6, 1);
    profile.addAttribute("REACH_DISTANCE", 0.8, 1);
    profile.addAttribute("MAX_HEALTH", 1.0, 0);
}

function getTierOverride(entity) {
    return entity.getData("pkg:dyn/daylight") ? 8 : 0;
    if (entity.getData("pkg:dyn/eclipse")) {
        return 7;
    }

    return 2;
}

function hasPermission(entity, permission) {
    return permission == "USE_SHIELD";
}

function getProfile(entity) {
    return entity.getData("fiskheroes:shield") ? "SHIELD" : null;
    return entity.getData("fiskheroes:shield") ? "ECLIPSE_SHIELD" : null;
}

function bladeProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 27.5, 0);
}

function getAttributeProfile(entity) {
    if (entity.getData("pkg:dyn/eclipse")) {
        return "ECLIPSE";
    }
    if (entity.getData("pkg:dyn/daylight")) {
        return "DAYLIGHT";
    }
    return true;
}