function init(hero) {
    hero.setName("Iceman");
    hero.setTier(6);
    
	hero.setHelmet("item.superhero_armor.piece.helmet");
    hero.setChestplate("item.superhero_armor.piece.chestplate");
    hero.setLeggings("item.superhero_armor.piece.leggings");
    hero.setBoots("item.superhero_armor.piece.boots");
    
	hero.addPowers("pack:cryogenic_physiology");
     hero.addAttribute("WEAPON_DAMAGE", 2.5, 0);
   hero.addAttribute("PUNCH_DAMAGE", 7, 0);
    hero.addAttribute("FALL_RESISTANCE", 10.0, 0);
    hero.addAttribute("JUMP_HEIGHT", 0.5, 1);
    hero.addAttribute("SPRINT_SPEED", 0.35, 1);	
    hero.addAttribute("STEP_HEIGHT", 0.5, 1);	

     hero.addKeyBind("CHARGE_ICE", "key.chargeIce", 1);
   hero.addKeyBind("SHIELD", "Frost Shield", 2);
    hero.addKeyBind("ENERGY_PROJECTION", "Ice Blast", 3);
   
    hero.setModifierEnabled(isModifierEnabled);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.setHasProperty(hasProperty);
		
    hero.setDefaultScale(0.95);
    hero.addAttributeProfile("SHIELD", shieldProfile);
    hero.setAttributeProfile(getAttributeProfile);
    hero.setDamageProfile(getDamageProfile);
    hero.addDamageProfile("SHIELD", {
        "types": {
            "SHARP": 1.0,
            "COLD": 0.4
        }
    });
    hero.addDamageProfile("ICE_PUNCH", {
        "types": {
            "BLUNT": 1.0,
            "COLD": 0.2
        }
    });
}

function shieldProfile(profile) {
    profile.inheritDefaults();
}

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

function getDamageProfile(entity) {
    return entity.getData("fiskheroes:shield") ? "SHIELD" : entity.getData("fiskheroes:cryo_charge") > 0 ? "ICE_PUNCH" : null;
}

function isModifierEnabled(entity, modifier) {
    return modifier.name() != "fiskheroes:shield" || entity.getData("fiskheroes:cryo_charge") > 0 || entity.isBookPlayer();
}

function isKeyBindEnabled(entity, keyBind) {
    switch (keyBind) {
    case "CHARGE_ICE":
        return !entity.getData("fiskheroes:shield");
    case "SHIELD":
        return entity.getHeldItem().isEmpty() && entity.getData("fiskheroes:cryo_charge") == 1 || entity.getData("fiskheroes:shield") || entity.isBookPlayer();
    default:
        return true;
    }
}

function hasProperty(entity, property) {
    return property == "MASK_TOGGLE" || !entity.getData("fiskheroes:mask_open");
}