Policy
    name = "PLC_DIVINE_AUTHORITY"
    description = "PLC_DIVINE_AUTHORITY_DESC"
    short_description = "PLC_DIVINE_AUTHORITY_SHORT_DESC"
    category = "SOCIAL_CATEGORY"
    adoptioncost = floor(2.0 * [[POPULATION_OWNED_BY_EMPIRE]]^0.5)
    prerequisites = [ "PLC_INDOCTRINATION" ]
    exclusions = [ "PLC_ALGORITHMIC_RESEARCH" "PLC_LIBERTY" ]
    unlock = Item type = Policy name = "PLC_FEUDALISM"
    effectsgroups = [
        [[SPECIES_LIKES_OR_DISLIKES_POLICY_STABILITY_EFFECTS]]

        // capital species likes empire more, other species less
        [[ONE_SPECIES_EMIPRE_OPINION_ADJUST(Source.Species,Source.Owner,3,PLC_DIVINE_AUTHORITY_CAPITAL_SPECIES_OPINION_BOOST)]]
        [[OTHER_SPECIES_EMIPRE_OPINION_ADJUST(Source.Species,Source.Owner,-3,PLC_DIVINE_AUTHORITY_NOT_CAPITAL_SPECIES_OPINION_PENALTY)]]

        // makes all planets more stable and influentential, but impairs research
        EffectsGroup
            scope = And [
                Planet
                OwnedBy empire = Source.Owner
                Population low = 0.001
            ]
            effects = [
                SetTargetHappiness value = Value
                    + (NamedReal name = "PLC_DIVINE_AUTHORITY_TARGET_HAPPINESS_FLAT" value = 4)
                SetTargetResearch value = Value
                    + (NamedReal name = "PLC_DIVINE_AUTHORITY_TARGET_RESEARCH_FLAT" value = -5)
            ]
        EffectsGroup
            scope = And [
                Planet
                OwnedBy empire = Source.Owner
                Population low = 0.001
                Happiness low = (NamedReal name = "PLC_DIVINE_AUTHORITY_MIN_STABILITY" value = 10)
            ]
            effects =
                SetTargetInfluence value = Value +
                    (NamedReal name = "PLC_DIVINE_AUTHORITY_TARGET_INFLUENCE_FLAT" value = 1)
    ]
    graphic = "icons/policies/social_divine_authority.png"

#include "/scripting/policies/policies.macros"
