function init(hero) {
    hero.setName("Alastor");
    hero.setTier(9);
    
    hero.setHelmet("item.superhero_armor.piece.head");
    hero.setChestplate("item.superhero_armor.piece.coat");
    hero.setLeggings("item.superhero_armor.piece.pants");
    hero.setBoots("item.superhero_armor.piece.shoes");
    hero.addPrimaryEquipment("fisktag:weapon{WeaponType:fan:microphone}", true, item => item.nbt().getString("WeaponType") == 'fan:microphone');
    hero.addPrimaryEquipment("fisktag:weapon{WeaponType:fan:plush}", true, item => item.nbt().getString("WeaponType") == 'fan:plush');

    hero.setKeyBindEnabled(isKeyBindEnabled);
    
    hero.addPowers("fan:radio_demon_physiology");
    hero.addAttribute("FALL_RESISTANCE", 1, 1);
    hero.addAttribute("PUNCH_DAMAGE", 11.0, 0);
    hero.addAttribute("MAX_HEALTH", 1.0, 0);
    hero.addAttribute("SPRINT_SPEED", 0.60, 1)
    hero.addAttribute("STEP_HEIGHT", 0.5, 0); 
    hero.addAttribute("JUMP_HEIGHT", 3.0, 0)
    
    hero.addKeyBind("TENTACLES", "Toggle Tentacles", 1);
    hero.addKeyBind("SHADOWFORM", "key.shadowForm", 2);
    hero.addKeyBind("SHADOWDOME", "key.shadowDome", 3);
    hero.addKeyBindFunc("func_GIANT_MODE", giantModeKey, "key.giantMode", 4);
    hero.addKeyBind("TENTACLE_JAB", "key.tentacleJab", 2);
    hero.addKeyBind("TENTACLE_GRAB", "key.tentacleGrab", 3);
    hero.addKeyBind("TENTACLE_STRIKE", "key.tentacleStrike", 4);
    hero.addKeyBind("SHIELD", "key.forcefield", 5);
}

function isModifierEnabled(entity, modifier) {
    return modifier.name() != "fiskheroes:arrow_catching" && modifier.name() != "fiskheroes:energy_projection" && modifier.name() != "fiskheroes:teleportation" || !entity.getData("fiskheroes:telekinesis");
}

function isKeyBindEnabled(entity, keyBind) {
    return keyBind != "ENERGY_PROJECTION" && keyBind != "TELEPORT" || !entity.getData("fiskheroes:telekinesis");
}

function getAttributeProfile(entity) {
    if (entity.getData("fiskheroes:shield_blocking")) return "SHIELD";
    if (entity.getData("fiskheroes:punchmode")) return "PUNCH";
    return null;
}

function giantModeKey(player, manager) {
    var flag = player.getData("fiskheroes:dyn/giant_mode");
    manager.setData(player, "fiskheroes:dyn/giant_mode", !flag);
    manager.setData(player, "fiskheroes:size_state", flag ? -1 : 1);
    return true;
}

function isModifierEnabled(entity, modifier) {
    switch (modifier.name()) {
        case "fiskheroes:flight":
        return entity.getData("fiskheroes:shadowform");
        case "fiskheroes:telekinesis":
        return entity.getHeldItem().isEmpty() && !entity.getData("fiskheroes:shadowform") && !entity.getData("fiskheroes:lightsout");
        default:
        return true;
    }
}

function isKeyBindEnabled(entity, keyBind) {
    if (keyBind == "TENTACLE_JAB" || keyBind == "TENTACLE_GRAB" || keyBind == "TENTACLE_STRIKE") {
        return entity.getData("fiskheroes:tentacles") != null;
        return keyBind == "func_GIANT_MODE";
    }
    
    if (keyBind == "TENTACLE_JAB" || keyBind == "TENTACLE_GRAB" || keyBind == "TENTACLE_STRIKE") {
        return entity.getData("fiskheroes:tentacles") != null;
    }
    if (entity.getData("fiskheroes:tentacles")) {
        return keyBind == "TENTACLES"
    }
    if (entity.getData("fiskheroes:shadowform")) {
        return keyBind == "SHADOWFORM";
    }
    else if (entity.getData("fiskheroes:lightsout")) {
        return keyBind == "SHADOWDOME";
        
    }
    return true;
}