BuildingType
    name = "BLD_REGIONAL_ADMIN"
    description = "BLD_REGIONAL_ADMIN_DESC"
    captureresult = Destroy
    buildcost = 12 * [[BUILDING_COST_MULTIPLIER]] * (Statistic Count condition = And [Planet OwnedBy empire = Source.Owner])
    buildtime = 6
    location = And [
        Planet
        OwnedBy empire = Source.Owner
        Not Contains Building name = "BLD_IMPERIAL_PALACE"
        Not Contains Building name = "BLD_REGIONAL_ADMIN"
        Not WithinStarlaneJumps jumps = 5 condition = And [
            Or [
                Building name = "BLD_IMPERIAL_PALACE"
                Building name = "BLD_REGIONAL_ADMIN"
            ]
            OwnedBy empire = Source.Owner
        ]
    ]
    enqueuelocation = [[ENQUEUE_BUILD_ONE_PER_PLANET]]
    effectsgroups = [
        [[SPECIES_LIKES_OR_DISLIKES_BUILDING_STABILITY_EFFECTS]]

        // destroy self if somehow acquired by different empire than built this...
        EffectsGroup
            scope = Source
            activation = And [
                Not Unowned
                Not ProducedByEmpire empire = Source.Owner
            ]
            effects = Destroy
    ]
    icon = "icons/building/regional_administration.png"

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