function init(hero) {
    hero.setName("Hobgoblin(2017)");
    hero.setTier(2);
    
    hero.setHelmet("item.superhero_armor.piece.helmet");
    hero.setChestplate("item.superhero_armor.piece.chestpiece");
    hero.setLeggings("item.superhero_armor.piece.pants");
    hero.setBoots("item.superhero_armor.piece.boots");
    
    hero.addPowers("randomhero:lightning", "fiskheroes:propelled_flight", "randomhero:weapon", "fiskheroes:metal_skin");
    hero.addAttribute("PUNCH_DAMAGE", 4.0, 0);
    hero.addAttribute("WEAPON_DAMAGE", 1.0, 0);
    hero.addAttribute("JUMP_HEIGHT", 1.0, 0);
    hero.addAttribute("FALL_RESISTANCE", 2.5, 0);
	
    hero.addKeyBind("BLADE", "Glider", 1);
    hero.addKeyBind("SHIELD", "Weapon", 1);
    
    hero.setModifierEnabled(isModifierEnabled);
    hero.addAttributeProfile("SHIELD", shieldProfile);
    hero.addAttributeProfile("INACTIVE", inactiveProfile);
    hero.setKeyBindEnabled(isKeyBindEnabled);
    hero.setAttributeProfile(getAttributeProfile);
    hero.setHasProperty(hasProperty);
}

function shieldProfile(profile) {
    profile.inheritDefaults();
    profile.addAttribute("PUNCH_DAMAGE", 10.0, 0);
}

function inactiveProfile(profile) {
    profile.revokeAugments();
}

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

function isModifierEnabled(entity, modifier) {
    switch (modifier.name()) {
    case "fiskheroes:blade":
        return !entity.getData("fiskheroes:shield");
    case "fiskheroes:propelled_flight":
        return entity.getData("fiskheroes:blade");
    case "fiskheroes:water_breathing":
        return entity.getData("fiskheroes:mask_open") == 1;
    default:
        return true;
    }
}

function isKeyBindEnabled(entity, keyBind) {
    switch (keyBind) {
    case "SHIELD":
        return !entity.isSneaking() && !entity.getData("fiskheroes:blade");
    case "BLADE":
        return !entity.isSneaking() && !entity.getData("fiskheroes:shield");
    default:
        return true;
    }
}

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