function init(hero) {
    hero.setName("Ice-Man");
    hero.setTier(6);
    hero.setVersion("\u00A7c\u00A7lX\u00A76\u00A7l-\u00A7e\u00A7lMEN\u00A7f")
    
    hero.setHelmet("Head");
    hero.setChestplate("item.superhero_armor.piece.jacket");
    hero.setLeggings("item.superhero_armor.piece.pants");
    hero.setBoots("item.superhero_armor.piece.boots");
    
    hero.addPowers("mvh:xm_iceman");
    hero.addAttribute("PUNCH_DAMAGE", 2.0, 0);
    hero.addAttribute("FALL_RESISTANCE", 4.0, 0);
    hero.addAttribute("SPRINT_SPEED", 0.1, 1);
    
    hero.addKeyBind("CHARGE_ICE", "key.chargeIce", 1);
    hero.addKeyBind("BLADE", "key.iceSpike", 2);
    hero.addKeyBind("STEEL_TRANSFORM", "Ice", 3);
    
    hero.setModifierEnabled(isModifierEnabled);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    
    hero.addAttributeProfile("BLADE", bladeProfile);
    hero.setAttributeProfile(getAttributeProfile);
    hero.setDamageProfile(getDamageProfile);
    hero.addDamageProfile("BLADE", {
        "types": {
            "SHARP": 1.0,
            "COLD": 0.4
        }
    });
    hero.addDamageProfile("ICE_PUNCH", {
        "types": {
            "BLUNT": 1.0,
            "COLD": 0.2
        }
    });
}

function bladeProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 6.0, 0);
}

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

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

function isModifierEnabled(entity, modifier) {
    switch (modifier.name()) {
        case "fiskheroes:cryo_charge":
            return entity.getData("fiskheroes:dyn/steeled");
        case "fiskheroes:icicles":
            return entity.getData("fiskheroes:dyn/steeled");
        case "fiskheroes:frost_walking":
            return entity.getData("fiskheroes:dyn/steeled");
        case "fiskheroes:regeneration":
            return entity.getData("fiskheroes:dyn/steeled");
        case "fiskheroes:damage_weakness":
            return entity.getData("fiskheroes:dyn/steeled");
        case "fiskheroes:gliding":
            return entity.getData("fiskheroes:dyn/steeled") && entity.isSprinting();
        default:
            return true;
        }
    }

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