Policy
    name = "PLC_BOOTSTRAPPING"
    description = "PLC_BOOTSTRAPPING_DESC"
    short_description = "PLC_BOOTSTRAPPING_SHORT_DESC"
    category = "ECONOMIC_CATEGORY"
    adoptioncost = floor(5.0 * [[PLANETS_OWNED_BY_EMPIRE]]^0.5)
    exclusions = [ "PLC_ISOLATION" ]
    effectsgroups = [
        [[SPECIES_LIKES_OR_DISLIKES_POLICY_STABILITY_EFFECTS]]

        EffectsGroup
            scope = And [
                Species
                Population high = (NamedReal name = "PLC_BOOTSTRAPPING_MAX_POP" value = 10.0)
                OwnedBy empire = Source.Owner
            ]
            effects = [
                SetIndustry value = min(Target.TargetIndustry, Value + 1.0)
                SetResearch value = min(Target.TargetResearch, Value + 1.0)
                SetInfluence value = min(Target.TargetInfluence, Value + 1.0)

                // increase target stability by 10 on first turn, decreasing each turn to 0 at turn 20
                SetTargetHappiness value = Value + 
                    0.5 * max(0.0, (NamedReal name = "PLC_BOOTSTRAPPING_MAX_TURNS" value = 20.0) - Target.TurnsSinceColonization)

                // increase stability growth rate
                SetHappiness value = Value + min(abs(Value(Target.TargetHappiness) - Value), 1) *
                    (Value < Value(Target.TargetHappiness))
            ]
    ]
    graphic = "icons/policies/economic_colonial_bootstrapping.png"

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