function init(hero) {
    hero.setName("Sinister Strange/\u00A7d\u00A7lKNIGHTS\u00A7r");
    hero.setTier(7);

    hero.setChestplate("item.superhero_armor.piece.robes");
    hero.setLeggings("item.superhero_armor.piece.pants");
    hero.setBoots("item.superhero_armor.piece.boots");

    hero.addPowers("knights:darkhold_magic");
    hero.addAttribute("PUNCH_DAMAGE", 1.5, 0);
    hero.addAttribute("JUMP_HEIGHT", 0.5, 0);
    hero.addAttribute("FALL_RESISTANCE", 3.5, 0);
    hero.addAttribute("MAX_HEALTH", 8.5, 0);

    hero.addKeyBind("AIM", "key.aim", -1);
    hero.addKeyBind("BLADE", "key.blade", 1);
    hero.addKeyBind("SHIELD", "key.shield", 1);
    hero.addKeyBind("SPELL_MENU", "Eldritch Magic", 2);
    hero.addKeyBind("NEXT", "Next", 3);

    hero.addKeyBind("TENTACLES", "Darkhold Magic", 1);
    hero.addKeyBind("TENTACLE_GRAB", "Dark Magic Grab", 2);
    hero.addKeyBind("TENTACLE_JAB", "Dark Magic Jab", 3);
    hero.addKeyBind("CHARGED_BEAM", "Energy Manipulation", 4);

    hero.setModifierEnabled(isModifierEnabled);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.supplyFunction("canAim", canAim);

    hero.addAttributeProfile("BLADE", bladeProfile);
    hero.setAttributeProfile(getProfile);
    hero.setDamageProfile(getProfile);
    hero.addDamageProfile("BLADE", {
        "types": {
            "SHARP": 1.0,
            "FIRE": 0.2
        }
    });

    hero.setTickHandler((entity, manager) => {
        if (!entity.isSneaking() && !entity.isOnGround() && entity.motionY() < -0.8) {
            manager.setData(entity, "fiskheroes:flying", true);
        }
    });
}

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

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

function isModifierEnabled(entity, modifier) {
    return modifier.name() != "fiskheroes:shield" || !entity.getData("fiskheroes:blade");
}

function isKeyBindEnabled(entity, keyBind) {
    switch (keyBind) {
    case "SHIELD":
        return !entity.getData("fiskheroes:dyn/steeled") && (!entity.getData("fiskheroes:shield") || !(entity.getData("fiskheroes:shield") && entity.getData("fiskheroes:aiming")));
    case "BLADE":
        return entity.getData("fiskheroes:shield") && entity.getData("fiskheroes:aiming") || entity.getData("fiskheroes:blade") || entity.isBookPlayer();
    case "SPELL_MENU":
        return !entity.getData("fiskheroes:dyn/steeled") && !entity.getData("fiskheroes:blade") && !entity.getData("fiskheroes:shield");
    case "AIM":
        return !entity.getData("fiskheroes:dyn/steeled");
    case "NEXT":
        return entity.getData("fiskheroes:tentacles") == null && !entity.getData("fiskheroes:beam_charge") && !entity.getData("fiskheroes:energy_projection") && !entity.getData("fiskheroes:gravity_manip") && !entity.getData("fiskheroes:intangible") && !entity.getData("fiskheroes:dyn/giant_mode") && !entity.getData("fiskheroes:lightsout")
    case "TENTACLES":
        return entity.getData("fiskheroes:dyn/steeled") && !entity.getData("fiskheroes:beam_charge") && !entity.getData("fiskheroes:energy_projection") && !entity.getData("fiskheroes:gravity_manip") && !entity.getData("fiskheroes:dyn/giant_mode") && !entity.getData("fiskheroes:lightsout")
    case "TENTACLE_GRAB":
        return entity.getData("fiskheroes:tentacles") != null && entity.getData("fiskheroes:dyn/steeled") && !entity.getData("fiskheroes:beam_charge") && !entity.getData("fiskheroes:energy_projection") && !entity.getData("fiskheroes:gravity_manip") && !entity.getData("fiskheroes:intangible") && !entity.getData("fiskheroes:lightsout")
    case "TENTACLE_JAB":
        return entity.getData("fiskheroes:tentacles") != null && entity.getData("fiskheroes:dyn/steeled") && !entity.getData("fiskheroes:beam_charge") && !entity.getData("fiskheroes:energy_projection") && !entity.getData("fiskheroes:gravity_manip") && !entity.getData("fiskheroes:dyn/giant_mode") && !entity.getData("fiskheroes:intangible")
    case "CHARGED_BEAM":
        return entity.getData("fiskheroes:dyn/steeled") && !entity.getData("fiskheroes:energy_projection") && !entity.getData("fiskheroes:gravity_manip") && !entity.getData("fiskheroes:dyn/giant_mode") && !entity.getData("fiskheroes:intangible")
    default:
        return true;
    }
}
function canAim(entity) {
    return entity.getData("fiskheroes:shield") && entity.getData("fiskheroes:shield_blocking_timer") == 0;
}
