BuildingType
    name = "BLD_CULTURE_LIBRARY"
    description = "BLD_CULTURE_LIBRARY_DESC"
    buildcost = 200 * [[BUILDING_COST_MULTIPLIER]]
    buildtime = 1
    tags = "ANTIQUATED"
    location = Not All
    effectsgroups = [
        [[SPECIES_LIKES_OR_DISLIKES_BUILDING_STABILITY_EFFECTS]]
    
        EffectsGroup
            scope = And [
                Object id = Source.PlanetID
                Planet
                Not Population high = 0
                Happiness low = (NamedReal name = "BLD_CULTURE_LIBRARY_MIN_STABILITY" value = 15)
            ]
            priority = [[TARGET_AFTER_SCALING_PRIORITY]]
            effects = SetTargetResearch value = Value
                        + (NamedReal name = "BLD_CULTURE_LIBRARY_TARGET_RESEARCH_FLAT" value = 5)

        EffectsGroup    // Destroy cultural library when the species is no longer present
            scope = Source
            activation = ContainedBy And [
                Object id = Source.PlanetID
                Population high = 0
            ]
            effects = Destroy
    ]
    icon = "icons/building/archive.png"

#include "/scripting/macros/priorities.macros"
#include "/scripting/macros/base_prod.macros"
#include "/scripting/buildings/buildings.macros"
