Policy
    name = "PLC_NECESSITY"
    description = "PLC_NECESSITY_DESC"
    short_description = "PLC_NECESSITY_SHORT_DESC"
    category = "SOCIAL_CATEGORY"
    adoptioncost = floor(2.0 * [[POPULATION_OWNED_BY_EMPIRE]]^0.5)
    effectsgroups = [
        [[SPECIES_LIKES_OR_DISLIKES_POLICY_STABILITY_EFFECTS]]
    
        // boosts research on planets with low stability
        EffectsGroup
            scope = And [
                Planet
                OwnedBy empire = Source.Owner
                Focus type = "FOCUS_RESEARCH"
                Not Happiness low = (NamedReal name = "PLC_NECESSITY_MAX_STABILITY" value = 6)
                Happiness low = 0
            ]
            effects = [
                SetTargetResearch value = Value + Target.Population *
                    (NamedReal name = "PLC_NECESSITY_TARGET_RESEARCH_FACTOR" value = 0.02) *
                    max(0.0, (NamedRealLookup name = "PLC_NECESSITY_MAX_STABILITY") - Target.Happiness)^1.5
                SetResearch value = min(Target.TargetResearch, Value + (NamedReal name = "PLC_NECESSITY_RESEARCH_GROWTH_BOOST" value = 1.0))
            ]
    ]
    graphic = "icons/policies/social_necessity.png"

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