OK, I think I got it.
Have a table zobrist_key_buildings[2][20][MAX_BLOCKS_PER_BUILDING+1]. I think from your description MAX_BLOCKS_PER_BUILDING is 24, or something like that. even if it is 100, this table is not too large.
Have a table zobrist_key_cards[2][5][5].
Have a table zobrist_pieces_on_hand[2][4][7].
When you place blocks in a building, do
zobrist_key ^= zobrist_key_buildings[player][cell][number_of_blocks[player][cell]];
number_of_blocks[player][cell] += piece_height;
zobrist_key ^= zobrist_key_buildings[player][cell][number_of_blocks[player][cell]];
When you get a card, do
zobrist_key ^= zobrist_key_cards[player][card_type][number_of_cards[player][card_type]];
number_of_cards[player][card_type]++;
zobrist_key ^= zobrist_key_cards[player][card_type][number_of_cards[player][card_type]];
When you lose a card, do
zobrist_key ^= zobrist_key_cards[player][card_type][number_of_cards[player][card_type]];
number_of_cards[player][card_type]--;
zobrist_key ^= zobrist_key_cards[player][card_type][number_of_cards[player][card_type]];
When you get a block, do
zobrist_key ^= zobrist_pieces_on_hand[player][piece_height-1][number_of_pieces_on_hand_by_height[piece_height-1]];
number_of_pieces_on_hand_by_height[piece_height-1]++;
zobrist_key ^= zobrist_pieces_on_hand[player][piece_height-1][number_of_pieces_on_hand_by_height[piece_height-1]];
When a block leaves your hand, do
zobrist_key ^= zobrist_pieces_on_hand[player][piece_height-1][number_of_pieces_on_hand_by_height[piece_height-1]];
number_of_pieces_on_hand_by_height[piece_height-1]--;
zobrist_key ^= zobrist_pieces_on_hand[player][piece_height-1][number_of_pieces_on_hand_by_height[piece_height-1]];
I am not dealing with the graveyard or the deck, so try to figure those out yourself. If you need help, post again and please describe what the graveyard and the deck might contain, together with an example.