function init(hero) {
    hero.setName("Black Panther");
	hero.setVersion("Nanosuit");
    hero.setTier(4);
    
    hero.setChestplate("item.superhero_armor.piece.chestpiece");
    
    hero.addAbilities("fiskheroes:superhuman_durability", "fiskheroes:fire_immunity", "fiskheroes:leaping", "fiskheroes:steel_transformation", "fiskheroes:explosion_immunity");
    hero.addAttribute("ATTACK_DAMAGE", 0.6, 1);
    hero.addAttribute("FALL_RESISTANCE", 1.0, 1);
    hero.addAttribute("JUMP_HEIGHT", 2.0, 0);
    hero.addAttribute("PUNCH_DAMAGE", 12.0, 0);
    hero.addAttribute("SPRINT_SPEED", 0.6, 1);
    hero.addAttribute("STEP_HEIGHT", 0.5, 0);
	
	hero.addKeyBind("TRANSFORM", "key.naniteTransform", 1);
	hero.addKeyBind("STEEL_TRANSFORM", "Use Suit Energy", 2);
    
	
	hero.setHasProperty(hasProperty);
	hero.setModifierEnabled(isModifierEnabled);
	hero.addAttributeProfile("STEEL", steelProfile);
	hero.supplyFunction("getTransformTimerTicks", 4200);
    hero.supplyFunction("getTransformTimerRegen", 3.5);
	hero.setTierOverride(getTierOverride);
	hero.setKeyBindEnabled(isKeyBindEnabled);
}

function getTierOverride(entity) {
    return entity.getData("fiskheroes:transformed") ? 4 : 0;
}

function hasProperty(entity, property) {
    switch (property) {
	case "MASK_TOGGLE":
        return entity.getData("fiskheroes:transformed");
    case "BREATHE_UNDERWATER":
        return !entity.getData("fiskheroes:mask_open");
    default:
        return false;
    }
}

function steelProfile(profile) {
    profile.addAttribute("ATTACK_DAMAGE", 1.0, 1);
    profile.addAttribute("FALL_RESISTANCE", 1.0, 1);
    profile.addAttribute("JUMP_HEIGHT", 2.0, 0);
    profile.addAttribute("PUNCH_DAMAGE", 12.5, 0);
	profile.addAttribute("SWORD_DAMAGE", -2.5, 0);
    profile.addAttribute("SPRINT_SPEED", 0.65, 1);
    profile.addAttribute("STEP_HEIGHT", 0.5, 0);
}

function isModifierEnabled(entity, modifier) {
    if (modifier == "fiskheroes:superhuman_durability" || modifier == "fiskheroes:fire_immunity") {
		return entity.getData("fiskheroes:transformed");
	}
	else if (modifier == "fiskheroes:steel_transformation") {
		return entity.getData("fiskheroes:transformed") && !entity.getData("fiskheroes:mask_open");
	}
	else if (modifier == "fiskheroes:explosion_immunity") {
		return entity.getData("fiskheroes:steeled");
	}
    return true;
}

function isKeyBindEnabled(entity, keyBind) {
    switch (keyBind) {
    case "TRANSFORM":
        return entity.getData("fiskheroes:mask_open_timer") == 0;
    default:
        return entity.getData("fiskheroes:transformed");
    }
}