function init(hero) {
    hero.setName("Quicksilver");
    hero.setTier(3);
    
    hero.setHelmet("item.superhero_armor.piece.hair");
    hero.setChestplate("item.superhero_armor.piece.jacket");
    hero.setLeggings("item.superhero_armor.piece.pants");
    hero.setBoots("item.superhero_armor.piece.boots");
    
    hero.addAbilities("fiskheroes:super_speed", "fiskheroes:enhanced_reflexes", "fiskheroes:cellular_regeneration", "fiskheroes:accelerated_perception");
    hero.addAttribute("ATTACK_DAMAGE", 0.1, 1);
    hero.addAttribute("FALL_RESISTANCE", 6.0, 0);
    hero.addAttribute("PUNCH_DAMAGE", 2.5, 0);
    hero.addAttribute("JUMP_HEIGHT", 1.25, 0);
    hero.addAttribute("SWORD_DAMAGE", -0.7, 1);
    
    hero.addKeyBind("SUPER_SPEED", "key.superSpeed", 1);
    hero.addKeyBind("SLOW_MOTION", "key.slowMotion", 2);
    hero.addKeyBind("DECELERATE", "key.decelerate", 3);
    hero.addKeyBind("ACCELERATE", "key.accelerate", 4);

    hero.setDefaultScale(0.99);
    hero.addAttributeProfile("MASK_TOGGLE", speed);
    hero.setHasProperty(hasProperty);
    hero.setAttributeProfile(getAttributeProfile);
    hero.setModifierEnabled(isModifierEnabled);
}
function speed(profile) {
    profile.addAttribute("PUNCH_DAMAGE", 3.5, 0);
    profile.addAttribute("JUMP_HEIGHT", 1.5, 0);
    profile.addAttribute("BASE_SPEED_LEVELS", 10.0, 0);
    profile.addAttribute("ATTACK_DAMAGE", 0.35, 1);
}

function hasProperty(entity, property) {
    return property == "MASK_TOGGLE";
}

function isModifierEnabled(entity, modifier) {
    return entity.getData("fiskheroes:mask_open") || modifier != "fiskheroes:super_speed" && modifier != "fiskheroes:accelerated_perception";
}

function getAttributeProfile(entity) {
    return entity.getData("fiskheroes:mask_open") ? "MASK_TOGGLE" : null;
}
