Dancing Hoskuld
Deity
Not quite what I meant.
The special building is not supposed to have the opposite effect. It is just there to store the effect so you can remove it by removing the special building. And that would be what the wonder would do.
Example:
Autobuilt special building "Superstition" with construct condition to be there unless you reach tech X or have built wonder Y or Z.
Different buildings and stuff then adds happiness and unhappiness to "Superstition" with BuildingHappinessChanges.
When you build wonder Y, the construct condition for "Superstition" is no more true so the building is removed and therefore all the happiness and unhappiness that was added to it with BuildingHappinessChanges.
I'm following what AIAndy is saying and it would work similar to the effect of replacing the pests when you get a building like the cat breeder. Separate out the effect of the unhealth/unhappiness from the building that is its source into a secondary derivative special building that can then be replaced by a later building that counters it but leaves the original building doing its thing.
I tried doing something similiar with a "demand" set of buildings to reflect what people in a city would want and would get upset at not having eg a market or a temple of the state religion but it did not work for the player.
Thi was because the "actual" values provided when selecting a building do not take into account (or show) local changes due to buildings local/auto being replaced.