function init(hero) {
    hero.setName("Steve");
    hero.setTier(4);

    hero.setHelmet("item.superhero_armor.piece.helmet");
    hero.setChestplate("item.superhero_armor.piece.chestpiece");
    hero.setLeggings("item.superhero_armor.piece.pants");
    hero.setBoots("item.superhero_armor.piece.boots");

    hero.addPowers("shadows:steve_power")

    hero.addKeyBindFunc("func_SLOT_CHANGING", slotChange, "Slot Change", 1)

    hero.addKeyBind("SLOT1", "Slot1", 4)
    hero.addKeyBind("SLOT2", "Slot2", 4)
    hero.addKeyBind("SLOT3", "Slot3", 4)
    hero.addKeyBind("_HEROBRINE", "Herobrine Transform", 4)

    hero.addKeyBind("TELEPORT", "Teleport", 5)
    hero.addKeyBind("TELEKINESIS", "Telekinesis", 3);

    hero.setHasProperty(hasProperty);

    hero.setModifierEnabled(isModifierEnabled);

    hero.setKeyBindEnabled(isKeyBindEnabled);

    hero.setTierOverride(getTierOverride);

    hero.addAttributeProfile("HEROBRINE", herobrineProfile);
    hero.setAttributeProfile(getProfile);

}

function slotChange(player, manager) {
    var dataVar = "shadows:dyn/slot"
        var slot = player.getData(dataVar)

        manager.setData(player, dataVar, slot + 1)

        if (slot == 6) {
            manager.setData(player, dataVar, 0)
        }

        return true;
}

function isModifierEnabled(entity, modifier) {
    return modifier.name() == "fiskheroes:transformation" || modifier.name() == "fiskheroes:cooldown" || entity.getData("fiskheroes:dyn/steeled")
}

function isKeyBindEnabled(entity, keyBind) {
    switch (keyBind) {
    case "func_SLOT_CHANGING":
        return !entity.getData("fiskheroes:dyn/steeled");
    case "SLOT1":
        return (entity.getData("shadows:dyn/slot") == 0 || entity.getData("shadows:dyn/slot") == 3) && !entity.getData("fiskheroes:dyn/steeled");
    case "SLOT2":
        return (entity.getData("shadows:dyn/slot") == 1 || entity.getData("shadows:dyn/slot") == 4) && !entity.getData("fiskheroes:dyn/steeled");
    case "SLOT3":
        return (entity.getData("shadows:dyn/slot") == 2 || entity.getData("shadows:dyn/slot") == 5) && !entity.getData("fiskheroes:dyn/steeled");
    case "_HEROBRINE":
        return entity.getData("shadows:dyn/slot") == 6 || entity.getData("fiskheroes:dyn/steeled");
    default:
        return entity.getData("fiskheroes:dyn/steeled");
    }
}

function hasProperty(entity, property) {
    return property == "MASK_TOGGLE" || property == "BREATHE_SPACE" && entity.getData("fiskheroes:dyn/steeled");
}

function getTierOverride(entity) {
    return entity.getData("fiskheroes:dyn/steeled") ? 10 : 4;
}

function herobrineProfile(profile) {
    profile.addAttribute("JUMP_HEIGHT", 4, 0);
    profile.addAttribute("BASE_SPEED", 2, 1);
    profile.addAttribute("FALL_RESISTANCE", 1, 1);
    profile.addAttribute("PUNCH_DAMAGE", 9, 0);
}

function getProfile(entity) {
    return entity.getData("fiskheroes:dyn/steeled") ? "HEROBRINE" : null;
}
