function init(hero) {
    hero.setName("Galvan");
    hero.setTier(5);
    
    hero.setHelmet("Head");
    hero.setChestplate("Chest");
    hero.setLeggings("Leggings");
    hero.setBoots("Feet");
    
    hero.addAttribute("FALL_RESISTANCE", 1, 0);
    hero.addAttribute("JUMP_HEIGHT", 0, 0);
    hero.addAttribute("PUNCH_DAMAGE", 3.5, 0);
    hero.addAttribute("SPRINT_SPEED", 0.2, 1);
    hero.addAttribute("STEP_HEIGHT", 2, 0);
    hero.addAttribute("IMPACT_DAMAGE", 1, 1);

    hero.setDefaultScale(0.3);
}

function webSwingingKey(player, manager) {
    var flag = player.getData("fiskheroes:web_swinging");
    
    if (!flag) {
        manager.setDataWithNotify(player, "fiskheroes:prev_utility_belt_type", player.getData("fiskheroes:utility_belt_type"));
        manager.setDataWithNotify(player, "fiskheroes:utility_belt_type", -1);
    }
    
    manager.setDataWithNotify(player, "fiskheroes:web_swinging", !flag);
    return true;
}

function isModifierEnabled(entity, modifier) {
    switch (modifier.name()) {
    case "fiskheroes:web_swinging":
        return entity.getHeldItem().isEmpty() && entity.getData("fiskheroes:utility_belt_type") == -1;
    case "fiskheroes:leaping":
        return modifier.id() == "springboard" == (entity.getData("fiskheroes:ticks_since_swinging") < 5);
    default:
        return true;
    }
}

function isKeyBindEnabled(entity, keyBind) {
    switch (keyBind) {
    case "func_WEB_SWINGING":
        return entity.getHeldItem().isEmpty();
    default:
        return true;
    }
}
