function init(hero) {
    hero.setName("The Flash/Comics-New 52/Isue 40-52");
    hero.setTier(7);
    
    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.addEquipment("fiskheroes:flash_ring");
    
    hero.addPowers("fiskheroes:speed_force", "tmfp:forwarding_time", "fiskheroes:energy_manipulation");
    hero.addAttribute("PUNCH_DAMAGE", 6.5, 0);
    hero.addAttribute("JUMP_HEIGHT", 1.0, 0);
    hero.addAttribute("FALL_RESISTANCE", 6.0, 0);
    hero.addAttribute("BASE_SPEED_LEVELS", 6.0, 0);

    hero.addKeyBind("SUPER_SPEED", "key.superSpeed", 1);
    hero.addKeyBind("SLOW_MOTION", "key.slowMotion", 2);
    hero.addKeyBind("FORWARD", "Move Time Forward", 4);
    hero.addKeyBind("CHARGE_ENERGY", "key.chargeEnergy", 5);
    
    hero.addAttributeProfile("FORWARD", forwardProfile);
    hero.addAttributeProfile("SPEED", speedProfile);
    hero.setAttributeProfile(getProfile);
    hero.setHasProperty(hasProperty);
    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");
    default:
        return true;
    }
}
function hasProperty(entity, property) {
    return property == "MASK_TOGGLE";
}

function speedProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("STEP_HEIGHT", 250.0, 0);
    profile.addAttribute("FALL_RESISTANCE", 250.0, 0);
    profile.addAttribute("PUNCH_DAMAGE", 10.5, 0);
    profile.addAttribute("JUMP_HEIGHT", 2.0, 0);
}
function forwardProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("STEP_HEIGHT", 250.0, 0);
    profile.addAttribute("FALL_RESISTANCE", 250.0, 0);
    profile.addAttribute("PUNCH_DAMAGE", 15.5, 0);
    profile.addAttribute("JUMP_HEIGHT", 3.0, 0);
    profile.addAttribute("BASE_SPEED_LEVELS", 10.0, 0);
    profile.addAttribute("SPRINT_SPEED", 2.0, 1);
}

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