BuildingType
    name = "BLD_BLACK_HOLE_POW_GEN"
    description = "BLD_BLACK_HOLE_POW_GEN_DESC"
    buildcost = 300 * [[BUILDING_COST_MULTIPLIER]] * (1 - 0.25 * Statistic If condition = And [Source EmpireHasAdoptedPolicy empire = Source.Owner name = "PLC_INDUSTRIALISM"])
    buildtime = 8
    tags = "ORBITAL"
    location = And [
        Planet
        Not Contains Building name = "BLD_BLACK_HOLE_POW_GEN"
        OwnedBy empire = Source.Owner
        Star type = BlackHole
    ]
    enqueuelocation = [[ENQUEUE_BUILD_ONE_PER_PLANET]]
    effectsgroups = [
        [[SPECIES_LIKES_OR_DISLIKES_BUILDING_STABILITY_EFFECTS]]
    
        EffectsGroup
            scope = And [
                Planet
                Focus type = "FOCUS_INDUSTRY"
                OwnedBy empire = Source.Owner
                Happiness low = (NamedReal name = "BLD_BLACK_HOLE_POW_GEN_MIN_STABILITY" value = 20)
                ResourceSupplyConnected empire = Source.Owner condition = Source
            ]
            activation = Star type = BlackHole
            stackinggroup = "BLD_BLACK_HOLE_POW_GEN_PRIMARY_EFFECT"
            priority = [[TARGET_AFTER_SCALING_PRIORITY]]
            effects = SetTargetIndustry value = Value + Target.Population
                        * (NamedReal name = "BLD_BLACK_HOLE_POW_GEN_TARGET_INDUSTRY_PERPOP"
                                     value = 1.0 * [[INDUSTRY_PER_POP]])
    ]
    icon = "icons/building/blackhole.png"

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