Tech
    name = "DEF_GARRISON_1"
    description = "DEF_GARRISON_1_DESC"
    short_description = "TROOPS_SHORT_DESC"
    category = "DEFENSE_CATEGORY"
    researchcost = 5 * [[TECH_COST_MULTIPLIER]]
    researchturns = 3
    tags = [ "PEDIA_DEFENSE_CATEGORY" ]
    prerequisites = "DEF_ROOT_DEFENSE"
    effectsgroups = [
        EffectsGroup
            scope = And [
                Planet
                OwnedBy empire = Source.Owner
            ]
            stackinggroup = "GARRISON_1_TROOPS_STACK"
            priority = [[LATE_PRIORITY]]
            effects = SetMaxTroops value = Value + 10 accountinglabel = "DEF_GARRISON_1"
    ]
    graphic = "icons/tech/troops.png"

Tech
    name = "DEF_GARRISON_2"
    description = "DEF_GARRISON_2_DESC"
    short_description = "TROOPS_SHORT_DESC"
    category = "DEFENSE_CATEGORY"
    researchcost = 15 * [[TECH_COST_MULTIPLIER]]
    researchturns = 5
    tags = [ "PEDIA_DEFENSE_CATEGORY" ]
    prerequisites = "DEF_GARRISON_1"
    effectsgroups = [
        EffectsGroup
            scope = And [
                Planet
                OwnedBy empire = Source.Owner
                (LocalCandidate.LastTurnAttackedByShip   < CurrentTurn)
            ]
            effects = SetTroops value = Value + 1

        EffectsGroup
            scope = And [
                Planet
                OwnedBy empire = Source.Owner
                Population low = 0.01
            ]
            stackinggroup = "GARRISON_2_TROOPS_STACK"
            priority = [[EARLY_PRIORITY]]
            effects = SetMaxTroops value = Value + Target.Population * 2 * [[TROOPS_PER_POP]] accountinglabel = "DEF_GARRISON_2"
    ]
    graphic = "icons/tech/troops.png"

Tech
    name = "DEF_GARRISON_3"
    description = "DEF_GARRISON_3_DESC"
    short_description = "TROOPS_SHORT_DESC"
    category = "DEFENSE_CATEGORY"
    researchcost = 50 * [[TECH_COST_MULTIPLIER]]
    researchturns = 7
    tags = [ "PEDIA_DEFENSE_CATEGORY" ]
    prerequisites = "DEF_GARRISON_2"
    effectsgroups = [
        EffectsGroup
            scope = And [
                Planet
                OwnedBy empire = Source.Owner
                (LocalCandidate.LastTurnAttackedByShip   < CurrentTurn)
            ]
            effects = SetTroops value = Value + 2

        EffectsGroup
            scope = And [
                Planet
                OwnedBy empire = Source.Owner
            ]
            stackinggroup = "GARRISON_3_TROOPS_STACK"
            priority = [[LATE_PRIORITY]]
            effects = SetMaxTroops value = Value + 16 accountinglabel = "DEF_GARRISON_3"
    ]
    graphic = "icons/tech/troops.png"

Tech
    name = "DEF_GARRISON_4"
    description = "DEF_GARRISON_4_DESC"
    short_description = "TROOPS_SHORT_DESC"
    category = "DEFENSE_CATEGORY"
    researchcost = 150 * [[TECH_COST_MULTIPLIER]]
    researchturns = 9
    tags = [ "PEDIA_DEFENSE_CATEGORY" ]
    prerequisites = "DEF_GARRISON_3"
    effectsgroups = [
        EffectsGroup
            scope = And [
                Planet
                OwnedBy empire = Source.Owner
                (LocalCandidate.LastTurnAttackedByShip   < CurrentTurn)
            ]
            effects = SetTroops value = Value + 3

        EffectsGroup
            scope = And [
                Planet
                OwnedBy empire = Source.Owner
                Population low = 0.01
            ]
            stackinggroup = "GARRISON_4_TROOPS_STACK"
            priority = [[EARLY_PRIORITY]]
            effects = SetMaxTroops value = Value + Target.Population * 2 * [[TROOPS_PER_POP]] accountinglabel = "DEF_GARRISON_4"
    ]
    graphic = "icons/tech/troops.png"

#include "../techs.macros"

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

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