function init(hero) {
    hero.setName("Kid Flash/Young Justice");
    hero.setTier(3);
    
    hero.setHelmet("item.superhero_armor.piece.cowl");
    hero.setChestplate("item.superhero_armor.piece.chestpiece");
    hero.setLeggings("item.superhero_armor.piece.pants");
    hero.setBoots("item.superhero_armor.piece.boots");
    
    hero.addPowers("fiskheroes:speed_force", "tmfp:stealth_suit");
    hero.addAttribute("PUNCH_DAMAGE", 4.5, 0);
    hero.addAttribute("JUMP_HEIGHT", 1.0, 0);
    hero.addAttribute("FALL_RESISTANCE", 3.0, 0);
    hero.addAttribute("BASE_SPEED_LEVELS", 5.0, 0);

    hero.addKeyBind("SUPER_SPEED", "key.superSpeed", 1);
    hero.addKeyBind("SLOW_MOTION", "key.slowMotion", 2);
    hero.addKeyBind("STEALTH_MOD", "Stealth Mod", 3);
    hero.addKeyBind("ARTIC_STEALTH_MOD", "Artic Stealth Mod", 4);
    
    hero.setDefaultScale(0.87);
    hero.setHasProperty(hasProperty);
    hero.addAttributeProfile("SPEED", speedProfile);
    hero.setAttributeProfile(getProfile);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.setDamageProfile(getDamageProfile);
    hero.addDamageProfile("SPEED_PUNCH", {
        "types": {
            "BLUNT": 1.0
        },
        "properties": {
            "HIT_COOLDOWN": 5
        }
    });
}

function getDamageProfile(entity) {
    return entity.getData("fiskheroes:speeding") ? "SPEED_PUNCH" : null;
}

function isKeyBindEnabled(entity, keyBind) {
    switch (keyBind) {
    case "CHARGE_ENERGY":
        return entity.getHeldItem().isEmpty() && entity.getData("fiskheroes:speeding");
    case "STEALTH_MOD":
        return !entity.getData("tmfp:dyn/artic_stealth");
    case "ARTIC_STEALTH_MOD":
        return !entity.getData("tmfp:dyn/stealth");
    default:
        return true;
    }
}
function speedProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("STEP_HEIGHT", 250.0, 0);
    profile.addAttribute("FALL_RESISTANCE", 250.0, 0);
}

function getProfile(entity) {
    return entity.isSneaking() && entity.getData("fiskheroes:speeding") ? "SPEED" : null;
}

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