Policy
    name = "PLC_LIBERTY"
    description = "PLC_LIBERTY_DESC"
    short_description = "PLC_LIBERTY_SHORT_DESC"
    category = "SOCIAL_CATEGORY"
    adoptioncost = floor(3.0 * [[POPULATION_OWNED_BY_EMPIRE]]^0.5)
    exclusions = [ "PLC_CONFORMANCE" "PLC_DIVINE_AUTHORITY" "PLC_FEUDALISM" "PLC_INDOCTRINATION" "PLC_MARTIAL_LAW" "PLC_TERROR_SUPPRESSION" "PLC_THE_HUNT" ]
    effectsgroups = [
        [[SPECIES_LIKES_OR_DISLIKES_POLICY_STABILITY_EFFECTS]]

        // EmpireHasAdoptedPolicy PLC_LIBERTY is used in setting stability adjustments for species dislikes in
        // species/common/happiness.macros (foci), buildings/buildings.macros and policies/policies.macros (policies)

        // Increases research on research-focused planets with stability>5.
        // Bonus grows with stability, up to a maximum of 0.15 / pop at 20.
        EffectsGroup
            scope = And [
                Planet
                OwnedBy empire = Source.Owner
                Species
                Focus type = "FOCUS_RESEARCH"
                Happiness low = (NamedReal name = "PLC_LIBERTY_MIN_STABILITY" value = 5)
            ]
            priority = [[TARGET_AFTER_SCALING_PRIORITY]]
            effects = SetTargetResearch value = Value +
                (min(Target.Happiness, (NamedReal name = "PLC_LIBERTY_MAX_STABILITY" value = 20)) - NamedRealLookup name = "PLC_LIBERTY_MIN_STABILITY")
                * Target.Population * (NamedReal name = "PLC_LIBERTY_RESEARCH_BONUS_SCALING" value = 0.01)
    ]
    graphic = "icons/policies/social_liberty.png"

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