BuildingType
    name = "BLD_TRANSLATOR"
    description = "BLD_TRANSLATOR_DESC"
    buildcost = 320 * [[BUILDING_COST_MULTIPLIER]]
    buildtime = 10
    location = And [
        Planet
        OwnedBy empire = Source.Owner
        Not Contains Building name = "BLD_TRANSLATOR"
        TargetPopulation low = 1
    ]
    enqueuelocation = [[ENQUEUE_BUILD_ONE_PER_PLANET]]
    effectsgroups = [
        [[SPECIES_LIKES_OR_DISLIKES_BUILDING_STABILITY_EFFECTS]]
    
        EffectsGroup
            scope = And [
                Capital
                OwnedBy empire = Source.Owner
            ]
            activation = Not Unowned
            stackinggroup = "TRANSLATOR_POLICY_SLOT_STACK"
            effects = SetEmpireMeter empire = Source.Owner
                                     meter = "SOCIAL_CATEGORY_NUM_POLICY_SLOTS" value = Value + 1
    
        EffectsGroup
            scope = And [
                Object id = Source.PlanetID
                Planet
                Not Unowned
                Focus type = "FOCUS_INFLUENCE"
            ]
            activation = Not Unowned
            priority = [[TARGET_AFTER_2ND_SCALING_PRIORITY]]
            effects = SetTargetInfluence value = Value + (NamedReal name = "TRANSLATOR_PER_SPECIES_INFLUENCE" value = 0.5) *
                (Statistic CountUnique
                    value = LocalCandidate.Species
                    condition = And [ Planet Species OwnedBy empire = Source.Owner ])^0.5
    ]
    icon = "icons/building/translator.png"

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