function init(hero) {
    hero.setName("Iron Fist");
    hero.setVersion("Ultimate Spider-Man");
    hero.setTier(7);
    
    hero.setHelmet("item.superhero_armor.piece.mask");
    hero.setChestplate("item.superhero_armor.piece.chestpiece");
    hero.setLeggings("item.superhero_armor.piece.pants");
    hero.setBoots("item.superhero_armor.piece.boots");
    
    hero.addPowers("pkg:chi");
    hero.addAttribute("FALL_RESISTANCE", 13.0, 0);
    hero.addAttribute("JUMP_HEIGHT", 2.0, 0);
    hero.addAttribute("PUNCH_DAMAGE", 4.0, 0);
    hero.addAttribute("SPRINT_SPEED", 0.45, 1);
    hero.addAttribute("STEP_HEIGHT", 0.5, 0);
    
    hero.addKeyBind("CHARGE_ICE", "Charge Chi", 1);
    hero.addKeyBind("EARTHQUAKE", "key.earthquake", 2);
    hero.addKeyBind("CHARGED_PUNCH", "Chi Punch", 3);
    hero.addKeyBind("GROUND_SMASH", "Chi Smash", 4);

    hero.addAttributeProfile("PUNCH", punchProfile);
    hero.addAttributeProfile("BLUNT", bluntProfile);
    hero.setAttributeProfile(getAttributeProfile);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.setHasProperty(hasProperty);
}

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

function punchProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 25, 0);
    profile.addAttribute("KNOCKBACK", 30.0, 0);
}

function bluntProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 20, 0);
}

function getAttributeProfile(entity) {
    return entity.getData("fiskheroes:punchmode") ? "PUNCH" : "BLUNT";
}

function isKeyBindEnabled(entity, keyBind) {
    switch (keyBind) {
        case "CHARGED_PUNCH":
            return entity.getHeldItem().isEmpty() && entity.getData("fiskheroes:cryo_charge") == 1;
        case "EARTHQUAKE":
            return entity.getHeldItem().isEmpty() && entity.getData("fiskheroes:cryo_charge") == 1;
        case "GROUND_SMASH":
            return entity.getHeldItem().isEmpty() && entity.getData("fiskheroes:cryo_charge") == 1;
        case "CHARGE_ICE":
            return entity.getHeldItem().isEmpty()
    default:
        return true;
    }
}

function punchProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 25, 0);
    profile.addAttribute("KNOCKBACK", 30.0, 0);
}

function bluntProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 20, 0);
}

function getAttributeProfile(entity) {
    return entity.getData("fiskheroes:punchmode") ? "PUNCH" : "BLUNT";
}
